/**
 * Default Theme – Diamond Catalog Styles
 *
 * Self-sufficient CSS for the Default theme wrapper.
 * Cream/beige background, serif-accented typography, filter pills,
 * full-width grid (no sidebar).
 *
 * @since 3.2.0
 */

/* ================================================================
   0. RESET / BASE
   ================================================================ */
.ns-diamonds-wrapper.ns-theme-default,
.ns-diamonds-wrapper.ns-theme-default *,
.ns-diamonds-wrapper.ns-theme-default *::before,
.ns-diamonds-wrapper.ns-theme-default *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * Design tokens (Appearance › Styles → Default skin)
 * generate_css() writes --ns-def-*-user for every colour the merchant changes;
 * each token falls back to the theme's original hex, so out of the box the look
 * is unchanged and customisation is opt-in / removable. The whole default theme
 * was hardcoded before — these tokens are what make its colour pickers work.
 * ───────────────────────────────────────────────────────────────── */
.ns-theme-default {
    --ns-def-accent:  var(--ns-def-accent-user, #a0884d);
    --ns-def-ink:     var(--ns-def-ink-user, #2c2824);
    --ns-def-bg:      var(--ns-def-bg-user, #f8f6f2);
    --ns-def-border:  var(--ns-def-border-user, #d4cfc6);
    --ns-def-text:    var(--ns-def-text-user, #8a8279);
    --ns-def-surface: var(--ns-def-surface-user, #f0ece5);

    /* Card text (Styles → Card Text block) */
    --ns-def-card-title-size: var(--ns-def-card-title-size-user, 16px);
    --ns-def-card-desc-size:  var(--ns-def-card-desc-size-user, 12px);
    --ns-def-card-text-align: var(--ns-def-card-text-align-user, left);
}

.ns-diamonds-wrapper.ns-theme-default {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: var(--ns-def-bg, #f8f6f2);
    -webkit-font-smoothing: antialiased;
}

.ns-diamonds-wrapper.ns-theme-default button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.ns-diamonds-wrapper.ns-theme-default a {
    text-decoration: none;
    color: inherit;
}

/* Container */
.ns-default-container {
    max-width: var(--ns-content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}


/* ================================================================
   1. TYPE TOGGLE (top bar)
   ================================================================ */
.ns-default-topbar {
    padding: 20px 0 10px;
}

.ns-default-topbar .ns-type-toggle {
    display: inline-flex;
    border: 1px solid #c9c3b8;
    border-radius: 30px;
    overflow: hidden;
}

.ns-default-topbar .ns-type-btn {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #7a7265;
    background: transparent;
    transition: all 0.25s ease;
}

.ns-default-topbar .ns-type-btn--active {
    background: var(--ns-def-surface, #f0ece5);
    color: #3a3530;
    font-weight: 600;
}

.ns-default-topbar .ns-type-btn:hover:not(.ns-type-btn--active) {
    background: #f5f2ec;
}


/* ================================================================
   2. HERO AREA
   ================================================================ */
.ns-default-hero {
    text-align: center;
    padding: 30px 0 35px;
}

.ns-default-hero-subtitle {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ns-def-accent, #a0884d);
    margin-bottom: 8px;
}

.ns-default-hero-title {
    font-family: "Playfair Display", "Georgia", "Times New Roman", serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 400;
    color: var(--ns-def-ink, #2c2824);
    line-height: 1.2;
    margin-bottom: 10px;
}

.ns-default-hero-title em {
    font-style: italic;
}

.ns-default-hero-count {
    font-size: 13px;
    color: var(--ns-def-text, #8a8279);
}

.ns-default-hero-count strong {
    font-weight: 700;
    color: #5a5249;
}


/* ================================================================
   3. FILTER PILLS BAR
   ================================================================ */
.ns-default-filters-bar {
    padding: 0 0 25px;
}

.ns-default-filters-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ns-default-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Individual pill */
.ns-default-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--ns-def-border, #d4cfc6);
    border-radius: 30px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #5a5249;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.ns-default-pill:hover {
    border-color: var(--ns-def-accent, #a0884d);
    color: #3a3530;
}

.ns-default-pill.active {
    border-color: var(--ns-def-accent, #a0884d);
    background: #f8f2e6;
    color: #8a7640;
}

.ns-default-pill-icon {
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.ns-default-pill-arrow {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.ns-default-pill.open .ns-default-pill-arrow {
    transform: rotate(180deg);
}

.ns-default-pill--reset {
    border-style: dashed;
    color: var(--ns-def-accent, #a0884d);
}

.ns-default-pill--reset[hidden] {
    display: none;
}

/* Pill badge (selected count) */
.ns-default-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--ns-def-accent, #a0884d);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.ns-default-pill-badge[hidden] {
    display: none;
}

/* ================================================================
   3b. FILTER PILL DROPDOWN PANELS
   ================================================================ */
.ns-default-pill-wrap {
    position: relative;
}

.ns-default-panel {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e0dbd2;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    padding: 16px;
    min-width: 260px;
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.ns-default-pill-wrap.open > .ns-default-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ns-default-pill-wrap.open > .ns-default-pill {
    border-color: var(--ns-def-accent, #a0884d);
    color: #3a3530;
}

/* Shape panel */
.ns-default-panel--shapes {
    min-width: 320px;
}

.ns-default-shape-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.ns-default-shape-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 4px 7px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ns-default-shape-opt:hover {
    border-color: var(--ns-def-accent, #a0884d);
}

.ns-default-shape-opt.selected {
    border-color: var(--ns-def-accent, #a0884d);
    background: #f8f2e6;
}

.ns-default-shape-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
}

.ns-default-shape-icon svg {
    width: 26px;
    height: 26px;
}

.ns-default-shape-name {
    font-size: 10px;
    color: #7a7265;
    letter-spacing: 0.02em;
}

.ns-default-shape-opt.selected .ns-default-shape-name {
    color: #8a7640;
    font-weight: 600;
}

/* Colour / clarity grade panels */
.ns-default-panel--grades {
    min-width: 300px;
}

.ns-default-grade-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ns-default-grade-opt {
    min-width: 40px;
    padding: 8px 10px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #5a5249;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ns-default-grade-opt:hover {
    border-color: var(--ns-def-accent, #a0884d);
}

.ns-default-grade-opt.selected {
    border-color: var(--ns-def-accent, #a0884d);
    background: var(--ns-def-accent, #a0884d);
    color: #fff;
}

/* Carat / price dual-handle range panels */
.ns-default-panel--range {
    min-width: 280px;
    padding: 18px 20px 22px;
}

.ns-default-range-vals {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #5a5249;
    margin-bottom: 14px;
}

.ns-default-range-track {
    position: relative;
    height: 3px;
    border-radius: 2px;
    background: #e8e4dc;
    cursor: pointer;
    margin: 0 8px;
}

.ns-default-range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--ns-def-accent, #a0884d);
    border-radius: 2px;
    pointer-events: none;
}

.ns-default-range-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--ns-def-accent, #a0884d);
    transform: translate(-50%, -50%);
    cursor: grab;
    padding: 0;
    transition: box-shadow 0.15s ease;
}

.ns-default-range-thumb:hover,
.ns-default-range-thumb:focus {
    box-shadow: 0 0 0 5px rgba(160, 136, 77, 0.15);
    outline: none;
}


/* ================================================================
   4. SORT DROPDOWN
   ================================================================ */
.ns-default-sort {
    position: relative;
}

.ns-default-sort .ns-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--ns-def-border, #d4cfc6);
    border-radius: 30px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #5a5249;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ns-default-sort .ns-sort-trigger:hover {
    border-color: var(--ns-def-accent, #a0884d);
}

.ns-default-sort .ns-sort-current {
    font-weight: 600;
    color: #3a3530;
}

.ns-default-sort .ns-sort-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0dbd2;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.ns-default-sort .ns-sort-menu--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ns-default-sort .ns-sort-options {
    list-style: none;
    padding: 6px 0;
}

.ns-default-sort .ns-sort-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 18px;
    font-size: 13px;
    color: #5a5249;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.ns-default-sort .ns-sort-option:hover {
    background: var(--ns-def-bg, #f8f6f2);
}

.ns-default-sort .ns-sort-option--active {
    color: var(--ns-def-accent, #a0884d);
    font-weight: 600;
}


/* ================================================================
   5. DIAMOND GRID
   ================================================================ */
.ns-default-content {
    padding: 0 0 60px;
}

.ns-theme-default .ns-grid-container {
    width: 100%;
}

.ns-theme-default .ns-grid-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Columns responsive — inherit from data-columns attr */
.ns-theme-default .ns-diamonds-grid[data-columns="3"] .ns-grid-items {
    grid-template-columns: repeat(3, 1fr);
}

.ns-theme-default .ns-diamonds-grid[data-columns="5"] .ns-grid-items {
    grid-template-columns: repeat(5, 1fr);
}


/* ================================================================
   6. DIAMOND CARDS
   ================================================================ */
.ns-card-default {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ns-card-default:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

/* Card image */
.ns-card-default .ns-card-image {
    position: relative;
    padding: 16px;
    background: #fafaf8;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.ns-card-default .ns-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Cert badge on image */
.ns-card-default .ns-card-cert-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #6b8f5e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
}

/* Card body */
.ns-card-default .ns-card-body {
    padding: 16px 18px 18px;
    text-align: var(--ns-def-card-text-align, left);
}

/* Carat + Price row */
.ns-card-default .ns-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.ns-card-default .ns-card-carat {
    font-size: var(--ns-def-card-title-size, 16px);
    font-weight: 400;
    color: var(--ns-def-ink, #2c2824);
}

.ns-card-default .ns-card-carat small {
    font-size: 12px;
    color: var(--ns-def-text, #8a8279);
    font-weight: 400;
}

.ns-card-default .ns-card-price {
    font-size: var(--ns-def-card-title-size, 16px);
    font-weight: 600;
    color: var(--ns-def-ink, #2c2824);
}

/* Specs row */
.ns-card-default .ns-card-specs {
    font-size: var(--ns-def-card-desc-size, 12px);
    color: var(--ns-def-text, #8a8279);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

/* CTA button */
.ns-card-default .ns-card-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a7265;
    border: 1px solid var(--ns-def-border, #d4cfc6);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ns-card-default .ns-card-cta:hover {
    border-color: var(--ns-def-accent, #a0884d);
    color: var(--ns-def-accent, #a0884d);
    background: #fdf9f0;
}


/* ================================================================
   7. PAGINATION
   ================================================================ */
.ns-theme-default .ns-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.ns-theme-default .ns-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ns-theme-default .ns-page-num,
.ns-theme-default .ns-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #5a5249;
    border: 1px solid #e0dbd2;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ns-theme-default .ns-page-num:hover,
.ns-theme-default .ns-page-btn:hover {
    border-color: var(--ns-def-accent, #a0884d);
    color: var(--ns-def-accent, #a0884d);
}

.ns-theme-default .ns-page-current {
    background: var(--ns-def-accent, #a0884d);
    color: #fff;
    border-color: var(--ns-def-accent, #a0884d);
}

.ns-theme-default .ns-page-dots {
    padding: 0 6px;
    color: #aaa;
}

/* AJAX-swapped pagination — NS_Template_Loader::pagination() markup
   (.ns-pagination-list / .ns-page-link) replaces the server-rendered
   .ns-page-num markup after the first AJAX request. */
.ns-theme-default .ns-pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ns-theme-default .ns-page-item {
    list-style: none;
}

.ns-theme-default .ns-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #5a5249;
    border: 1px solid #e0dbd2;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ns-theme-default .ns-page-link:hover {
    border-color: var(--ns-def-accent, #a0884d);
    color: var(--ns-def-accent, #a0884d);
}

.ns-theme-default .ns-page-item.ns-active .ns-page-link {
    background: var(--ns-def-accent, #a0884d);
    color: #fff;
    border-color: var(--ns-def-accent, #a0884d);
}

.ns-theme-default .ns-page-item.ns-disabled .ns-page-link {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.ns-theme-default .ns-page-item.ns-page-dots .ns-page-link {
    border: none;
    background: transparent;
    color: #aaa;
    min-width: auto;
}


/* ================================================================
   7b. BOOKING MODAL (catalog-only mode)
   Base .ns-modal rules duplicated here because ns-modal.css is not
   enqueued on catalogue pages — kept identical to assets/css/ns-modal.css.
   ================================================================ */
.ns-default-booking-modal[aria-hidden="true"] {
    display: none;
}

.ns-default-booking-modal[aria-hidden="false"] {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.ns-default-booking-modal .ns-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 40, 36, 0.55);
    cursor: pointer;
}

.ns-default-booking-modal .ns-modal__container {
    position: relative;
    background: #fff;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 30px;
    z-index: 1;
}

.ns-default-booking-modal .ns-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ns-default-booking-modal .ns-modal__title {
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--ns-def-ink, #2c2824);
    margin: 0;
}

.ns-default-booking-modal .ns-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #7a7265;
    line-height: 0;
}

.ns-default-booking-modal .ns-modal__close:hover {
    color: var(--ns-def-ink, #2c2824);
}

body.ns-modal-open {
    overflow: hidden;
}


/* ================================================================
   8. NO RESULTS
   ================================================================ */
.ns-theme-default .ns-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--ns-def-text, #8a8279);
}

.ns-theme-default .ns-no-results-icon {
    margin-bottom: 16px;
    opacity: 0.4;
}

.ns-theme-default .ns-no-results h3 {
    font-family: "Playfair Display", "Georgia", serif;
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #5a5249;
}

.ns-theme-default .ns-no-results p {
    font-size: 14px;
}


/* ================================================================
   9. ANIMATIONS
   ================================================================ */
.ns-card-default.ns-animate-fade {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.ns-card-default.ns-animate-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* ================================================================
   10. RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .ns-theme-default .ns-grid-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ns-theme-default .ns-grid-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ns-default-hero-title {
        font-size: 28px;
    }

    .ns-default-filters-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Wrap (not overflow-x scroll): the dropdown panels are absolutely
       positioned and would be clipped inside a scroll container. */
    .ns-default-pills {
        width: 100%;
        flex-wrap: wrap;
    }

    .ns-default-panel {
        max-width: calc(100vw - 32px);
    }

    .ns-default-panel--shapes,
    .ns-default-panel--grades,
    .ns-default-panel--range {
        min-width: min(280px, calc(100vw - 32px));
    }

    .ns-default-sort {
        width: 100%;
    }

    .ns-default-sort .ns-sort-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .ns-default-sort .ns-sort-menu {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ns-theme-default .ns-grid-items {
        grid-template-columns: 1fr;
    }

    .ns-default-container {
        padding: 0 12px;
    }

    .ns-default-pill {
        padding: 7px 12px;
        font-size: 12px;
    }
}
