/* ==========================================================================
   Gem catalogue – blue & white theme (loaded after Bootstrap 5.3)
   System fonts only (CSP: font-src 'self'), no inline styles anywhere.
   ========================================================================== */
:root {
    --navy: #0a1f44;
    --blue-900: #0d2f6f;
    --blue-700: #1347b5;
    --blue-600: #1a5ce5;
    --blue-500: #3b82f6;
    --blue-300: #93bbff;
    --blue-100: #e3edff;
    --blue-50: #f3f7ff;
    --sky: #2bb4f5;
    --ink: #0f1b33;
    --muted: #5b6b86;
    --line: #dfe7f5;
    --white: #fff;
    --grad: linear-gradient(135deg, var(--blue-600) 0%, #2d8bf2 55%, var(--sky) 100%);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(10, 31, 68, .06), 0 2px 8px rgba(10, 31, 68, .05);
    --shadow-md: 0 10px 30px rgba(26, 92, 229, .14);
    --ring: 0 0 0 .22rem rgba(26, 92, 229, .25);
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --bs-link-color: var(--blue-600);
    --bs-link-hover-color: var(--blue-700);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px;
}

body {
    background: var(--white);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--blue-600);
}

img {
    max-width: 100%;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--navy);
    color: #fff;
    padding: 8px 12px;
    z-index: 2000;
    border-radius: 8px;
}

.skip-link:focus {
    left: 8px;
}

/* Focus */
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
button:focus-visible,
.search-input:focus-visible {
    box-shadow: var(--ring);
    border-color: var(--blue-600);
    outline: none;
}

/* Buttons */
.btn {
    border-radius: 999px;
    font-weight: 600;
}

.btn-dark {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-bg: var(--blue-600);
    --bs-btn-border-color: var(--blue-600);
    --bs-btn-hover-bg: var(--blue-700);
    --bs-btn-hover-border-color: var(--blue-700);
    --bs-btn-active-bg: var(--blue-900);
    --bs-btn-active-border-color: var(--blue-900);
    box-shadow: 0 6px 16px rgba(26, 92, 229, .28);
}

.btn-outline-dark {
    --bs-btn-color: var(--blue-600);
    --bs-btn-border-color: var(--blue-300);
    --bs-btn-hover-bg: var(--blue-600);
    --bs-btn-hover-border-color: var(--blue-600);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--blue-700);
    --bs-btn-active-border-color: var(--blue-700);
    --bs-btn-active-color: #fff;
    background: #fff;
}

.btn-link {
    color: var(--blue-600);
    text-decoration: none;
}

.form-control,
.form-select {
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

.form-check-input {
    border-color: #b9c9e8;
}

.form-check-input:checked {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
}

.eyebrow {
    display: inline-block;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--blue-600);
    background: var(--blue-100);
    padding: .35rem .8rem;
    border-radius: 999px;
    margin-bottom: .9rem;
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--navy);
    color: #cfe0ff;
    font-size: .8rem;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: .45rem;
    gap: 1rem;
}

.topbar-live {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: #fff;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ddc97;
    box-shadow: 0 0 0 0 rgba(61, 220, 151, .6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 7px rgba(61, 220, 151, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
    }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid transparent;
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    transition: box-shadow .25s, border-color .25s;
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 8px 24px rgba(10, 31, 68, .07);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand toggle" "search search";
    align-items: center;
    gap: .75rem 1rem;
    padding-block: .8rem;
}

.header-inner .brand {
    grid-area: brand;
}

.header-inner .nav-toggle {
    grid-area: toggle;
    justify-self: end;
}

.header-inner .search-wrap {
    grid-area: search;
}

@media (min-width: 768px) {
    .header-inner {
        grid-template-columns: auto minmax(260px, 1fr) auto;
        grid-template-areas: "brand search nav";
        gap: 1.5rem;
    }

    .header-inner .main-nav {
        grid-area: nav;
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--navy);
    text-decoration: none;
    white-space: nowrap;
}

.brand:hover {
    color: var(--navy);
}

.brand-tile {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 6px 14px rgba(26, 92, 229, .35);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.28rem;
    letter-spacing: .01em;
}

.search-wrap {
    width: 100%;
    max-width: 680px;
    justify-self: center;
}

.search-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--blue-50);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: .3rem .3rem .3rem 1rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.search-pill:focus-within {
    background: #fff;
    border-color: var(--blue-600);
    box-shadow: var(--ring);
}

