:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --text: #1B1F1D;
  --muted: #5B625E;
  --line: #DCDDD7;
  --placeholder: #ECEDE8;
  --accent: #1F5C3F;
  --accent-hover: #174832;
  --accent-soft: #E8EFEA;
  --error: #A3261B;
  --radius: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  --font-head: 'Bricolage Grotesque', 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 250, 247, 0.96);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--text); line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.brand-town { font-size: 14px; color: var(--accent); font-weight: 600; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-weight: 500;
  transition: border-color 150ms var(--ease);
}
.cart-btn:hover { border-color: var(--accent); }
.count {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  display: inline-grid; place-items: center;
}

/* Intro */
.intro { padding: 28px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.intro h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.intro p { color: var(--muted); }
.intro strong { color: var(--text); font-weight: 600; }
.section-title { font-size: 20px; margin-bottom: 14px; }

/* Product grid */
.grid {
  list-style: none; margin: 0 0 40px; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card-main {
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: none; border: 0; padding: 0; flex: 1;
}
.card-main:focus-visible { outline-offset: -2px; border-radius: var(--radius) var(--radius) 0 0; }
.thumb {
  display: grid; place-items: center; aspect-ratio: 4 / 3;
  background: var(--placeholder); color: var(--muted); font-weight: 500; font-size: 15px;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 4px; }
.card-name { font-weight: 600; font-size: 16px; }
.card-hindi { font-size: 14px; color: var(--muted); }
.card-price { font-size: 15px; margin-top: 4px; }
.per { color: var(--muted); font-size: 14px; }
.card-ctrl { padding: 8px 12px 12px; }
.card.is-out .thumb { opacity: 0.55; }
.out-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.out-note { font-size: 13px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent);
  font-weight: 600; text-decoration: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.btn:hover { background: var(--accent-soft); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-add { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; font-size: 14px;
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: none; border: 0; border-radius: 10px; color: var(--text);
}
.icon-btn:hover { background: var(--placeholder); }

/* Quantity stepper */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--accent); border-radius: 10px; min-height: 44px; overflow: hidden;
}
.stepper button {
  width: 44px; height: 44px; flex: none; border: 0; background: var(--accent-soft); color: var(--accent);
  font-size: 20px; font-weight: 600; line-height: 1;
}
.stepper button:hover:not([aria-disabled=true]) { background: #D7E4DB; }
.stepper button[aria-disabled=true] { color: var(--muted); background: var(--placeholder); cursor: not-allowed; }
.stepper button:focus-visible { outline-offset: -3px; }
.stepper output { flex: 1; text-align: center; font-weight: 600; font-size: 15px; white-space: nowrap; }
.fade { animation: fade-in 180ms var(--ease); }

/* Sticky cart bar (mobile) */
.cart-bar {
  position: sticky; bottom: 0; z-index: 9;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 250, 247, 0.97); border-top: 1px solid var(--line);
  animation: fade-in 200ms var(--ease);
}
.cart-bar-btn { width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 15px; }
.footer-grid { display: grid; gap: 20px; }
.footer-grid p + p { margin-top: 6px; }
.footer-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; }

/* Sheets (dialogs) */
dialog.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--bg); color: var(--text);
  box-shadow: 0 -4px 24px rgba(27, 31, 29, 0.12);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up 220ms var(--ease); }
dialog.sheet::backdrop { background: rgba(27, 31, 29, 0.45); }
dialog.sheet[open]::backdrop { animation: fade-in 200ms var(--ease); }
.sheet-head {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line);
}
.sheet-head .icon-btn:first-child { margin-left: -8px; }
.sheet-title { font-size: 19px; flex: 1; }
.sheet-body { overflow-y: auto; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.view { animation: fade-in 200ms var(--ease); }
.sheet-foot { position: sticky; bottom: -16px; background: var(--bg); padding: 12px 0 4px; margin-top: 8px; }

/* Product detail */
.pd-thumb { border-radius: var(--radius); margin-bottom: 14px; aspect-ratio: 4 / 3; }
.pd-hindi { color: var(--muted); }
.pd-price { font-size: 18px; font-weight: 600; margin: 6px 0 10px; }
.pd-desc { margin-bottom: 16px; }
.pd-limits { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* Cart */
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-name { font-weight: 600; }
.line-sub { font-size: 14px; color: var(--muted); }
.line-total { font-weight: 600; text-align: right; }
.line-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.line-ctrl .stepper { width: 168px; }
.summary { margin: 16px 0 4px; display: grid; gap: 6px; }
.summary-row { display: flex; justify-content: space-between; }
.summary-total { font-weight: 700; font-size: 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.free { color: var(--accent); font-weight: 600; }
.warn {
  margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--text);
  border-radius: 8px; background: var(--surface); font-size: 15px;
}
.empty { text-align: center; padding: 24px 0; }
.empty p { margin-bottom: 16px; color: var(--muted); }

/* Form */
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface); border: 1px solid #B9BBB4; border-radius: 10px;
  font-size: 16px; transition: border-color 150ms var(--ease);
}
textarea { resize: vertical; min-height: 88px; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); border-radius: 10px; }
[aria-invalid=true] { border-color: var(--error) !important; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span {
  display: grid; place-items: center; padding: 0 12px;
  border: 1px solid #B9BBB4; border-right: 0; border-radius: 10px 0 0 10px; background: var(--placeholder);
}
.prefix-input input { border-radius: 0 10px 10px 0 !important; }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.err { font-size: 14px; color: var(--error); margin-top: 4px; font-weight: 500; }
.err:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check label { font-weight: 500; padding-top: 10px; }
.check input, .radio input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check input { margin-top: 11px; }
.radios { display: grid; gap: 8px; }
.radio {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 500;
}
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#turnstile:not(:empty) { margin-bottom: 16px; }
.alert {
  margin: 0 0 12px; padding: 14px; border-radius: 10px; scroll-margin-bottom: 104px;
  border: 1px solid var(--error); background: #FBF1EF;
}
.alert p + p, .alert p + .btn { margin-top: 10px; }

/* Success */
.ok-id { font-family: var(--font-head); font-size: 30px; font-weight: 700; margin: 4px 0 12px; }
.ok-label { font-size: 14px; color: var(--muted); }
.ok-promise { padding: 14px; background: var(--accent-soft); border-radius: 10px; margin-bottom: 16px; }
.ok-hint { margin-top: 14px; }
.ok-actions { display: grid; gap: 10px; margin-top: 20px; }

@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .intro h1 { font-size: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cart-bar { display: none !important; }
  dialog.sheet { margin: auto; border-radius: 16px; max-height: 86vh; }
  dialog.sheet[open] { animation: sheet-in 200ms var(--ease); }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } }
}

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