/* ==========================================================================
   Storefront styles. Mobile first. No build step needed.
   Palette: night indigo, marigold, kumkum red, mist.
   ========================================================================== */
:root {
    --ink: #15123b;
    --ink-2: #241f5c;
    --gold: #ffb300;
    --gold-dark: #d99500;
    --red: #d3213a;
    --leaf: #0f8f6a;
    --mist: #f4f3fa;
    --line: #e2e0ef;
    --text: #1d1b2e;
    --muted: #625f7c;
    --white: #fff;
    --radius: 14px;
    --header-h: 64px;
    --font: "Anek Tamil", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--mist); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink-2); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#fireworks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--gold); color: var(--ink); font-weight: 800; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--gold-dark); }
.btn-sm { min-height: 40px; padding: 0 16px; }
.btn-block { display: flex; width: 100%; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-2); }
.btn[aria-disabled="true"], .btn:disabled { background: #d9d7e6; color: #7d7a93; cursor: not-allowed; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 10px 0 0; color: var(--muted); text-decoration: underline; cursor: pointer; width: 100%; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--mist); font-size: 28px; line-height: 1; cursor: pointer; }

/* Top bar and header */
.topbar { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; padding: 8px 16px; background: var(--ink); color: #d9d6f3; font-size: 14px; }
.topbar strong { color: var(--gold); }
.topbar a { color: var(--white); text-decoration: none; font-weight: 600; margin-left: 14px; }
.topbar a:first-child { margin-left: 0; }

.site-header { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding: 10px 16px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: 1 1 auto; min-width: 0; }
.brand img { width: 60px; height: 60px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 14px; background: var(--ink); color: var(--gold); font-weight: 800; font-size: 30px; flex: none; }
.brand-name { font-weight: 800; font-size: 24px; letter-spacing: -0.01em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.nav { order: 3; display: flex; justify-content: center; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--mist); }
.nav a.active { color: var(--ink); background: #fff3d1; }
.cart-btn { position: relative; width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--ink); color: var(--white); cursor: pointer; display: grid; place-items: center; flex: none; }
.cart-count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--red); color: var(--white); font-size: 13px; font-weight: 800; display: grid; place-items: center; }

@media (min-width: 760px) {
    .site-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 28px; }
    .brand { flex: 0 1 auto; grid-column: 1; }
    .nav { order: 0; width: auto; grid-column: 2; justify-content: center; }
    .cart-btn { grid-column: 3; justify-self: end; }
}