.search-icon {
    color: var(--blue-600);
    flex: none;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: .95rem;
    padding: .45rem 0;
    color: var(--ink);
}

.search-input::placeholder {
    color: #7f8fab;
}

.search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.search-btn {
    padding: .45rem 1.2rem;
    font-size: .9rem;
}

.main-nav {
    gap: .25rem;
}

.main-nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: .93rem;
    font-weight: 600;
    padding: .5rem .85rem;
    border-radius: 999px;
    transition: background .2s, color .2s;
}

.main-nav a:hover {
    background: var(--blue-100);
    color: var(--blue-700);
}

.nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    color: var(--navy);
}

.mobile-nav {
    border-top: 1px solid var(--line);
    background: #fff;
}

.mobile-nav .container-xxl {
    display: flex;
    flex-direction: column;
    padding-block: .5rem;
}

.mobile-nav a {
    padding: .75rem .25rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.mobile-nav a:last-child {
    border-bottom: 0;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 380px at 88% -10%, rgba(43, 180, 245, .28), transparent 60%),
        radial-gradient(700px 400px at -5% 110%, rgba(26, 92, 229, .16), transparent 60%),
        linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue-300), transparent);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
    padding-block: 2.25rem 2rem;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.2vw, 3.3rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--navy);
    margin: 0 0 .9rem;
}

.hero-lead {
    color: var(--muted);
    font-size: clamp(.98rem, 1.5vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 1.4rem;
    max-width: 56ch;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: start;
    gap: .5rem;
    margin: 0;
    padding: 0;
}

@media (min-width: 576px) {
    .hero-stats {
        gap: .75rem;
    }
}

.hero-stats li {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .8rem;
    min-width: 0;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(6px);
}

.hero-stats strong {
    color: var(--blue-600);
    font-size: 1.2rem;
    line-height: 1.2;
}

.hero-stats span {
    color: var(--muted);
    font-size: .78rem;
}

.hero-art {
    display: none;
}

@media (min-width: 768px) {
    .hero-inner {
        grid-template-columns: 1.25fr .75fr;
        padding-block: 3rem 2.75rem;
    }

    .hero-art {
        display: block;
        justify-self: end;
        width: min(100%, 360px);
    }
}

.hero-art svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 24px 34px rgba(26, 92, 229, .28));
    overflow: visible;
}

.art-main {
    animation: bob 6s ease-in-out infinite;
    transform-box: fill-box;
}

.art-float-1 {
    animation: bob 5s ease-in-out -1.5s infinite;
}

.art-float-2 {
    animation: bob 7s ease-in-out -3s infinite;
}

@keyframes bob {

    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -9px;
    }
}

.spark {
    transform-box: fill-box;
    transform-origin: center;
    animation: twinkle 3s ease-in-out infinite;
}

.spark-2 {
    animation-delay: -1s;
}

.spark-3 {
    animation-delay: -2s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: .2;
        scale: .6;
    }

    50% {
        opacity: 1;
        scale: 1.1;
    }
}

.breadcrumb {
    --bs-breadcrumb-divider-color: var(--blue-300);
}

.breadcrumb a {
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--muted);
}

/* ---------- Gemstone type pills ---------- */
.pills-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.gem-pills {
    display: flex;
    gap: .5rem;
    margin: 0;
    padding: .85rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.gem-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    display: inline-block;
    white-space: nowrap;
    scroll-snap-align: start;
    text-decoration: none;
    color: var(--ink);
    background: var(--blue-50);
    border: 1px solid var(--line);
    padding: .45rem 1rem;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    transition: all .2s;
}

