/* ===========================================================================
   Suman Agro - component layer.

   Tailwind (CDN) supplies the utilities; this file defines the handful of
   repeated components so that a button, card or field looks the same on every
   page. Colours are declared as CSS variables mirroring the Tailwind config,
   so a component here and a utility class there never drift apart.
   =========================================================================== */

:root {
  /* A muted forest ground with a pale-mint accent. The accent is deliberately
     desaturated: a bright saturated green reads as cheap on a dark page, while
     mint against deep green reads as considered. */
  --base:       #131a16;
  --surface:    #1c2620;
  --surface2:   #25322b;
  --line:       #35453c;
  --line2:      #4a5d51;

  --primary:    #befab9;   /* pale mint - buttons, links, accents */
  --primaryDk:  #d3f7cd;   /* hover: lighter, not darker */
  --primaryInk: #16301a;   /* text that sits on mint */
  --sage:       #5d8550;   /* selected / active state */
  --sageInk:    #f1f5ef;

  --accent:     #e8d5a3;   /* soft wheat, for offers and warnings */
  --accentInk:  #3a2f14;

  --muted:      #b4c6b7;   /* secondary copy - lifted for readability */
  --cream:      #f1f5ef;
  --radius:     1.25rem;
}

/* Base type scale. 17px body is deliberate - this is a shop read at arm's length,
   often on a phone in a field, so nothing important sits below 14px. */
html { font-size: 17.5px; }
body { font-size: 1rem; line-height: 1.7; letter-spacing: -0.003em; }

/* Paragraph copy gets a comfortable measure rather than running the full width. */
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* Devanagari sits on a taller baseline; give it a little more room to breathe. */
html.lang-hi body { line-height: 1.75; }
html.lang-hi h1, html.lang-hi h2, html.lang-hi h3 { line-height: 1.4; }

body { -webkit-font-smoothing: antialiased; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
}

/* --------------------------------------------------------------- a11y ---- */
.skip-link {
  color: var(--primaryInk);
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--primary);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.75rem 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ nav ------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .18s ease, background-color .18s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--cream); background: var(--surface); }
.nav-link-active { color: var(--sageInk); background: var(--sage); }
.nav-link-active:hover { color: var(--sageInk); background: var(--sage); }

.dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  padding-top: 0.6rem;
  min-width: 14rem;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.group:hover > .dropdown,
.group:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-panel {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.375rem;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .75);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 0.7rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.dropdown-item:hover { background: var(--surface2); color: var(--cream); }

.icon-btn {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--primaryInk); }

/* Same chrome as .icon-btn but laid out in a row, for icon + label pills
   such as the language switch. .icon-btn is a grid, which would stack them. */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.pill-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--primaryInk); }

/* ---------------------------------------------------------- buttons ----- */
.btn-primary, .btn-ghost, .btn-accent, .btn-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 9999px;
  padding: 0.8rem 1.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform .15s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primaryInk); }
.btn-primary:hover { background: var(--primaryDk); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--accentInk); }
.btn-accent:hover { background: var(--accentDk); transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(190,250,185,.07); }
.btn-disabled {
  background: var(--surface2);
  color: var(--muted);
  cursor: not-allowed;
}

/* ------------------------------------------------------------ cards ----- */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: var(--line2);
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, .8);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary); color: var(--primaryInk); }
.badge-accent  { background: var(--accent);  color: var(--accentInk); }
.badge-muted   { background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }

/* ------------------------------------------------------------ text ------ */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-title {
  font-family: Manrope, 'Noto Sans Devanagari', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--cream);
}
.footer-heading {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
}
.footer-link {
  font-size: 0.93rem;
  color: var(--muted);
  transition: color .15s ease;
}
.footer-link:hover { color: var(--primary); }

.line-clamp-2, .line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* ----------------------------------------------------------- forms ------ */
.field-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Element+class beats the forms plugin's bare [type=...] selectors, which are
   injected by the Tailwind CDN after this file and would otherwise win on order. */
input.field-input,
select.field-select,
textarea.field-textarea,
input[type="text"].field-input,
input[type="email"].field-input,
input[type="password"].field-input,
input[type="number"].field-input,
input[type="search"].field-input,
input[type="tel"].field-input {
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: var(--base);
  padding: 0.8rem 1.05rem;
  font-size: 0.97rem;
  color: var(--cream);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input.field-input::placeholder,
textarea.field-textarea::placeholder { color: rgba(180, 198, 183, .55); }

input.field-input:focus,
select.field-select:focus,
textarea.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  outline: none;
  background-color: var(--base);
  color: var(--cream);
}
textarea.field-textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }

