/* =====================================================================
   NOOR GEMS - category pages: filters, gem cards and detail popup
   (ng- prefix so nothing clashes with the rest of the site)
   ===================================================================== */
.ng {
    --ng-deep: #174B70;
    --ng-dark: #0F3A5A;
    --ng-soft: #B8D9EC;
    --ng-ice: #DDF3FF;
    --ng-line: rgba(184, 217, 236, .55);
    --ng-ease: cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: calc(var(--fixed-header-height, 132px) + 48px) 20px 80px;
    background-color: #FFFFFF;
    background-image:
        radial-gradient(circle, rgba(184, 217, 236, .25) 1px, transparent 1px),
        linear-gradient(180deg, #FFFFFF 0%, #F0F8FF 50%, #FFFFFF 100%);
    background-size: 24px 24px, 100% 100%;
    font-family: 'Inter', sans-serif;
    color: #374151;
    min-height: 70vh;
}
.ng *, .ng-modal * { box-sizing: border-box; }
.ng-wrap { max-width: 1200px; margin: 0 auto; }

/* ---------- Heading ---------- */
.ng-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.ng-eyebrow {
    display: inline-flex; align-items: center; gap: 14px;
    font-size: 11px; font-weight: 600; letter-spacing: .35em; text-transform: uppercase; color: var(--ng-deep);
}
.ng-eyebrow::before, .ng-eyebrow::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--ng-deep)); }
.ng-eyebrow::after { transform: scaleX(-1); }
.ng-title {
    margin: 14px 0 0; font-family: 'Cormorant Garamond', 'Playfair Display', serif;
    font-weight: 600; color: var(--ng-deep); font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1;
}
.ng-sub { margin: 12px auto 0; max-width: 560px; font-size: .98rem; line-height: 1.65; color: #4b5563; }

/* ---------- Category tabs (text links) ---------- */
.ng-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin: 0 0 22px; }
.ng-tab {
    position: relative; background: none; border: 0; padding: 6px 0; cursor: pointer;
    font: 600 .78rem/1.2 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #8FA3B4;
    transition: color .3s ease;
}
.ng-tab::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ng-deep);
    transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ng-ease);
}
.ng-tab:hover { color: var(--ng-deep); }
.ng-tab.is-active { color: var(--ng-deep); }
.ng-tab.is-active::after, .ng-tab:hover::after { transform: scaleX(1); transform-origin: left; }
.ng-tab:focus-visible { outline: 2px solid var(--ng-deep); outline-offset: 4px; }