.pill:hover {
    background: var(--blue-100);
    border-color: var(--blue-300);
    color: var(--blue-700);
    transform: translateY(-1px);
}

.pill.active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px rgba(26, 92, 229, .3);
}

/* ---------- Listing layout ---------- */
.listing-shell {
    padding-block: 1.75rem 1rem;
}

/* Filters */
.filter-panel {
    --bs-offcanvas-width: 340px;
    --bs-offcanvas-bg: #fff;
}

.filter-panel .offcanvas-header {
    border-bottom: 1px solid var(--line);
}

@media (min-width: 992px) {
    .filter-panel {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--blue-300) transparent;
    }

    .filter-panel .offcanvas-body {
        padding: 0;
    }
}

.filter-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.1rem .5rem;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 991.98px) {
    .filter-card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}

.filter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .35rem;
}

.filter-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    color: var(--navy);
}

.filter-title svg {
    color: var(--blue-600);
}

.clear-all {
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.filter-group {
    border-bottom: 1px solid var(--line);
    padding: .85rem 0;
}

.filter-group:last-of-type {
    border-bottom: 0;
}

.filter-group>summary {
    cursor: pointer;
    font-weight: 700;
    font-size: .92rem;
    color: var(--navy);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

.filter-group>summary::-webkit-details-marker {
    display: none;
}

.filter-group>summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--blue-600);
    border-bottom: 2px solid var(--blue-600);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
}

.filter-group[open]>summary::after {
    transform: rotate(-135deg) translate(-2px, -1px);
}

.filter-options {
    margin-top: .6rem;
}

.filter-options.scroll {
    max-height: 224px;
    overflow-y: auto;
    padding-right: .25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-300) transparent;
}

.filter-options .form-check {
    margin: 0 0 .15rem;
    padding: 0;
}

.filter-options .form-check-input {
    float: none;
    margin: 0;
    flex: none;
}

.filter-options .form-check {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .5rem;
    border-radius: 10px;
    transition: background .15s;
}

.filter-options .form-check:hover {
    background: var(--blue-50);
}

.filter-options .form-check:has(.form-check-input:checked) {
    background: var(--blue-100);
}

.filter-options .form-check-label {
    flex: 1;
    font-size: .92rem;
    cursor: pointer;
}

.range-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .65rem;
}

.range-row .form-control {
    background: var(--blue-50);
}

.range-sep {
    color: var(--muted);
}

/* Mobile bar + view toggle */
.filters-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.view-toggle {
    display: none;
    flex: none;
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}

.js .view-toggle {
    display: inline-flex;
}

.view-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    transition: all .2s;
}

.view-btn[aria-pressed="true"] {
    background: #fff;
    color: var(--blue-600);
    box-shadow: var(--shadow-sm);
}


/* Toolbar + chips */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    margin-bottom: 1rem;
    padding: .7rem 1rem;
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.toolbar-count {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
}

.toolbar-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.toolbar-label {
    margin: 0;
    font-size: .85rem;
    color: var(--muted);
}

.sort-select {
    width: auto;
    border-radius: 999px;
    font-weight: 600;
    font-size: .88rem;
    padding-inline: .9rem 2rem;
    background-color: #fff;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
    padding: 0;
}

.chip {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    padding: .3rem .8rem;
    border: 1px solid var(--blue-300);
    border-radius: 999px;
    background: var(--blue-100);
    color: var(--blue-700);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    transition: all .15s;
}

.chip:hover {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: #fff;
}

.chip-clear {
    background: #fff;
    border-color: var(--line);
    color: var(--muted);
}

.notice {
    margin-bottom: 1rem;
    padding: .65rem 1rem;
    border-radius: var(--radius-sm);
    background: #eef6ff;
    border: 1px solid var(--blue-300);
    color: var(--blue-900);
    font-size: .88rem;
}

/* ---------- Cards ---------- */
.gem-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .3s, transform .3s, border-color .3s;
    animation: rise .5s both;
}

.results-grid>.col:nth-child(2) .gem-card {
    animation-delay: .05s;
}

.results-grid>.col:nth-child(3) .gem-card {
    animation-delay: .1s;
}

