:root {
    --gold: #ffc348;
    --gold2: #dc7900;
    --ink: #080808;
    --navy: #18213b;
    --line: #ece7df;
    --cream: #fffaf2;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: #fffdf9;
    color: #111;
    font-family: Georgia, "Times New Roman", serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================
   HEADER
========================================= */

.header {
    background: #050505;
    color: #fff;
}

.top {
    min-height: 95px;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 8px 3%;
}

.logo {
    flex: 0 0 295px;
}

.logo img {
    width: 280px;
    max-width: 100%;
    display: block;
}

.search {
    display: flex;
    height: 43px;
    flex: 1;
    max-width: 390px;
}

.search input {
    min-width: 0;
    width: 100%;
    border: 0;
    border-radius: 9px 0 0 9px;
    padding: 0 17px;
    font-size: 12px;
    outline: 0;
}

.search button {
    width: 46px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(120deg, #f6ad2e, #ffcc60);
    font: 26px Arial, sans-serif;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.header-actions a {
    display: block;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}

.header-actions a:hover {
    color: var(--gold);
}

.head-icon {
    display: block;
    font: 29px/30px Arial, sans-serif;
}

.count {
    display: inline-flex;
    background: #ffb92f;
    color: #111;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    font: bold 11px Arial, sans-serif;
    vertical-align: top;
    margin-left: -6px;
}

/* =========================================
   RESPONSIVE STICKY NAVIGATION
   Desktop: horizontal
   Mobile: left-to-right sidebar
========================================= */

.nav {
    position: sticky;
    top: 0;
    z-index: 9999;
    min-height: 48px;
    background: #080808;
    color: #fff;
    border-top: 1px solid #29231a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .15);
}

.nav-inner {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 5px;
    width: 100%;
    padding: 0 2%;
}

.nav-menu>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 48px;
    padding: 14px 8px;
    border-bottom: 2px solid transparent;
    color: #f8f4ed;
    font: 12px Arial, sans-serif;
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s ease, background .2s ease,
        border-color .2s ease;
}

.nav-menu>a:hover {
    color: var(--gold);
    background: rgba(255, 192, 71, .05);
}

.nav-menu>a.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.hot {
    display: inline-block;
    padding: 3px 5px;
    border-radius: 3px;
    background: #e11d25;
    color: #fff;
    font-size: 9px;
    line-height: 1.2;
}

/* Hamburger button */

.nav-toggle {
    display: none;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 42px;
    margin: 3px 12px;
    padding: 8px;
    border: 1px solid #41351f;
    border-radius: 7px;
    background: #111;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
    transition: transform .25s ease, opacity .25s ease;
}

.nav-toggle.active span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

/* Sidebar-only elements stay hidden on desktop */

.drawer-brand,
.drawer-close {
    display: none;
}

.nav-overlay {
    display: none;
}

.nav-toggle:focus-visible,
.drawer-close:focus-visible,
.nav-menu>a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -3px;
}

/* =========================================
   BREADCRUMB
========================================= */

.breadcrumb {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 2.5%;
    font-size: 12px;
    color: #565656;
    background: #fffdf9;
}

.breadcrumb span {
    color: #a0a0a0;
}

/* =========================================
   CATEGORY HERO
========================================= */

.category-hero {
    height: 350px;
    background: #f4d9b3 url("/frontassets/necklace-hero.png") center / cover no-repeat;
    display: flex;
    align-items: center;
    padding: 18px 3.5%;
    position: relative;
    overflow: hidden;
}

.category-hero:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(255, 245, 226, .88),
            rgba(255, 244, 223, .65) 43%,
            transparent 75%);
}

.hero-copy {
    position: relative;
    max-width: 480px;
}

.hero-copy h1 {
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1;
    margin: 0 0 4px;
}

.hero-copy h2 {
    font-size: 22px;
    font-weight: normal;
    margin: 0 0 6px;
}

.hero-copy p {
    font-size: 16px;
    line-height: 1.28;
    margin: 0;
    max-width: 460px;
}

/* =========================================
   SUBCATEGORY GRID
========================================= */

.subcategories {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    padding: 13px 2.5% 17px;
    background: #fffdf9;
    border-bottom: 1px solid #f3eee5;
}

.subcat {
    text-align: center;
    min-width: 0;
}

.subcat img {
    width: 92px;
    max-width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 5px;
    background: #fff0d9;
    border: 2px solid transparent;
}

.subcat.active img {
    border-color: #ffa800;
}

.subcat span {
    display: block;
    font-size: 13px;
    line-height: 1.22;
    min-height: 31px;
}

/* =========================================
   CONTENT AND FILTERS
========================================= */

