/* The shopping pages: products, product, cart, checkout, done. Matches the shop/* design boards at 390px and stays
   fluid from 360 to 430. Colors: blue #0155EE, lime #A4FC01, page #F6F5F3. Logical properties only, so English (LTR) flips by itself. */
:root {
  --s-blue: #0155ee;
  --s-lime: #a4fc01;
  --s-bg: #f6f5f3;
  --s-ink: #0b1b3f;
  --s-muted: #7e8aa6;
  --s-line: #eef1f6;
  --s-field: #eef3fe;
  --s-chip: #d5dcea;
  --s-green: #2f6b00;
  --s-red: #e5484d;
}
body.shop { margin: 0; background: var(--s-bg); color: var(--s-ink); font-family: 'Alexandria', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body.shop * { box-sizing: border-box; }
body.shop a { text-decoration: none; }
body.shop button { font: inherit; cursor: pointer; }
:where(body.shop) a, :where(body.shop) button { color: inherit; }
.shop-wrap { max-width: 430px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: 104px; }
.shop-wrap.no-nav { padding-bottom: 150px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.flip-rtl:dir(rtl) svg { transform: scaleX(-1); }

/* ---------- top bar ---------- */
.shop-top { background: #fff; padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 4px 14px rgba(11, 27, 63, 0.05); }
.shop-brandrow { display: flex; align-items: center; gap: 10px; }
.shop-logo { width: 40px; height: 40px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(1, 85, 238, 0.18); flex-shrink: 0; overflow: hidden; }
.shop-logo img { width: 100%; height: 100%; object-fit: contain; }
.shop-name { flex: 1; font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-lang a, .shop-lang button { height: 32px; padding: 0 10px; border-radius: 10px; background: #f1f4fa; display: flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--s-blue); border: 0; }
.shop-search { position: relative; height: 48px; border-radius: 16px; background: var(--s-field); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--s-blue); }
.shop-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--s-ink); outline: none; }
.shop-search input::placeholder { color: var(--s-muted); }
.shop-search .clear { border: 0; background: transparent; color: var(--s-muted); display: none; padding: 4px; }
.shop-search.has-text .clear { display: flex; }

.pills { display: flex; gap: 8px; padding: 14px 16px; background: #fff; border-top: 1px solid var(--s-line); overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--s-chip); background: #fff; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.pill svg.i { width: 17px; height: 17px; color: var(--s-blue); }
.pill.on { border-color: var(--s-blue); background: var(--s-field); color: var(--s-blue); }
.pill .n { min-width: 18px; height: 18px; border-radius: 9px; background: var(--s-blue); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- search understanding + suggestions ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 12px; border-radius: 999px; background: var(--s-field); color: var(--s-blue); font-size: 12px; font-weight: 600; border: 0; }
.chip svg.i { width: 14px; height: 14px; }
.didyou { margin: 10px 16px 0; padding: 10px 12px; border-radius: 14px; background: #fff7d6; font-size: 12.5px; color: #6b5200; }
.cross-note { margin: 8px 16px 0; font-size: 12.5px; color: #5b6478; }
.didyou b { font-weight: 700; }
.suggest { position: absolute; z-index: 30; inset-inline: 0; top: 100%; margin-top: 6px; background: #fff; border-radius: 18px; box-shadow: 0 14px 34px rgba(11, 27, 63, 0.18); padding: 8px; max-height: 70dvh; overflow: auto; color: var(--s-ink); }
.suggest[hidden] { display: none; }
.sg-title { font-size: 11px; font-weight: 700; color: var(--s-muted); padding: 8px 8px 4px; }
.sg-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; font-size: 13px; }
.sg-row:active, .sg-row:hover { background: var(--s-field); }
.sg-thumb { width: 44px; height: 44px; border-radius: 12px; background: #eef2fa; object-fit: contain; flex-shrink: 0; }
.sg-main { flex: 1; min-width: 0; }
.sg-main b { display: block; font-size: 12.5px; line-height: 1.4; max-height: 35px; overflow: hidden; }
.sg-price { color: var(--s-blue); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.sg-words { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px 8px; }
.sg-word { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--s-field); color: var(--s-blue); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; border: 0; }

/* ---------- category cards ---------- */
.cats { display: flex; gap: 10px; padding: 14px 16px 2px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { width: 84px; flex-shrink: 0; height: 92px; border-radius: 20px; background: #fff; box-shadow: 0 6px 16px rgba(11, 27, 63, 0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 600; scroll-snap-align: start; border: 2px solid transparent; padding: 0 4px; text-align: center; }
.cat .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--s-field); color: var(--s-blue); display: flex; align-items: center; justify-content: center; }
.cat .ic svg { width: 24px; height: 24px; }
.cat.on { border-color: var(--s-blue); }
.cat span.nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.listhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; }
.listhead b { font-size: 15px; font-weight: 700; }
.listhead small { font-size: 12px; color: #8a93a6; font-weight: 500; }
.sortbtn { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--s-blue); font-weight: 600; background: transparent; border: 0; padding: 6px 0; }
.sortbtn svg.i { width: 15px; height: 15px; }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; list-style: none; margin: 0; }
.card { position: relative; border-radius: 22px; background: #fff; padding: 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 18px rgba(11, 27, 63, 0.05); min-width: 0; content-visibility: auto; contain-intrinsic-size: 260px; }
.card .photo { display: flex; height: 118px; border-radius: 16px; background: radial-gradient(circle at 50% 45%, #fff 0%, #eef2fa 80%); align-items: center; justify-content: center; overflow: hidden; }
.card .photo img { width: 100%; height: 100%; object-fit: contain; }
.card .photo svg { width: 44px; height: 44px; color: #b8c3dc; }
/* The key size on the picture (22 قدم, 55 بوصة ...): a small dark pill on the corner opposite the discount badge. */
.spec-badge { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; height: 24px; padding: 0 9px; border-radius: 999px; background: rgb(13 24 48 / 82%); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; white-space: nowrap; pointer-events: none; }
.pp-gallery .spec-badge { top: auto; bottom: 24px; inset-inline-end: 16px; height: 28px; font-size: 12px; }
.badge-off { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--s-lime); color: var(--s-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; }
.card .brand { font-size: 10px; color: #6b7590; font-weight: 600; min-height: 14px; }
.card .nm { font-size: 12.5px; font-weight: 700; line-height: 1.55; height: 39px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.card .pr { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card .pr b { font-size: 14px; color: var(--s-blue); font-weight: 700; white-space: nowrap; }
.card .pr b small { font-size: 10px; font-weight: 600; }
.card .pr s { font-size: 11px; color: #8a93a6; min-height: 15px; }
.card .pr .ask { font-size: 12px; color: var(--s-muted); font-weight: 600; }
.cartbtn { width: 36px; height: 36px; border-radius: 12px; background: var(--s-blue); color: #fff; display: flex; align-items: center; justify-content: center; border: 0; flex-shrink: 0; position: relative; z-index: 2; }
.cartbtn[disabled] { background: #c9d2e6; }
.cartbtn svg.i { width: 19px; height: 19px; }
.more { display: flex; justify-content: center; margin: 16px auto 0; padding: 12px 0; }
.more[hidden] { display: none; }
.more-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--s-chip); border-top-color: var(--s-blue); animation: more-spin 0.8s linear infinite; }
@keyframes more-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .more-spin { animation-duration: 2.4s; } }
.empty { text-align: center; padding: 44px 24px; color: var(--s-muted); font-size: 13px; line-height: 1.8; }
.empty b { display: block; color: var(--s-ink); font-size: 15px; margin-bottom: 6px; }
.skeleton .photo { background: linear-gradient(90deg, #eef2fa, #f8faff, #eef2fa); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton .photo { animation: none; } }

/* ---------- bottom sheets ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11, 27, 63, 0.45); z-index: 40; opacity: 0; transition: opacity 0.2s; }
.overlay.open { opacity: 1; }
.sheet { position: fixed; z-index: 41; inset-inline: 0; bottom: 0; max-width: 430px; margin: 0 auto; max-height: 86dvh; height: 640px; background: #fff; border-radius: 28px 28px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.25s ease-out; padding-bottom: env(safe-area-inset-bottom); }
.sheet.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .sheet, .overlay { transition: none; } }
.sheet-head { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--s-line); flex-shrink: 0; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.sheet-head .x { width: 36px; height: 36px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.sheet-head .back { height: 34px; padding: 0 12px 0 8px; border-radius: 12px; background: var(--s-field); color: var(--s-blue); border: 0; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 2px; }
.sheet-head .clear { background: transparent; border: 0; color: var(--s-red); font-size: 12px; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--s-line); flex-shrink: 0; }
.btn { width: 100%; height: 54px; border-radius: 18px; background: var(--s-blue); color: #fff; border: 0; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 22px rgba(1, 85, 238, 0.25); }
.btn[disabled] { background: #b9c6e4; box-shadow: none; }
.btn.lime { background: var(--s-lime); color: var(--s-ink); box-shadow: none; }
.btn.ghost { background: #fff; color: var(--s-green); border: 1.5px solid #cfeaa0; box-shadow: none; }
.frow { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--s-line); font-size: 14px; font-weight: 600; width: 100%; background: transparent; border-inline: 0; border-top: 0; text-align: start; gap: 10px; }
.frow .val { color: var(--s-muted); font-size: 11.5px; font-weight: 500; margin-inline-start: auto; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow svg.i { color: var(--s-muted); width: 16px; height: 16px; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: #dde3ef; position: relative; border: 0; flex-shrink: 0; transition: background 0.15s; }
.toggle::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); transition: inset-inline-start 0.15s; }
.toggle[aria-checked='true'] { background: var(--s-blue); }
.toggle[aria-checked='true']::after { inset-inline-start: 23px; }
.pick { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--s-line); font-size: 14px; font-weight: 600; width: 100%; background: transparent; border-inline: 0; border-top: 0; text-align: start; }
.pick .cnt { margin-inline-start: auto; color: var(--s-muted); font-size: 12px; font-weight: 500; }
.pick .logo { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--s-line); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 10px; font-weight: 700; color: var(--s-blue); flex-shrink: 0; }
.pick .logo img { width: 100%; height: 100%; object-fit: contain; }
.mark { width: 24px; height: 24px; border: 2px solid var(--s-chip); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.mark.radio { border-radius: 50%; }
.mark.box { border-radius: 7px; }
.pick[aria-checked='true'] .mark { background: var(--s-blue); border-color: var(--s-blue); }
.pick[aria-checked='true'] .mark svg { display: block; }
.mark svg { display: none; width: 14px; height: 14px; stroke-width: 3; }
.sheet-search { margin: 12px 20px; height: 44px; border-radius: 14px; background: var(--s-field); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--s-muted); }
.sheet-search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 13px; outline: none; color: var(--s-ink); min-width: 0; }
.price-fields { display: flex; gap: 12px; padding: 20px; }
.price-fields label { flex: 1; font-size: 12px; color: var(--s-muted); display: flex; flex-direction: column; gap: 6px; }
.price-fields input { height: 48px; border-radius: 14px; border: 1.5px solid var(--s-chip); padding: 0 12px; font: inherit; font-size: 15px; color: var(--s-ink); width: 100%; }
.price-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px; }
.sortlist .pick { height: 54px; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 60; inset-inline: 0; bottom: 96px; margin: 0 auto; width: max-content; max-width: 86vw; background: var(--s-ink); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 28px rgba(11, 27, 63, 0.3); opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--s-red); }

/* ---------- product page ---------- */
.pp-gallery { position: relative; height: 350px; background: radial-gradient(circle at 50% 40%, #fff 0%, #eef2fa 80%); overflow: hidden; }
.pp-slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pp-slides::-webkit-scrollbar { display: none; }
.pp-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 38px 24px; }
.pp-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pp-slide svg { width: 90px; height: 90px; color: #b8c3dc; }
.pp-btn { position: absolute; top: 18px; width: 42px; height: 42px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(11, 27, 63, 0.1); border: 0; color: var(--s-blue); z-index: 2; }
.pp-back { inset-inline-start: 16px; }
.pp-share { inset-inline-end: 16px; }
.pp-save { position: absolute; bottom: 24px; inset-inline-start: 16px; width: 60px; height: 60px; border-radius: 50%; background: var(--s-lime); color: var(--s-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; line-height: 1.2; box-shadow: 0 8px 20px rgba(164, 252, 1, 0.5); }
.pp-save b { font-size: 14px; font-weight: 700; }
.pp-dots { position: absolute; bottom: 14px; inset-inline: 0; display: flex; justify-content: center; gap: 5px; }
.pp-dots i { width: 6px; height: 6px; border-radius: 3px; background: #c4cbe0; }
.pp-dots i.on { width: 20px; background: var(--s-blue); }
.pp-body { background: #fff; padding: 14px 16px 22px; display: flex; flex-direction: column; gap: 10px; }
.pp-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--s-muted); flex-wrap: wrap; }
.pp-meta b { color: var(--s-blue); font-weight: 700; }
.pp-meta .eye { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.pp-meta .eye svg { width: 14px; height: 14px; }
.pp-name { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.55; }
.pp-model { font-size: 12px; color: var(--s-muted); }
.pp-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pp-price b { font-size: 28px; font-weight: 700; color: var(--s-ink); }
.pp-price b small { font-size: 14px; font-weight: 600; margin-inline-start: 4px; }
.pp-price s { font-size: 13px; color: #8a93a6; }
.pp-price .save { font-size: 12px; color: var(--s-green); font-weight: 700; }
.pp-badges { display: flex; gap: 10px; }
.pp-badge { flex: 1; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.pp-badge.stock { background: #f0fadc; color: var(--s-green); border: 1px solid #cfeaa0; }
.pp-badge.ship { background: var(--s-field); color: var(--s-blue); }
.pp-badge svg.i { width: 17px; height: 17px; }
.pp-sec { background: #fff; padding: 6px 16px 12px; }
.pp-sec h3 { margin: 10px 0 8px; font-size: 15px; font-weight: 700; }
.pp-desc { font-size: 13px; line-height: 1.9; color: #4a5575; white-space: pre-line; }
.pp-desc .more-link { color: var(--s-blue); font-weight: 700; background: transparent; border: 0; padding: 0; }
.specs { border: 1px solid var(--s-line); border-radius: 18px; overflow: hidden; }
.specs div { display: flex; gap: 14px; padding: 12px 14px; font-size: 12.5px; }
.specs div:nth-child(odd) { background: #f8f9fd; }
.specs dt { width: 34%; color: var(--s-muted); flex-shrink: 0; margin: 0; }
.specs dd { margin: 0; font-weight: 700; flex: 1; }
.raffle-card { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 14px; border-radius: 18px; background: #fff6d2; border: 1px solid #f2e4a0; }
.raffle-card .ic { width: 44px; height: 44px; border-radius: 14px; background: #ffe36a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.raffle-card b { display: block; font-size: 14px; }
.raffle-card span { font-size: 12px; color: #6b5200; }
.cart-main .pay-sec { margin: 12px 16px 0; border-radius: 16px; padding: 6px 14px 14px; }
.visit { display: flex; align-items: center; gap: 6px; padding: 14px 16px 4px; font-size: 12px; color: var(--s-muted); }
.stickybar { position: fixed; bottom: 0; inset-inline: 0; max-width: 430px; margin: 0 auto; z-index: 25; background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -6px 24px rgba(11, 27, 63, 0.08); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; }
.stickybar .p { display: flex; flex-direction: column; min-width: 86px; }
.stickybar .p b { color: var(--s-blue); font-size: 15px; font-weight: 700; white-space: nowrap; }
.stickybar .p small { font-size: 10.5px; color: #8a93a6; }
.stickybar .p small i { color: var(--s-green); font-weight: 700; font-style: normal; }
.stickybar .add { flex: 1; height: 52px; border-radius: 16px; background: var(--s-lime); color: var(--s-ink); border: 0; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.stickybar .add[disabled] { background: #dfe6c8; color: #7a8566; }
.stickybar .wa { width: 52px; height: 52px; border-radius: 16px; background: #e8f7d5; color: #1f9d3a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; }
.stickybar .wa svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }

/* ---------- cart ---------- */
.page-head { height: 74px; background: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.page-head .ic { width: 42px; height: 42px; border-radius: 14px; background: var(--s-field); color: var(--s-blue); display: flex; align-items: center; justify-content: center; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.page-head h1 small { font-size: 13px; color: var(--s-muted); font-weight: 600; }
.page-head .empty-btn { border: 0; background: transparent; color: var(--s-red); font-size: 12px; font-weight: 600; }
.page-head .back { height: 36px; padding: 0 12px 0 8px; border-radius: 12px; background: var(--s-field); color: var(--s-blue); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 2px; border: 0; }
.lines { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.line { background: #fff; border-radius: 22px; padding: 12px; display: flex; gap: 12px; box-shadow: 0 6px 18px rgba(11, 27, 63, 0.04); }
.line .ph { width: 76px; height: 76px; border-radius: 16px; background: #eef2fa; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.line .ph img { width: 100%; height: 100%; object-fit: contain; }
.line .ph svg { width: 30px; height: 30px; color: #b8c3dc; }
.line .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.line .br { font-size: 10px; color: #6b7590; font-weight: 600; }
.line .nm { font-size: 13px; font-weight: 700; line-height: 1.5; }
.line .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.line .pr { color: var(--s-blue); font-weight: 700; font-size: 14px; white-space: nowrap; }
.line .pr small { font-size: 10px; }
.line.gone { opacity: 0.75; }
.line .gone-tag { font-size: 11px; font-weight: 700; color: var(--s-red); }
.qty { display: flex; align-items: center; height: 40px; border-radius: 14px; border: 1.5px solid var(--s-line); background: #fff; }
.qty button { width: 38px; height: 100%; border: 0; background: transparent; color: var(--s-blue); display: flex; align-items: center; justify-content: center; }
.qty button.del { color: var(--s-red); }
.qty b { min-width: 22px; text-align: center; font-size: 13px; }
.note { margin: 0 16px; padding: 14px; border-radius: 16px; background: var(--s-field); display: flex; gap: 10px; font-size: 12px; line-height: 1.8; color: #4a5575; }
.note svg { color: var(--s-blue); margin-top: 3px; }
.note b { color: var(--s-ink); }
.cartbar { position: fixed; bottom: 0; inset-inline: 0; max-width: 430px; margin: 0 auto; background: #fff; border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(11, 27, 63, 0.1); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; z-index: 25; }
.cartbar .tot { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--s-muted); }
.cartbar .tot b { font-size: 22px; color: var(--s-ink); font-weight: 700; }
.cartbar .tot small { font-size: 12px; margin-inline-start: 4px; }
.cartbar .btns { display: flex; gap: 10px; }
.cartbar .btns .btn { height: 52px; }
.cartbar .btns .ghost { width: 40%; }

/* ---------- checkout / done ---------- */
.sumcard { margin: 14px 16px; padding: 12px 14px; border-radius: 18px; background: #fff; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sumcard .th { display: flex; gap: 4px; }
.sumcard .th i { width: 34px; height: 34px; border-radius: 10px; background: var(--s-field); overflow: hidden; display: block; }
.sumcard .th img { width: 100%; height: 100%; object-fit: contain; }
.sumcard b { margin-inline-start: auto; color: var(--s-blue); }
.form { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #4a5575; }
.fld { height: 52px; border-radius: 16px; border: 1.5px solid var(--s-chip); background: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--s-blue); }
.fld:focus-within { border-color: var(--s-blue); }
.fld input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--s-ink); height: 100%; }
.fld.bad { border-color: var(--s-red); }
.errmsg { color: var(--s-red); font-size: 11.5px; font-weight: 600; min-height: 0; }
.pinbtn { height: 52px; border-radius: 16px; border: 1.5px dashed var(--s-blue); background: transparent; color: var(--s-blue); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.pinbtn.set { border-style: solid; background: var(--s-field); }
.pinbtn.bad { border-color: var(--s-red); color: var(--s-red); }
.map-box { height: 280px; border-radius: 18px; overflow: hidden; border: 1px solid var(--s-line); position: relative; background: #e9edf5; }
.map-box[hidden] { display: none; }
.map-tools { display: flex; gap: 8px; margin-top: 8px; }
.map-tools button { flex: 1; height: 44px; border-radius: 14px; border: 1.5px solid var(--s-chip); background: #fff; font-weight: 600; font-size: 13px; }
.map-tools button[hidden] { display: none; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--s-muted); line-height: 1.8; }
.hint svg { margin-top: 3px; width: 16px; height: 16px; }
.pagefoot { position: fixed; bottom: 0; inset-inline: 0; max-width: 430px; margin: 0 auto; background: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); z-index: 25; box-shadow: 0 -8px 30px rgba(11, 27, 63, 0.06); }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 24px 24px; gap: 14px; }
.done .ok { width: 96px; height: 96px; border-radius: 50%; background: var(--s-lime); display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 34px rgba(164, 252, 1, 0.45); }
.done .ok svg { width: 48px; height: 48px; stroke-width: 3; }
.done h1 { margin: 6px 0 0; font-size: 22px; }
.done p { margin: 0; color: #4a5575; font-size: 14px; line-height: 1.8; }
.done .num { display: inline-block; padding: 10px 22px; border-radius: 16px; background: #fff; font-size: 20px; font-weight: 700; color: var(--s-blue); box-shadow: 0 6px 18px rgba(11, 27, 63, 0.06); }
.done .raffle { background: #fff6d2; border: 1px solid #f2e4a0; border-radius: 16px; padding: 12px 14px; font-size: 12.5px; color: #6b5200; }
.done .acts { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.done .acts a { text-decoration: none; }
.hidden-input { position: absolute; opacity: 0; pointer-events: none; }
.pin-marker span { display: block; width: 30px; height: 38px; background: var(--s-blue); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(0.8); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(1, 85, 238, 0.5); }
.pin-marker span::after { content: ''; display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin: 8px; }
.map-fail { padding: 18px; font-size: 12.5px; color: var(--s-red); text-align: center; }
.pp-btn.pp-back { width: auto; height: 36px; padding: 0 12px 0 8px; gap: 2px; border-radius: 12px; font-size: 12px; font-weight: 700; background: var(--s-field); }
.pp-btn.pp-back:dir(ltr) { padding: 0 8px 0 12px; }
.sheet-head .back { height: 36px; }

/* Subcategories: a second chip row under the categories */
.subs { display: flex; gap: 8px; padding: 10px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.subs::-webkit-scrollbar { display: none; }
.subs[hidden] { display: none; }
.sub { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #d5dceb; background: #fff; color: #0b1b3f; font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sub small { color: #6b7590; font-size: 11px; font-weight: 600; }
.sub.on { background: var(--s-blue); border-color: var(--s-blue); color: #fff; }
.sub.on small { color: rgb(255 255 255 / 80%); }
/* The count on a subcategory chip: the same small rounded badge */
.sub small { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-inline-start: 2px; padding: 0 6px; border-radius: 999px; background: #e8effe; color: #0155ee; font-size: 11px; font-weight: 800; line-height: 1; }
.sub.on small { background: #fff; color: #0b1b3f; }

/* ---------- product gallery: arrows, clickable dots, drag, lightbox ---------- */
.pp-gallery:focus-visible { outline: 2px solid var(--s-blue); outline-offset: -2px; }
.pp-slides.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.pp-dots i { position: relative; cursor: pointer; }
.pp-dots i::after { content: ''; position: absolute; inset: -9px -4px; }
.pp-nav { position: absolute; top: 175px; transform: translateY(-50%); z-index: 3; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--s-blue); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(11, 27, 63, 0.16); cursor: pointer; transition: opacity 0.15s; }
.pp-nav[hidden] { display: none; }
.pp-nav:disabled { opacity: 0.35; cursor: default; }
.pp-nav-left { left: 8px; }
.pp-nav-right { right: 8px; }
.pp-nav-left svg { transform: scaleX(-1); }
.pp-nav svg { width: 18px; height: 18px; stroke: currentColor; }
.pp-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 12, 30, 0.92); overflow: hidden; }
.pp-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.pp-lightbox::backdrop { background: rgba(6, 12, 30, 0.6); }
.pp-light-img { width: calc(100vw - 120px); height: calc(100dvh - 120px); max-width: 1100px; object-fit: contain; border-radius: 12px; background: #fff; }
.pp-lightbox .pp-nav { top: 50%; width: 44px; height: 44px; }
.pp-lightbox .pp-nav svg { width: 22px; height: 22px; }
.pp-lightbox .pp-nav-left { left: 16px; }
.pp-lightbox .pp-nav-right { right: 16px; }
.pp-light-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--s-blue); font-size: 28px; line-height: 1; cursor: pointer; z-index: 3; }
.pp-light-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
@media (hover: hover) { .pp-slides { cursor: zoom-in; } }

/* ---------- one clean picture box: the whole product, never cropped, one flat light colour to the edges ---------- */
.card .photo, .line .ph, .sumcard .th i, .sg-thumb { background: #f3f5fa; }
.card .photo { box-sizing: border-box; padding: 6px; }
.card .photo img, .line .ph img, .sumcard .th img, .sg-thumb { object-fit: contain; mix-blend-mode: multiply; }
.line .ph img, .sumcard .th img { padding: 3px; box-sizing: border-box; }
.sg-thumb { padding: 3px; box-sizing: border-box; }
/* The badges stay small and see-through so they do not hide the product. */
.card .spec-badge { top: 8px; height: 20px; padding: 0 7px; font-size: 10px; background: rgb(13 24 48 / 62%); backdrop-filter: blur(4px); }
.card .badge-off { top: 8px; height: 20px; padding: 0 7px; font-size: 10px; opacity: 0.92; }

/* ---------- payment methods: equal rectangles, 2 per row on phones, 4 on wide screens ---------- */
.pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pay-item { height: 64px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--s-line); border-radius: 14px; background: #fff; min-width: 0; }
.pay-logo { flex: none; width: 40px; height: 28px; display: grid; place-items: center; font-style: normal; color: #8a93a6; }
.pay-logo img { width: 100%; height: 100%; object-fit: contain; }
.pay-item em { font-style: normal; font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; min-width: 0; }
@media (min-width: 1024px) { .pay { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
