:root {
  --bg: #ffffff;
  --soft: #f4f3f8;
  --text: #13111c;
  --muted: #6e6b7b;
  --line: #e8e6ee;
  --card: #ffffff;
  --good: #059669;
  --grad: linear-gradient(120deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  --grad-soft: linear-gradient(90deg, #f5f0ff 0%, #fdeef6 50%, #fff4e5 100%);
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e15;
    --soft: #1b1924;
    --text: #f2f1f7;
    --muted: #a3a0b2;
    --line: #2b2836;
    --card: #15141c;
    --good: #34d399;
    --grad-soft: linear-gradient(90deg, #221a36 0%, #2d1a2a 50%, #2e2415 100%);
  }
}

/* Tight letter-spacing suits Latin headings but squeezes Bangla letters together. */
html:lang(bn) .hero-title, html:lang(bn) .brand-name, html:lang(bn) .reviews h2 { letter-spacing: 0; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Latin text uses Plus Jakarta Sans, Bangla falls through to Hind Siliguri. */
  font-family: "Plus Jakarta Sans", "Hind Siliguri", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; gap: 28px; height: 88px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #fff; font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 6px 18px -6px #ec489988;
}
.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }

.search {
  flex: 1; max-width: 560px; display: flex; align-items: center;
  background: var(--soft); border-radius: 999px; padding: 6px 6px 6px 22px; height: 56px;
  border: 2px solid transparent; transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: #ec489955; background: var(--bg); box-shadow: 0 0 0 5px #ec489918; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.search button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  transition: transform .15s;
}
.search button:hover { transform: scale(1.06); }

.lang {
  margin-left: auto; padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg); font-weight: 700;
}

