/* =====================================================
   NEW-ARRIVALS.CSS — Emerald Peak
   Luxury dark theme · 3D card effects · gold accents
   Updated: Full gem-detail modal matching design spec
   ===================================================== */

/* ── Page Section ── */
.arrivals-section {
    padding: 100px 6% 120px;
    background: var(--dark);
    position: relative;
    min-height: 100vh;
}

.arrivals-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 30%, rgba(201,149,42,0.07) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 80% 70%, rgba(201,149,42,0.05) 0%, transparent 55%);
    pointer-events: none;
}

/* ── Container ── */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ── Section Title ── */
.section-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--white);
    letter-spacing: 0.1em;
    margin-bottom: 60px;
    
}

.section-title em {
    font-style: italic;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1em;
    font-weight: 300;
}

/* ── Gem Grid ── */
.gem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Gem Card ── */
.gem-card {
    background: var(--dark-3, #0f1622);
    border: 1px solid rgba(201,149,42,0.1);
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.45s ease;
    transform-style: preserve-3d;
    animation: cardFadeIn 0.6s ease both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gem-card:nth-child(1) { animation-delay: 0.05s; }
.gem-card:nth-child(2) { animation-delay: 0.12s; }
.gem-card:nth-child(3) { animation-delay: 0.19s; }
.gem-card:nth-child(4) { animation-delay: 0.26s; }
.gem-card:nth-child(5) { animation-delay: 0.33s; }
.gem-card:nth-child(6) { animation-delay: 0.40s; }
.gem-card:nth-child(7) { animation-delay: 0.47s; }
.gem-card:nth-child(8) { animation-delay: 0.54s; }

.gem-card:hover {
    border-color: rgba(201,149,42,0.45);
    box-shadow:
        0 30px 60px rgba(0,0,0,0.55),
        0 0 40px rgba(201,149,42,0.09),
        inset 0 1px 0 rgba(201,149,42,0.08);
}

/* New badge */
.gem-card::after {
    content: 'New';
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Jost', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    background: rgba(52,211,153,0.15);
    border: 1px solid rgba(52,211,153,0.35);
    color: #34d399;
    backdrop-filter: blur(6px);
}

/* ── Image Wrapper ── */
.gem-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(13,21,38,0.95), rgba(15,26,46,0.98));
    display: flex;
    align-items: center;
    justify-content: center;
}

.gem-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    filter: saturate(0.85) brightness(0.9);
}

.gem-card:hover .gem-image-wrapper img {
    transform: scale(1.08);
    filter: saturate(1.1) brightness(1.02);
}

/* Shimmer sweep */
.gem-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(201,149,42,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.65s ease;
    pointer-events: none;
    z-index: 2;
}
.gem-card:hover .gem-image-wrapper::after {
    transform: translateX(100%);
}

/* Eye overlay icon */
.gem-image-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(201,149,42,0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230a0e1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}
.gem-card:hover .gem-image-wrapper::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* No image placeholder */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(201,149,42,0.4);
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Card Details ── */
.gem-details {
    padding: 20px 22px 22px;
    position: relative;
}

.gem-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(201,149,42,0.2), transparent);
}

.gem-category {
    font-family: 'Jost', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold, #c9952a);
    margin-bottom: 6px;
    opacity: 0.85;
}

.gem-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--white);
    margin: 0 0 10px;
    line-height: 1.35;
    letter-spacing: 0.03em;
}

.gem-price {
    font-family: 'Cinzel', serif;
    font-size: 0.88rem;
    color: var(--gold);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.gem-price::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    margin-right: 8px;
    vertical-align: middle;
    opacity: 0.7;
}