/* Belt and braces: any input inside a card is dark-themed, whatever classes it
   happens to carry. This is what keeps typed text visible. */
.card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.card select,
.card textarea {
  color: var(--cream);
  color-scheme: dark;
}

/* Chrome paints autofilled fields with a light background, which is unreadable on a
   dark form. The inset shadow trick is the only reliable way to override it. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0 1000px var(--base) inset;
  caret-color: var(--cream);
  transition: background-color 9999s ease-out 0s;
}

/* Native pickers (date, select arrows, search cancel) default to a light UI. */
.field-input, .field-select, .field-textarea { color-scheme: dark; }
.field-hint { margin-top: 0.35rem; font-size: 0.75rem; color: var(--muted); }

/* Quantity steppers.
   These sit inside a rounded pill on a dark ground. Left to the browser, a
   number input renders with the platform's dark-on-light default and the digit
   disappears, so the colour, the background and the spinner are all stated. */
input.qty-input,
input[type="number"].qty-input {
  width: 3.5rem;
  border: 0;
  background-color: transparent;
  background-image: none;
  padding: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
  -moz-appearance: textfield;
  appearance: textfield;
  color-scheme: dark;
}
input.qty-input:focus,
input[type="number"].qty-input:focus {
  outline: none;
  box-shadow: none;
  border: 0;
  background-color: transparent;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border-radius: 9999px;
  border: 1px solid var(--line2);
  background: var(--base);
}
.qty-step-btn {
  display: grid;
  place-items: center;
  height: 2.6rem;
  width: 2.6rem;
  color: var(--muted);
  transition: color .15s ease, background-color .15s ease;
}
.qty-step-btn:hover { color: var(--primary); background: var(--surface2); }

/* Pack chooser. The whole tile is the hit target, not just the radio, and the
   selected state is carried by a class so it survives a server re-render. */
/* ---------------------------------------------- admin section editing ---- */

/* Locked preview: the fields are visibly present but inert, so an accidental
   keystroke cannot change anything. A disabled fieldset is also never submitted. */
.section-locked input,
.section-locked select,
.section-locked textarea {
  cursor: default;
  opacity: .85;
  background: var(--surface2) !important;
  border-color: var(--line) !important;
  color: var(--cream) !important;
  -webkit-text-fill-color: var(--cream);
}
.section-locked textarea { resize: none; }

.edit-dialog {
  width: min(64rem, 94vw);
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--cream);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
}
.edit-dialog::backdrop {
  background: rgba(6, 10, 8, .72);
  backdrop-filter: blur(3px);
}
.edit-dialog[open] { animation: dialog-in .18s cubic-bezier(.22, 1, .36, 1); }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.gallery-thumb {
  flex: 0 0 auto;
  height: 4.5rem;
  width: 4.5rem;
  overflow: hidden;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: var(--surface2);
  opacity: .6;
  transition: opacity .15s ease, border-color .15s ease;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb-active { opacity: 1; border-color: var(--primary); }

/* One rung of the quantity price ladder; the active one is highlighted live. */
.tier-row { transition: background-color .15s ease; }
.tier-row-active {
  background: rgba(190, 250, 185, .10);
  box-shadow: inset 3px 0 0 var(--primary);
}
.tier-row-active span { color: var(--cream); }

.pack-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--base);
  padding: 0.9rem 1.1rem;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.pack-option:hover { border-color: var(--line2); }
.pack-option-selected {
  border-color: var(--primary);
  background: rgba(190, 250, 185, .07);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.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;
}

