:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #15181d;
  --muted: #5f6672;
  --border: #e3e6eb;
  --accent: #e4461b;
  --accent-soft: #fdeee8;
  --good: #0f8a4a;
  --amazon: #ff9900;
  --amazon-text: #111;
  --flipkart: #2874f0;
  --flipkart-text: #fff;
  --meesho: #9f2089;
  --meesho-text: #fff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #eef0f3;
    --muted: #9aa2ae;
    --border: #2a2f38;
    --accent: #ff6a3d;
    --accent-soft: #2e1d17;
    --good: #3ccf83;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 900;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.tg { background: #229ed9; color: #fff; font-weight: 600; }

/* Hero */
.hero { padding: 32px 0 8px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; }
.hero p { margin: 0 0 18px; color: var(--muted); }
.search {
  width: 100%; max-width: 560px;
  padding: 13px 16px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Toolbar */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.chip .n { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active .n { color: rgba(255,255,255,.85); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.row select {
  font: inherit; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Grid + cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-2);
  display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12px; background: #fff; }
.thumb .icon { font-size: 4rem; }
.badge {
  position: absolute; top: 10px; padding: 4px 9px; border-radius: 8px;
  font-size: .8rem; font-weight: 800;
}
.badge.off { left: 10px; background: var(--good); color: #fff; }
.badge.hot { right: 10px; background: var(--accent); color: #fff; }
.body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cat { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.title { margin: 0; font-size: 1rem; line-height: 1.35; }
.rating { font-size: .85rem; color: var(--muted); }
.rating b { color: #f5a623; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price strong { font-size: 1.35rem; }
.price s { color: var(--muted); font-size: .9rem; }
.price .pct { color: var(--good); font-weight: 700; font-size: .9rem; }
.extras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.extras li { background: var(--accent-soft); padding: 5px 8px; border-radius: 8px; }
.expiry { font-size: .82rem; color: var(--muted); }
.expiry.soon { color: var(--accent); font-weight: 600; }
.buy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.btn {
  flex: 1 1 100px; text-align: center; text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: 10px 8px; border-radius: 10px; border: 0; cursor: pointer; font-family: inherit;
}
.btn.amazon { background: var(--amazon); color: var(--amazon-text); }
.btn.flipkart { background: var(--flipkart); color: var(--flipkart-text); }
.btn.meesho { background: var(--meesho); color: var(--meesho-text); }
.btn:hover { filter: brightness(1.06); }
.btn.copy { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border); flex: none; width: 100%; font-weight: 600; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.note { margin: 28px 0 8px; font-size: .85rem; color: var(--muted); text-align: center; }

/* Content pages */
.page { max-width: 760px; padding-top: 32px; padding-bottom: 32px; }
.page h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin-top: 0; }
.page h2 { font-size: 1.15rem; margin-top: 28px; }
.page p, .page li { color: var(--text); }
.box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin: 16px 0;
}

/* Footer */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--surface); font-size: .9rem; color: var(--muted); }
.foot-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 28px 16px; }
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: .95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.disclose { border-top: 1px solid var(--border); padding: 14px 16px 24px; font-size: .82rem; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* Store price comparison rows */
.price .from { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.stores { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 6px; }
.store {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-left: 5px solid var(--c);
  position: relative;
}
.store:hover { border-color: var(--c); }
.store.amazon { --c: var(--amazon); }
.store.flipkart { --c: var(--flipkart); }
.store.meesho { --c: var(--meesho); }
.store .sname { font-weight: 600; font-size: .92rem; }
.store .sprice { font-weight: 800; margin-left: auto; }
.store .tag { position: absolute; top: -9px; right: 10px; background: var(--good); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.store .go {
  background: var(--c); color: #fff; font-weight: 700; font-size: .82rem;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
}
.store.amazon .go { color: var(--amazon-text); }
.store .sname + .go { margin-left: auto; }
.store.best { background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: var(--good); border-left-color: var(--c); }

/* "Search on stores" box */
.store-search {
  margin: 18px 0 0; padding: 16px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.store-search p { margin: 0 0 12px; }
.ss-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ss-btns .btn { flex: 0 1 140px; }

/* Clickable cards */
a.thumb { text-decoration: none; color: inherit; }
.title a { color: inherit; text-decoration: none; }
.title a:hover { color: var(--accent); }
.dealtag { color: var(--accent); font-weight: 800; }
.details-link { font-size: .88rem; font-weight: 600; text-decoration: none; text-align: center; padding: 4px; }
.details-link:hover { text-decoration: underline; }

/* Item detail page */
.product-page { padding-top: 20px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.detail { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .detail { grid-template-columns: 1fr 1fr; align-items: start; } }
.gallery { display: flex; flex-direction: column; gap: 10px; }
.main-img {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.main-img img { width: 100%; height: 100%; object-fit: contain; padding: 20px; background: #fff; }
.main-img .icon { font-size: 8rem; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.tbtn { flex: none; width: 64px; height: 64px; padding: 4px; border-radius: 10px; border: 2px solid var(--border); background: #fff; cursor: pointer; }
.tbtn.active { border-color: var(--accent); }
.tbtn img { width: 100%; height: 100%; object-fit: contain; }
.info { display: flex; flex-direction: column; gap: 10px; }
.info h1 { margin: 0; font-size: clamp(1.3rem, 3.5vw, 1.8rem); line-height: 1.25; }
.info .price strong { font-size: 2rem; }
.info .stores { margin-top: 0; }
.info .store { padding: 13px 14px; }
.info .store .sname { font-size: 1rem; }
.info .store .sprice { font-size: 1.15rem; }
.h-compare { margin: 10px 0 0; font-size: 1.05rem; }
.fine { font-size: .8rem; color: var(--muted); margin: 0; }
.expired-note { background: var(--accent-soft); color: var(--accent); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.product-page .box h2, .product-page section > h2 { margin: 0 0 12px; font-size: 1.15rem; }
.product-page section { margin-top: 24px; }
.features { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