.content {
    display: grid;
    grid-template-columns: 213px minmax(0, 1fr);
    gap: 20px;
    padding: 5px 2.2% 18px;
    background: linear-gradient(110deg, #fffaf2, #fffdf9);
}

.filters {
    background: #fff;
    border: 1px solid #f3eee6;
    border-radius: 7px;
    overflow: hidden;
    align-self: start;
}

.filter-group {
    padding: 12px 14px;
    border-bottom: 1px solid #eee9e1;
}

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

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
}

.chevron {
    font: 20px Arial, sans-serif;
    color: #17213a;
}

.filter-list {
    display: grid;
    gap: 3px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 5px;
    color: #3c3c3c;
    cursor: pointer;
}

.filter-option.active {
    background: #ffda87;
    color: #171717;
}

.filter-option input {
    accent-color: #f5a800;
    margin: 0;
    width: 16px;
    height: 16px;
}

.range-line {
    height: 4px;
    background: #ffc44a;
    margin: 15px 5px 12px;
    position: relative;
    border-radius: 4px;
}

.range-line:before,
.range-line:after {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #f7a800;
    top: -5px;
}

.range-line:before {
    left: -1px;
}

.range-line:after {
    right: -1px;
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

/* =========================================
   PRODUCT LISTING HEADER
========================================= */

.listing {
    min-width: 0;
}

.listing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 4px 16px;
}

.listing-title {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.listing-title h2 {
    font-size: 24px;
    margin: 0;
    white-space: nowrap;
}

.listing-title span {
    font-size: 12px;
    white-space: nowrap;
}

.listing-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    white-space: nowrap;
}

.listing-tools select {
    border: 1px solid #e2e2e2;
    border-radius: 5px;
    padding: 7px 9px;
    background: #fff;
    max-width: 125px;
}

.view-toggle {
    font: 22px Arial, sans-serif;
    border: 0;
    background: transparent;
    color: #777;
    padding: 0 2px;
}

.view-toggle.active {
    color: #111;
}

/* =========================================
   PRODUCTS
========================================= */

.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.product {
    min-width: 0;
    background: #fff;
    border: 1px solid #f4eee6;
    border-radius: 7px;
    padding: 7px;
    position: relative;
    text-align: center;
    transition: box-shadow .2s ease, transform .2s ease;
}

.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .07);
}

.product-image {
    display: block;
    position: relative;
}

