:root {
    --cream: #FAF6EE;
    --warm-white: #FDF9F3;
    --ink: #1A1208;
    --amber: #E8912A;
    --amber-light: #F5C97A;
    --amber-dark: #C47415;
    --sage: #5A7A5C;
    --rust: #C0442A;
    --sand: #D9C9A8;
    --card-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

h1,
h2,
h3,
.serif {
    font-family: 'Playfair Display', serif;
}

/* ── NAV ── */
nav {
    background: var(--ink);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--amber);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--amber-light);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo span {
    color: var(--amber);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: #C8BDA8;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--amber-light);
}

.cart-btn {
    background: var(--amber);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.cart-btn:hover {
    background: var(--amber-light);
}

/* Mobile nav */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--amber-light);
    cursor: pointer;
    padding: 0.25rem;
}

/* ── HERO BANNER ── */
.hero {
    background: var(--ink);
    padding: 3.5rem 1.25rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 120%, rgba(232, 145, 42, 0.18) 0%, transparent 70%);
}

.hero-tag {
    display: inline-block;
    background: var(--amber);
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1.1rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #FAF6EE;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.hero h1 em {
    color: var(--amber);
    font-style: italic;
}

.hero p {
    color: #A89B88;
    font-size: 1rem;
    max-width: 540px;
    margin: 0 auto;
}

/* ── MAIN LAYOUT ── */
.store-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ── SIDEBAR FILTERS ── */
.sidebar {
    background: var(--card-bg);
    border: 1.5px solid var(--sand);
    border-radius: 16px;
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink);
}

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

.filter-label {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: #9A8E7E;
    margin-bottom: 0.6rem;
}

.filter-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1.5px solid var(--sand);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--warm-white);
    color: var(--ink);
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--ink);
    font-weight: 700;
}

.price-range {
    margin-top: 0.5rem;
}

.price-range input[type=range] {
    width: 100%;
    accent-color: var(--amber);
    cursor: pointer;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #7A6E60;
    margin-top: 0.3rem;
}

.clear-btn {
    width: 100%;
    padding: 0.6rem;
    border: 1.5px solid var(--sand);
    border-radius: 8px;
    background: none;
    color: #9A8E7E;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: var(--rust);
    color: var(--rust);
}

/* ── PRODUCT GRID AREA ── */
/* .products-area {} */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.results-count {
    font-size: 0.85rem;
    color: #7A6E60;
}

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

.sort-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-wrap label {
    font-size: 0.8rem;
    color: #7A6E60;
}

.sort-wrap select {
    border: 1.5px solid var(--sand);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    background: white;
    color: var(--ink);
    cursor: pointer;
    outline: none;
    font-family: 'DM Sans', sans-serif;
}

.sort-wrap select:focus {
    border-color: var(--amber);
}

/* ── PRODUCT GRID ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.4rem;
}

/* ── PRODUCT CARD ── */
.product-card {
    background: var(--card-bg);
    border: 1.5px solid var(--sand);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(26, 18, 8, 0.13);
    border-color: var(--amber);
}

.card-thumb {
    position: relative;
    padding-top: 68%;
    overflow: hidden;
}

.card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.product-card:hover .card-thumb img {
    transform: scale(1.06);
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.badge-book {
    background: #2A3E5C;
    color: #A8C8F0;
}

.badge-course {
    background: var(--sage);
    color: #D6F0D6;
}

.badge-bestseller {
    background: var(--amber);
    color: var(--ink);
}

.card-body {
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-size: 0.68rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--amber-dark);
    margin-bottom: 0.3rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.card-author {
    font-size: 0.78rem;
    color: #7A6E60;
    margin-bottom: 0.7rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.card-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--amber-dark);
}

.card-price .old-price {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: #A89B88;
    text-decoration: line-through;
    font-weight: 400;
    display: block;
    margin-bottom: -2px;
}

.add-btn {
    background: var(--ink);
    color: var(--amber-light);
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.add-btn:hover {
    background: var(--amber);
    color: var(--ink);
}

.star-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.55rem;
}

.stars {
    color: var(--amber);
    font-size: 0.78rem;
    letter-spacing: -1px;
}

.star-count {
    font-size: 0.72rem;
    color: #9A8E7E;
}

/* ── EMPTY STATE ── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: #9A8E7E;
}

.empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.page-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid var(--sand);
    background: white;
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.page-btn:hover {
    border-color: var(--amber);
    color: var(--amber-dark);
}

.page-btn.active {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--ink);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-btn.nav-arrow {
    font-size: 1rem;
}

/* ── MOBILE FILTER DRAWER ── */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 18, 8, 0.5);
    z-index: 200;
}

.mobile-filter-drawer {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: var(--warm-white);
    padding: 1.5rem;
    overflow-y: auto;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.drawer-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--ink);
    line-height: 1;
}

.mobile-filter-overlay.open {
    display: block;
}

/* ── FOOTER ── */
footer {
    background: var(--ink);
    color: #7A6E60;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.82rem;
}

footer a {
    color: var(--amber);
    text-decoration: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .store-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 640px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-wrap {
        width: 100%;
    }

    .sort-wrap select {
        flex: 1;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.9rem;
    }
}

@media (max-width: 380px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ── SKELETON ── */
.skeleton {
    animation: shimmer 1.5s infinite;
    background: linear-gradient(90deg, #EDE8DE 25%, #F5F0E8 50%, #EDE8DE 75%);
    background-size: 200% 100%;
    border-radius: 8px;
}

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

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

/* ── MOBILE FILTER TOGGLE BTN ── */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--ink);
    color: var(--amber-light);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

@media (max-width: 900px) {
    .mobile-filter-toggle {
        display: flex;
    }
}

/* ── SEARCH BAR ── */
.search-bar-wrap {
    max-width: 480px;
    margin: 1.5rem auto 0;
    position: relative;
}

.search-bar-wrap input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #FAF6EE;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar-wrap input::placeholder {
    color: #6E6358;
}

.search-bar-wrap input:focus {
    border-color: var(--amber);
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6E6358;
    font-size: 1rem;
    pointer-events: none;
}

/* card enter animation */
.product-card {
    animation: cardIn 0.35s ease both;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