/* ---------- Banner ---------- */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 0;
  padding: 16px 24px; border-radius: 999px; background: var(--grad-soft); font-weight: 500; text-align: center;
}
.live { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 #22c55e88; animation: live 1.8s infinite; flex-shrink: 0; }
@keyframes live { 70% { box-shadow: 0 0 0 9px #22c55e00; } 100% { box-shadow: 0 0 0 0 #22c55e00; } }

/* ---------- Pills (chips) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-weight: 500; font-size: .92rem;
  cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s;
}
.pill:hover { border-color: var(--muted); }
.pill .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pill .sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--shop); }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.off { opacity: .4; }
.pill.off .name { text-decoration: line-through; }
.pill.err { color: #dc2626; border-color: #fecaca; cursor: default; }
.pill.linkonly { border-style: dashed; color: var(--muted); }
.pill .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--shop); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.related { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-top: 18px; }
.related > span { color: var(--muted); font-size: .92rem; }
.related .pill { padding: 6px 14px; }

/* ---------- Home ---------- */
.home { padding: 56px 0 24px; }
.hero-title { margin: 0; font-size: clamp(2.1rem, 5.2vw, 4rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; max-width: 900px; }
.hero-title span { display: block; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 18px 0 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 44px 0 48px; }
.feature { border-radius: 22px; padding: 26px; }
.feature h3 { margin: 16px 0 6px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); }
.ficon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; }
.f1 { background: #f3edff; } .f1 .ficon { background: #7c3aed; }
.f2 { background: #fdeaf3; } .f2 .ficon { background: #ec4899; }
.f3 { background: #fff2df; } .f3 .ficon { background: #f59e0b; }
@media (prefers-color-scheme: dark) {
  .f1 { background: #221a36; } .f2 { background: #2d1a2a; } .f3 { background: #2e2415; }
}
.small-head { font-size: 1rem; color: var(--muted); font-weight: 600; margin: 0 0 14px; }

/* ---------- Results header ---------- */
.results { padding: 34px 0 10px; }
.rhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.rhead h1 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.desc { margin: 6px 0 0; color: var(--muted); }
.desc b { color: var(--text); }
.deal {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #fff;
  background: var(--grad); padding: 14px 22px; border-radius: 18px; min-width: 240px;
  box-shadow: 0 14px 30px -14px #ec4899aa; transition: transform .15s;
}
.deal:hover { transform: translateY(-2px); }
.deal .k { font-size: .82rem; opacity: .9; font-weight: 600; }
.deal .v { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.deal .s { font-size: .9rem; font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0 22px; }

.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sort select {
  appearance: none; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: 9px 38px 9px 14px; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6b7b' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.shops { margin: 16px 0 30px; }

/* ---------- Card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 30px; }

.card { display: block; text-decoration: none; min-width: 0; }
/* Product photos sit on white, so the tile stays a light pastel in both themes
   and "multiply" blends the white away into the shop colour. */
.thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--shop, #999) 14%, #ffffff);
}
.thumb img {
  width: 100%; height: 100%; object-fit: contain; padding: 22px; mix-blend-mode: multiply;
  transition: transform .3s;
}
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--shop); opacity: .35; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb .hover {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 16px; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 8, 20, .62)); opacity: 0; transition: opacity .2s;
}
.card:hover .thumb .hover, .card:focus-visible .thumb .hover { opacity: 1; }
.ribbon {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: .78rem; box-shadow: 0 6px 14px -6px #ec4899;
}
.variant {
  position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #13111c; font-weight: 600; font-size: .78rem;
}
.card.best .thumb { box-shadow: 0 0 0 3px #ec4899, 0 18px 34px -18px #ec4899; }
.card.muted .thumb img { opacity: .45; filter: grayscale(.8); }

.ctitle {
  margin: 12px 0 8px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.crow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--shop); color: #fff; font-size: .78rem; font-weight: 800;
}
.sname { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { padding: 1px 7px; border-radius: 5px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: var(--soft); color: var(--muted); }
.badge.official { background: #dcfce7; color: #15803d; }
.badge.unofficial { background: #fef3c7; color: #b45309; }
.badge.market { background: #ede9fe; color: #6d28d9; }
@media (prefers-color-scheme: dark) {
  .badge.official { background: #14532d; color: #86efac; }
  .badge.unofficial { background: #451a03; color: #fcd34d; }
  .badge.market { background: #2e1065; color: #c4b5fd; }
}
.cprice { margin-left: auto; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cprice .p { font-weight: 800; font-size: 1.05rem; }
.card.best .cprice .p { color: var(--good); }
.cprice .o { display: block; color: var(--muted); text-decoration: line-through; font-size: .78rem; line-height: 1; }
.cprice .st { font-size: .82rem; color: var(--muted); font-weight: 600; }
.seller { margin-top: 4px; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Loading placeholders */
.skel .thumb { background: linear-gradient(90deg, var(--soft) 25%, var(--line) 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel .bar { height: 12px; border-radius: 6px; background: var(--soft); margin-top: 12px; }
.skel .bar.short { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 1.05rem; }

/* ---------- Reviews ---------- */
.reviews { margin-top: 70px; }
.reviews h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 24px; letter-spacing: -.01em; }
.reviews h2::after { content: ""; display: block; width: 64px; height: 5px; border-radius: 3px; background: var(--grad); margin-top: 10px; }
.videos .thumb { aspect-ratio: 16 / 9; background: var(--soft); }
.videos .thumb img { object-fit: cover; padding: 0; mix-blend-mode: normal; }
.play {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #ec4899;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); transition: transform .2s;
}
.card:hover .play { transform: scale(1.1); }
.ago { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.more {
  display: inline-flex; margin-top: 30px; padding: 12px 22px; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box;
}

/* ---------- Footer ---------- */
.foot { margin-top: 80px; padding: 30px 0 40px; background: var(--soft); color: var(--muted); font-size: .9rem; }
.foot p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .top { flex-wrap: wrap; height: auto; padding-top: 14px; padding-bottom: 6px; gap: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; height: 52px; }
  .lang { padding: 9px 16px; }
  .banner { border-radius: 18px; font-size: .9rem; padding: 12px 16px; }
  .home { padding-top: 32px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .thumb img { padding: 12px; }
  .crow { flex-wrap: wrap; }
  .cprice { margin-left: 0; text-align: left; flex-basis: 100%; }
  .cprice .o { display: inline; margin-right: 6px; }
  .deal { width: 100%; }
  .videos { grid-template-columns: 1fr; }
}