.gem-weight {
    font-family: 'Jost', sans-serif;
    font-size: 0.75rem;
    color: rgba(240,236,228,0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.gem-card .gem-details::after {
    content: 'View Details →';
    display: block;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(201,149,42,0.45);
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.gem-card:hover .gem-details::after {
    color: var(--gold);
    letter-spacing: 4px;
}

/* ── No Gems Message ── */
.no-gems {
    text-align: center;
    grid-column: 1 / -1;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: rgba(240,236,228,0.35);
    letter-spacing: 2px;
    padding: 60px 0;
}

/* ══════════════════════════════════════════════════════════
   GEM DETAIL MODAL
══════════════════════════════════════════════════════════ */

.gem-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(4, 8, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
    /* align-items සහ justify-content ඉවත් */
}

.gem-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalBgIn 0.35s ease;
}

/* Centering wrapper — needed so content scrolls properly on small screens */
.gem-modal-inner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 30px 24px;
    box-sizing: border-box;
    /* pointer-events passthrough so backdrop click works */
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Inner wrapper — two-column */
.gem-modal-inner {
    display: grid;
    grid-template-columns: 55% 45%;
    max-width: 1060px;
    width: 100%;
    height: 600px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 60px 120px rgba(0,0,0,0.7),
        0 0 0 1px rgba(201,149,42,0.12);
    animation: modalSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    flex-shrink: 0;
}

@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

/* ── LEFT: Gallery Panel ── */
.gm-left {
    background: #080d18;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Thumbnail strip */
.gm-thumbs {
    display: flex;
    gap: 8px;
    padding: 14px 14px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(0,0,0,0.35);
    flex-shrink: 0;
}

.gm-thumbs::-webkit-scrollbar { display: none; }

.gm-thumb {
    width: 58px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid rgba(201,149,42,0.15);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.25s, border-color 0.25s, transform 0.2s;
    flex-shrink: 0;
}

.gm-thumb:hover { opacity: 0.85; transform: scale(1.05); }
.gm-thumb.active {
    opacity: 1;
    border-color: var(--gold, #c9952a);
    box-shadow: 0 0 12px rgba(201,149,42,0.3);
}

/* Main image */
.gm-main-img-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #060b14;
    min-height: 340px;
}

#gmMainImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: opacity 0.3s ease;
}

/* Nav arrows */
.gm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(201,149,42,0.12);
    border: 1px solid rgba(201,149,42,0.3);
    color: rgba(240,236,228,0.85);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s;
    z-index: 2;
    line-height: 1;
}
.gm-nav:hover { background: var(--gold, #c9952a); color: #060b14; border-color: var(--gold, #c9952a); }
.gm-prev { left: 12px; }
.gm-next { right: 12px; }

/* Image counter */
.gm-counter {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 2px;
    color: rgba(240,236,228,0.45);
    background: rgba(0,0,0,0.45);
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

/* ── RIGHT: Details Panel ── */
.gm-right {
    background: #0e1929;
    padding: 36px 32px 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,149,42,0.2) transparent;
}

.gm-right::-webkit-scrollbar { width: 4px; }
.gm-right::-webkit-scrollbar-track { background: transparent; }
.gm-right::-webkit-scrollbar-thumb { background: rgba(201,149,42,0.25); border-radius: 4px; }

/* Close button */
.gm-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(201,149,42,0.1);
    border: 1px solid rgba(201,149,42,0.25);
    color: rgba(240,236,228,0.7);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s;
    z-index: 2;
}
.gm-close:hover { background: var(--gold, #c9952a); color: #060b14; border-color: var(--gold, #c9952a); }

/* Breadcrumb */
.gm-breadcrumb {
    font-family: 'Jost', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold, #c9952a);
    margin-bottom: 10px;
    opacity: 0.85;
}

/* Title */
.gm-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    color: var(--white, #f0ece4);
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    line-height: 1.2;
}

/* Gold accent bar */
.gm-title-bar {
    width: 44px;
    height: 2px;
    background: var(--gold, #c9952a);
    border-radius: 2px;
    margin-bottom: 18px;
}

/* Description */
.gm-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(240,236,228,0.65);
    margin: 0 0 24px;
}

/* Specs grid */
.gm-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.gm-spec-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(201,149,42,0.1);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.25s, background 0.25s;
}
.gm-spec-box:hover {
    border-color: rgba(201,149,42,0.28);
    background: rgba(201,149,42,0.04);
}

.gm-spec-label {
    font-family: 'Jost', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(240,236,228,0.35);
    margin-bottom: 6px;
}

.gm-spec-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(240,236,228,0.9);
    letter-spacing: 0.02em;
}

/* Price row */
.gm-price-row {
    background: rgba(201,149,42,0.06);
    border: 1px solid rgba(201,149,42,0.18);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gm-price-label {
    font-family: 'Jost', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(240,236,228,0.4);
    margin-bottom: 4px;
}

.gm-price-value {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--gold, #c9952a);
    letter-spacing: 0.02em;
}

.gm-price-unit {
    font-family: 'Jost', sans-serif;
    font-size: 0.65rem;
    color: rgba(240,236,228,0.35);
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Availability badge */
.gm-avail-badge {
    padding: 6px 18px;
    border-radius: 30px;
    font-family: 'Jost', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.avail-yes {
    background: rgba(52,211,153,0.12);
    border: 1px solid rgba(52,211,153,0.35);
    color: #34d399;
}

.avail-no {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
}

/* Action buttons */
.gm-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.gm-btn-primary {
    flex: 1;
    min-width: 160px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--gold, #c9952a);
    border: none;
    color: #060b14;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}
.gm-btn-primary:hover {
    background: #daa830;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(201,149,42,0.35);
}

.gm-btn-secondary {
    padding: 14px 20px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(201,149,42,0.35);
    color: var(--gold, #c9952a);
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.gm-btn-secondary:hover {
    background: rgba(201,149,42,0.08);
    border-color: rgba(201,149,42,0.7);
    transform: translateY(-2px);
}

body.modal-open { overflow: hidden; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .arrivals-section { padding: 80px 5% 100px; }
    .gem-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
    .gem-modal-inner { max-width: 92vw; height: 560px; }
}

@media (max-width: 768px) {
    .gem-modal-inner {
        grid-template-columns: 1fr;
        grid-template-rows: 45% 55%;
        max-width: 95vw;
        height: 88vh;
        max-height: 700px;
        border-radius: 22px;
    }

    .gm-left { height: 100%; }
    .gm-main-img-wrap { min-height: 0; }
    .gm-right { padding: 24px 20px 20px; height: 100%; }
    .gm-specs-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .gm-modal-inner-wrap { padding: 20px 12px; }
}

@media (max-width: 640px) {
    .arrivals-section { padding: 60px 4% 80px; }
    .section-title { font-size: clamp(1.5rem, 7vw, 2rem); }
    .gem-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .gem-image-wrapper { height: 160px; }
    .gem-details { padding: 14px 14px 16px; }
    .gem-name { font-size: 0.88rem; }
    .gem-price { font-size: 0.78rem; }
    .gem-weight { font-size: 0.66rem; }
    .gem-card .gem-details::after { font-size: 0.58rem; }

    .gem-modal-inner {
        grid-template-columns: 1fr;
        grid-template-rows: 42% 58%;
        max-width: 100%;
        height: 92vh;
        max-height: none;
        border-radius: 18px;
    }
    .gm-modal-inner-wrap { padding: 16px 8px; }
    .gm-specs-grid { grid-template-columns: 1fr 1fr; }
    .gm-title { font-size: 1.2rem; }
    .gm-actions { flex-direction: column; }
    .gm-btn-primary, .gm-btn-secondary { width: 100%; }
    .gm-right { padding: 20px 16px 16px; }
}

@media (max-width: 420px) {
    .gem-grid { grid-template-columns: 1fr; gap: 14px; }
    .gem-image-wrapper { height: 200px; }
    .gem-details { padding: 18px 18px 20px; }
    .gem-name { font-size: 0.95rem; }
    .gm-specs-grid { grid-template-columns: 1fr; }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .gem-card:active {
        border-color: rgba(201,149,42,0.5);
        transform: scale(0.98) !important;
        transition: transform 0.15s ease !important;
    }
    .gem-image-wrapper::before { display: none; }
}