.results-grid>.col:nth-child(4) .gem-card {
    animation-delay: .15s;
}

.results-grid>.col:nth-child(n+5) .gem-card {
    animation-delay: .2s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.gem-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--blue-300);
}

.gem-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: linear-gradient(160deg, #eef4ff, #dbe8ff);
    overflow: hidden;
}

.gem-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.gem-card:hover .gem-media img {
    transform: scale(1.07);
}

.gem-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(10, 31, 68, .18));
    pointer-events: none;
}

.gem-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: var(--blue-500);
    font-size: .8rem;
    font-weight: 600;
}

.gem-flag {
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: rgba(255, 255, 255, .94);
    color: var(--blue-700);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .28rem .6rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.gem-badge {
    position: absolute;
    z-index: 1;
    top: 10px;
    right: 10px;
    background: var(--navy);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .3rem .7rem;
    border-radius: 999px;
}

.gem-body {
    padding: .95rem 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    flex: 1;
}

.gem-kind {
    margin: 0;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue-600);
}

.gem-name {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gem-code {
    margin: 0;
    font-size: .76rem;
    color: var(--muted);
    letter-spacing: .02em;
}

.gem-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: .5rem 0 .6rem;
    padding: 0;
}

.gem-attrs li {
    font-size: .75rem;
    font-weight: 600;
    color: #2c4a86;
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .15rem .6rem;
}

.gem-attrs li.attr-weight {
    background: var(--blue-100);
    border-color: var(--blue-300);
    color: var(--blue-700);
}

.gem-cert {
    margin: .1rem 0 0;
    font-size: .78rem;
    color: #34507f;
}

.gem-foot {
    margin-top: auto;
    padding-top: .75rem;
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex-wrap: wrap;
    border-top: 1px dashed var(--line);
}

.gem-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--blue-600);
    letter-spacing: -.01em;
}

.gem-price-na {
    font-size: .92rem;
    font-weight: 600;
    color: var(--muted);
}

.gem-lot {
    font-size: .75rem;
    color: var(--muted);
}

/* List layout (toggled by JS on .results-wrap) */
.view-list .results-grid>.col {
    width: 100%;
    flex: 0 0 100%;
}

.view-list .gem-card {
    flex-direction: row;
}

.view-list .gem-media {
    width: 34%;
    max-width: 240px;
    min-width: 120px;
    aspect-ratio: auto;
    min-height: 190px;
    flex: none;
}

.view-list .gem-body {
    padding: 1rem 1.2rem;
}

.view-list .gem-name {
    font-size: 1.2rem;
}

@media (max-width: 575.98px) {
    .view-list .gem-media {
        width: 38%;
        min-height: 170px;
    }

    .view-list .gem-attrs li {
        font-size: .7rem;
    }
}

/* ---------- States + skeleton ---------- */
.state {
    text-align: center;
    padding: 3.5rem 1rem;
    border: 1.5px dashed var(--blue-300);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--blue-50), #fff);
}

.state-icon {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--blue-100);
    color: var(--blue-600);
    margin-bottom: 1rem;
}

.state-error .state-icon {
    background: #e8f0ff;
}

[aria-busy="true"] {
    opacity: .65;
    transition: opacity .15s;
}

.skeleton {
    animation: none;
}