/* Hero slider */
.hero { position: relative; margin: 12px auto 0; max-width: 1240px; padding: 0 12px; }
.slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); background: var(--ink); }
.slider::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 16 / 9; overflow: hidden; color: var(--white); }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-1 { background: radial-gradient(circle at 80% 40%, #3a2d95 0, var(--ink) 65%); }
.slide-2 { background: linear-gradient(120deg, #241f5c 0, var(--ink) 70%); }
.slide-3 { background: linear-gradient(120deg, #4a1233 0, #15123b 75%); }
.slide-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 8%; }
.slide-1::before { content: ""; position: absolute; right: -8%; top: 50%; width: 70%; aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 179, 0, .35) 0 4deg, transparent 4deg 15deg);
    -webkit-mask: radial-gradient(circle, transparent 12%, #000 13%, #000 60%, transparent 71%); mask: radial-gradient(circle, transparent 12%, #000 13%, #000 60%, transparent 71%); }
.burst { position: relative; font-size: clamp(22px, 5vw, 44px); font-weight: 600; }
.burst span { font-size: clamp(64px, 17vw, 168px); line-height: .9; font-weight: 800; color: var(--gold); letter-spacing: -0.04em; }
.slide-title { font-size: clamp(28px, 6.2vw, 64px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.slide-line { position: relative; font-size: clamp(14px, 2.2vw, 22px); color: #d9d6f3; max-width: 30ch; }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .55); cursor: pointer; }
.dots button[aria-selected="true"] { width: 26px; border-radius: 6px; background: var(--gold); }
@media (min-width: 700px) { .slide { aspect-ratio: 16 / 6; } .hero { margin-top: 20px; padding: 0 20px; } }

/* Shop section */
.shop { max-width: 1240px; margin: 0 auto; padding: 16px 12px 0; }
.toolbar { position: sticky; top: var(--header-h-live, 108px); z-index: 20; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; background: var(--mist); }
.search input { width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.view-toggle { display: flex; padding: 3px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
.view-toggle button { border: 0; padding: 0 14px; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--ink); font-weight: 800; }
.chips { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--white); }
.offer-note { margin: 6px 0 4px; font-size: 14px; color: var(--muted); }

.cat { margin-top: 30px; }
.cat > h2 { padding: 0 0 10px; border-bottom: 2px solid var(--ink); color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: 0; }
.prods { display: grid; gap: 0; }

/* Product card (grid view): plain rows, one hairline divider, nothing else competing for attention */
.prod { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img name qty" "img unit qty" "img price qty"; gap: 2px 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); background: transparent; transition: background-color .15s; }
.prod:hover { background: var(--mist); }
.prod.in-cart, .prod.in-cart:hover { background: #fffaf0; }
.p-img { grid-area: img; grid-row: 1 / 4; width: 64px; height: 64px; border-radius: 10px; background: var(--mist); display: grid; place-items: center; overflow: hidden; color: var(--ink-2); font-weight: 800; font-size: 24px; }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-name { grid-area: name; font-size: 16px; font-weight: 700; line-height: 1.3; align-self: end; }
.p-name small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }
.p-unit { grid-area: unit; font-size: 13px; color: var(--muted); align-self: start; }
.p-price { grid-area: price; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 2px; }
.p-price strong { font-size: 18px; font-weight: 800; color: var(--ink); }
.p-price s { font-size: 13px; color: var(--muted); font-weight: 400; }
.off { color: var(--red); font-size: 12px; font-weight: 700; }
.p-line { display: none; }

.qty { grid-area: qty; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }
.qty button:active { background: var(--mist); }
.qty input { width: 40px; height: 38px; border: 0; text-align: center; font-weight: 700; background: transparent; -moz-appearance: textfield; }
.prod.in-cart .qty { border-color: var(--gold); }

.thead { display: none; }
.empty { padding: 30px 12px; text-align: center; color: var(--muted); }

@media (min-width: 640px) { .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } .prod { grid-template-areas: "img name name" "img unit unit" "img price qty"; grid-template-columns: 64px minmax(0, 1fr) auto; } }
@media (min-width: 1000px) { .prods { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Table view */
.view-table .prods { grid-template-columns: 1fr; gap: 0; padding: 0; background: var(--white); }
.view-table .prod { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name qty" "unit qty" "price qty" "line line"; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; }
.view-table .prod.in-cart { box-shadow: none; background: #fffaf0; }
.view-table .p-img { display: none; }
.view-table .p-line { display: block; font-size: 13px; color: var(--leaf); font-weight: 600; text-align: right; }
.view-table .p-line:empty { display: none; }
@media (min-width: 760px) {
    .view-table .thead { display: grid; grid-template-columns: 56px minmax(0, 1fr) 70px 190px 130px 90px; gap: 12px; margin-top: 14px; padding: 10px 12px; border-radius: 10px 10px 0 0; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 14px; }
    .view-table .cat { margin-top: 0; }
    .view-table .cat > h2 { border-radius: 0; border-bottom: 0; background: var(--ink-2); color: var(--white); padding: 10px 14px; }
    .view-table .prod { grid-template-columns: 56px minmax(0, 1fr) 70px 190px 130px 90px; grid-template-areas: "img name unit price qty line"; gap: 12px; }
    .view-table .p-img { display: grid; grid-row: auto; width: 56px; height: 56px; font-size: 20px; }
    .view-table .p-line { text-align: right; font-weight: 800; color: var(--ink); }
    .view-table .p-line:empty { display: block; }
}

/* Floating cart bar + WhatsApp */
.has-cartbar { padding-bottom: 84px; }
.cartbar { position: fixed; left: 12px; bottom: 12px; z-index: 40; width: min(520px, calc(100% - 92px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--white); box-shadow: 0 8px 24px rgba(21, 18, 59, .35); }
.cartbar p { font-weight: 600; font-size: 15px; line-height: 1.2; }
.cartbar strong { color: var(--gold); }
.wa-fab { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.wa-fab:hover { background: #1ebe5a; }

/* Cart drawer */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(21, 18, 59, .55); }
.drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--white); transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
.drawer.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--mist); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line h3 { font-size: 15px; font-weight: 800; line-height: 1.25; }
.cart-line .meta { font-size: 13px; color: var(--muted); }
.cart-line .line-total { grid-column: 2; grid-row: 1; font-weight: 800; text-align: right; }
.cart-line .qty { grid-column: 1 / -1; justify-self: start; }
.cart-line .qty button, .cart-line .qty input { height: 38px; }
.cart-line .remove { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; border: 0; background: none; color: var(--red); cursor: pointer; text-decoration: underline; }
.sub-row { display: flex; justify-content: space-between; font-size: 18px; margin: 8px 0 2px; }
.hint { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.progress-bar { height: 8px; border-radius: 4px; background: #d9d7e6; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.progress p { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.progress.ok .progress-bar span { background: var(--leaf); }
.progress.ok p { color: var(--leaf); }

/* Content pages */
.page { max-width: 760px; margin: 24px auto; padding: 24px 20px; background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); }
.page h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 16px; }
.page p { margin-bottom: 12px; max-width: 65ch; }
.safety-list { margin: 0; padding-left: 22px; max-width: 65ch; }
.safety-list li { margin-bottom: 10px; padding-left: 4px; }
.page-cta { margin-top: 20px; }
.page-cta .btn { text-decoration: none; }
@media (min-width: 760px) { .page { margin: 32px auto; padding: 36px; } }

/* Checkout + order */
.narrow { max-width: 1040px; margin: 20px auto; padding: 0 12px; }
.narrow > h1 { font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.02em; margin-bottom: 12px; }
.checkout-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
    .checkout-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
    .checkout-grid > form { grid-column: 1; grid-row: 1; }
    .checkout-grid > aside { grid-column: 2; grid-row: 1; position: sticky; top: 96px; }
}
.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.card + .card { margin-top: 16px; }
.card > h2 { font-size: 18px; margin-bottom: 12px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9c6de; border-radius: 10px; background: var(--white); }
.field textarea { min-height: 84px; resize: vertical; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.error-text { color: var(--red); font-size: 14px; font-weight: 600; margin-top: 4px; }
.row-2 { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.alert-error { background: #fde8ec; color: #8f1225; border: 1px solid #f5b5c0; }
.alert-ok { background: #e2f6ee; color: #075c43; border: 1px solid #a8e0cb; }
.alert-info { background: #fff3d1; color: #5c4200; border: 1px solid #f2d580; }

.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.sum-line small { display: block; color: var(--muted); }
.sum-total { display: flex; justify-content: space-between; margin-top: 10px; font-size: 20px; font-weight: 800; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-row .free { color: var(--leaf); font-weight: 800; }

.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 800; background: #fff3d1; color: #5c4200; }
.pill.s-verifying { background: #dfe9ff; color: #1b3a8a; }
.pill.s-confirmed, .pill.s-packed, .pill.s-delivered { background: #e2f6ee; color: #075c43; }
.pill.s-cancelled { background: #fde8ec; color: #8f1225; }

.pay-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .pay-grid { grid-template-columns: 1fr auto; align-items: start; } }
.bank-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.bank-list dt { color: var(--muted); }
.bank-list dd { margin: 0; font-weight: 800; word-break: break-word; }
.qr { width: 190px; height: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.copy { margin-left: 8px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--mist); font-size: 13px; cursor: pointer; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* Footer */
.site-footer { display: grid; gap: 16px; margin-top: 36px; padding: 24px 16px 28px; background: var(--ink); color: #d9d6f3; }
.site-footer a { display: block; color: var(--white); text-decoration: none; padding: 3px 0; }
.site-footer strong { color: var(--gold); font-size: 18px; }
@media (min-width: 760px) { .site-footer { grid-template-columns: 2fr 1fr 1fr; padding: 28px 28px 32px; } }
.site-credit { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 14px 16px; background: var(--ink-2); color: #b9b5dd; font-size: 13px; text-align: center; }
.site-credit p { margin: 0; }
.site-credit a { color: var(--gold); text-decoration: none; font-weight: 600; }
.site-credit a:hover { text-decoration: underline; }
@media (min-width: 760px) { .site-credit { flex-direction: row; justify-content: space-between; padding: 14px 28px; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .drawer, .progress-bar span { transition: none; }
}
@media print {
    .topbar, .site-header, .site-footer, .site-credit, .wa-fab, .cartbar, .no-print { display: none !important; }
    body { background: #fff; padding: 0; }
}
