/* ---------- tokens ---------- */
:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #15211d;
  --muted: #5d6b66;
  --border: #dfe6e3;
  --brand: #0b7a55;
  --brand-ink: #ffffff;
  --brand-soft: #e2f3ec;
  --accent: #e2553f;
  --accent-soft: #fde9e5;
  --warn: #b7791f;
  --fish: linear-gradient(135deg, #d8eefc, #bfe3f7);
  --meat: linear-gradient(135deg, #fde4dc, #f9cfc2);
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 6px 20px rgba(16, 24, 20, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #17201d;
    --surface-2: #1e2a26;
    --text: #e7efec;
    --muted: #9aaba5;
    --border: #2a3833;
    --brand: #2fbf8a;
    --brand-ink: #062118;
    --brand-soft: #173a2e;
    --accent: #ff7a63;
    --accent-soft: #3a1f1a;
    --warn: #f0b350;
    --fish: linear-gradient(135deg, #16324a, #1c3e57);
    --meat: linear-gradient(135deg, #43231d, #522a22);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Hind Siliguri", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.bn { font-family: "Noto Sans Bengali", "Hind Siliguri", "SolaimanLipi", system-ui, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hint { font-size: 13px; color: var(--muted); margin: .4em 0 0; }
.error { color: var(--accent); font-size: 14px; min-height: 1em; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 17px; }
.center { text-align: center; }
.big-emoji { font-size: 52px; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .05s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 6px; font-weight: 600; }
.link-btn.danger { color: var(--accent); font-weight: 500; font-size: 13px; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 400;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-mark { font-size: 28px; background: var(--brand-soft); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; }
.search { flex: 1; margin: 0; }
.search input { margin: 0; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.cart-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px;
  padding: 9px 14px; font-weight: 700; cursor: pointer;
}
.badge { background: var(--brand-ink); color: var(--brand); border-radius: 999px; min-width: 22px; padding: 0 6px; font-size: 13px; text-align: center; }
.badge.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------- hero ---------- */
.hero { background: linear-gradient(120deg, var(--brand-soft), var(--surface-2)); border-bottom: 1px solid var(--border); }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding-top: 36px; padding-bottom: 36px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--brand); margin: 0 0 8px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); }
.hero-sub { font-size: 18px; color: var(--muted); margin: 0 0 16px; }
.perks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.perks li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.hero-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; justify-self: end; }
.hero-art span { font-size: 54px; width: 100px; height: 100px; display: grid; place-items: center; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); }
.hero-art span:nth-child(odd) { transform: translateY(14px); }

/* ---------- catalogue ---------- */
.catalogue { padding-top: 24px; padding-bottom: 48px; }
.tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs select { width: auto; margin: 0 0 0 auto; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card.is-out { opacity: .65; }
.card-media { position: relative; height: 150px; display: grid; place-items: center; }
.card-media.fish { background: var(--fish); }
.card-media.meat { background: var(--meat); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .emoji { font-size: 72px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.tag { position: absolute; top: 10px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.tag.sale { left: 10px; background: var(--accent); color: #fff; }
.tag.hot { right: 10px; background: var(--surface); color: var(--text); }
.card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 16px; margin: 0; }
.card-body .bn { margin: 0 0 6px; font-size: 14px; }
.desc { font-size: 13px; color: var(--muted); margin: 0 0 10px; flex: 1; }
.price { margin: 0 0 10px; display: flex; align-items: baseline; gap: 6px; }
.price strong { font-size: 20px; }
.price s { font-size: 13px; }
.cut { margin-bottom: 10px; }
.cut select { padding: 7px 10px; font-size: 14px; }
.buy { display: flex; gap: 8px; }
.buy .btn { flex: 1; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 34px; height: 38px; cursor: pointer; font-size: 18px; }
.stepper output { min-width: 42px; text-align: center; font-weight: 700; padding: 0 4px; }
.stepper.small button { height: 28px; width: 28px; font-size: 15px; }
.stepper.small { display: inline-flex; margin-top: 6px; }
.stepper.small output { font-size: 13px; min-width: 56px; }
.low { color: var(--warn); font-weight: 600; }
.stock-out { color: var(--accent); font-weight: 700; margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 40;
  background: var(--surface); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { padding: 16px; border-top: 1px solid var(--border); }
.drawer-foot .btn { margin-top: 10px; }
.empty-cart { text-align: center; color: var(--muted); padding: 60px 0; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-emoji { font-size: 28px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--surface-2); border-radius: 10px; flex-shrink: 0; }
.cart-info { flex: 1; min-width: 0; }
.cart-info strong, .cart-info small { display: block; }
.cart-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }

/* ---------- modals ---------- */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(880px, calc(100% - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal.small { width: min(460px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; }
.modal-body h3 { font-size: 15px; margin-top: 4px; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.summary { background: var(--surface-2); border-radius: var(--radius); padding: 16px; align-self: start; position: sticky; top: 70px; }
.summary .row { font-size: 14px; }
.summary .btn { margin-top: 8px; }
.pay-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pay-option { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; margin: 0; color: var(--text); }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-option.bkash span::before { content: "●"; color: #e2136e; margin-right: 4px; }
.pay-option.nagad span::before { content: "●"; color: #f6921e; margin-right: 4px; }
.pay-option.cod span::before { content: "●"; color: var(--brand); margin-right: 4px; }
.mfs-box { background: var(--accent-soft); border-radius: 10px; padding: 12px; font-size: 14px; }
.mfs-box p { margin: 0 0 10px; }
.mfs-box label { margin: 0; }

/* ---------- tracking ---------- */
.track-card { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font-size: 14px; }
.timeline { list-style: none; padding: 0; margin: 12px 0; display: flex; justify-content: space-between; position: relative; }
.timeline li { flex: 1; text-align: center; font-size: 11px; color: var(--muted); position: relative; padding-top: 22px; }
.timeline li::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--border); }
.timeline li::after { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: -1; }
.timeline li:first-child::after { display: none; }
.timeline li.done { color: var(--text); font-weight: 600; }
.timeline li.done::before, .timeline li.done::after { background: var(--brand); }
.status-pill.cancelled { color: var(--accent); font-weight: 700; }

/* ---------- footer & toast ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer p { margin: 4px 0; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 100;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .cart-btn > span:not(.badge) { display: none; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 24px; padding-bottom: 24px; }
  .hero-art { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .summary { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card-media { height: 110px; }
  .card-media .emoji { font-size: 54px; }
  .desc { display: none; }
  .buy { flex-direction: column; }
  .stepper { justify-content: space-between; }
  .tabs select { margin-left: 0; width: 100%; }
}
