/*
  Storefront design system.
  Principles:
  1. Editorial, not dashboard — whitespace and type carry hierarchy, not cards/shadows.
  2. Serif/sans contrast is the brand voice: serif tells the story, sans runs the transaction.
  3. The brass accent appears only for price and primary-action moments — never decorative.
  No web fonts (none permitted) — system serif and system sans stacks only.
*/

:root {
    --ink: #111111;
    --linen: #f4efe8;
    --brass: #b58b5a;
    --text: #1a1a1a;
    --muted: #777777;
    --white: #ffffff;
    --border: #e7e2dc;
    --danger: #b3261e;
    --success: #2e7d32;

    --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--sans); cursor: pointer; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 42px; line-height: 1.1; }
h2 { font-size: 30px; line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.3; }
p { line-height: 1.65; }

.eyebrow {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    transition: background-color .25s ease, box-shadow .25s ease, border-color .25s ease;
    border-bottom: 1px solid transparent;
}
.site-header.solid {
    background: var(--white);
    border-bottom-color: var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    max-width: var(--container);
    margin: 0 auto;
}
.header-inner .brand { font-family: var(--serif); font-size: 22px; letter-spacing: 0.01em; }
.site-header.on-hero:not(.solid) .brand,
.site-header.on-hero:not(.solid) .main-nav a,
.site-header.on-hero:not(.solid) .header-icons a { color: var(--white); }

.main-nav { display: flex; gap: 28px; font-size: 14px; }
.main-nav a { padding: 4px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover { border-bottom-color: currentColor; }

.header-icons { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.header-icons a { position: relative; }
.cart-count {
    position: absolute; top: -8px; right: -10px;
    background: var(--ink); color: var(--white);
    font-size: 10px; font-weight: 600; border-radius: 999px;
    min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
}
.site-header.on-hero:not(.solid) .cart-count { background: var(--white); color: var(--ink); }

.hamburger { display: none; background: none; border: none; font-size: 20px; }

/* ---------- Mobile nav drawer ---------- */
.mobile-drawer {
    position: fixed; inset: 0; z-index: 200; display: none;
}
.mobile-drawer.open { display: block; }
.mobile-drawer .backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.mobile-drawer .panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: 82%; max-width: 340px;
    background: var(--white); padding: 24px; overflow-y: auto;
}
.mobile-drawer .panel a { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.mobile-drawer .close-btn { background: none; border: none; font-size: 22px; float: right; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 86vh; min-height: 480px; overflow: hidden; background: var(--ink); }
.hero-slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
    display: flex; align-items: flex-end;
    background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; }
.hero-slide .scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 55%); }
.hero-slide .hero-content { position: relative; z-index: 2; color: var(--white); padding: 0 24px 72px; max-width: var(--container); margin: 0 auto; width: 100%; }
.hero-slide .eyebrow { color: rgba(255,255,255,.75); }
.hero-slide h1 { font-size: 54px; margin: 0 0 20px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; }
.btn {
    display: inline-block; padding: 13px 26px; font-size: 13.5px; letter-spacing: 0.02em;
    border: 1px solid currentColor; background: transparent; color: inherit;
}
.btn-solid { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-solid:hover { background: #000; }
.hero-content .btn:not(.btn-solid) { color: var(--white); }

.hero-nav { position: absolute; bottom: 28px; right: 24px; z-index: 3; display: flex; gap: 8px; }
.hero-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); border: none; padding: 0; cursor: pointer; }
.hero-dot.active { background: var(--white); }
.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    background: rgba(255,255,255,.15); color: var(--white); border: none;
    width: 40px; height: 40px; font-size: 16px; cursor: pointer;
}
.hero-arrow.prev { left: 16px; } .hero-arrow.next { right: 16px; }

@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-linen { background: var(--linen); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 36px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .subtitle { color: var(--muted); font-size: 14px; }
.view-all { font-size: 13px; border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; }

/* ---------- Category cards ---------- */
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.category-grid.secondary { grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
.category-card { position: relative; aspect-ratio: 4/5; overflow: hidden; display: flex; align-items: flex-end; }
.category-grid.secondary .category-card { aspect-ratio: 3/2; }
.category-card .swatch { position: absolute; inset: 0; }
.category-card .label { position: relative; z-index: 2; padding: 20px; color: var(--white); font-family: var(--serif); font-size: 22px; }
.category-grid.secondary .category-card .label { font-size: 16px; font-family: var(--sans); }
.category-card .scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.45), rgba(0,0,0,0) 60%); }

