/* =========================================================
   Sweta Creation — design tokens
   Palette: ivory base, deep wine + muted gold accents, charcoal ink
   Type: Fraunces (display serif) + Karla (body sans)
========================================================= */
:root {
    --ivory: #FAF6F0;
    --blush: #F3E6DE;
    --wine: #7B2D3E;
    --wine-dark: #5E2130;
    --gold: #B9873D;
    --ink: #2B2420;
    --ink-soft: #6B5F57;
    --line: #E7DCD2;
    --white: #FFFFFF;
    --success: #4A7C59;
    --radius: 3px;
    --max-width: 1200px;
    --header-h: 116px;
    padding-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
html, body { height: auto; }

body {
    margin: 0;
    background: var(--ivory);
    color: var(--ink);
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15.5px;
    line-height: 1.55;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 .4em;
    color: var(--ink);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

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

:focus-visible {
    outline: 2px solid var(--wine);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* -----------------------------------------------------------
   Header
----------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}

.topbar {
    background: var(--wine);
    color: var(--blush);
    font-size: 12.5px;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 7px;
    padding-bottom: 7px;
}
.topbar-phone { color: #fff; font-weight: 600; }

.nav-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.brand-name {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    letter-spacing: .01em;
    color: var(--wine);
}
.brand-logo { height: 38px; }
.brand { margin-right: auto; }

.main-nav {
    display: none;
}
.main-nav a {
    padding: 8px 4px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-soft);
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--wine); border-color: var(--gold); }

.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
    position: relative;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink);
    border-radius: 50%;
}
.icon-btn:hover { background: var(--blush); }
.cart-count {
    position: absolute; top: -2px; right: -2px;
    background: var(--wine); color: #fff;
    font-size: 10px; font-weight: 700;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.menu-toggle {
    width: 34px; height: 34px;
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 0;
}
.menu-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.mobile-nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(43,36,32,.45);
    z-index: 55;
}
.mobile-nav-overlay.open { display: block; }

/* Mobile nav drawer — deliberately a SIBLING of <header>, not nested inside
   it. Nesting position:fixed inside a position:sticky ancestor breaks the
   drawer's positioning on a number of mobile browsers. */
.mobile-nav-drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 80%; max-width: 320px;
    background: var(--ivory);
    z-index: 60;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform .28s ease;
    overflow-y: auto;
    box-shadow: 2px 0 24px rgba(0,0,0,.18);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-nav-drawer.open { transform: translateX(0); }
