/**
 * NivoSync — Generic theme, SINGLE diamond page styles.
 *
 * loop.css is NOT loaded on single/ring-builder pages, so this file MUST
 * self-declare the full `--ns-gen-*` token block (copied verbatim from
 * loop.css). The root <article> carries `.ns-theme-generic`, so the tokens
 * declared on that class resolve for every descendant here, and the admin
 * Styles panel overrides (emitted as `--ns-gen-*-user` scoped to
 * `.ns-theme-generic`) win over these defaults exactly as they do on the loop.
 *
 * Every component rule is scoped under `.ns-single-generic` so nothing leaks
 * into the host WordPress theme, and every colour/geometry is a token
 * (`var(--ns-gen-*)`) — never a hardcoded hex.
 *
 * @package NivoSync
 * @since   3.0.7
 */

/* =========================================================================
   DESIGN TOKENS — copied verbatim from loop.css (defaults; admin overrides
   the *-user vars).
   ========================================================================= */
.ns-theme-generic {
    --ns-gen-bg:        var(--ns-gen-bg-user, #ffffff);
    --ns-gen-surface:   var(--ns-gen-surface-user, #f4f4f3);
    --ns-gen-ink:       var(--ns-gen-ink-user, #1a1a1a);
    --ns-gen-ink-soft:  var(--ns-gen-ink-soft-user, #6b6b6b);
    --ns-gen-line:      var(--ns-gen-line-user, #e3e3e1);
    --ns-gen-accent:    var(--ns-gen-accent-user, #8a6d3b);
    --ns-gen-on-ink:    var(--ns-gen-on-ink-user, #ffffff);
    --ns-gen-track:     var(--ns-gen-track-user, #dcdcda);
    --ns-gen-active:    var(--ns-gen-active-user, #d3a441);
    --ns-gen-focus:     var(--ns-gen-focus-user, #2b6cb0);

    /* Button state tokens (configurable; sensible derived defaults). */
    --ns-gen-btn-solid-bg:       var(--ns-gen-btn-solid-bg-user, var(--ns-gen-ink));
    --ns-gen-btn-solid-text:     var(--ns-gen-btn-solid-text-user, var(--ns-gen-on-ink));
    --ns-gen-btn-solid-hover-bg: var(--ns-gen-btn-solid-hover-bg-user, var(--ns-gen-accent));
    --ns-gen-btn-solid-hover-text: var(--ns-gen-btn-solid-hover-text-user, var(--ns-gen-btn-solid-text));
    --ns-gen-btn-ghost-bg:       var(--ns-gen-btn-ghost-bg-user, var(--ns-gen-bg));
    --ns-gen-btn-ghost-text:     var(--ns-gen-btn-ghost-text-user, var(--ns-gen-ink));
    --ns-gen-btn-ghost-hover-bg: var(--ns-gen-btn-ghost-hover-bg-user, var(--ns-gen-surface));
    --ns-gen-card-hover-border:  var(--ns-gen-card-hover-border-user, var(--ns-gen-line));

    /* Type. */
    --ns-gen-font-display: var(--ns-gen-font-display-user, Georgia, 'Times New Roman', serif);
    --ns-gen-font-body:    var(--ns-gen-font-body-user, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);

    /* Geometry / motion. */
    --ns-gen-radius:    var(--ns-gen-radius-user, 4px);
    --ns-gen-radius-lg: var(--ns-gen-radius-lg-user, 8px);
    --ns-gen-gap:       16px;
    --ns-gen-maxw:      1280px;
    --ns-gen-card-min:  240px;
    --ns-gen-t:         160ms ease;
}

/* =========================================================================
   BASE (scoped) — loop.css is not loaded here, so re-declare the essentials.
   ========================================================================= */
.ns-single-generic { color: var(--ns-gen-ink); font-family: var(--ns-gen-font-body); font-size: 15px; line-height: 1.5; }
.ns-single-generic *, .ns-single-generic *::before, .ns-single-generic *::after { box-sizing: border-box; }
.ns-single-generic img, .ns-single-generic svg { display: block; max-width: 100%; }
.ns-single-generic button { font: inherit; cursor: pointer; }
.ns-single-generic a { color: inherit; text-decoration: none; }
.ns-single-generic :focus-visible { outline: 2px solid var(--ns-gen-focus); outline-offset: 2px; }
.ns-single-generic .ns-wrap { max-width: var(--ns-gen-maxw); margin: 0 auto; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .ns-single-generic * { transition: none !important; } }

/* =========================================================================
   BREADCRUMB / CONTEXT
   ========================================================================= */
.ns-single-generic__breadcrumb { font-size: 13px; color: var(--ns-gen-ink-soft); padding: 22px 0 12px; }
.ns-single-generic__crumb-sep { margin: 0 6px; }
.ns-single-generic__lab { color: var(--ns-gen-ink-soft); }

/* =========================================================================
   LAYOUT: media + info
   ========================================================================= */
.ns-single-generic__detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-bottom: 40px; }

/* --- Media --------------------------------------------------------------- */
.ns-single-generic__media { position: relative; }
/* The stage is a definite square (aspect-ratio). Frames are absolutely
   positioned so the 360 canvas (whose size the viewer derives from its
   container) can NEVER feed back into the stage height — a plain
   height:100% + min-height frame let the canvas push the row taller each
   ResizeObserver tick, runaway-growing the canvas (e.g. to 3208px). */
.ns-single-generic .ns-single-media-stage {
    position: relative;
    background: var(--ns-gen-surface);
    aspect-ratio: 1 / 1;
    border-radius: var(--ns-gen-radius-lg);
    overflow: hidden;
}
.ns-single-generic .ns-single-media-frame { position: absolute; inset: 0; display: none; }
.ns-single-generic .ns-single-media-frame.is-active { display: block; }
.ns-single-generic .ns-single-media-frame[hidden] { display: none; }
.ns-single-generic .ns-single-media-frame img,
.ns-single-generic .ns-single-media-frame video { width: 100%; height: 100%; object-fit: cover; }
.ns-single-generic .ns-single-media-frame[data-media="360"] { padding: 0; }
.ns-single-generic .ns-360-viewer-container { position: absolute; inset: 0; width: 100%; height: 100%; }

.ns-single-generic .ns-badge-360 {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    background: var(--ns-gen-ink); color: var(--ns-gen-on-ink);
    font-size: 11px; letter-spacing: .3px; padding: 4px 8px; border-radius: 99px;
}

.ns-single-generic .ns-single-media-tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ns-single-generic .ns-single-media-tab {
    border: 1px solid var(--ns-gen-line); border-radius: 99px;
    background: var(--ns-gen-bg); color: var(--ns-gen-ink-soft);
    padding: 6px 14px; font-size: 12px;
    transition: border-color var(--ns-gen-t), color var(--ns-gen-t), background-color var(--ns-gen-t);
}
/* Pin background too: Elementor's kit paints bare <button>s on :hover/:focus at
   (0,2,1) — without the pin this tab flashes the host theme's button colour. */
.ns-single-generic .ns-single-media-tab:hover,
.ns-single-generic .ns-single-media-tab:focus { color: var(--ns-gen-ink); background: var(--ns-gen-bg); }
.ns-single-generic .ns-single-media-tab.is-active {
    background: var(--ns-gen-ink); color: var(--ns-gen-on-ink); border-color: var(--ns-gen-ink);
}

/* --- Info ---------------------------------------------------------------- */
.ns-single-generic__eyebrow { color: var(--ns-gen-ink-soft); font-size: 13px; letter-spacing: .4px; text-transform: uppercase; margin: 0 0 6px; }
.ns-single-generic__title { font-family: var(--ns-gen-font-display); font-weight: 500; font-size: 28px; line-height: 1.2; margin: 0 0 6px; color: var(--ns-gen-ink); }
.ns-single-generic__specs { color: var(--ns-gen-accent); font-size: 14px; margin: 0 0 16px; }

.ns-single-generic__price { margin: 0 0 22px; }
.ns-single-generic__price-main { font-size: 26px; font-weight: 700; margin: 0 0 4px; color: var(--ns-gen-ink); }
.ns-single-generic__price-main small { font-size: 13px; font-weight: 400; color: var(--ns-gen-ink-soft); }
.ns-single-generic__vat-note { color: var(--ns-gen-ink-soft); font-size: 13px; margin: 0; }

/* --- CTA row ------------------------------------------------------------- */
.ns-single-generic__cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.ns-single-generic .ns-btn {
    border-radius: var(--ns-gen-radius); padding: 13px 22px; font-size: 14px; text-align: center;
    border: 1px solid var(--ns-gen-ink); display: inline-block;
    transition: background-color var(--ns-gen-t), color var(--ns-gen-t), border-color var(--ns-gen-t);
}
.ns-single-generic .ns-btn--solid { background: var(--ns-gen-btn-solid-bg); color: var(--ns-gen-btn-solid-text); border-color: var(--ns-gen-btn-solid-bg); }
.ns-single-generic .ns-btn--solid:hover { background: var(--ns-gen-btn-solid-hover-bg); border-color: var(--ns-gen-btn-solid-hover-bg); color: var(--ns-gen-btn-solid-hover-text); }
.ns-single-generic .ns-btn--ghost { background: var(--ns-gen-btn-ghost-bg); color: var(--ns-gen-btn-ghost-text); }
.ns-single-generic .ns-btn--ghost:hover { background: var(--ns-gen-btn-ghost-hover-bg); }
.ns-single-generic .ns-btn.ns-loading { opacity: .7; pointer-events: none; }

/* Scoped at 0,2,0 (+ explicit svg + button reset) so WooCommerce / the host
   theme's global button styles can't override the wishlist control. */
.ns-single-generic .ns-single-generic__wish {
    width: 44px; height: 44px; flex: 0 0 auto; padding: 0; margin: 0; display: grid; place-items: center;
    background: var(--ns-gen-bg); border: 1px solid var(--ns-gen-line); border-radius: var(--ns-gen-radius);
    color: var(--ns-gen-ink-soft); box-shadow: none; text-transform: none; line-height: 1;
    transition: color var(--ns-gen-t), border-color var(--ns-gen-t);
}
.ns-single-generic .ns-single-generic__wish svg { width: 20px; height: 20px; display: block; stroke: currentColor; }
.ns-single-generic .ns-single-generic__wish:hover,
.ns-single-generic .ns-single-generic__wish.is-active { color: var(--ns-gen-accent); border-color: var(--ns-gen-accent); background: var(--ns-gen-bg); }

/* --- Spec table ---------------------------------------------------------- */
/* Scoped at 0,2,x so the host theme's default <table>/<td> borders + row
   shading don't bleed in. Clean border-bottom rows with horizontal padding
   so values aren't pinned against the cell edges. */
.ns-single-generic .ns-single-generic__spec-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; }
.ns-single-generic .ns-single-generic__spec-table caption { text-align: left; font-weight: 600; padding: 0 0 10px; color: var(--ns-gen-ink); }
.ns-single-generic .ns-single-generic__spec-table th,
.ns-single-generic .ns-single-generic__spec-table td { text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--ns-gen-line); background: transparent; vertical-align: middle; }
.ns-single-generic .ns-single-generic__spec-table th { color: var(--ns-gen-ink-soft); font-weight: 500; width: 42%; padding-left: 2px; }
.ns-single-generic .ns-single-generic__spec-table td { color: var(--ns-gen-ink); }
.ns-single-generic .ns-single-generic__spec-table a { color: var(--ns-gen-accent); text-decoration: underline; }

/* --- Reassurance strip --------------------------------------------------- */
.ns-single-generic__reassure {
    display: flex; gap: 24px; flex-wrap: wrap;
    border-top: 1px solid var(--ns-gen-line); margin: 24px 0 0; padding: 18px 0 0;
    list-style: none;
    font-size: 13px; color: var(--ns-gen-ink-soft);
}
.ns-single-generic__reassure li { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.ns-single-generic__reassure svg { color: var(--ns-gen-accent); }

/* =========================================================================
   SIMILAR DIAMONDS — the card partial emits `.ns-card` markup styled only by
   loop.css (not loaded here), so re-declare the grid + card essentials.
   ========================================================================= */
.ns-single-generic__similar { border-top: 1px solid var(--ns-gen-line); padding: 34px 0 40px; }
.ns-single-generic__similar-title { font-family: var(--ns-gen-font-display); font-weight: 500; font-size: 22px; margin: 0 0 22px; color: var(--ns-gen-ink); }

.ns-single-generic .ns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ns-gen-card-min), 1fr)); gap: 24px; }
.ns-single-generic .ns-card { border: 1px solid transparent; border-radius: var(--ns-gen-radius); transition: border-color var(--ns-gen-t); cursor: pointer; }
.ns-single-generic .ns-card:hover { border-color: var(--ns-gen-card-hover-border); }
.ns-single-generic .ns-card__media { position: relative; background: var(--ns-gen-surface); aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--ns-gen-radius) var(--ns-gen-radius) 0 0; }
.ns-single-generic .ns-card__media-link { display: block; width: 100%; height: 100%; }
.ns-single-generic .ns-card__img { width: 100%; height: 100%; object-fit: cover; }
.ns-single-generic .ns-card__wish { position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; background: var(--ns-gen-bg); border: 1px solid var(--ns-gen-line); border-radius: 50%; color: var(--ns-gen-ink-soft); transition: color var(--ns-gen-t); }
.ns-single-generic .ns-card__wish:hover, .ns-single-generic .ns-card__wish.is-active { color: var(--ns-gen-accent); }
.ns-single-generic .ns-card__badge { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--ns-gen-ink); color: var(--ns-gen-on-ink); font-size: 10px; letter-spacing: .3px; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; }
.ns-single-generic .ns-card__body { padding: 14px 12px 12px; }
.ns-single-generic .ns-card__title { font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.ns-single-generic .ns-card__specs { color: var(--ns-gen-accent); font-size: 13px; margin: 0 0 12px; }
.ns-single-generic .ns-card__price { font-weight: 700; font-size: 15px; color: var(--ns-gen-ink); }
.ns-single-generic .ns-card__price small { font-weight: 400; color: var(--ns-gen-ink-soft); font-size: 12px; }
.ns-single-generic .ns-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height var(--ns-gen-t), opacity var(--ns-gen-t); }
.ns-single-generic .ns-card__actions:only-child { grid-template-columns: 1fr; }
.ns-single-generic .ns-card:hover .ns-card__actions, .ns-single-generic .ns-card:focus-within .ns-card__actions { max-height: 60px; opacity: 1; }
.ns-single-generic .ns-card .ns-btn { padding: 10px 8px; font-size: 13px; }

/* =========================================================================
   LIGHTBOX — the shared single-diamond shell always prints #ns-lightbox (BEM
   classes), but its stylesheet (ns-single.css) is not enqueued for modular
   themes, so without this it rendered as unstyled buttons at the bottom of
   the page. Hidden by default via aria-hidden; styled for when it opens.
   Unscoped on purpose (the lightbox is a sibling of .ns-single-generic) —
   safe because single.css only loads on this theme's single pages.
   ========================================================================= */
#ns-lightbox.ns-lightbox {
    position: fixed; inset: 0; z-index: 99990;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .92);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
}
#ns-lightbox.ns-lightbox.is-open,
#ns-lightbox.ns-lightbox[aria-hidden="false"] { opacity: 1; visibility: visible; pointer-events: auto; }
.ns-lightbox__content { max-width: 90vw; max-height: 88vh; display: flex; }
.ns-lightbox__image { max-width: 100%; max-height: 88vh; object-fit: contain; }
.ns-lightbox__close, .ns-lightbox__nav {
    position: absolute; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; cursor: pointer;
    transition: background-color 150ms ease;
}
.ns-lightbox__close:hover, .ns-lightbox__nav:hover { background: rgba(255, 255, 255, .28); }
.ns-lightbox__close { top: 20px; right: 20px; }
.ns-lightbox__nav { top: 50%; transform: translateY(-50%); }
.ns-lightbox__prev { left: 20px; }
.ns-lightbox__next { right: 20px; }
.ns-lightbox__counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; }