/* ---------- Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 20px; }
@media (max-width: 980px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; } }

.product-card { position: relative; }
.product-card .thumb { position: relative; aspect-ratio: 3/4; overflow: hidden; margin-bottom: 12px; }
.product-card .thumb .swatch { position: absolute; inset: 0; transition: opacity .3s ease; }
.product-card .thumb .swatch.secondary { opacity: 0; }
.product-card:hover .thumb .swatch.secondary { opacity: 1; }
.product-card .badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--white); font-size: 11px; padding: 4px 9px; z-index: 2; }
.product-card .wishlist-btn {
    position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.9);
    border: none; width: 30px; height: 30px; font-size: 14px;
}
.product-card .name { font-size: 14px; margin-bottom: 4px; }
.product-card .price { font-size: 13.5px; color: var(--muted); }
.product-card .price .sale { color: var(--brass); font-weight: 600; }
.product-card .price .was { text-decoration: line-through; margin-right: 6px; }
.product-card .quick-add {
    display: block; width: 100%; margin-top: 8px; padding: 9px; font-size: 12.5px;
    background: var(--ink); color: var(--white); border: none; opacity: 0; transition: opacity .2s ease;
}
.product-card:hover .quick-add { opacity: 1; }
@media (hover: none) { .product-card .quick-add { opacity: 1; } }

/* Placeholder "swatch" imagery — a calm, consistent stand-in where no photo has been
   uploaded yet, rather than a broken-image icon. Deterministic tone per product so the
   grid still reads as a coherent lookbook instead of flat grey boxes. */
