/* ===== Shop page (shop.php) — rebuilt to match the Juviano shop mockup.
   Every colour is a var() from navigation.php's :root — no hex values in
   this file. Same visual language as product-page.css (.pp-* classes). ===== */

.sp-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 28px 40px 72px;
}

.sp-breadcrumb {
    font-size: 13.5px;
    color: var(--jv-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sp-breadcrumb a {
    color: var(--jv-muted);
}

.sp-breadcrumb a:hover {
    color: var(--jv-gold-dark);
}

.sp-breadcrumb .sp-current {
    color: var(--jv-ink);
}

.sp-heading {
    font-family: var(--jv-font-serif);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 600;
    margin: 10px 0 0;
    color: var(--jv-ink);
}

/* ----- Toolbar: count | sort | view toggle | mobile filter button ----- */
.sp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--jv-line);
}

.sp-count {
    font-size: 14.5px;
    color: var(--jv-muted);
}

.sp-count strong {
    color: var(--jv-ink);
}

.sp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sp-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--jv-line);
    border-radius: 999px;
    background: transparent;
    padding: 9px 18px;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--jv-ink);
    cursor: pointer;
}

.sp-sort-select {
    border: 1px solid var(--jv-line);
    border-radius: 999px;
    background: var(--jv-paper);
    padding: 9px 16px;
    font-size: 13.5px;
    color: var(--jv-ink);
    font-family: var(--jv-font-sans);
}

.sp-view-toggle {
    display: flex;
    gap: 4px;
    border: 1px solid var(--jv-line);
    border-radius: 999px;
    padding: 3px;
}

.sp-view-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--jv-muted);
    cursor: pointer;
}

.sp-view-btn.active {
    background: var(--jv-ink);
    color: var(--jv-paper);
}

/* ----- Layout: sidebar | grid ----- */
.sp-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    margin-top: 28px;
    align-items: start;
}

@media (max-width: 991px) {
    .sp-layout {
        grid-template-columns: 1fr;
    }

    /* Grid items default to min-width:auto, so a wide enough card (or the
       hidden-but-still-measured sidebar) can force this single column wider
       than the viewport itself ("grid blowout"). min-width:0 lets them
       shrink to the actual available space instead. */
    .sp-layout > * {
        min-width: 0;
    }

    .sp-filter-toggle {
        display: inline-flex;
    }

    .sp-sidebar {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: var(--jv-paper);
        padding: 24px;
        overflow-y: auto;
    }

    .sp-sidebar.sp-sidebar-open {
        display: block;
    }
}

/* ----- Sidebar ----- */
.sp-sidebar {
    position: sticky;
    top: 24px;
}

.sp-sidebar-close {
    display: none;
}

@media (max-width: 991px) {
    .sp-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        border: none;
        background: transparent;
        font-size: 22px;
        color: var(--jv-ink);
        cursor: pointer;
        width: 100%;
        margin-bottom: 12px;
    }
}

.sp-filter-group {
    border-bottom: 1px solid var(--jv-line);
    padding-bottom: 22px;
    margin-bottom: 22px;
}

.sp-filter-title {
    font-family: var(--jv-font-serif);
    font-size: 19px;
    font-weight: 600;
    color: var(--jv-ink);
    margin: 0 0 14px;
}

.sp-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14.5px;
    color: var(--jv-text);
    cursor: pointer;
}

.sp-filter-item input {
    accent-color: var(--jv-ink);
    width: 16px;
    height: 16px;
    flex: none;
}

.sp-filter-item span.sp-filter-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-filter-item .sp-filter-count {
    color: var(--jv-muted);
    font-size: 13px;
}

.sp-clear-filters {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13.5px;
    color: var(--jv-gold-dark);
    text-decoration: underline;
    cursor: pointer;
}

/* ----- Product grid ----- */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.sp-grid.sp-grid-list {
    grid-template-columns: 1fr;
}

/* The 767px 2-column rule for .sp-grid now lives in the shared
   assets/css/mobile-product-grid.css (also used by .ld-grid), so both
   product-card systems agree on that breakpoint from one place. */

.sp-card {
    background: var(--jv-paper);
    border: 1px solid var(--jv-line);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sp-card:hover {
    border-color: var(--jv-gold);
    box-shadow: 0 10px 30px rgba(14, 42, 34, 0.08);
}

.sp-grid-list .sp-card {
    flex-direction: row;
}

.sp-grid-list .sp-card-image {
    width: 220px;
    flex: none;
}

.sp-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--jv-cream);
    overflow: hidden;
}

.sp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.sp-card-image .sp-card-img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.sp-card:hover .sp-card-img-hover {
    opacity: 1;
}

.sp-sale-badge,
.sp-oos-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    color: var(--jv-paper);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.sp-sale-badge {
    background: var(--jv-sale);
}

.sp-oos-badge {
    background: var(--jv-ink);
}

.sp-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px 22px;
    flex: 1;
}

.sp-card-category {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jv-muted);
}

.sp-card-name {
    font-family: var(--jv-font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--jv-ink);
    margin: 0;
}

.sp-card-name a {
    color: inherit;
}

.sp-card-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.sp-card-swatch {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.sp-card-swatch-more {
    font-size: 12px;
    color: var(--jv-muted);
}

.sp-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 6px;
}

.sp-card-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--jv-gold-dark);
}

.sp-card-old-price {
    font-size: 14px;
    color: var(--jv-muted);
    text-decoration: line-through;
}

.sp-card-cta {
    margin-top: 12px;
    text-align: center;
    border: 1px solid var(--jv-ink);
    color: var(--jv-ink);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 11px 0;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    display: block;
}

.sp-card-cta:hover {
    background: var(--jv-ink);
    color: var(--jv-paper);
}

.sp-card-cta.sp-oos,
.sp-card-cta.sp-oos:hover {
    background: var(--jv-paper);
    border-color: var(--jv-line);
    color: var(--jv-muted);
    cursor: not-allowed;
}

/* ----- Empty state ----- */
.sp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 72px 24px;
    color: var(--jv-muted);
}

.sp-empty h3 {
    font-family: var(--jv-font-serif);
    font-size: 26px;
    color: var(--jv-ink);
    margin: 0 0 10px;
}

/* ----- Pagination ----- */
.sp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 40px 0 0;
    padding: 0;
}

.sp-pagination li a,
.sp-pagination li button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--jv-line);
    border-radius: 999px;
    background: var(--jv-paper);
    color: var(--jv-ink);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.sp-pagination li a:hover,
.sp-pagination li button:hover {
    border-color: var(--jv-gold);
}

.sp-pagination li a.active {
    background: var(--jv-ink);
    color: var(--jv-paper);
    border-color: var(--jv-ink);
}

.sp-pagination li span.sp-pagination-ellipsis {
    color: var(--jv-muted);
    padding: 0 4px;
}

/* Two-per-row mobile grid (<480px) rules live in the shared
   assets/css/mobile-product-grid.css (also used by index.php's Deals/
   Bouquets cards) — see that file, linked below in shop.php. */