.mobile-nav-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.mobile-nav-close { background: none; border: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.mobile-nav-drawer a { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.mobile-nav-drawer a:active, .mobile-nav-drawer a:hover { background: var(--blush); }

@media (min-width: 900px) {
    .menu-toggle { display: none; }
    .mobile-nav-drawer, .mobile-nav-overlay { display: none !important; }
    .main-nav { display: flex; gap: 22px; align-items: center; }
}

/* -----------------------------------------------------------
   Buttons
----------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px;
    font-weight: 700; font-size: 14.5px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    text-align: center;
}
.btn-primary { background: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-dark); }
.btn-outline { background: transparent; color: var(--wine); border-color: var(--wine); }
.btn-outline:hover { background: var(--wine); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a07530; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* -----------------------------------------------------------
   Hero
----------------------------------------------------------- */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--blush) 0%, var(--ivory) 60%);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.hero-inner {
    padding: 46px 18px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    gap: 26px;
    align-items: center;
}
.hero-eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.hero h1 { font-size: 34px; max-width: 13ch; }
.hero p { color: var(--ink-soft); max-width: 40ch; margin: 14px 0 22px; font-size: 15.5px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media {
    aspect-ratio: 4/3;
    background: var(--blush) center/cover no-repeat;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    overflow: hidden;
}
@media (min-width: 860px) {
    .hero-inner { grid-template-columns: 1fr 1fr; padding: 74px 18px; }
    .hero h1 { font-size: 46px; }
}

/* -----------------------------------------------------------
   Section headings / layout helpers
----------------------------------------------------------- */
.section { padding: 44px 0; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { font-size: 24px; }
.section-head .view-all { font-weight: 700; font-size: 13.5px; color: var(--wine); white-space: nowrap; }
.section-sub { color: var(--ink-soft); margin-top: -14px; margin-bottom: 22px; max-width: 60ch; }

/* -----------------------------------------------------------
   Category chips / grid
----------------------------------------------------------- */
.cat-scroll {
    display: flex; gap: 12px; overflow-x: auto; padding: 2px 0 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-card {
    scroll-snap-align: start;
    flex: 0 0 auto; width: 148px;
    text-align: center;
}
.cat-card .cat-img {
    width: 100%; aspect-ratio: 1/1; border-radius: 50%;
    background: var(--blush) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold); font-family: 'Fraunces', serif; font-size: 26px;
    border: 1px solid var(--line);
    margin-bottom: 10px;
}
.cat-card span { font-weight: 700; font-size: 13.5px; }

/* -----------------------------------------------------------
   Product grid & card
----------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 14px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 980px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card { display: block; position: relative; }
.product-thumb {
    position: relative;
    aspect-ratio: 1/1.1;
    background: var(--blush) center/cover no-repeat;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 10px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-sale {
    position: absolute; top: 10px; left: 10px;
    background: var(--wine); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 4px 8px; border-radius: 2px;
}
.badge-oos {
    position: absolute; inset: 0; background: rgba(250,246,240,.72);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: var(--ink-soft);
}
.product-cat { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.product-name { font-size: 14.5px; font-weight: 600; margin: 3px 0 5px; line-height: 1.35; }
.product-price { font-weight: 700; color: var(--wine); font-size: 15px; }
.product-price .was { color: var(--ink-soft); font-weight: 500; text-decoration: line-through; margin-left: 6px; font-size: 13px; }

.quick-add {
    position: absolute; right: 8px; bottom: 8px;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--wine); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 8px rgba(43,36,32,.25);
}
.quick-add:hover { background: var(--wine-dark); }

/* -----------------------------------------------------------
   Filters bar (shop page)
----------------------------------------------------------- */
.filters-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 20px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.filters-bar select, .search-box input {
    border: 1px solid var(--line); background: var(--white);
    border-radius: var(--radius); padding: 10px 12px; font-size: 14px; color: var(--ink);
    font-family: inherit;
}
.search-box { flex: 1 1 220px; display: flex; }
.search-box input { width: 100%; }
.result-count { color: var(--ink-soft); font-size: 13.5px; margin-left: auto; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* -----------------------------------------------------------
   Product detail
----------------------------------------------------------- */
.pdp { display: grid; gap: 30px; padding: 26px 0 50px; }
@media (min-width: 860px) { .pdp { grid-template-columns: 1fr 1fr; gap: 50px; } }

.pdp-gallery-main {
    aspect-ratio: 1/1;
    background: var(--blush) center/cover no-repeat;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 10px;
}
.pdp-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs { display: flex; gap: 8px; }
.pdp-thumbs button {
    width: 60px; height: 60px; border-radius: 2px; overflow: hidden;
    border: 1px solid var(--line); background: var(--blush) center/cover no-repeat; padding: 0; cursor: pointer;
}
.pdp-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.breadcrumb { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--wine); }

.pdp-info h1 { font-size: 26px; margin-bottom: 8px; }
.pdp-price { font-size: 22px; font-weight: 700; color: var(--wine); margin: 10px 0; }
.pdp-price .was { color: var(--ink-soft); text-decoration: line-through; font-size: 16px; font-weight: 500; margin-left: 8px; }
.pdp-stock { font-size: 13px; margin-bottom: 16px; }
.pdp-stock.in { color: var(--success); }
.pdp-stock.low { color: var(--gold); }
.pdp-stock.out { color: var(--wine); }
.pdp-desc { color: var(--ink-soft); margin: 16px 0 22px; line-height: 1.7; }

.size-select { margin: 6px 0 20px; }
.size-select-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-pill {
    padding: 9px 16px; border: 1px solid var(--line); border-radius: 30px;
    background: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.size-pill:hover:not(.disabled) { border-color: var(--wine); }
.size-pill.selected { background: var(--wine); border-color: var(--wine); color: #fff; }
.size-pill.disabled { color: var(--ink-soft); background: var(--blush); text-decoration: line-through; cursor: not-allowed; }

.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.qty-control button { width: 38px; height: 40px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--wine); }
.qty-control input { width: 44px; text-align: center; border: none; font-size: 15px; font-weight: 600; background: none; }
.pdp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pdp-actions .btn { flex: 1 1 180px; }
.sku-line { font-size: 12.5px; color: var(--ink-soft); margin-top: 18px; }

/* -----------------------------------------------------------
   Cart / Checkout
----------------------------------------------------------- */
.cart-layout { display: grid; gap: 28px; padding: 26px 0 60px; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.cart-item {
    display: grid; grid-template-columns: 72px 1fr auto; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); background: var(--blush); }
.cart-item-name { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.cart-item-price { color: var(--wine); font-weight: 700; font-size: 14px; }
.cart-item-remove { color: var(--ink-soft); font-size: 12.5px; text-decoration: underline; margin-top: 6px; display: inline-block; cursor: pointer; background: none; border: none; padding: 0; }
.cart-item-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.summary-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; color: var(--ink-soft); }
.summary-row.total { font-size: 17px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }

.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
    width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 11px 13px; font-size: 14.5px; font-family: inherit; background: var(--white); color: var(--ink);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* -----------------------------------------------------------
   About / footer
----------------------------------------------------------- */
.about-section { background: var(--blush); }
.about-inner { display: grid; gap: 20px; padding: 46px 0; max-width: 760px; margin: 0 auto; text-align: center; }
.about-inner p { color: var(--ink-soft); font-size: 16px; line-height: 1.8; }

.site-footer { background: var(--ink); color: #E7DDD3; margin-top: 30px; padding-bottom: 70px; }
.footer-grid { display: grid; gap: 30px; padding: 46px 0 30px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } .site-footer { padding-bottom: 0; } }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col a, .footer-col span { display: block; color: #C9BDB2; font-size: 13.5px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-brand .brand-name { color: #fff; font-size: 20px; }
.footer-brand p { color: #C9BDB2; font-size: 13.5px; margin: 10px 0 14px; }
.footer-social { display: flex; gap: 14px; }
.footer-bottom { border-top: 1px solid #423A34; padding: 16px 0; font-size: 12px; color: #9C9187; }
@media (min-width: 720px) { .footer-bottom { margin-bottom: 0; } }

/* -----------------------------------------------------------
   Mobile bottom nav
----------------------------------------------------------- */
.mobile-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--white); border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; align-items: center;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10.5px; color: var(--ink-soft); font-weight: 600; position: relative; padding: 2px 8px;
}
.mobile-bottom-nav a.active { color: var(--wine); }
.bottom-cart-count {
    position: absolute; top: -2px; right: 2px;
    background: var(--wine); color: #fff; font-size: 9px; font-weight: 700;
    width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
@media (min-width: 900px) { .mobile-bottom-nav { display: none; } body { padding-bottom: 0; } }

/* -----------------------------------------------------------
   Toast
----------------------------------------------------------- */
.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
    background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 30px;
    font-size: 13.5px; font-weight: 600; z-index: 60; opacity: 0;
    transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 30px; } }

/* -----------------------------------------------------------
   Misc
----------------------------------------------------------- */
.page-head { padding: 30px 0 10px; }
.page-head h1 { font-size: 26px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.divider { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