/* ---------- Filter bar ---------- */
.ng-bar {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    padding: 14px; margin-bottom: 14px; border-radius: 16px;
    background: rgba(255, 255, 255, .85); border: 1px solid var(--ng-line);
    box-shadow: 0 10px 40px -24px rgba(15, 58, 90, .25);
}
.ng-bar .ng-search { grid-column: 1 / -1; }
@media (min-width: 900px) {
    .ng-bar { grid-template-columns: 1.6fr repeat(4, 1fr); }
    .ng-bar .ng-search { grid-column: auto; }
}
.ng-input, .ng-select {
    width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ng-line);
    background: #FAFCFF; font: 400 .88rem 'Inter', sans-serif; color: #1F2D3A; outline: none;
    transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.ng-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, #6B7D8D 50%), linear-gradient(135deg, #6B7D8D 50%, transparent 50%);
    background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.ng-input:focus, .ng-select:focus { border-color: var(--ng-deep); background-color: #FFFFFF; box-shadow: 0 0 0 4px rgba(23, 75, 112, .08); }

.ng-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 18px; font-size: .8rem; color: #6B7D8D; }
.ng-clear {
    background: none; border: 0; padding: 0 0 2px; cursor: pointer; font: 600 .74rem 'Inter', sans-serif;
    letter-spacing: .1em; text-transform: uppercase; color: var(--ng-deep); border-bottom: 1px solid currentColor;
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.ng-clear.show { opacity: 1; pointer-events: auto; }

/* ---------- Grid + cards ---------- */
.ng-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .ng-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1024px) { .ng-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.ng-card {
    position: relative; display: flex; flex-direction: column; cursor: pointer; text-align: left;
    background: #FFFFFF; border-radius: 16px; overflow: hidden; border: 1px solid rgba(184, 217, 236, .4);
    box-shadow: 0 10px 40px -20px rgba(15, 58, 90, .1);
    transition: transform .8s var(--ng-ease), box-shadow .8s var(--ng-ease), border-color .4s ease;
    animation: ngIn .7s var(--ng-ease) both; animation-delay: var(--d, 0ms);
}
@keyframes ngIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.ng-card:hover { transform: translateY(-6px); border-color: var(--ng-soft); box-shadow: 0 30px 60px -20px rgba(15, 58, 90, .2); }
.ng-card:focus-visible { outline: 2px solid var(--ng-deep); outline-offset: 3px; }
.ng-media { position: relative; aspect-ratio: 4 / 3.2; overflow: hidden; background: linear-gradient(135deg, #EAF4FB, #D7E9F5); }
.ng-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ng-ease); }
.ng-card:hover .ng-media img { transform: scale(1.08); }
.ng-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font: italic 500 1.05rem 'Cormorant Garamond', serif; color: #8FA3B4; }
.ng-tag {
    position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 99px;
    font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    background: rgba(255, 255, 255, .92); color: var(--ng-deep); backdrop-filter: blur(6px);
}
.ng-tag.is-sold { background: rgba(15, 58, 90, .88); color: #FFFFFF; }
.ng-tag.is-reserved { background: rgba(226, 185, 59, .95); color: #3A2A00; }
.ng-tag-360 { left: auto; right: 10px; }
.ng-card.is-sold .ng-media img { filter: grayscale(.35); opacity: .85; }

.ng-body { padding: 14px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.ng-cat { font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8FA3B4; margin-bottom: 6px; }
.ng-name { margin: 0 0 4px; font: 600 1.25rem/1.2 'Cormorant Garamond', serif; color: var(--ng-dark); }
.ng-specs { font-size: .76rem; color: var(--ng-deep); margin-bottom: 8px; }
.ng-desc { font-size: .8rem; line-height: 1.5; color: #6b7280; margin: 0 0 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ng-price { margin-top: auto; margin-bottom: 10px; font: 600 1.15rem/1.2 'Cormorant Garamond', serif; color: var(--ng-dark); }
.ng-price.is-enq { font: 600 .68rem/1.2 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #9A7B1C; }
.ng-more { align-self: flex-start; padding-bottom: 2px; border-bottom: 1px solid currentColor;
    font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ng-deep);
    transition: letter-spacing .5s var(--ng-ease);
}
.ng-card:hover .ng-more { letter-spacing: .16em; }

.ng-skel { border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, .6); border: 1px solid rgba(184, 217, 236, .4); }
.ng-skel i { display: block; background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%); background-size: 200% 100%; animation: ngShimmer 1.5s infinite; }
.ng-skel i:first-child { aspect-ratio: 4 / 3.2; }
.ng-skel i + i { height: 12px; border-radius: 4px; margin: 16px; }
.ng-skel i:last-child { width: 55%; margin-top: 0; }
@keyframes ngShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.ng-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #6b7280;
    font: italic 400 1.2rem 'Cormorant Garamond', serif; }

@media (max-width: 600px) {
    .ng { padding: calc(var(--fixed-header-height, 132px) + 32px) 14px 64px; }
    .ng-body { padding: 12px 12px 14px; }
    .ng-name { font-size: 1.1rem; }
    .ng-desc { font-size: .76rem; }
}

/* =====================================================================
   DETAIL POPUP
   ===================================================================== */
.ng-modal {
    --ng-deep: #174B70; --ng-dark: #0F3A5A; --ng-soft: #B8D9EC; --ng-ease: cubic-bezier(0.16, 1, 0.3, 1);
    position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(15, 58, 90, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s;
    font-family: 'Inter', sans-serif; color: #374151;
}
.ng-modal.open { opacity: 1; visibility: visible; }
.ng-dialog {
    position: relative; width: 100%; max-width: 1020px; max-height: calc(100vh - 40px); overflow: auto;
    background: #FFFFFF; border-radius: 22px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .45);
    display: grid; grid-template-columns: 1fr;
    transform: translateY(26px) scale(.97); opacity: 0;
    transition: transform .7s var(--ng-ease), opacity .45s ease;
}
.ng-modal.open .ng-dialog { transform: none; opacity: 1; }
@media (min-width: 860px) { .ng-dialog { grid-template-columns: 1.05fr 1fr; overflow: hidden; } }

.ng-close {
    position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(184, 217, 236, .7); background: rgba(255, 255, 255, .92); color: var(--ng-deep);
    font-size: 20px; line-height: 1; cursor: pointer; transition: transform .5s var(--ng-ease), background .3s ease;
}
.ng-close:hover { transform: rotate(90deg); background: #FFFFFF; }

.ng-viewer { background: #F3F8FC; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ng-stage { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #EAF4FB, #D7E9F5); }
.ng-stage img, .ng-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: ngFade .5s ease both; }
.ng-stage video { object-fit: contain; background: #0F1B26; }
@keyframes ngFade { from { opacity: 0; } to { opacity: 1; } }
.ng-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ng-thumb {
    position: relative; flex: 0 0 64px; height: 64px; border-radius: 10px; overflow: hidden; cursor: pointer; padding: 0;
    border: 2px solid transparent; background: #DDEAF4; transition: border-color .3s ease, transform .4s var(--ng-ease);
}
.ng-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ng-thumb:hover { transform: translateY(-2px); }
.ng-thumb.is-active { border-color: var(--ng-deep); }
.ng-thumb-video { display: flex; align-items: center; justify-content: center; background: var(--ng-dark); color: #FFFFFF;
    font-size: 10px; font-weight: 600; letter-spacing: .1em; }

.ng-info { padding: 30px 28px 28px; overflow: auto; max-height: calc(100vh - 40px); }
.ng-info .ng-cat { font-size: 10.5px; margin-bottom: 8px; }
.ng-info h2 { margin: 0; font: 600 clamp(1.8rem, 3.4vw, 2.4rem)/1.1 'Cormorant Garamond', serif; color: var(--ng-dark); padding-right: 40px; }
.ng-status { display: inline-block; margin-top: 12px; padding: 4px 12px; border-radius: 99px; font-size: 10px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; background: #E7F7EF; color: #0F7A4C; }
.ng-status.is-sold { background: #E9EEF2; color: #4B5B69; }
.ng-status.is-reserved { background: #FCF3D9; color: #8A6400; }
.ng-price-lg { margin-top: 14px; font: 600 1.7rem/1.1 'Cormorant Garamond', serif; color: var(--ng-dark); }
.ng-price-lg.is-enq { font: 600 .78rem/1.2 'Inter', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #9A7B1C; }
.ng-lead { margin: 14px 0 0; font-size: .95rem; line-height: 1.65; color: #4b5563; }
.ng-spec { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 20px 0 0; padding: 0; }
.ng-spec div { padding: 10px 0; border-bottom: 1px solid rgba(184, 217, 236, .55); }
.ng-spec dt { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8FA3B4; }
.ng-spec dd { margin: 3px 0 0; font-size: .9rem; font-weight: 500; color: var(--ng-dark); }
.ng-full { margin: 18px 0 0; font-size: .88rem; line-height: 1.7; color: #4b5563; white-space: pre-line; }
.ng-actions { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 24px; }
.ng-link {
    padding-bottom: 3px; border-bottom: 1px solid currentColor; text-decoration: none;
    font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ng-deep);
    transition: letter-spacing .5s var(--ng-ease), color .3s ease;
}
.ng-link:hover { letter-spacing: .18em; color: var(--ng-dark); }
.ng-link.is-wa { color: #128C7E; }

@media (max-width: 859px) {
    .ng-modal { padding: 0; align-items: flex-end; }
    .ng-dialog { max-height: 94vh; border-radius: 22px 22px 0 0; }
    .ng-info { max-height: none; overflow: visible; padding: 22px 20px 30px; }
    .ng-stage { aspect-ratio: 4 / 3.4; }
}

@media (prefers-reduced-motion: reduce) {
    .ng *, .ng-modal * { animation: none !important; transition: none !important; }
}