.skeleton .gem-media {
    background: linear-gradient(90deg, #e6eefc 25%, #f5f9ff 37%, #e6eefc 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

.skeleton .gem-media::after {
    display: none;
}

.skeleton .sk {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: #e6eefc;
    margin: .4rem 0;
}

.sk-w80 {
    width: 80%;
}

.sk-w60 {
    width: 60%;
}

.sk-w50 {
    width: 50%;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ---------- Pagination ---------- */
.pager {
    margin-top: 2rem;
}

.pagination {
    --bs-pagination-color: var(--blue-700);
    --bs-pagination-bg: #fff;
    --bs-pagination-border-color: var(--line);
    --bs-pagination-hover-bg: var(--blue-100);
    --bs-pagination-hover-color: var(--blue-700);
    --bs-pagination-hover-border-color: var(--blue-300);
    --bs-pagination-active-bg: var(--blue-600);
    --bs-pagination-active-border-color: var(--blue-600);
    --bs-pagination-disabled-bg: #fff;
    --bs-pagination-disabled-color: #9fb0cf;
    --bs-pagination-focus-box-shadow: var(--ring);
    gap: .35rem;
}

.pagination .page-link {
    min-width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px !important;
    font-weight: 700;
    padding: 0 .6rem;
}

.pagination .active .page-link {
    box-shadow: 0 6px 14px rgba(26, 92, 229, .3);
}

/* ---------- Guide / FAQ ---------- */
.guide {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.faq {
    border-top: 0;
    margin-top: 2.5rem;
    padding-top: 0;
}

.section-head {
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.guide-card {
    height: 100%;
    background: linear-gradient(180deg, #fff, var(--blue-50));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--blue-300);
}

.guide-card h3 {
    color: var(--navy);
    font-weight: 700;
}

.guide-card p {
    margin: 0;
    color: var(--muted);
    font-size: .94rem;
    line-height: 1.65;
}

.guide-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--grad);
    color: #fff;
    margin-bottom: .9rem;
    box-shadow: 0 8px 18px rgba(26, 92, 229, .3);
}

.accordion {
    --bs-accordion-border-color: var(--line);
    --bs-accordion-border-radius: var(--radius-sm);
    --bs-accordion-inner-border-radius: var(--radius-sm);
    --bs-accordion-active-bg: var(--blue-50);
    --bs-accordion-active-color: var(--blue-700);
    --bs-accordion-btn-focus-box-shadow: var(--ring);
    max-width: 900px;
}

.accordion-item {
    margin-bottom: .6rem;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

.accordion-button {
    font-weight: 700;
    color: var(--navy);
}

.accordion-button:not(.collapsed) {
    color: var(--blue-700);
    background: var(--blue-50);
    box-shadow: none;
}

.accordion-body {
    color: var(--muted);
    line-height: 1.65;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 4.5rem;
    background: linear-gradient(180deg, #0c2a63 0%, var(--navy) 100%);
    color: #c7d7f5;
    position: relative;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad);
}

.footer-top {
    padding-block: 3rem 2rem;
}

.brand-light,
.brand-light:hover {
    color: #fff;
}

.brand-light .brand-tile {
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.footer-text {
    margin: 1rem 0 0;
    font-size: .92rem;
    line-height: 1.65;
    max-width: 44ch;
}

.footer-h {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: .55rem;
}

.footer-links a {
    color: #c7d7f5;
    text-decoration: none;
    font-size: .92rem;
    transition: color .15s, padding .15s;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-block: 1.1rem 1.4rem;
    font-size: .84rem;
    color: #9db4e0;
}

/* ---------- Back to top ---------- */
.to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1020;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(26, 92, 229, .4);
    transition: transform .2s, opacity .2s;
}

.to-top[hidden] {
    display: none;
}

.to-top:hover {
    transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Gem card link (whole card clickable) ---------- */
.gem-link {
    color: inherit;
    text-decoration: none;
}

.gem-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

.gem-link:hover {
    color: var(--blue-600);
}

.gem-link:focus-visible {
    outline: none;
}

.gem-card:has(.gem-link:focus-visible) {
    box-shadow: var(--ring);
    border-color: var(--blue-600);
}

/* ---------- Detail page ---------- */
.detail-head {
    background: linear-gradient(180deg, #f3f8ff, #fff);
    border-bottom: 1px solid var(--line);
}

.detail-head-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-block: 1.25rem 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    margin-bottom: 1rem;
}

.back-link:hover {
    gap: .6rem;
}

.back-link,
.back-link svg {
    transition: gap .2s;
}

.detail-code {
    margin: 0 0 .25rem;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--blue-600);
}

.detail-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4.2vw, 2.7rem);
    line-height: 1.1;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 .5rem;
}

.detail-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
    font-weight: 600;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9fb0cf;
}

.status-dot.is-on {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}

.detail-shell {
    padding-block: 1.5rem 0;
}

.detail-card {
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

@media (min-width: 992px) {
    .detail-card {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    }
}

.detail-gallery {
    padding: 1rem;
    background: linear-gradient(180deg, var(--blue-50), #fff);
}

@media (min-width: 992px) {
    .detail-gallery {
        padding: 1.5rem;
        border-right: 1px solid var(--line);
    }
}

.gallery-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(160deg, #eef4ff, #dbe8ff);
    border: 1px solid var(--line);
    touch-action: pan-y;
}

.gallery-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f6f9ff;
}

.gallery-stage .gem-placeholder {
    color: var(--blue-500);
}

.gallery-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 31, 68, .72);
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    padding: .25rem .7rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.gallery-nav {
    display: none;
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, background .2s;
}

.js .gallery-nav {
    display: grid;
}

.gallery-nav:hover {
    background: var(--blue-600);
    color: #fff;
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

.gallery-thumbs {
    display: flex;
    gap: .6rem;
    margin: .8rem 0 0;
    padding: 0 0 .3rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-300) transparent;
}

.gallery-thumbs a {
    display: block;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--line);
    opacity: .75;
    transition: all .2s;
}

.gallery-thumbs a:hover {
    opacity: 1;
}

.gallery-thumbs a.active {
    border-color: var(--blue-600);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(26, 92, 229, .3);
}

.gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-info {
    padding: 1.25rem;
}

@media (min-width: 992px) {
    .detail-info {
        padding: 1.75rem;
    }
}

.price-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 1.2rem 1.4rem;
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--grad);
    box-shadow: 0 14px 30px rgba(26, 92, 229, .3);
}

