:root {
  --orange: #f85606;
  --orange-dark: #d84304;
  --orange-soft: #fff1e6;
  --ink: #212121;
  --muted: #757575;
  --line: #eee;
  --bg: #f5f5f5;
  --green: #1a7f37;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
html[data-font="big"] { font-size: 19px; }
html[data-font="bigger"] { font-size: 22px; }
body {
  font-family: "Noto Serif Bengali", serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: 4.6rem;
  max-width: 560px;
  margin: 0 auto;
}
.hidden { display: none !important; }
/* Owner panel active: the shop chrome disappears — no search bar, no
   ⋯ menu button, no bottom nav, and no dead space where the nav was.
   Only the brand header (logo + ঘরে পাবেন) stays above the panel. */
body.owner-active .search-row,
body.owner-active #menuBtn,
body.owner-active .bottom-nav { display: none; }
body.owner-active { padding-bottom: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, #ff6a1a, var(--orange));
  padding: 0.55rem 0.8rem 0.65rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; }
.logo { color: #fff; font-weight: 900; font-size: 1.45rem; letter-spacing: .2px; display: flex; align-items: center; gap: .5rem; }
.logo-img {
  width: 2.35rem; height: 2.35rem; border-radius: 50%; object-fit: cover; flex: none;
  background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 2px 6px rgba(0,0,0,.25);
}
.icon-btn {
  background: rgba(255,255,255,.22); color: #fff; border: none;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  font-size: 1.35rem; line-height: 1; backdrop-filter: blur(3px);
}
.search-row { margin-top: 0.5rem; }
.search-row input {
  width: 100%; border: none; border-radius: 2rem;
  padding: 0.55rem 1rem; outline: none; background: #fff;
}

/* ---------------- banner ---------------- */
.banner {
  margin: 0.7rem; border-radius: 0.9rem; color: #fff;
  background: linear-gradient(120deg, #ff7a18, #f85606 55%, #d81a60 130%);
  padding: 1.1rem 1rem;
}
.banner-title { font-size: 1.7rem; font-weight: 900; }
.banner-sub { opacity: .95; margin: 0.15rem 0 0.55rem; line-height: 1.5; overflow-wrap: break-word; }
.banner-chip {
  background: #fff; color: var(--orange-dark); font-weight: 700;
  padding: 0.2rem 0.7rem; border-radius: 2rem; font-size: .85rem;
}

/* ---------------- categories ---------------- */
.cats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem 0.4rem; padding: 0.4rem 0.7rem 0.9rem;
}
.cat { background: none; border: none; text-align: center; color: var(--ink); }
.cat .ring {
  width: 4.3rem; height: 4.3rem; margin: 0 auto 0.3rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; box-shadow: 0 3px 8px rgba(0,0,0,.15);
  border: 2px solid #fff;
}
.cat span { font-size: .92rem; font-weight: 600; display: block; }
.cat.selected .ring { outline: 3px solid var(--orange); }

/* ---------------- flash ---------------- */
.flash-head {
  padding: 0.2rem 0.8rem; font-weight: 900; color: var(--orange-dark);
  font-size: 1.1rem;
}
#flashTitle { cursor: pointer; }
.flash-sub {
  color: var(--orange-dark); font-weight: 700; font-size: .85rem; margin-left: .4rem;
  background: var(--orange-soft); border: 1px solid var(--orange); border-radius: 2rem;
  padding: .18rem .7rem; cursor: pointer;
}
.flash-sub.active { background: var(--orange); color: #fff; }
.flash-strip {
  display: flex; gap: 0.6rem; overflow-x: auto;
  padding: 0.4rem 0.8rem 0.8rem; scrollbar-width: none;
}
.flash-item {
  min-width: 7.2rem; background: #fff; border-radius: 0.7rem;
  padding: 0.45rem; border: 1px solid var(--line); text-align: left;
}
.flash-item .fname { font-size: .8rem; height: 2.4em; overflow: hidden; }
.off-badge {
  background: #e40046; color: #fff; font-size: .72rem; font-weight: 700;
  padding: 0.05rem 0.4rem; border-radius: 0.3rem;
}

/* ---------------- product grid ---------------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.3rem 0.8rem;
}
.section-head h2 { font-size: 1.2rem; font-weight: 900; }
.grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.6rem; padding: 0.2rem 0.7rem 0.8rem;
}
.card {
  background: #fff; border-radius: 0.8rem; overflow: hidden;
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.card .imgbox {
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card .imgbox img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; gap: .1rem;
}
.placeholder .initial { font-size: 2.6rem; font-weight: 900; }
.placeholder .brand { font-size: .8rem; opacity: .92; padding: 0 .4rem; text-align: center; }
.sample-badge {
  position: absolute; top: .45rem; left: .45rem;
  background: rgba(0,0,0,.62); color: #ffd54d;
  font-size: .72rem; font-weight: 700; padding: .08rem .45rem; border-radius: .3rem;
}
.card .body { padding: 0.55rem 0.6rem 0.7rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card .pname { font-size: .95rem; line-height: 1.35; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: .45rem; }
.price { color: var(--orange-dark); font-weight: 900; font-size: 1.08rem; }
.old-price { color: var(--muted); text-decoration: line-through; font-size: .85rem; }
.add-btn {
  margin-top: .35rem; background: var(--orange); color: #fff; border: none;
  border-radius: 0.55rem; padding: 0.5rem; font-weight: 700; font-size: .95rem;
}
.add-btn:active { background: var(--orange-dark); }
.load-more {
  display: block; margin: 0.4rem auto 1.2rem; background: #fff;
  border: 2px solid var(--orange); color: var(--orange-dark);
  padding: 0.6rem 1.6rem; border-radius: 2rem; font-weight: 700;
}
.grid-sentinel { height: 1px; }
.loading-note, .end-note { text-align: center; color: var(--muted); padding: 0.7rem 1rem 1.1rem; }
.loading-note { font-weight: 700; color: var(--orange-dark); }
.empty { text-align: center; color: var(--muted); padding: 1.4rem 1rem; }
.cart-shop-btn { margin-top: .85rem; }

/* ---------------- views / generic ---------------- */
.view { display: none; }
.view.active { display: block; }
.page-title { padding: 0.9rem 0.8rem 0.4rem; font-size: 1.3rem; font-weight: 900; }
.primary-btn {
  background: var(--orange); color: #fff; border: none; width: 100%;
  padding: 0.75rem; border-radius: 0.6rem; font-weight: 800; font-size: 1.05rem;
}
.primary-btn.small { width: auto; padding: 0.55rem 1.2rem; }
.link-btn { background: none; border: none; color: var(--orange-dark); font-weight: 700; padding: .4rem; }
.link-btn.danger { color: #c62828; display: block; margin: 1rem auto; }
.form-msg { margin-top: 0.6rem; font-weight: 600; }
.form-msg.ok { color: var(--green); }
.form-msg.fail { color: #c62828; }
.hint { color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }
.hint code { background: #f0f0f0; padding: .05rem .3rem; border-radius: .25rem; }

/* ---------------- categories page ---------------- */
.cat-list { padding: 0.4rem 0.8rem; display: flex; flex-direction: column; gap: .55rem; }
.cat-row {
  display: flex; align-items: center; gap: .8rem; background: #fff;
  border: 1px solid var(--line); border-radius: .8rem; padding: .7rem .9rem;
  text-align: left; width: 100%; font-size: 1.05rem; font-weight: 700;
}
.cat-row .ring { width: 3rem; height: 3rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* ---------------- cart / checkout ---------------- */
.cart-item {
  display: flex; gap: .7rem; background: #fff; margin: 0.5rem 0.8rem;
  border: 1px solid var(--line); border-radius: .8rem; padding: .6rem;
  align-items: center;
}
.cart-item .thumb { width: 3.4rem; height: 3.4rem; border-radius: .5rem; overflow: hidden; flex: none; }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .thumb .placeholder .initial { font-size: 1.4rem; }
.cart-item .thumb .placeholder .brand { display: none; }
.cart-item .info { flex: 1; }
.qty { display: flex; align-items: center; gap: .5rem; }
.qty button {
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid #ccc;
  background: #fff; font-size: 1.05rem; line-height: 1;
}
.totals {
  background: #fff; margin: 0.8rem; border: 1px solid var(--line);
  border-radius: .8rem; padding: .8rem .9rem;
}
.totals > div { display: flex; justify-content: space-between; padding: .15rem 0; }
.totals .grand { border-top: 1px dashed #ccc; margin-top: .4rem; padding-top: .5rem; font-size: 1.1rem; }
.cod-note { color: var(--muted); font-size: .88rem; margin-top: .4rem; }
form label { display: block; margin: 0.7rem 0.8rem 0; font-weight: 600; }
form input, form select, form textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem;
  border: 1px solid #ccc; border-radius: .55rem; background: #fff; font-weight: 400;
}
#checkoutForm .primary-btn { margin: 0.9rem 0.8rem 0; width: calc(100% - 1.6rem); }
#checkoutForm .form-msg { margin: 0.6rem 0.8rem 1rem; }

/* ---------------- orders ---------------- */
.lookup { display: flex; gap: .5rem; margin: 0.6rem 0.8rem; }
.lookup input { flex: 1; padding: .55rem .7rem; border: 1px solid #ccc; border-radius: .55rem; }
.order-card {
  background: #fff; margin: 0.85rem 0.8rem; border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: .8rem; padding: .7rem .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.order-card .ohead { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.status-chip { background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; font-size: .8rem; padding: .1rem .55rem; border-radius: 1rem; white-space: nowrap; }
.order-card .odate { color: var(--muted); font-size: .88rem; margin-top: .1rem; }
.order-card .addr { color: var(--muted); font-size: .9rem; }
.oitems { display: flex; flex-direction: column; gap: .45rem; margin: .55rem 0; }
.oitem {
  display: flex; align-items: center; gap: .6rem;
  background: #fffaf5; border: 1px solid var(--line); border-radius: .6rem; padding: .35rem .5rem;
}
.oitem .thumb { width: 3rem; height: 3rem; border-radius: .45rem; overflow: hidden; flex: none; }
.oitem .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oitem .thumb .placeholder { width: 100%; height: 100%; }
.oitem .thumb .placeholder .initial { font-size: 1.2rem; }
.oitem .thumb .placeholder .brand { display: none; }
/* order tracking stepper */
.stepper { display: flex; align-items: flex-start; margin: .75rem 0 .35rem; }
.stepper .step { display: flex; flex-direction: column; align-items: center; width: 2.7rem; flex: none; text-align: center; }
.stepper .dot {
  width: 1.55rem; height: 1.55rem; border-radius: 50%; z-index: 1;
  background: #e3e3e3; border: 2px solid #e3e3e3; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.stepper .step.done .dot { background: var(--orange); border-color: var(--orange); }
.stepper .step.current .dot { background: #fff; border-color: var(--orange); color: var(--orange-dark); box-shadow: 0 0 0 3px var(--orange-soft); }
.stepper .step-label { font-size: .62rem; color: var(--muted); margin-top: .28rem; line-height: 1.3; }
.stepper .step.done .step-label, .stepper .step.current .step-label { color: var(--orange-dark); font-weight: 700; }
.stepper .step-line { flex: 1; height: 2px; background: #e3e3e3; margin-top: .78rem; }
.stepper .step.done + .step-line { background: var(--orange); }
.cancelled-badge {
  background: #fdecea; color: #c62828; font-weight: 700; text-align: center;
  padding: .4rem .7rem; border-radius: .5rem; margin: .65rem 0 .25rem;
}
.orders-hint { margin: .15rem .8rem 0; }

.oitem .oinfo { flex: 1; min-width: 0; }
.oitem .oname { font-weight: 600; line-height: 1.35; }
.oitem .ometa { color: var(--muted); font-size: .88rem; }
.oitem .oline { white-space: nowrap; }

/* ---------------- owner ---------------- */
.owner-tabs { display: flex; gap: .4rem; padding: 0.4rem 0.8rem; flex-wrap: wrap; }
.owner-tabs .tab {
  border: 1px solid var(--orange); background: #fff; color: var(--orange-dark);
  border-radius: 2rem; padding: .4rem .9rem; font-weight: 700;
}
.owner-tabs .tab.active { background: var(--orange); color: #fff; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.preview { width: 6rem; height: 6rem; object-fit: cover; border-radius: .6rem; margin: 0.6rem 0.8rem 0; border: 1px solid var(--line); }
.row-btns { display: flex; align-items: center; gap: .6rem; margin: 0.9rem 0.8rem 0; }
.row-btns .primary-btn { flex: 1; }
#tab-bulk { padding: 0.4rem 0.8rem; }
#tab-bulk textarea { width: 100%; padding: .6rem; border: 1px solid #ccc; border-radius: .55rem; }
#tab-bulk .primary-btn { margin-top: .6rem; }
.owner-product {
  display: flex; align-items: center; gap: .6rem; background: #fff;
  margin: 0.5rem 0.8rem; border: 1px solid var(--line); border-radius: .7rem; padding: .55rem .7rem;
}
.owner-product .info { flex: 1; }
.owner-product .info small { color: var(--muted); }
.mini-btn { border: 1px solid #bbb; background: #fff; border-radius: .45rem; padding: .35rem .6rem; font-weight: 700; }
.mini-btn.del { color: #c62828; border-color: #e0a3a3; }
.owner-order select { padding: .35rem; border-radius: .45rem; border: 1px solid #bbb; margin-top: .4rem; }
/* owner main tabs: পণ্য | অর্ডার | সেটিংস */
.owner-mtabs {
  display: flex; gap: .45rem; margin: 0.2rem 0.8rem 0.7rem;
  background: #fff; border: 1px solid var(--line); border-radius: 2rem; padding: .3rem;
}
.owner-mtabs .mtab {
  flex: 1; border: none; background: none; border-radius: 2rem;
  padding: .5rem .2rem; font-weight: 800; font-size: .98rem; color: var(--muted);
}
.owner-mtabs .mtab.active { background: var(--orange); color: #fff; }
.mtabpane { display: none; }
.mtabpane.active { display: block; }
.pane-title { margin: 0.4rem 0.9rem 0.2rem; font-size: 1.08rem; font-weight: 900; }
.owner-filter { display: flex; gap: .45rem; padding: 0.5rem 0.8rem 0; }
.owner-filter .chip {
  border: 1px solid var(--orange); background: #fff; color: var(--orange-dark);
  border-radius: 2rem; padding: .35rem .85rem; font-weight: 700;
}
.owner-filter .chip.active { background: var(--orange); color: #fff; }
.price-pending {
  background: #fff3e0; color: #b26a00; border: 1px solid #ffcc80;
  font-size: .72rem; font-weight: 800; padding: .08rem .45rem; border-radius: 1rem;
  white-space: nowrap;
}
.owner-product .thumb { width: 3.2rem; height: 3.2rem; border-radius: .5rem; overflow: hidden; flex: none; }
.owner-product .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.owner-product .thumb .placeholder { width: 100%; height: 100%; }
.owner-product .thumb .placeholder .initial { font-size: 1.25rem; }
.owner-product .thumb .placeholder .brand { display: none; }
/* settings tab cards (PIN change, backup, fingerprint — each exactly once) */
.settings-card {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--orange);
  border-radius: .7rem; margin: 0.9rem 0.8rem; padding: 0.4rem 0.9rem 1rem;
}
.settings-card h3 { margin: 0.7rem 0 0.4rem; font-size: 1.05rem; font-weight: 900; }
.settings-card .primary-btn { margin-top: 0.6rem; }
.settings-card form label { margin-left: 0; margin-right: 0; }
.settings-card #fpList .owner-product { margin-left: 0; margin-right: 0; }
.settings-card label input { display: block; width: 100%; padding: .55rem .65rem; border: 1px solid #ccc; border-radius: .55rem; margin-top: .25rem; }
/* settings category heads: big icon in an orange-tinted circle + title */
.settings-card-head { display: flex; align-items: center; gap: .6rem; margin: 0.7rem 0 0.4rem; }
.settings-card-head h3 { margin: 0; }
.settings-ico {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: #fff3ea; border: 1px solid #ffd9c2;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
/* settings category list: four tappable rows (icon + name + arrow);
   each opens its own detail screen one level deeper */
#settingsMenu { margin: 0.9rem 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
#settingsMenu.hidden { display: none; }
.settings-row {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: .7rem;
  padding: .75rem .9rem; font: inherit; font-size: 1.02rem; font-weight: 800;
  color: inherit; cursor: pointer; text-align: left;
}
.settings-row:active { background: #fff3ea; }
.settings-row-arrow { margin-left: auto; font-size: 1.5rem; line-height: 1; font-weight: 900; color: var(--orange); }
.settings-back { display: inline-block; margin: 0.9rem 0.8rem 0; font-size: 1rem; font-weight: 800; }
.settings-subhead { margin: 1rem 0 0.4rem; font-size: 0.98rem; font-weight: 900; }
/* pending-count pill on the ডিভাইস রিকোয়েস্ট settings row */
.settings-badge {
  flex: none; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem;
  border-radius: 999px; background: #d92c2c; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900;
}
.settings-badge.hidden { display: none; }
/* device rows inside the ডিভাইস রিকোয়েস্ট card reuse .owner-product;
   the approval code gets its own big chip so it can be compared with
   the code on the waiting device's screen */
.settings-card #devPendingList .owner-product,
.settings-card #devTrustedList .owner-product { margin-left: 0; margin-right: 0; }
.dev-code {
  flex: none; background: #fff3ea; border: 1px dashed var(--orange); color: var(--orange);
  border-radius: .55rem; padding: .25rem .6rem; font-size: 1.25rem; font-weight: 900; letter-spacing: .15em;
}
/* the owner's own phone in the trusted list: flagged, never revocable
   from that screen (every phone shows the same UA label) */
.dev-mine {
  flex: none; background: #e8f7ee; border: 1px solid #9fd8b4; color: #14713c;
  border-radius: .55rem; padding: .3rem .6rem; font-size: .9rem; font-weight: 800;
}
/* panel heads-up: a new device is asking to log in */
.device-notice {
  margin: 0.7rem 0.8rem 0; padding: .65rem .9rem; cursor: pointer;
  background: #fff7ed; border: 1px solid #ffd9c2; border-left: 4px solid var(--orange);
  border-radius: .6rem; font-weight: 700;
}
.device-notice.hidden { display: none; }
/* PIN modal: waiting-for-owner-approval block */
.pin-wait { text-align: center; }
.pin-wait-title { font-size: 1.05rem; font-weight: 900; margin: 0.4rem 0; }
.pin-wait-code {
  font-size: 2.4rem; font-weight: 900; letter-spacing: .25em; color: var(--orange);
  background: #fff3ea; border: 1px dashed var(--orange); border-radius: .7rem;
  padding: .5rem 0 .5rem .25em; margin: 0.6rem 0;
}

/* settings step-up lock screen (fingerprint gate) */
.settings-lock {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--orange);
  border-radius: .7rem; margin: 0.9rem 0.8rem; padding: 1.6rem 1rem 1.2rem; text-align: center;
}
.settings-lock .lock-icon { font-size: 3.2rem; line-height: 1.1; }
.settings-lock h3 { margin: 0.5rem 0 0.3rem; font-size: 1.15rem; font-weight: 900; }
.settings-lock .hint { max-width: 22rem; margin: 0 auto; }
.settings-lock .primary-btn { margin-top: 0.9rem; }
.settings-lock .primary-btn:disabled { opacity: .5; }

/* ---------------- bottom nav ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; background: #fff; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #ddd; box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.nav-btn {
  background: none; border: none; padding: 0.45rem 0 0.55rem;
  font-size: .82rem; color: var(--muted); position: relative; font-weight: 600;
}
.nav-btn .nav-ico { display: block; font-size: 1.25rem; }
.nav-btn .nav-label { display: block; }
.nav-btn.active { color: var(--orange-dark); }
.badge {
  position: absolute; top: .2rem; right: calc(50% - 1.3rem);
  background: #e40046; color: #fff; border-radius: 1rem;
  font-size: .68rem; padding: .02rem .38rem;
}

/* ---------------- modals / toast ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  background: #fff; width: 100%; max-width: 560px; border-radius: 1.1rem 1.1rem 0 0;
  padding: 1.1rem 1rem 1.3rem;
}
.modal-card h3 { margin-bottom: .7rem; font-size: 1.2rem; }
.menu-group { margin-bottom: .9rem; }
.menu-label { font-weight: 700; margin-bottom: .4rem; }
.seg { display: flex; gap: .4rem; }
.seg button {
  flex: 1; padding: .5rem; border-radius: .6rem; border: 1px solid #ccc; background: #fff; font-weight: 600;
}
.seg button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.menu-item {
  display: block; width: 100%; text-align: left; background: #fafafa;
  border: 1px solid var(--line); border-radius: .6rem;
  padding: .65rem .8rem; margin-bottom: .5rem; font-size: 1rem; font-weight: 600;
}
.about-text { color: var(--muted); margin: 0 0 .8rem; }
.about-logo { display: block; width: 150px; height: 150px; object-fit: cover; border-radius: 18px; margin: 0 auto .8rem; }
.modal-card input { display: block; width: 100%; padding: .6rem .7rem; border: 1px solid #ccc; border-radius: .55rem; margin-bottom: .5rem; }
.toast {
  position: fixed; bottom: 5.6rem; left: 50%; transform: translateX(-50%);
  background: #222; color: #fff; padding: .55rem 1.1rem; border-radius: 2rem;
  z-index: 80; font-size: .95rem; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* ---------------- order cost breakdown ---------------- */
.cost-breakdown {
  border-top: 1px dashed #d8d8d8; margin-top: .55rem; padding-top: .5rem;
}
.cost-breakdown > div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .14rem 0; color: var(--muted);
}
.cost-breakdown > div b { color: #222; font-weight: 700; }
.cost-breakdown > div.grand {
  border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .45rem;
  color: #222; font-size: 1.05rem;
}
.cost-breakdown > div.grand b { color: var(--orange-dark); font-weight: 900; }

/* ---------------- product detail view ---------------- */
.detail {
  position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 50;
  background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.detail-head {
  position: sticky; top: 0; z-index: 5; background: #fff;
  border-bottom: 1px solid var(--line); padding: .55rem .8rem;
}
.detail-back {
  background: none; border: none; font-size: 1.05rem; font-weight: 800;
  color: var(--orange-dark); padding: .25rem .1rem;
}
.detail-main {
  position: relative; aspect-ratio: 1/1; background: #fff; overflow: hidden;
}
.detail-main .placeholder { position: absolute; inset: 0; }
.detail-main .placeholder .initial { font-size: 4rem; }
img.detail-img {
  width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in;
}
.detail-main.zoomed img.detail-img { transform: scale(1.7); cursor: zoom-out; }
.detail-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.3rem; height: 2.3rem; border-radius: 50%; border: none;
  background: rgba(0,0,0,.45); color: #fff; font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.detail-arrow.prev { left: .6rem; }
.detail-arrow.next { right: .6rem; }
.detail-count {
  position: absolute; right: .7rem; bottom: .7rem;
  background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 700;
  padding: .12rem .55rem; border-radius: 1rem;
}
.detail-dots { display: flex; gap: .4rem; justify-content: center; padding: .55rem 0 0; background: #fff; }
.dot-nav {
  width: .55rem; height: .55rem; border-radius: 50%; border: none;
  background: #d5d5d5; padding: 0;
}
.dot-nav.active { background: var(--orange); }
.detail-thumbs {
  display: flex; gap: .5rem; padding: .6rem .8rem .8rem; background: #fff; overflow-x: auto;
}
.detail-thumbs img {
  width: 3.6rem; height: 3.6rem; object-fit: cover; border-radius: .5rem;
  border: 2px solid var(--line); flex: none; background: #fff;
}
.detail-thumbs img.active { border-color: var(--orange); }
.detail-info { background: #fff; margin-top: .6rem; padding: .9rem .95rem 1rem; }
.detail-name { font-size: 1.28rem; font-weight: 900; line-height: 1.35; }
.detail-catrow { display: flex; gap: .45rem; margin-top: .5rem; flex-wrap: wrap; }
.detail-price { margin-top: .55rem; }
.detail-price .price { font-size: 1.55rem; }
.detail-h { margin: 1rem 0 .35rem; font-size: 1.05rem; font-weight: 900; }
.detail-lines { color: var(--muted); line-height: 1.55; }
.detail-lines p { margin: .15rem 0; }
.detail-qty {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; font-weight: 700;
}
.detail-actions {
  position: sticky; bottom: 0; display: flex; gap: .6rem;
  background: #fff; border-top: 1px solid var(--line);
  padding: .65rem .8rem calc(.65rem + env(safe-area-inset-bottom));
  margin-top: .6rem;
}
.detail-actions button {
  flex: 1; padding: .8rem .4rem; border-radius: .6rem; font-size: 1.02rem; font-weight: 800;
}
.detail-add { background: #fff; border: 2px solid var(--orange); color: var(--orange-dark); }
.detail-buy { background: var(--orange); border: 2px solid var(--orange); color: #fff; }