/* =========================================================================
   ENQUIRY MODAL SUBMIT BUTTON — the #ns-inquiry-modal renders outside
   .ns-single-generic (it's a sibling), but it's still inside body.ns-theme-
   generic, so the --ns-gen-* tokens are inherited. Match the Custom skin's
   solid button exactly (0,2,0 beats the shared ns-modal.css base rule).
   ========================================================================= */
.ns-theme-generic .ns-inquiry-submit {
    background: var(--ns-gen-btn-solid-bg);
    color: var(--ns-gen-btn-solid-text);
    border-color: var(--ns-gen-btn-solid-bg);
    border-radius: var(--ns-gen-radius);
}
.ns-theme-generic .ns-inquiry-submit:hover {
    background: var(--ns-gen-btn-solid-hover-bg);
    border-color: var(--ns-gen-btn-solid-hover-bg);
    color: var(--ns-gen-btn-solid-hover-text);
    filter: none;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 860px) {
    .ns-single-generic__detail { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 560px) {
    .ns-single-generic__cta { gap: 10px; }
    .ns-single-generic .ns-btn { flex: 1 1 auto; }
    .ns-single-generic__wish { flex: 0 0 auto; }
    .ns-single-generic__reassure { gap: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. DIAMOND CONTENT SECTION (admin: Appearance → Diamond Page)
   The Four C's / detail-table partials are shared and were authored with the
   Elegant single's class names (.ns-elegant-*). This skin reuses them, so they
   are restyled here against the --ns-gen-* tokens — that keeps them native to
   the Custom skin AND merchant-configurable. Scoped to this skin's wrapper so
   nothing leaks into default/modern/elegant.
   ═══════════════════════════════════════════════════════════════════════════ */

.ns-single-generic__content-section {
    max-width: var(--ns-gen-maxw);
    margin: 48px auto 0;
    padding: 0 20px;
    color: var(--ns-gen-ink);
    font-family: var(--ns-gen-font-body);
}

.ns-single-generic__content-section .ns-elegant-fourcees__container {
    max-width: 100%;
}

.ns-single-generic__content-section .ns-elegant-fourcees__title,
.ns-single-generic__content-section .ns-elegant-fourcees__heading {
    font-family: var(--ns-gen-font-display);
    color: var(--ns-gen-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ns-single-generic__content-section .ns-elegant-fourcees__title {
    font-size: 26px;
    margin: 0 0 24px;
}

.ns-single-generic__content-section .ns-elegant-fourcees__heading {
    font-size: 18px;
    margin: 0 0 8px;
}

.ns-single-generic__content-section .ns-elegant-fourcees__row {
    padding: 24px 0;
}

.ns-single-generic__content-section .ns-elegant-fourcees__row--border {
    border-top: 1px solid var(--ns-gen-line);
}

.ns-single-generic__content-section .ns-elegant-fourcees__text,
.ns-single-generic__content-section .ns-elegant-fourcees__desc,
.ns-single-generic__content-section .ns-elegant-fourcees__info-desc {
    color: var(--ns-gen-ink-soft);
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

.ns-single-generic__content-section .ns-elegant-fourcees__value-large {
    font-family: var(--ns-gen-font-display);
    font-size: 30px;
    color: var(--ns-gen-ink);
}

.ns-single-generic__content-section .ns-elegant-fourcees__value-medium {
    font-size: 15px;
    font-weight: 600;
    color: var(--ns-gen-ink);
}

.ns-single-generic__content-section .ns-elegant-fourcees__label,
.ns-single-generic__content-section .ns-elegant-fourcees__unit {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ns-gen-ink-soft);
}

.ns-single-generic__content-section .ns-elegant-fourcees__data-cols {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ns-gen-gap);
}

.ns-single-generic__content-section .ns-elegant-fourcees__data-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ns-gen-line);
}

.ns-single-generic__content-section .ns-elegant-fourcees__info-box {
    background: var(--ns-gen-surface);
    border: 1px solid var(--ns-gen-line);
    border-radius: var(--ns-gen-radius-lg);
    padding: 16px;
    margin-top: 12px;
}

.ns-single-generic__content-section .ns-elegant-fourcees__info-title {
    font-weight: 600;
    color: var(--ns-gen-ink);
    margin-bottom: 4px;
    font-size: 14px;
}

/* Grade scale (colour / clarity strips) */
.ns-single-generic__content-section .ns-elegant-scale {
    margin-top: 14px;
}

.ns-single-generic__content-section .ns-elegant-scale__gradient {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ns-gen-track), var(--ns-gen-accent));
}

.ns-single-generic__content-section .ns-elegant-scale__marks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.ns-single-generic__content-section .ns-elegant-scale__label,
.ns-single-generic__content-section .ns-elegant-scale__tick {
    font-size: 10px;
    color: var(--ns-gen-ink-soft);
}

/* Detail-table mode reuses the shared specs table — keep it on-skin. */
.ns-single-generic__content-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ns-single-generic__content-section table th,
.ns-single-generic__content-section table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--ns-gen-line);
    text-align: left;
}

.ns-single-generic__content-section table th {
    color: var(--ns-gen-ink-soft);
    font-weight: 500;
}

@media (max-width: 640px) {
    .ns-single-generic__content-section { margin-top: 32px; }
    .ns-single-generic__content-section .ns-elegant-fourcees__title { font-size: 22px; }
    .ns-single-generic__content-section .ns-elegant-fourcees__value-large { font-size: 24px; }
}
