:root {
  --bg: #fbf7ef;
  --surface: #ffffff;
  --ink: #2a2418;
  --muted: #6f6656;
  --line: #e8dfcc;
  --brand: #2f5d34;
  --brand-ink: #ffffff;
  --brand-soft: #e6efe2;
  --accent: #c8891b;
  --accent-soft: #fbf0d9;
  --danger: #b3412e;
  --wa: #1fa855;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 45, 10, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --surface: #221f17;
    --ink: #f1eadb;
    --muted: #b3a88f;
    --line: #3a3426;
    --brand: #7fb874;
    --brand-ink: #10200f;
    --brand-soft: #24331f;
    --accent: #e3a93f;
    --accent-soft: #3a2f18;
    --danger: #e0785f;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Noto Sans", "Noto Sans Telugu", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.te { font-family: "Noto Sans Telugu", sans-serif; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: var(--brand-ink);
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
}
.top .logo { font-weight: 800; font-size: 17px; line-height: 1.15; }
.top .logo small { display: block; font-weight: 500; font-size: 12px; opacity: .85; }
.top .spacer { flex: 1; }
.icon-btn {
  position: relative; background: rgba(255,255,255,.15); border: 0; color: inherit;
  border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600;
}
.badge {
  position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff;
  border-radius: 99px; font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; font-weight: 700;
}
.demo-bar { background: var(--accent-soft); color: var(--ink); font-size: 13px; padding: 6px 16px; text-align: center; }

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

/* Hero */
.hero { padding: 22px 0 8px; }
.hero h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; }
.hero p { margin: 0; color: var(--muted); }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.trust span { background: var(--brand-soft); border-radius: 99px; padding: 4px 10px; font-size: 13px; }

/* Category chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.search {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface);
}

.section-title { margin: 22px 0 10px; font-size: 18px; }
.section-title .te { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 6px; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
}
.thumb {
  aspect-ratio: 1 / 1; background: var(--accent-soft); display: grid; place-items: center;
  font-size: 54px; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet .thumb { aspect-ratio: 16 / 9; max-height: 200px; width: 100%; }
.tag {
  position: absolute; top: 8px; left: 8px; background: var(--brand); color: var(--brand-ink);
  font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600;
}
.tag.off { background: var(--danger); color: #fff; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.card .te { font-size: 13px; color: var(--muted); }
.price { font-weight: 700; }
.mrp { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; gap: 6px; }
.oos { color: var(--danger); font-size: 13px; font-weight: 600; }

.btn {
  border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 700;
  background: var(--brand); color: var(--brand-ink);
}
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Sheet / modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 16px 16px 24px;
}
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.close { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; flex: none; }

.variants { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.variant { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; cursor: pointer; text-align: left; }
.variant.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.variant b { display: block; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.qty button { border: 0; background: none; width: 34px; height: 34px; cursor: pointer; font-size: 18px; font-weight: 700; color: var(--brand); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }

details { background: var(--surface); border-radius: 12px; padding: 10px 14px; margin: 10px 0; border: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }
details ul { margin: 8px 0 0; padding-left: 20px; }
.compare { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.compare th, .compare td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }

/* Cart */
.cart-line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info b { display: block; }
.totals { margin: 12px 0; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.hint { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 8px 0; }
.warn { background: #fde7e2; color: #7a2716; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
@media (prefers-color-scheme: dark) { .warn { background: #3d1f18; color: #f3c2b5; } }

.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.field textarea { min-height: 70px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; }
.check input { margin-top: 4px; }

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.08);
}
.cart-bar .btn { width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; padding: 13px 16px; font-size: 16px; }

.success { text-align: center; }
.success .big { font-size: 46px; }
.qr { display: grid; place-items: center; margin: 12px auto; }
.qr img, .qr canvas { background: #fff; padding: 8px; border-radius: 10px; }

footer { margin: 40px 0 0; padding: 24px 16px 110px; background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
footer b { color: var(--ink); }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.social a { background: var(--brand-soft); color: var(--ink); text-decoration: none; padding: 7px 12px; border-radius: 99px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px;
}

/* Admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; position: sticky; top: 54px; background: var(--bg); z-index: 10; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.tab.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.list-item { background: var(--surface); border-radius: 12px; padding: 12px; margin: 8px 0; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; }
.list-item .info { flex: 1; min-width: 0; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #b9b2a3; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--wa); }
.switch input:checked + span::before { transform: translateX(22px); }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); }
.status.delivered { background: var(--brand-soft); }
.status.cancelled { background: #fde7e2; color: #7a2716; }
.variant-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 6px; margin: 6px 0; }
.variant-row input { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.login { max-width: 380px; margin: 60px auto; background: var(--surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