/* ------------------------------------------------------- notifications -- */
.flash {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 1rem;
  border: 1px solid;
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.flash-success { border-color: rgba(190, 250, 185, .32); background: rgba(190, 250, 185, .10); color: #cdf5c8; }
.flash-error   { border-color: rgba(240, 140, 140, .32); background: rgba(240, 140, 140, .10); color: #f4bcbc; }

#toast {
  color: var(--primaryInk);
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 150%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: var(--primary);
  padding: 0.7rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
#toast.show { transform: translate(-50%, 0); }

/* -------------------------------------------------------- timeline ------ */
.timeline-dot {
  display: grid;
  place-items: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 9999px;
  border: 2px solid var(--line2);
  background: var(--surface);
  color: var(--muted);
  flex-shrink: 0;
}
.timeline-dot-done {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primaryInk);
}

/* ------------------------------------------------------ admin shell ----- */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.admin-nav-link:hover { background: var(--surface2); color: var(--cream); }
.admin-nav-active { background: var(--sage); color: var(--sageInk); }
.admin-nav-active:hover { background: var(--sage); color: var(--sageInk); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--cream);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--surface2); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-PLACED     { background: rgba(232, 213, 163, .18); color: #e8d5a3; }
.status-PROCESSING { background: rgba(138, 180, 248, .18); color: #a8c7fa; }
.status-SHIPPED    { background: rgba(190, 170, 250, .18); color: #c9bafb; }
.status-DELIVERED  { background: rgba(190, 250, 185, .18); color: #befab9; }
.status-CANCELLED  { background: rgba(240, 140, 140, .18); color: #f2a8a8; }

/* Print an order sheet without the site furniture. */
@media print {
  header, footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------- menu drag and drop --- */
/* The grip is the only drag surface, so text stays selectable everywhere else. */
.menu-grip {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  color: var(--muted);
  cursor: grab;
}
.menu-grip:hover { background: var(--surface2); color: var(--primary); }
.menu-grip:active { cursor: grabbing; }

.menu-row { transition: opacity .12s ease, background-color .12s ease; }
.menu-row.dragging { opacity: .4; }

/* Where the row will land: a line above or below, a filled outline for nesting. */
.menu-row.drop-before { box-shadow: inset 0 3px 0 0 var(--primary); }
.menu-row.drop-after  { box-shadow: inset 0 -3px 0 0 var(--primary); }
.menu-row.drop-into {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  box-shadow: inset 0 0 0 2px var(--primary);
}

/* ------------------------------------------------- mobile action bar ---- */
/*
   Pinned within thumb reach on a phone. safe-area-inset keeps it clear of the
   iPhone home indicator instead of sitting underneath it.
*/
.mobile-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.125rem;
  padding: 0.375rem 0.25rem calc(0.375rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.mobile-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 46px;             /* comfortable tap target */
  padding: 0.25rem 0.125rem;
  border-radius: 0.7rem;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-align: center;
}
.mobile-bar-item.is-active { color: var(--primary); background: var(--surface2); }
.mobile-bar-item:active { background: var(--surface2); }

/* Room so the bar never covers the last line of the footer. */
@media (max-width: 1023px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------ sticky buy bar -- */
/* Sits directly above the phone action bar, never over it. */
.buy-bar {
  position: fixed;
  inset-inline: 0;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 44;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.buy-bar[hidden] { display: none; }

/* --------------------------------------------------- category chips ----- */
/* One scrolling line on a phone instead of an eleven-row rail. */
.chip-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
  scroll-snap-type: x proximity;
  /* Bleed to the screen edges so the strip reads as scrollable. */
  margin-inline: -1rem;
  padding-inline: 1rem;
}
.chip-strip::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: 40px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.is-active { background: var(--sage); border-color: var(--sage); color: var(--cream); }
.chip-count { font-size: 12.5px; opacity: .7; }

/* ------------------------------------------------- category tiles ------- */
/* The phone stand-in for the desktop category cards: art, name, one line. */
.cat-tile {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 72px;
  scroll-snap-align: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.cat-tile-art {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface2);
  color: var(--primary);
}
.cat-tile-art img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}
.cat-tile:active .cat-tile-art { border-color: var(--primary); }

/* --------------------------------------------- picks quick-add button --- */
.pick-add {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--primary);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.pick-add:hover, .pick-add:active { background: var(--primary); color: var(--primaryInk); }

/* Trust points read as one scrollable line on a phone, a wrapped list above sm. */
@media (max-width: 639px) {
  .trust-line { max-width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .trust-line::-webkit-scrollbar { display: none; }
}

/* ------------------------------------------- mobile preview (temporary) - */
/* Development aid; removed by setting dev_mobile_preview to 0. */
.preview-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--cream);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgb(0 0 0 / .45);
}
.preview-fab:hover { border-color: var(--primary); color: var(--primary); }

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgb(0 0 0 / .72);
  backdrop-filter: blur(4px);
}
.preview-overlay[hidden] { display: none; }

.preview-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / .6);
}
.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
}
.preview-size {
  min-width: 40px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.preview-size.is-active { border-color: var(--primary); color: var(--primary); }
.preview-shell iframe { display: block; border: 0; background: var(--base); }

/* ------------------------------------------------ cart / checkout bar --- */
/* Same shape as the product buy bar. On checkout the tab bar is hidden, so this
   sits on the safe-area edge instead of above it. */
.summary-bar {
  position: fixed;
  inset-inline: 0;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 44;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
body:not(:has(.mobile-bar)) .summary-bar { bottom: env(safe-area-inset-bottom); }