.price-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .3), transparent 70%);
}

.price-label {
    font-size: .8rem;
    font-weight: 600;
    opacity: .9;
    letter-spacing: .04em;
}

.price-value {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.price-value-na {
    font-size: 1.5rem;
}

.price-sub {
    font-size: .85rem;
    opacity: .92;
    font-weight: 500;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 1.1rem 0 0;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
}

.stat-row>div {
    padding-inline: .9rem;
    border-left: 1px solid var(--line);
    min-width: 0;
}

.stat-row>div:first-child {
    padding-left: 0;
    border-left: 0;
}

.stat-row dt,
.info-grid dt {
    font-size: .76rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 .15rem;
}

.stat-row dd {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    overflow-wrap: anywhere;
}

.info-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin: 1.25rem 0 .9rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.2rem;
    margin: 0;
}

@media (min-width: 576px) {
    .info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.info-grid dd {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
    font-size: .95rem;
    overflow-wrap: anywhere;
}

.assure {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 1.25rem;
    padding: 1.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--blue-300);
    background: linear-gradient(135deg, var(--blue-50), #eaf3ff);
}

@media (min-width: 992px) {
    .assure {
        grid-template-columns: 1.2fr 1.8fr;
        align-items: center;
    }
}

.assure-main {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
}

.assure-main p {
    margin: 0;
    color: #34507f;
    font-size: .92rem;
    line-height: 1.6;
}

.assure-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 .25rem;
}

.assure-icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 8px 18px rgba(26, 92, 229, .3);
}

.assure-icon.sm {
    width: 40px;
    height: 40px;
    margin-bottom: .5rem;
}

.assure-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

@media (min-width: 576px) {
    .assure-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .assure-list li {
        border-left: 1px solid var(--blue-300);
    }

    .assure-list li:first-child {
        border-left: 0;
    }
}

.assure-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-inline: .8rem;
}

.assure-list strong {
    font-size: .92rem;
    color: var(--navy);
}

