/* DOOSH – storefront styles. Mobile-first; no external fonts or libraries. */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --bg: #fffaf3;
  --surface: #ffffff;
  --surface-2: #f6f1e8;       /* behind product photos */
  --ink: #1c2238;
  --ink-2: #474d65;
  --muted: #6d7186;
  --line: #ebe3d5;
  --brand: #2f3bd3;           /* primary buttons and links */
  --brand-hover: #232cb0;
  --brand-soft: #eceefe;
  --sun: #ffc83d;             /* brand accent */
  --sale: #d32f25;
  --ok: #17804a;
  --low: #b45309;
  --out: #6d7186;
  --wa: #0c7f47;
  --wa-hover: #096a3b;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(28 34 56 / 6%), 0 4px 14px rgb(28 34 56 / 6%);
  --shadow-lift: 0 2px 4px rgb(28 34 56 / 8%), 0 12px 28px rgb(28 34 56 / 12%);
  --gutter: 16px;
  --max: 1180px;
  --header-h: 60px;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: 16px; line-height: 1; text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: var(--surface); color: var(--brand); border-color: currentColor; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }
.btn[disabled], .btn[aria-disabled="true"] { background: #c9ccd6; color: #fff; border-color: transparent; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { display: inline-flex; align-items: flex-end; }
.brand-name { font-size: 26px; font-weight: 900; letter-spacing: 0.06em; line-height: 1; }
.brand-dot { width: 9px; height: 9px; margin-left: 3px; margin-bottom: 3px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px var(--ink) inset; }
.brand-mark.has-logo { align-items: center; gap: 10px; }
.brand-logo-img { display: block; flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 600;
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer; place-items: center;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); position: relative; transition: transform .2s;
}
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 719px) {
  .menu-toggle { display: grid; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 12px; border-radius: var(--radius-sm); font-size: 17px; }
  .btn-wa.btn-sm { padding: 0 12px; }
}
@media (max-width: 380px) {
  .btn-wa-text { display: none; }
  .btn-wa.btn-sm { width: 44px; padding: 0; }
}

/* ---------- Intro ---------- */
.intro { padding-block: 28px 8px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); background: var(--sun); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.intro h1 { font-size: clamp(30px, 7.4vw, 50px); font-weight: 850; max-width: 16ch; }
.lead { margin-top: 10px; font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.perks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.perks li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px;
}
.perks li::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 7.2 2.3 2.3 4.7-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