.product img {
    width: 100%;
    aspect-ratio: 1 / .91;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.heart {
    position: absolute;
    right: 7px;
    top: 7px;
    background: rgba(0, 0, 0, .16);
    border: 0;
    color: white;
    font: 23px Arial, sans-serif;
    text-shadow: 0 1px 3px #333;
    padding: 0 2px;
}

.badge {
    position: absolute;
    left: 5px;
    top: 6px;
    background: #e52227;
    color: white;
    border-radius: 10px;
    padding: 3px 5px;
    font: bold 10px Arial, sans-serif;
}

.badge.gold {
    background: #ffd76e;
    color: #111;
}

.product h3 {
    font-size: 13px;
    font-weight: normal;
    line-height: 1.2;
    margin: 6px 2px 4px;
    min-height: 31px;
}

.rating {
    color: #f4a000;
    font: 15px Arial, sans-serif;
    letter-spacing: 0;
}

.rating small {
    color: #555;
    font: 11px Georgia, serif;
}

.price {
    font-size: 15px;
    font-weight: bold;
    margin: 3px 0 8px;
}

.old-price {
    font-size: 11px;
    color: #888;
    text-decoration: line-through;
    font-weight: normal;
    margin-left: 5px;
}

.add-btn {
    width: 100%;
    border: 0;
    border-radius: 5px;
    background: linear-gradient(110deg, #ffc34a, #ffd577);
    font-size: 13px;
    font-weight: bold;
    padding: 9px 4px;
    color: #111;
}

/* =========================================
   PAGINATION
========================================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 0 4px;
}

.pagination button {
    width: 33px;
    height: 33px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 5px;
}

.pagination button.active {
    background: #bf7900;
    color: #fff;
    border-color: #bf7900;
}

/* =========================================
   TOAST
========================================= */

.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: #151515;
    color: white;
    border-radius: 7px;
    padding: 12px 18px;
    display: none;
    z-index: 10002;
    max-width: calc(100vw - 32px);
    box-shadow: 0 5px 20px #0003;
    text-align: center;
    font: 13px/1.5 Arial, sans-serif;
}

.toast.show {
    display: block;
}

/* =========================================
   RESPONSIVE FOOTER
========================================= */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 24px 4%;
    background: #080808;
    color: #eee;
    font-size: 13px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-links a {
    color: #eee;
    transition: color .2s ease;
}

.footer-links a:hover {
    color: var(--gold);
}

/* =========================================
   TABLET AND MOBILE SIDEBAR
========================================= */

@media (max-width: 900px) {

    .top {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    .logo {
        flex: 1 1 220px;
    }

    .logo img {
        width: 220px;
    }

    .search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .header-actions {
        gap: 13px;
    }

    .nav {
        min-height: 50px;
    }

    .nav-inner {
        justify-content: flex-start;
    }

    .nav-toggle {
        display: flex;
    }

    /* Full-page dark overlay */

    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        /* display: none; */
        background: rgba(0, 0, 0, .58);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .3s ease, visibility .3s ease;
    }

    .nav-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Left-to-right drawer */

    .nav-menu {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10001;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        width: min(86vw, 340px);
        height: 100vh;
        height: 100dvh;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #080808;
        box-shadow: 12px 0 35px rgba(0, 0, 0, .25);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .3s ease, visibility .3s ease;
    }

    .nav-menu.open {
        transform: translateX(0);
        visibility: visible;
    }

    /* Logo and close button */

    .drawer-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 86px;
        padding: 16px 18px;
        background: linear-gradient(135deg, #17130b, #050505);
        border-bottom: 1px solid #342817;
    }

    .drawer-brand>a {
        display: block;
        flex: 1;
        min-width: 0;
    }

    .drawer-brand img {
        display: block;
        width: 190px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .drawer-close {
        display: inline-flex;
        flex: 0 0 36px;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid #514127;
        border-radius: 50%;
        background: #15120d;
        color: var(--gold);
        font: 25px/1 Arial, sans-serif;
        cursor: pointer;
        transition: background .2s ease, transform .2s ease;
    }

    .drawer-close:hover {
        transform: rotate(90deg);
        background: #2b2111;
    }

    /* Sidebar links */

    .nav-menu>a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 51px;
        padding: 15px 21px;
        border-bottom: 1px solid #222;
        border-left: 3px solid transparent;
        color: #f5f1e9;
        font-size: 14px;
    }

    .nav-menu>a:hover,
    .nav-menu>a.active {
        background: #17130c;
        color: var(--gold);
        border-left-color: var(--gold);
        border-bottom-color: #332818;
    }

    .nav-menu .hot {
        margin-left: 8px;
    }

    body.nav-drawer-open {
        overflow: hidden;
    }

    /* Category page responsive layout */

    .category-hero {
        height: 160px;
    }

    .subcategories {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 15px;
    }

    .subcat img {
        width: 82px;
    }

    .content {
        grid-template-columns: 175px minmax(0, 1fr);
        gap: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .listing-head {
        flex-wrap: wrap;
    }

    .listing-title h2 {
        font-size: 21px;
    }
}

/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 580px) {

    .logo img {
        width: 190px;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions a {
        font-size: 10px;
    }

    .head-icon {
        font-size: 24px;
    }

    .breadcrumb {
        font-size: 11px;
    }

    .category-hero {
        height: 185px;
        background-position: 62% center;
        padding: 16px;
    }

    .category-hero:before {
        background: linear-gradient(90deg,
                rgba(255, 245, 226, .93),
                rgba(255, 244, 223, .7) 70%,
                rgba(255, 244, 223, .2));
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .hero-copy h2 {
        font-size: 18px;
    }

    .hero-copy p {
        font-size: 13px;
        max-width: 300px;
    }

    .subcategories {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 12px 8px;
    }

    .subcat img {
        width: 68px;
    }

    .subcat span {
        font-size: 11px;
    }

    .content {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    .filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-group {
        padding: 10px;
    }

    .filter-group:nth-child(n+3) {
        display: none;
    }

    .filter-head {
        font-size: 13px;
    }

    .filter-list {
        max-height: 145px;
        overflow: auto;
    }

    .filter-option {
        font-size: 11px;
        padding: 3px;
    }

    .listing-head {
        margin: 8px 0 12px;
    }

    .listing-title h2 {
        font-size: 20px;
    }

    .listing-title span {
        font-size: 11px;
    }

    .listing-tools {
        gap: 6px;
    }

    .listing-tools select {
        max-width: 105px;
        padding: 6px;
    }

    .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .product {
        padding: 5px;
    }

    .product h3 {
        font-size: 12px;
        min-height: 29px;
    }

    .price {
        font-size: 14px;
    }

    .add-btn {
        font-size: 12px;
    }

    .pagination {
        gap: 5px;
    }

    .pagination button {
        width: 30px;
        height: 30px;
    }

    /* Match the main JEWELVY footer on phones */

    .footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 22px 16px;
    }

    .footer-links {
        gap: 12px 16px;
    }
}

/* =========================================
   ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .nav-menu,
    .nav-overlay,
    .nav-toggle span,
    .footer-links a {
        transition: none !important;
    }
}