.assure-list small {
    color: var(--muted);
    font-size: .8rem;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Mega menu (desktop) + mobile accordion. No inline styles anywhere (CSP).
   ========================================================================== */
.mega-bar { border-top: 1px solid var(--line); background: var(--white); }
.mega-top { display: flex; align-items: stretch; gap: .25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.mega-item { position: relative; display: flex; align-items: center; }
.mega-link {
    display: inline-flex; align-items: center; gap: .4rem; padding: .85rem .35rem .85rem .85rem; color: var(--navy);
    font-weight: 600; font-size: .94rem; text-decoration: none; border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.mega-static .mega-link, .mega-item:not(:has(.mega-toggle)) .mega-link { padding-right: .85rem; }
.mega-item:hover > .mega-link, .mega-item.is-open > .mega-link { color: var(--blue-600); }
.mega-item.is-current > .mega-link { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.mega-icon { font-size: 1.05em; line-height: 1; }
.mega-toggle, .mega-sub-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; background: transparent;
    color: var(--muted); border-radius: 8px; cursor: pointer; transition: transform .18s ease, background-color .15s ease, color .15s ease; padding: 0;
}
.mega-toggle { margin-right: .35rem; }
.mega-toggle:hover, .mega-sub-toggle:hover { background: var(--blue-50); color: var(--blue-600); }
.mega-toggle[aria-expanded="true"] { transform: rotate(180deg); color: var(--blue-600); }
.mega-link:focus-visible, .mega-toggle:focus-visible, .mega-sub-toggle:focus-visible, .mega-panel a:focus-visible, .mega-sub a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.mega-panel {
    position: absolute; left: 0; top: 100%; z-index: 1040; min-width: 260px; padding: .5rem; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(6px); transition: opacity .16s ease, transform .16s ease; pointer-events: none;
}
.mega-panel[hidden], .mega-sub[hidden] { display: none; }
.mega-panel.is-visible, .mega-sub.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.mega-l2, .mega-sub ul { list-style: none; margin: 0; padding: 0; }
.mega-l2-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.mega-l2-item:hover, .mega-l2-item.is-open { background: var(--blue-50); }
.mega-l2 a, .mega-sub a {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .75rem; color: var(--ink);
    text-decoration: none; font-size: .92rem; border-radius: 10px;
}
.mega-l2-link { flex: 1; }
.mega-l2 a:hover, .mega-sub a:hover { color: var(--blue-600); background: var(--blue-50); }
.mega-l2 a[aria-current="page"], .mega-sub a[aria-current="page"] { color: var(--blue-600); font-weight: 700; }
.mega-all { font-weight: 700; color: var(--blue-700) !important; }
.mega-count { color: var(--muted); font-size: .78rem; font-weight: 500; }
.mega-sub-toggle { position: absolute; right: 4px; top: 50%; margin-top: -14px; }
.has-sub > .mega-l2-link { padding-right: 2.2rem; }
.mega-sub {
    position: absolute; left: calc(100% - 2px); top: -.5rem; min-width: 250px; padding: .5rem; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
    opacity: 0; transform: translateX(-6px); transition: opacity .16s ease, transform .16s ease; pointer-events: none;
}
/* Panels open to the right by default. menu.js adds .is-flipped only when a panel would really run off the screen
   AND flipping it fits: never by item position (that pushed panels off the left edge when there were few menus). */
.mega-panel.is-flipped { left: auto; right: 0; }
.mega-sub.is-flipped { left: auto; right: calc(100% - 2px); }
.mega-sub.is-flipped.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) { .mega-panel, .mega-sub, .mega-toggle { transition: none; } }

.mobile-menu { padding: .5rem 0 .75rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.mobile-menu a, .mobile-menu summary { display: block; padding: .65rem .25rem; color: var(--navy); font-weight: 600; text-decoration: none; cursor: pointer; }
.mobile-menu summary { list-style: none; display: flex; justify-content: space-between; align-items: center; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; margin-right: .4rem; }
.mobile-menu details[open] > summary::after { transform: rotate(-135deg); }
.mobile-menu details > a, .mobile-menu details > details { margin-left: 1rem; font-weight: 500; border-left: 2px solid var(--blue-100); padding-left: .75rem; }
.mobile-menu details > details > a { margin-left: 0; }
.mobile-menu .mm-all { color: var(--blue-700); font-weight: 700; }
.mobile-menu a:focus-visible, .mobile-menu summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