/* ---------- Sections ---------- */
.section { padding-block: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 22px; font-weight: 800; }
.link-more { font-weight: 700; text-decoration: none; }
.result-count { color: var(--muted); font-size: 15px; }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 12px; margin-bottom: 18px; }
.search { position: relative; }
.search input {
  width: 100%; height: 50px; padding: 0 16px 0 46px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-icon { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-block: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 15px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: #d8cfbf; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

@media (min-width: 720px) {
  .filters { grid-template-columns: minmax(260px, 380px) 1fr; align-items: center; }
  .chips { margin: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
}

/* ---------- Product grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }

.card {
  position: relative; /* keeps hidden screen-reader text inside the card (prevents page overflow) */
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: box-shadow .2s, transform .2s;
}
@media (hover: hover) {
  a.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
  a.card:hover .card-cta { background: var(--brand); color: #fff; border-color: var(--brand); }
}
.card-media {
  position: relative; aspect-ratio: 1 / 1; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden;
}
/* "contain" keeps the photo's real proportions – never stretched or cropped. */
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card.is-out .card-media img { opacity: .55; filter: grayscale(.4); }
.card-noimg { color: var(--muted); font-size: 14px; }

.badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 13px; font-weight: 800; line-height: 1; padding: 6px 9px; border-radius: 999px;
}
.badge-sale { background: var(--sale); color: #fff; }
.badge-out { background: var(--ink); color: #fff; }

.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; flex: 1; }
.card-title {
  font-size: 15px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-cta { margin-top: auto; width: 100%; }
.card .stock { margin-bottom: 6px; }
@media (min-width: 720px) {
  .card-body { padding: 14px 16px 16px; }
  .card-title { font-size: 16px; }
}

/* ---------- Price ---------- */
.price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.price-now { font-size: 19px; font-weight: 850; color: var(--ink); letter-spacing: -0.01em; }
.price-was { font-size: 14px; color: var(--muted); text-decoration-thickness: 1.5px; }
.price.lg .price-now { font-size: 30px; }
.price.lg .price-was { font-size: 18px; }

/* ---------- Stock ---------- */
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-in { color: var(--ok); }
.stock-low { color: var(--low); }
.stock-out { color: var(--out); }

/* ---------- Featured row (swipe on phones, grid on desktop) ---------- */
.featured-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 12px;
  scroll-padding-inline: var(--gutter);
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-row > .card { scroll-snap-align: start; }
@media (min-width: 720px) {
  .featured-row { grid-auto-columns: calc((100% - 36px) / 3); gap: 18px; }
}
@media (min-width: 1024px) {
  .featured-row {
    grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px;
    overflow: visible; margin: 0; padding: 0 0 4px;
  }
}

/* ---------- Skeleton loading ---------- */
.skeleton { box-shadow: none; }
.skeleton .card-media, .skeleton .card-body span {
  background: linear-gradient(90deg, #f1ebe0 0%, #f8f4ed 50%, #f1ebe0 100%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton .card-body span { display: block; height: 14px; border-radius: 6px; }
.skeleton .card-body span + span { width: 50%; height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Notices (empty / error) ---------- */
.notice {
  text-align: center; padding: 32px 20px; margin-top: 8px;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius);
  display: grid; gap: 8px; justify-items: center; color: var(--ink-2);
}
.notice-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.notice .btn { margin-top: 8px; }
.notice-error { border-color: #f1c4bf; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px; background: var(--ink); color: #d7d9e4;
  padding-block: 36px calc(24px + env(safe-area-inset-bottom, 0px));
}
.footer-inner { display: grid; gap: 28px; }
.footer-logo { color: #fff; }
.footer-tagline { margin-top: 6px; color: #b4b8c9; }
.footer-brand .btn { margin-top: 16px; }
.footer-heading { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: #9ca1b7; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #fff; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.contact-list li { display: grid; gap: 2px; }
.contact-label { font-size: 13px; color: #9ca1b7; }
.contact-list .muted { color: #b4b8c9; }
.footer-legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 12%); font-size: 13.5px; color: #9ca1b7; }
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1.3fr 1fr 1fr; }
}

/* ---------- Simple pages (404 etc.) ---------- */
.page-message { padding-block: 56px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.page-message .big { font-size: 64px; font-weight: 900; color: var(--sun); -webkit-text-stroke: 2px var(--ink); line-height: 1; }
.page-message h1 { font-size: 28px; }
.page-message p { color: var(--ink-2); max-width: 40ch; }
.page-message .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Product page ---------- */
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 17px; }
.btn-outline-wa { background: var(--surface); color: var(--wa); border-color: currentColor; }
.btn-outline-wa:hover { background: #effaf4; }
.btn-outline-wa .icon { width: 22px; height: 22px; }
span.btn[aria-disabled="true"] { cursor: default; }

.product-page { padding-block: 12px 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.pd { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .pd { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .pd-gallery { position: sticky; top: calc(var(--header-h) + 16px); }
}
/* Edge-to-edge photos on phones, like most shopping apps. */
@media (max-width: 599px) {
  .pd-gallery { margin-inline: calc(var(--gutter) * -1); }
  .pd-gallery .g-main { border-radius: 0; }
  .pd-gallery .g-thumbs { padding-inline: var(--gutter); }
}

.pd-info { display: grid; gap: 14px; align-content: start; }
.pd-cat { font-size: 14px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.pd-title { font-size: clamp(24px, 6vw, 34px); font-weight: 850; }
.pd-price { display: grid; gap: 6px; }
.pd-save {
  justify-self: start; font-size: 14px; font-weight: 700; color: var(--sale);
  background: #fdeceb; padding: 4px 10px; border-radius: 999px;
}
.pd-stock { font-size: 15px; }
.pd-actions { display: grid; gap: 10px; margin-top: 4px; }
@media (min-width: 600px) { .pd-actions { grid-template-columns: 1fr 1fr; } }
.pd-note { font-size: 14px; color: var(--muted); margin-top: -4px; }
.pd-block { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.pd-block h2 { font-size: 17px; font-weight: 800; }
.pd-desc { color: var(--ink-2); white-space: pre-line; }
.pd-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--ink-2); }
.pd-features li { display: flex; gap: 10px; align-items: flex-start; }
.pd-features li::before {
  content: ""; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; flex: none;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m5 9.3 2.6 2.6L13 6.5' fill='none' stroke='%232f3bd3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.pd-specs { margin: 0; display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.pd-specs > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 14px; }
.pd-specs > div + div { border-top: 1px solid var(--line); }
.pd-specs dt { color: var(--muted); font-size: 14.5px; }
.pd-specs dd { margin: 0; font-weight: 600; }
.related { padding-top: 36px; }

/* Loading placeholders */
.skeleton-box, .skeleton-line {
  background: linear-gradient(90deg, #f1ebe0 0%, #f8f4ed 50%, #f1ebe0 100%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.pd-skeleton .g-main { aspect-ratio: 1 / 1; }
.skeleton-line { display: block; height: 16px; border-radius: 6px; }
.skeleton-line.tall { height: 30px; }
.w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }

/* Sticky "Order Now" bar on phones */
.order-bar { display: none; }
@media (max-width: 899px) {
  body.has-order-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .order-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: center; gap: 12px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgb(255 255 255 / 97%); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgb(28 34 56 / 8%);
    transition: transform .2s ease, visibility .2s;
  }
  .order-bar.is-hidden { transform: translateY(110%); visibility: hidden; }
  .order-bar-price { display: grid; min-width: 0; flex: 1; }
  .order-bar-name { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .order-bar .price-now { font-size: 20px; }
  .order-bar .btn { min-height: 50px; padding: 0 24px; }
}

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: 10px; }
.g-main { position: relative; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.g-empty { aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--muted); }
.g-track {
  display: flex; aspect-ratio: 1 / 1;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible { outline-offset: -3px; }
.g-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; cursor: zoom-in; }
/* "contain" = the whole photo is always visible in its real proportions. */
.g-slide img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }

.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / 92%); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  transition: opacity .15s;
}
.g-nav svg { width: 22px; height: 22px; }
.g-nav:disabled { opacity: 0; pointer-events: none; }
.g-prev { left: 10px; }
.g-next { right: 10px; }
.g-counter, .lb-counter {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 700; color: #fff; background: rgb(28 34 56 / 70%);
  padding: 4px 10px; border-radius: 999px; pointer-events: none;
}
.g-zoom {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / 92%); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
}
.g-zoom svg { width: 20px; height: 20px; }

.g-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.g-thumbs::-webkit-scrollbar { display: none; }
.g-thumb {
  flex: none; width: 66px; height: 66px; padding: 3px; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); border: 2px solid transparent;
}
.g-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.g-thumb[aria-current="true"] { border-color: var(--brand); background: var(--surface); }
@media (min-width: 900px) { .g-thumb { width: 78px; height: 78px; } }

/* ---------- Full-screen photo viewer ---------- */
html.has-modal { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #0f1220; color: #fff; overflow: hidden;
}
.lightbox::backdrop { background: #0f1220; }
.lb-track {
  display: flex; width: 100%; height: 100%;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; place-items: center;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 12px calc(56px + env(safe-area-inset-bottom, 0px));
}
.lb-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; }
.lb-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / 14%); color: #fff; cursor: pointer;
}
.lb-close svg { width: 24px; height: 24px; }
.lightbox .g-nav { background: rgb(28 34 56 / 72%); color: #fff; box-shadow: 0 0 0 1px rgb(255 255 255 / 18%); width: 48px; height: 48px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-counter { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: rgb(255 255 255 / 14%); }
@media (hover: none) and (max-width: 599px) {
  /* On phones people swipe; keep arrows small and out of the way. */
  .lightbox .g-nav { width: 40px; height: 40px; }
}

/* ---------- Order page ---------- */
.btn-block { width: 100%; }
.order-page { padding-block: 12px 8px; }
.order-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.order-title { font-size: clamp(24px, 6vw, 32px); font-weight: 850; }
.order-sub { color: var(--ink-2); margin-top: 6px; }
.order-layout { display: grid; gap: 14px; margin-top: 18px; }
.order-main { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .order-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
  .order-side { position: sticky; top: calc(var(--header-h) + 16px); }
}

.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; }
@media (min-width: 600px) { .panel { padding: 22px; } }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.step {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 800;
}

.order-product { display: flex; gap: 14px; align-items: center; }
.order-product img { width: 88px; height: 88px; object-fit: contain; background: var(--surface-2); border-radius: 12px; flex: none; }
.order-product-info { display: grid; gap: 4px; min-width: 0; }
.op-name { font-weight: 700; line-height: 1.3; }
.op-change { font-size: 14px; font-weight: 600; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty-btn {
  width: 48px; height: 48px; border: 0; background: transparent; border-radius: 50%;
  font-size: 24px; font-weight: 600; line-height: 1; color: var(--brand); cursor: pointer;
}
.qty-btn:disabled { color: #c3c6d1; cursor: not-allowed; }
.qty input {
  width: 48px; height: 48px; border: 0; background: transparent; text-align: center;
  font-size: 18px; font-weight: 800; -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-hint { text-align: right; color: var(--low); font-weight: 600; min-height: 0; }
.qty-hint:empty { display: none; }

.zones { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .zones { grid-template-columns: 1fr 1fr; } }
.zone {
  position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.zone input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
.zone-text { display: grid; }
.zone-name { font-weight: 700; }
.zone-price { font-size: 14px; color: var(--ink-2); }
.zone:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.zones[aria-invalid="true"] .zone { border-color: #e6a19b; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field-label { font-weight: 700; font-size: 15px; }
.optional { font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid #ddd5c6; border-radius: var(--radius-sm); background: #fff;
  font-size: 16px; /* 16px stops iOS from zooming in */
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field [aria-invalid="true"] { border-color: var(--sale); }
.field input[readonly], .field textarea[readonly] { background: #f7f5f0; }
.field-hint { font-size: 13.5px; color: var(--muted); }
.field-error {
  font-size: 14px; font-weight: 600; color: var(--sale);
  display: flex; gap: 6px; align-items: flex-start;
}
.field-error::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--sale); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
#zone-error { margin-top: 10px; }

.summary { display: grid; gap: 14px; }
.summary .panel-title { margin-bottom: 0; }
.sum-product { display: flex; gap: 12px; align-items: center; }
.sum-product img { width: 64px; height: 64px; object-fit: contain; background: var(--surface-2); border-radius: 10px; flex: none; }
.sum-name { font-weight: 700; line-height: 1.3; }
.sum-each { font-size: 14px; color: var(--muted); }
.sum-lines { margin: 0; display: grid; gap: 8px; }
.sum-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.sum-lines dt { color: var(--ink-2); }
.sum-zone { color: var(--muted); font-size: 14px; }
.sum-lines dd { margin: 0; font-weight: 600; text-align: right; }
.sum-total { border-top: 1.5px dashed var(--line); padding-top: 12px; margin-top: 4px; align-items: baseline; }
.sum-total dt { color: var(--ink); font-weight: 800; font-size: 17px; }
.sum-total dd { font-size: 22px; font-weight: 850; color: var(--ink); }
.captcha:empty { display: none; }
.captcha { min-height: 65px; display: flex; justify-content: center; }
.fine { font-size: 13px; color: var(--muted); text-align: center; }

.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; display: grid; gap: 10px; justify-items: start; }
.alert-error { background: #fdeceb; color: #8c1d16; border: 1px solid #f3c4bf; }
.alert-warning { background: #fff6e0; color: #7a4a00; border: 1px solid #f3dca4; }
.alert:focus { outline: none; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { background: var(--brand-hover); color: #fff; cursor: progress; }

/* ---------- Order confirmation ---------- */
.confirmation { display: grid; gap: 16px; max-width: 620px; margin: 8px auto 0; }
.confirmation:focus { outline: none; }
.confirm-head { text-align: center; display: grid; gap: 8px; justify-items: center; padding-top: 12px; }
.confirm-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 68'%3E%3Cpath d='m21 35 9 9 17-19' fill='none' stroke='%23fff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
  box-shadow: 0 0 0 8px #dff3e7;
}
.confirm-head h1 { font-size: clamp(22px, 5.6vw, 30px); font-weight: 850; margin-top: 8px; }
.confirm-lead { color: var(--ink-2); }
.ref-box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  background: var(--surface); border: 2px dashed var(--brand); border-radius: var(--radius); padding: 14px 18px;
}
.ref-label { grid-column: 1; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ref-code { grid-column: 1; font-size: clamp(18px, 5.4vw, 28px); font-weight: 850; letter-spacing: .02em; color: var(--ink); user-select: all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  grid-column: 2; grid-row: 1 / span 2; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--brand); background: var(--surface); color: var(--brand); font-weight: 700; cursor: pointer;
}
@media (max-width: 379px) {
  .ref-box { grid-template-columns: minmax(0, 1fr); }
  .copy-btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
}
.confirm-summary { display: grid; gap: 14px; }
.next-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.next-steps .panel-title { margin-bottom: 10px; }
.confirm-actions { display: grid; gap: 10px; justify-items: stretch; }
@media (min-width: 600px) { .confirm-actions { grid-template-columns: 1fr 1fr; } }
.link-subtle { grid-column: 1 / -1; justify-self: center; font-size: 14.5px; font-weight: 600; color: var(--ink-2); padding: 8px; }

/* Shown only when a page is opened by double-clicking (file://) */
.file-warning {
  max-width: var(--max); margin: 16px auto; padding: 16px 18px; display: grid; gap: 8px;
  background: #fff6e0; color: #5c3a00; border: 1.5px solid #f3dca4; border-radius: var(--radius-sm);
  width: calc(100% - 2 * var(--gutter));
}
.file-warning-cmd { display: block; padding: 10px 12px; background: #1c2238; color: #fff; border-radius: 8px; overflow-x: auto; white-space: nowrap; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