.swatch {
    background: linear-gradient(145deg, var(--sw1, #d8cfc2) 0%, var(--sw2, #b9ab96) 100%);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); color: rgba(255,255,255,.75); font-size: 13px; text-align: center; padding: 16px;
}

/* ---------- Filters / shop layout ---------- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
@media (max-width: 860px) { .shop-layout { grid-template-columns: 1fr; } }
.filter-group { margin-bottom: 28px; }
.filter-group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.filter-option { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; }
.swatch-pill {
    display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); cursor: pointer;
}
.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; font-size: 13.5px; }
.sort-bar select { padding: 8px 10px; border: 1px solid var(--border); font-family: var(--sans); }
.mobile-filter-toggle { display: none; }

/* ---------- Product detail ---------- */
.pdp-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 860px) { .pdp-layout { grid-template-columns: 1fr; gap: 24px; } }
.pdp-gallery-main { aspect-ratio: 4/5; margin-bottom: 10px; }
.pdp-gallery-thumbs { display: flex; gap: 8px; }
.pdp-gallery-thumbs .swatch { width: 64px; height: 80px; cursor: pointer; }
.pdp-info h1 { margin: 0 0 6px; font-size: 30px; }
.pdp-sku { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.pdp-price { font-size: 22px; margin-bottom: 20px; }
.pdp-price .was { text-decoration: line-through; color: var(--muted); margin-right: 10px; font-size: 16px; }
.pdp-price .sale { color: var(--brass); }
.option-row { margin-bottom: 22px; }
.option-row h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 10px; }
.size-pill, .color-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 12px; margin: 0 8px 8px 0;
    border: 1px solid var(--border); font-size: 13px; cursor: pointer; background: var(--white);
}
.size-pill.selected, .color-pill.selected { border-color: var(--ink); background: var(--ink); color: var(--white); }
.size-pill.disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-control { display: flex; border: 1px solid var(--border); }
.qty-control button { width: 36px; height: 40px; border: none; background: none; font-size: 15px; }
.qty-control input { width: 44px; text-align: center; border: none; font-family: var(--sans); font-size: 14px; }
.pdp-actions { display: flex; gap: 10px; margin-bottom: 28px; }
.pdp-actions .btn { flex: 1; text-align: center; padding: 15px; }
.pdp-tabs { border-top: 1px solid var(--border); }
.pdp-tab { border-bottom: 1px solid var(--border); padding: 16px 0; }
.pdp-tab summary { cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.pdp-tab summary::-webkit-details-marker { display: none; }
.pdp-tab[open] summary::after { content: '−'; } .pdp-tab summary::after { content: '+'; color: var(--muted); }
.pdp-tab-body { padding-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.stock-note { font-size: 12.5px; margin-bottom: 16px; }
.stock-note.low { color: var(--brass); }
.stock-note.out { color: var(--danger); }

/* ---------- Cart / Checkout ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-row .swatch { aspect-ratio: 3/4; }
.cart-row .meta { font-size: 13.5px; color: var(--muted); }
.cart-row .remove { font-size: 12px; color: var(--danger); margin-top: 6px; display: inline-block; }
.summary-box { border: 1px solid var(--border); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 8px 0; }
.summary-row.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.coupon-row { display: flex; gap: 8px; margin: 16px 0; }
.coupon-row input { flex: 1; padding: 10px; border: 1px solid var(--border); font-family: var(--sans); }

.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-section { margin-bottom: 32px; }
.checkout-section h3 { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
    width: 100%; padding: 11px 12px; border: 1px solid var(--border); font-family: var(--sans); font-size: 14px;
}
.payment-option { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); margin-bottom: 8px; font-size: 13.5px; }
.payment-option.selected { border-color: var(--ink); }

/* ---------- Account ---------- */
.account-layout { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
@media (max-width: 760px) { .account-layout { grid-template-columns: 1fr; } }
.account-nav a { display: block; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.account-nav a.active { font-weight: 600; }
.order-row { border: 1px solid var(--border); padding: 18px; margin-bottom: 14px; }
.order-row-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; }
.status-pill { font-size: 11px; padding: 3px 9px; background: var(--linen); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfcdc6; padding: 64px 0 28px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 48px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h5 { color: var(--white); font-size: 13px; margin: 0 0 14px; font-weight: 600; }
.footer-grid a { display: block; font-size: 13px; padding: 5px 0; color: #a9a79f; }
.footer-brand { font-family: var(--serif); font-size: 22px; color: var(--white); margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; font-size: 12px; color: #8a887f; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.newsletter-form { display: flex; gap: 8px; max-width: 420px; }
.newsletter-form input { flex: 1; padding: 11px; border: 1px solid var(--border); font-family: var(--sans); }

/* ---------- Mobile bottom nav ---------- */
.mobile-bottom-nav { display: none; }
@media (max-width: 760px) {
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
        background: var(--white); border-top: 1px solid var(--border);
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-bottom-nav a { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); }
    .mobile-bottom-nav a .icon { display: block; font-size: 17px; margin-bottom: 2px; }
    body { padding-bottom: 56px; }
    .main-nav, .header-icons .desktop-only { display: none; }
    .hamburger { display: block; }
    .hero-slide h1 { font-size: 34px; }
    .section { padding: 56px 0; }
    .category-grid.secondary { grid-template-columns: 1fr 1fr; }
}

/* ---------- Buttons / misc ---------- */
.btn-full { display: block; width: 100%; text-align: center; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.alert { padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #fbeaea; color: var(--danger); border: 1px solid #f0c9c7; }
.alert-success { background: #eaf5ea; color: var(--success); border: 1px solid #c9e4c9; }
.empty-state { text-align: center; padding: 80px 24px; color: var(--muted); }

/* ---------- Quick View modal ---------- */
.qv-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.qv-backdrop.open { display: flex; }
.qv-modal {
    background: var(--white); max-width: 760px; width: 100%; max-height: 88vh; overflow-y: auto;
    display: grid; grid-template-columns: 1fr 1fr; position: relative;
}
@media (max-width: 680px) { .qv-modal { grid-template-columns: 1fr; } }
.qv-close {
    position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--white);
    border: none; width: 32px; height: 32px; font-size: 18px; cursor: pointer;
}
.qv-image { aspect-ratio: 4/5; }
.qv-body { padding: 28px; }
.qv-body h2 { margin: 0 0 6px; font-size: 22px; }
.qv-loading { padding: 60px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
