/* ==========================================================================
   Donia Store - warm beige / coffee design system (LIGHT ONLY)

   NOTE: this site is permanently locked to the light theme. Dark mode was
   removed, so there is no `html.dark` branch anywhere in this file and no
   `dark:` variant in the markup. The one value every rule below has to clear
   is 4.5:1 (3:1 for text >= 24px or >= 18.66px bold) against the light
   surfaces: #FDFBF7 page, #FFFFFF cards, #F7F1E8 / #EFE3D2 tints.

   PALETTE (mirrors `tailwind.config.colors` in index.html - keep in sync).
   Defining the ramp once per file means the ~200 Tailwind utilities in the
   markup and every hand-written rule below resolve to the same warm tones:

     sand   50 #FDFBF7 (cream) . 400 #B9A78D . 800 #3A2F25 . 950 #1A140F
     coffee 50 #F7F1E8 . 300 #CBAE8C . 500 #8B5A2B . 600 #6F4E37 . 950 #241811

   Two cases drove the non-obvious values:
     - a muted tone needs a LIGHT step (#7D6B55 works on white; #B9A78D does
       not), so the "muted" greys are warm browns, never neutral grey.
     - gradient-filled controls paint via `background-image`, so the solid
       fallback is irrelevant; each end of every gradient is checked anyway.
   ========================================================================== */

:root {
  /* Z-Index Hierarchy Matrix - the single source of truth for stacking. */
  --z-base: 1;
  --z-card-interactive: 10;
  --z-header: 30;
  --z-backdrop: 40;
  --z-drawer: 50;
  --z-modal: 60;
  /* The WhatsApp button. Deliberately BELOW --z-toast.
     Both are fixed, both sit at bottom-4, and at equal z-index the winner is
     whichever appears later in the document — which put the button over the toasts
     on any screen narrow enough for the toast column to reach it. */
  --z-fab: 65;
  --z-toast: 70;

  /* Brand accents */
  --color-primary: #8B5A2B;
  --color-primary-hover: #6F4E37;
  --color-espresso: #241811;

  /* Header = announcement bar (2rem) + controls row (4rem) */
  --header-h: calc(6rem + env(safe-area-inset-top, 0px));

  /* Warm neutrals ("slate") */
  --sand-50: #FDFBF7;
  --sand-100: #F8F2E9;
  --sand-200: #EFE5D6;
  --sand-300: #E1D3BF;
  --sand-400: #B9A78D;
  --sand-500: #7D6B55;
  --sand-600: #63533F;
  --sand-700: #4E4032;
  --sand-800: #3A2F25;
  --sand-900: #2A221A;
  --sand-950: #1A140F;

  /* Coffee / sand accent ramp */
  --coffee-50: #F7F1E8;
  --coffee-100: #EFE3D2;
  --coffee-200: #DFCDB2;
  --coffee-300: #CBAE8C;
  --coffee-400: #BB9468;
  --coffee-500: #8B5A2B;
  --coffee-600: #6F4E37;
  --coffee-700: #5A3D2B;
  --coffee-800: #4A3223;
  --coffee-900: #3A271B;
  --coffee-950: #241811;

  /* Semantic */
  --ok: #1F6B4F;
  --warn: #8A5E12;
  --danger: #9F1239;
}

/* ==========================================================================
   BASE
   ========================================================================== */

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  scrollbar-gutter: stable;
}

body {
  font-family: Cairo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  overflow-x: hidden;
  user-select: none;
}

input,
textarea,
select {
  user-select: text;
}

/* Pushes <main> below the fixed header. */
.with-header-offset {
  padding-top: var(--header-h);
}

body.is-locked {
  overflow: hidden;
  touch-action: none;
}

/* ==========================================================================
   SCROLLBARS
   ========================================================================== */

.no-scrollbar::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(125, 107, 85, 0.28);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(125, 107, 85, 0.5);
}

/* ==========================================================================
   GLASSMORPHISM - warm, not the blue-grey default
   ========================================================================== */

.glassmorphism {
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ==========================================================================
   DECORATIVE PAGE GLOW
   --------------------------------------------------------------------------
   Driven from CSS rather than utility classes so these warm blobs can never
   drift out of the palette. The whole layer is [data-decorative] (see below)
   and therefore never receives pointer events.
   ========================================================================== */

.decor-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
}

.decor-blob--a {
  top: -10rem;
  inset-inline-start: -8rem;
  width: 28rem;
  height: 28rem;
  background-color: rgba(139, 90, 43, 0.22);
}

.decor-blob--b {
  bottom: -13rem;
  inset-inline-end: -8rem;
  width: 34rem;
  height: 34rem;
  background-color: rgba(111, 78, 55, 0.2);
}

.decor-blob--c {
  inset-inline-start: 33%;
  top: 33%;
  width: 18rem;
  height: 18rem;
  background-color: rgba(203, 174, 140, 0.3);
}

.decor-vignette {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(74, 50, 35, 0.1) 100%
  );
}

/* ==========================================================================
   ANNOUNCEMENT BAR
   ========================================================================== */

.announce-bar {
  min-height: 2rem;
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(139, 90, 43),
    rgb(74, 50, 35)
  );
  color: rgb(253, 251, 247);
  border-bottom: 1px solid rgba(74, 50, 35, 0.35);
}

.announce-dot {
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background-color: rgb(232, 200, 155);
  animation: announcePulse 2.4s ease-in-out infinite;
}

@keyframes announcePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.65);
  }
}

/* ==========================================================================
   Z-INDEX + OVERLAY PRIMITIVES
   --------------------------------------------------------------------------
   The matrix lives in :root (--z-*). Everything below only wires those
   variables to selectors so the hierarchy is never stated twice.
   ========================================================================== */

#global-backdrop {
  z-index: var(--z-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* `.active` is the ONLY thing that makes the backdrop interactive. */
#global-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

header {
  z-index: var(--z-header);
}

#sidebar-drawer,
#cart-drawer {
  z-index: var(--z-drawer);
}

#checkout-modal,
#reset-modal,
#about-modal,
#wishlist-modal,
#order-done-modal,
#order-detail-modal {
  z-index: var(--z-modal);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility linear 0.25s;
}

#checkout-modal.active,
#reset-modal.active,
#about-modal.active,
#wishlist-modal.active,
#order-done-modal.active,
#order-detail-modal.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s, visibility linear;
}

#checkout-modal .modal-content,
#reset-modal .modal-content,
#about-modal .modal-content,
#wishlist-modal .modal-content,
#order-done-modal .modal-content,
#order-detail-modal .modal-content {
  pointer-events: auto;
}

/* Split deliberately: the noscript fallback covers the page, so it stays with
   the toasts, while the floating button sits below them. */
#toast-container,
body > noscript > div {
  z-index: var(--z-toast);
}

#wa-fab {
  z-index: var(--z-fab);
}

#toast-container {
  pointer-events: none;
}

#toast-container > * {
  pointer-events: auto;
}

/* Drawers: sidebar slides in from the LEFT, cart from the RIGHT. */
#sidebar-drawer {
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility linear 0.35s;
}

#sidebar-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility linear;
}

#cart-drawer {
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility linear 0.35s;
}

#cart-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility linear;
}

.modal-content {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   SECTION HEADINGS / CHIPS
   ========================================================================== */

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.6;
  color: var(--sand-900);
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.5rem;
  }
}

.section-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--sand-500);
}

.section-badge {
  flex-shrink: 0;
  border: 1px solid var(--coffee-200);
  border-radius: 9999px;
  background-color: var(--coffee-50);
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--coffee-700);
}

.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.85rem;
  background-color: #fff;
  padding: 0.6rem 0.85rem;
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: nowrap;
}

/* ==========================================================================
   PRODUCT PAGE HEADER — the price sort

   There is no .results-scope rule any more, and no #results-count to wrap:
   the section that named the active category and budget is gone with the
   homepage's grid. A product page has a real heading (كل المنتجات / ملابس
   حريمي / المنتجات الاقتصادية) instead, so the count line beside the sort
   needs to say only how many of them there are. Dead rules are a hazard —
   a style that survives its element is a claim about the design that is no
   longer true.
   ========================================================================== */

/* The native control is kept rather than restyled with appearance:none: the
   browser places the dropdown arrow on the correct side for dir="rtl" on its
   own, and a background-image arrow would have to re-derive that by hand and
   would then be wrong the moment the page direction changed. The roomier
   inline-end padding is what keeps the longest option clear of that arrow. */
.sort-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sand-700);
  white-space: nowrap;
}

.sort-select {
  height: 2.4rem;
  max-width: 100%;
  border: 1px solid var(--sand-200);
  border-radius: 0.7rem;
  background-color: #fff;
  padding-inline: 0.7rem 1.9rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sand-800);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-select:hover {
  border-color: var(--coffee-500);
}

.sort-select:focus {
  border-color: var(--coffee-500);
  box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15);
}

/* "رجوع للرئيسية" — the way off a listing page and back to the whole shop.
   Sized to clear the 44px touch-target floor on phones (the visual pill is
   smaller, the padding is not), and given a real focus ring rather than relying
   on the hover state, because arriving here by keyboard is the normal case for
   a page reached from a link. */
.back-home {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.8rem;
  background-color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sand-800);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.back-home:hover {
  border-color: var(--coffee-500);
  color: var(--sand-900);
}

.back-home:focus-visible {
  border-color: var(--coffee-500);
  box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15);
}

.back-home:active {
  transform: scale(0.97);
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.nav-heading {
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sand-500);
}

.nav-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.85rem;
  background: none;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: start;
  color: var(--sand-800);
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover {
  background-color: var(--coffee-50);
  color: var(--coffee-700);
}

/* ==========================================================================
   CATEGORY PILLS
   ========================================================================== */

.cat-pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--sand-200);
  border-radius: 9999px;
  background-color: #fff;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--sand-600);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s,
    box-shadow 0.2s, transform 0.1s;
}

.cat-pill:hover {
  border-color: var(--coffee-500);
  color: var(--coffee-700);
}

.cat-pill:active {
  transform: scale(0.95);
}

.cat-pill.active {
  border-color: var(--coffee-600);
  background-color: var(--coffee-600);
  color: #fff;
  box-shadow: rgba(111, 78, 55, 0.9) 0 8px 18px -10px;
}

/* ==========================================================================
   BUDGET TIER CARDS
   --------------------------------------------------------------------------
   `--tier-accent` is the vivid tone used for rings, price labels and the range
   line; `--tier-tint` is its translucent wash behind the emoji/glow. Each
   accent clears 4.5:1 on the white card.
   ========================================================================== */

.budget-tier-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s,
    border-color 0.25s;
}

.budget-tier-card:hover {
  transform: translateY(-2px);
}

.budget-tier-card.active-tier {
  border-color: var(--tier-accent);
  box-shadow: 0 0 0 2px var(--tier-accent), 0 12px 26px -14px var(--tier-accent);
  transform: translateY(-2px);
}

.budget-tier-card[data-tier="economic"] {
  --tier-accent: #2e6b4f;
  --tier-tint: rgba(46, 107, 79, 0.14);
}

.budget-tier-card[data-tier="medium"] {
  --tier-accent: #8b5a2b;
  --tier-tint: rgba(139, 90, 43, 0.14);
}

.budget-tier-card[data-tier="premium"] {
  --tier-accent: #8a5e12;
  --tier-tint: rgba(138, 94, 18, 0.16);
}

.budget-tier-card[data-tier="luxury"] {
  --tier-accent: #7a2e42;
  --tier-tint: rgba(122, 46, 66, 0.14);
}

.tier-glow {
  position: absolute;
  top: -2rem;
  inset-inline-end: -2rem;
  width: 6rem;
  height: 6rem;
  border-radius: 9999px;
  background-color: var(--tier-tint);
  filter: blur(16px);
  opacity: 0.85;
  transition: opacity 0.25s;
  pointer-events: none;
}

.budget-tier-card:hover .tier-glow {
  opacity: 1;
}

.tier-emoji {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background-color: var(--tier-tint);
  font-size: 1.05rem;
}

.tier-range {
  color: var(--tier-accent);
}

/* ==========================================================================
   HORIZONTAL RAILS (best sellers / discounted)
   ========================================================================== */

.rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  margin-inline: -0.25rem;
  padding: 0.25rem 0.25rem 0.5rem;
  scroll-snap-type: x;
}

.rail-item {
  flex: 0 0 calc(50% - 0.375rem);
  min-width: 0;
  scroll-snap-align: start;
}

.rail-item > .product-card {
  height: 100%;
}

@media (min-width: 640px) {
  .rail {
    gap: 1rem;
  }
  .rail-item {
    flex-basis: calc(33.333% - 0.666rem);
  }
}

@media (min-width: 1024px) {
  .rail-item {
    flex-basis: calc(25% - 0.75rem);
  }
}

/* ==========================================================================
   PRODUCT CARDS
   ========================================================================== */

.product-card {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
  background-color: #fff;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: rgba(139, 90, 43, 0.45) 0 18px 35px -20px;
  border-color: rgba(139, 90, 43, 0.55);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  /* A floor and a cap in addition to the ratio: a card image can never
     collapse to nothing, and a gigantic source photo (a 4000px tall upload)
     can never blow the grid apart — object-fit: cover crops the overflow.
     The cap matches the forced 220px card-image height a few rules below, so
     the fixed height and this container never disagree and no dark gutter can
     appear behind a short image. */
  min-height: 12rem;
  max-height: 220px;
  background-image: linear-gradient(
    135deg,
    rgb(200, 159, 123) 0%,
    rgb(111, 78, 55) 100%
  );
}

.product-image-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Forced store-card image sizing: every card image is a uniform 220px cover
   crop on every breakpoint, immune to the source image's intrinsic size or to
   any other rule fighting over the height. */
.product-card img,
.product-image-container img {
  width: 100% !important;
  height: 220px !important;
  object-fit: cover !important;
  display: block !important;
}

.product-card:hover .product-image-container img {
  transform: scale(1.08);
}

.product-badges {
  position: absolute;
  top: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  pointer-events: none;
}

.product-badge {
  border-radius: 9999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.5;
  color: #fff;
  background-color: #6b2438;
  box-shadow: rgba(36, 24, 17, 0.5) 0 4px 10px -3px;
}

.product-badge.is-discount {
  background-color: #1f6b4f;
}

.product-badge.is-hot {
  background-color: #8a5e12;
}

.product-badge.is-new {
  background-color: #6b2438;
}

/* ---- Low stock / out of stock ------------------------------------------------
   `stockHTML()` in app.js emits nothing at all when a product is well stocked,
   so these rules only ever paint the two states that need attention. The
   urgency line is a quiet amber rather than a red alarm: it is a nudge, not an
   error, and a customer who is told the shop is panicking tends to distrust the
   whole page. The sold-out line is grey and struck through the price, because
   when the button is disabled the reason has to be visible without one.
   -------------------------------------------------------------------------- */
.product-stock {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
}

.product-stock.is-low {
  color: #8a5e12;
}

.product-stock.is-out {
  color: #94a3b8;
}

/* A sold-out card should not read as buyable: the photo dims rather than
   disappearing, so the product is still recognisable in the grid. */
.product-card.is-sold-out .product-image-container {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.product-card.is-sold-out .product-price {
  opacity: 0.6;
}

/* The disabled button has to carry the whole phrase "غير متوفر حالياً", which is
   far wider than the round "+" it replaces, so it becomes a pill that spans the
   price row instead of sitting in the corner. */
.product-card.is-sold-out .product-price-row {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.add-to-cart-btn.is-out {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 2rem;
  padding: 0 0.7rem;
  border-radius: 9999px;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: no-preference) {
  .product-stock.is-low {
    animation: stock-pulse 2.4s ease-in-out infinite;
  }
}

@keyframes stock-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

.heart-btn {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  z-index: 6;
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--sand-600);
  box-shadow: rgba(36, 24, 17, 0.45) 0 4px 10px -4px;
  transition: transform 0.15s, color 0.15s, background-color 0.15s;
}

.heart-btn.is-inline {
  position: static;
  flex-shrink: 0;
}

.heart-btn:hover {
  color: #9f1239;
  transform: scale(1.08);
}

.heart-btn:active {
  transform: scale(0.85);
}

.heart-btn.is-wished {
  color: #9f1239;
  background-color: rgba(159, 18, 57, 0.12);
}

.heart-btn.is-wished svg {
  fill: #9f1239;
}

.product-body {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem;
}

.product-category {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--coffee-600);
}

.product-name {
  display: -webkit-box;
  min-height: 2.5em;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.6;
  color: var(--sand-900);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* The card is the link now, so the name is a real <a>. It has to stop looking
   like a link, because an underline on every card would out-shout the price —
   but it must keep a focus ring, because it is now the way a keyboard user
   reaches a product at all. It is the only tab stop inside the card apart from
   the heart and the add button, and those two are things you can already guess
   are buttons. */
.product-name-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.product-name-link:hover {
  color: var(--coffee-600);
}

.product-name-link:focus-visible {
  border-radius: 0.25rem;
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
}

.product-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--sand-900);
}

/* The "was" price inside a cart row and a wishlist row.

   The markup has always emitted .cart-item-was in both places and nothing styled
   it, so the old price rendered at the same size and weight as the current one and
   read as part of the live figure rather than as a struck-through comparison.
   Given a row like "320 ج.م  400 ج.م" that is a real misreading, not a missing
   nicety. */
.cart-item-was {
  color: var(--sand-400);
  text-decoration: line-through;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.product-old-price {
  font-size: 0.65rem;
  color: var(--sand-600);
  text-decoration: line-through;
}

.add-to-cart-btn {
  display: flex;
  height: 2.1rem;
  width: 2.1rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(36, 24, 17)
  );
  color: #fff;
  box-shadow: rgba(111, 78, 55, 0.7) 0 6px 14px -6px;
  transition: transform 0.15s, opacity 0.2s;
}

.add-to-cart-btn:hover {
  opacity: 0.9;
}

.add-to-cart-btn:active {
  transform: scale(0.88);
}

.add-to-cart-btn.is-added {
  background-image: linear-gradient(to left, rgb(31, 107, 79), rgb(20, 63, 48));
  pointer-events: none;
}

/* ==========================================================================
   CART + WISHLIST ROWS
   ========================================================================== */

.cart-item,
.wishlist-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.9rem;
  background-color: #fff;
  padding: 0.6rem;
  animation: itemIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes itemIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item-thumb,
.wishlist-item-thumb {
  height: 3.25rem;
  width: 3.25rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.7rem;
  background-image: linear-gradient(
    135deg,
    rgb(200, 159, 123),
    rgb(111, 78, 55)
  );
}

.cart-item-thumb img,
.wishlist-item-thumb img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.cart-item-info,
.wishlist-item-info {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  flex-direction: column;
  gap: 0.15rem;
}

.cart-item-name,
.wishlist-item-name {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--sand-900);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-unit,
.wishlist-item-unit {
  font-size: 0.65rem;
  color: var(--sand-600);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.6rem;
  padding: 0.1rem;
}

.qty-stepper button {
  display: flex;
  height: 1.5rem;
  width: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  color: var(--sand-600);
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.qty-stepper button:hover:not(:disabled) {
  background-color: var(--coffee-600);
  color: #fff;
}

.qty-stepper button:active:not(:disabled) {
  transform: scale(0.88);
}

.qty-stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-value {
  min-width: 1.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--sand-900);
  user-select: none;
}

.cart-item-line-total {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--coffee-600);
  white-space: nowrap;
  text-align: end;
}

.remove-item-btn {
  display: flex;
  height: 1.85rem;
  width: 1.85rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--sand-600);
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}

.remove-item-btn:hover {
  background-color: rgba(159, 18, 57, 0.1);
  color: #9f1239;
}

.remove-item-btn:active {
  transform: scale(0.85);
}

.wishlist-item .wishlist-add-btn {
  flex-shrink: 0;
  border-radius: 0.6rem;
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(36, 24, 17)
  );
  padding: 0.4rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}

.wishlist-item .wishlist-add-btn:hover {
  opacity: 0.9;
}

.wishlist-item .wishlist-add-btn:active {
  transform: scale(0.94);
}

#co-summary li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  line-height: 1.6;
}

#co-summary .co-qty {
  flex-shrink: 0;
  border-radius: 9999px;
  background-color: rgba(139, 90, 43, 0.14);
  padding: 0.05rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--coffee-600);
  white-space: nowrap;
}

/* ==========================================================================
   TOASTS
   ========================================================================== */

#toast-container {
  max-width: min(22rem, calc(100vw - 2rem));
}

.toast-item {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.85rem;
  background-color: rgba(255, 255, 255, 0.97);
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sand-900);
  box-shadow: rgba(36, 24, 17, 0.5) 0 18px 35px -18px;
  backdrop-filter: blur(10px);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-item.leaving {
  animation: toastSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.toast-icon {
  display: flex;
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.toast-item[data-type="success"] .toast-icon {
  color: #1f6b4f;
  background-color: rgba(31, 107, 79, 0.13);
}

.toast-item[data-type="error"] .toast-icon {
  color: #9f1239;
  background-color: rgba(159, 18, 57, 0.12);
}

.toast-item[data-type="info"] .toast-icon {
  color: #6f4e37;
  background-color: rgba(111, 78, 55, 0.12);
}

.toast-item[data-type="cart"] .toast-icon {
  color: #8a5e12;
  background-color: rgba(138, 94, 18, 0.12);
}

.toast-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   MISC PRIMITIVES
   ========================================================================== */

[data-decorative] {
  pointer-events: none;
  user-select: none;
}

.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1rem;
  z-index: 100;
  border-radius: 0.75rem;
  background-color: var(--coffee-600);
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--coffee-600);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

:focus:not(:focus-visible) {
  outline: none;
}

@keyframes badgePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

.badge-pop {
  animation: badgePop 0.3s ease-out;
}

/* ==========================================================================
   AUTH + ACCOUNT VIEWS
   --------------------------------------------------------------------------
   The sign-up / login / account screens are routed views inside index.html
   (`#view-auth`) rather than separate documents, so the site stays a
   3-file, no-build-step static bundle.
   ========================================================================== */

.view[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 27rem;
  border: 1px solid var(--sand-200);
  border-radius: 1.25rem;
  background-color: #fff;
  box-shadow: 0 24px 50px -32px rgba(36, 24, 17, 0.5);
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 2rem;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.auth-logo {
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(36, 24, 17)
  );
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--sand-900);
  text-align: center;
}

.auth-sub {
  margin-top: 0.3rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--sand-500);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin: 1.25rem 0 1rem;
  border-radius: 0.85rem;
  background-color: var(--sand-100);
  padding: 0.25rem;
}

.auth-tab {
  border-radius: 0.65rem;
  padding: 0.55rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--sand-600);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.auth-tab[aria-selected="true"] {
  background-color: #fff;
  color: var(--coffee-700);
  box-shadow: 0 2px 8px -4px rgba(36, 24, 17, 0.4);
}

.field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sand-700);
}

.field-input {
  width: 100%;
  height: 2.75rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.7rem;
  background-color: #fff;
  padding-inline: 0.85rem;
  font-size: 0.85rem;
  color: var(--sand-800);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input::placeholder {
  color: var(--sand-500);
}

.field-input:focus {
  border-color: var(--coffee-500);
  box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15);
}

.field-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(159, 18, 57, 0.12);
}

/* A textarea carrying .field-input would inherit the single-line height above
   and clip its own second row, so the box grows with its `rows` instead. Only
   textareas are affected - every input keeps the fixed 2.75rem. */
textarea.field-input {
  height: auto;
  min-height: 4.5rem;
  padding-block: 0.55rem;
  line-height: 1.5;
  resize: vertical;
}

.field-hint {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--sand-500);
}

.field-error {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.auth-alert {
  margin-bottom: 0.9rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.7rem;
  background-color: var(--sand-50);
  padding: 0.65rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
}

.auth-alert:empty {
  display: none;
}

.auth-alert[data-tone="error"] {
  border-color: rgba(159, 18, 57, 0.3);
  background-color: rgba(159, 18, 57, 0.06);
  color: #8c0f33;
}

.auth-alert[data-tone="success"] {
  border-color: rgba(31, 107, 79, 0.3);
  background-color: rgba(31, 107, 79, 0.06);
  color: #175a42;
}

.auth-alert[data-tone="info"] {
  border-color: rgba(138, 94, 18, 0.3);
  background-color: rgba(138, 94, 18, 0.08);
  color: #6f4c0e;
}

.auth-alt {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--sand-500);
}

.auth-link {
  font-weight: 800;
  color: var(--coffee-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link:hover {
  color: var(--coffee-500);
}

.auth-footnote {
  margin-top: 1.1rem;
  border-top: 1px solid var(--sand-200);
  padding-top: 0.9rem;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--sand-500);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sand-400);
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background-color: var(--sand-200);
}

.pw-wrap {
  position: relative;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.35rem;
  display: flex;
  height: 2.1rem;
  width: 2.1rem;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--sand-500);
}

.pw-toggle:hover {
  background-color: var(--sand-100);
  color: var(--sand-800);
}

/* ==========================================================================
   ACCOUNT VIEW
   ========================================================================== */

.account-card {
  border: 1px solid var(--sand-200);
  border-radius: 1.1rem;
  background-color: #fff;
  padding: 1.1rem;
}

.account-card + .account-card {
  margin-top: 1rem;
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.account-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sand-900);
}

/* ---- Owner analytics: the metric cards ------------------------------------
   A stat card is a flat tile with the label above the number, so a row of them
   reads as a row of figures rather than as four buttons. The number is the
   loudest thing in the tile because that is the only part the owner scans for.

   `is-pending` is the honest-missing treatment: a muted tile with an em dash.
   It is deliberately NOT a muted zero — "0" would state that the shop sold
   nothing, which is a claim the card cannot actually make. The distinct
   treatment is what tells the owner "not available yet" at a glance.
   ------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  border: 1px solid var(--sand-200);
  border-radius: 0.9rem;
  background-color: #fff;
  padding: 0.7rem 0.75rem;
}

.stat-icon {
  font-size: 1.05rem;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--sand-500);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--sand-900);
  /* A long product name must wrap, not push the tile wider than its column. */
  overflow-wrap: anywhere;
}

.stat-sub {
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--sand-500);
}

/* The stock tile is amber because an alert that looks like the calm tiles
   around it is an alert nobody reads. */
.stat-card.is-alert {
  border-color: #fcd34d;
  background-color: #fffbeb;
}

.stat-card.is-alert .stat-value { color: #92400e; }

/* Only when there is genuinely nothing to warn about. */
.stat-card.is-clear {
  border-color: #bbf7d0;
  background-color: #f0fdf4;
}

.stat-card.is-clear .stat-value { color: #166534; }

.stat-card.is-pending {
  border-style: dashed;
  background-color: var(--sand-50, #faf8f6);
}

.stat-card.is-pending .stat-value { color: var(--sand-500); }

/* The named products behind the stock count. Chips rather than a list because
   they are labels, not actions — none of them links anywhere. */
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.stat-chip {
  border: 1px solid #fcd34d;
  border-radius: 9999px;
  background-color: #fffbeb;
  padding: 0.15rem 0.55rem;
  font-size: 0.64rem;
  font-weight: 700;
  color: #92400e;
}

.stat-chip.is-out {
  border-color: #fda4af;
  background-color: #fff1f2;
  color: #9f1239;
}

.stat-chip.is-more {
  border-color: var(--sand-200);
  background-color: var(--sand-50, #faf8f6);
  color: var(--sand-500);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.avatar {
  display: flex;
  height: 3.25rem;
  width: 3.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(139, 90, 43)
  );
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}

.address-card {
  border: 1px solid var(--sand-200);
  border-radius: 0.85rem;
  background-color: var(--sand-50);
  padding: 0.8rem;
}

.address-card + .address-card {
  margin-top: 0.6rem;
}

.address-card.is-selected {
  border-color: var(--coffee-500);
  background-color: var(--coffee-50);
  box-shadow: 0 0 0 1px var(--coffee-500);
}

.chip-default {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background-color: var(--coffee-600);
  padding: 0.1rem 0.5rem;
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
}

/* A saved address the store does not deliver to. It is shown, not hidden: the
   customer still owns it and must be able to edit or delete it. What it cannot
   do is be picked for an order, so the treatment is a warning rather than the
   greyed-out treatment used for sold-out products — a sold-out product cannot be
   bought at all, an out-of-zone address is merely not this store's problem yet. */
.chip-out-of-zone {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 0.1rem 0.5rem;
  font-size: 0.6rem;
  font-weight: 800;
  color: #92400e;
}

.addr-pick-row.is-out-of-zone > .addr-option {
  border-style: dashed;
  background-color: #fffbeb;
}

.addr-pick-row.is-out-of-zone > .addr-option:hover {
  background-color: #fef3c7;
}

.address-card.is-out-of-zone {
  border-color: #fcd34d;
  background-color: #fffbeb;
}

/* A saved-order row is a <button>: it opens the order-detail modal. The UA
   button chrome is reset here so the row keeps its original flat look. */
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.5rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sand-200);
  border-radius: 0.75rem;
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.order-row:hover {
  background-color: var(--sand-100);
}

.order-row:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
  background-color: var(--sand-100);
}

.order-row:active {
  background-color: var(--sand-200);
}

.order-row:last-child {
  border-bottom: 0;
}

.order-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--coffee-700);
}

/* ==========================================================================
   SAVED-ADDRESS PICKER INSIDE CHECKOUT
   ========================================================================== */

.addr-picker {
  border: 1px solid var(--sand-200);
  border-radius: 0.85rem;
  background-color: var(--sand-50);
  padding: 0.7rem;
}

.addr-option {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  padding: 0.55rem 0.6rem;
  text-align: start;
  transition: background-color 0.2s, border-color 0.2s;
}

.addr-option + .addr-option {
  margin-top: 0.25rem;
}

/* Checkout address picker.

   The row is a <div>, not a <button>, because it has to carry a second control
   — the تعديل button. A <button> may not contain another <button>: the browser
   is free to close the outer element early, and the click would land on the
   outer one anyway, so picking an address would also fire the edit. The row
   therefore hosts two sibling buttons, and the pick button absorbs the slack so
   the layout is unchanged from the single-button version. */
.addr-pick-row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.addr-pick-row + .addr-pick-row {
  margin-top: 0.25rem;
}

.addr-pick-row > .addr-option {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.addr-edit-btn {
  flex-shrink: 0;
  align-self: center;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0369a1;
  transition: background-color 0.2s, border-color 0.2s;
}

.addr-edit-btn:hover {
  border-color: var(--coffee-200, #e7dcd2);
  background-color: #f0f9ff;
}

.addr-edit-btn:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 1px;
}

.addr-option:hover {
  background-color: var(--coffee-50);
}

.addr-option[aria-pressed="true"] {
  border-color: var(--coffee-500);
  background-color: var(--coffee-50);
}

.addr-radio {
  margin-top: 0.15rem;
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  accent-color: var(--coffee-600);
}

.save-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.7rem;
  background-color: var(--sand-50);
  padding: 0.55rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sand-700);
  cursor: pointer;
}

.save-toggle:has(input:checked) {
  border-color: var(--coffee-500);
  background-color: var(--coffee-50);
  color: var(--coffee-700);
}

.save-toggle input {
  height: 1rem;
  width: 1rem;
  accent-color: var(--coffee-600);
}

/* ==========================================================================
   ORDER CONFIRMATION
   ========================================================================== */

.order-done-mark {
  display: flex;
  height: 4.25rem;
  width: 4.25rem;
  margin: 0 auto 0.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(31, 107, 79, 0.12);
  color: var(--ok);
  animation: badgePop 0.45s ease-out;
}

.order-ref-box {
  border: 1px dashed var(--coffee-300);
  border-radius: 0.85rem;
  background-color: var(--coffee-50);
  padding: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 800;
  transition: opacity 0.2s, transform 0.1s, background-color 0.2s,
    box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* The text half of a button. app.js swaps `.btn-label`'s text for a busy
   message and inserts a `.spinner` before it, so the label must not be
   allowed to shrink while the spinner is present. */
.btn-label {
  flex: 0 1 auto;
  white-space: nowrap;
}

.btn-primary {
  background-image: linear-gradient(
    to left,
    rgb(111, 78, 55),
    rgb(36, 24, 17)
  );
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(111, 78, 55, 0.9);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-secondary {
  border: 1px solid var(--sand-200);
  background-color: #fff;
  color: var(--sand-800);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--coffee-500);
  color: var(--coffee-700);
}

.btn-ghost {
  color: var(--sand-600);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--sand-100);
  color: var(--sand-900);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.9rem 1.4rem;
  font-size: 0.9rem;
}

.btn-danger {
  border: 1px solid rgba(159, 18, 57, 0.35);
  background-color: rgba(159, 18, 57, 0.06);
  color: #9f1239;
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(159, 18, 57, 0.12);
}

/* Spinner used inside buttons while a request is in flight. */
.spinner {
  height: 0.9rem;
  width: 0.9rem;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   HEADER ACCOUNT BUTTON
   ========================================================================== */

.acct-btn {
  display: flex;
  height: 2.75rem;
  max-width: 11rem;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.8rem;
  background-color: #fff;
  padding-inline: 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--sand-800);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.acct-btn:hover {
  border-color: var(--coffee-500);
  color: var(--coffee-700);
}

.acct-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .acct-name {
    display: none;
  }
  .acct-btn {
    max-width: none;
    padding-inline: 0.55rem;
  }
}

/* --------------------------------------------------------------------------
   VERY NARROW HEADERS (<= 360px / <= 320px)
   --------------------------------------------------------------------------
   The logo is pinned to the exact centre of the row, but the two control
   clusters are not the same width: the cart group is a single button while the
   nav group is the menu button PLUS the account button. That asymmetry shifts
   the usable lane off-centre, and below ~340px the centred wordmark would run
   under the nav group. Rather than un-centring the logo (which the header
   contract forbids), the controls, the brand lockup and the row padding all
   get a little tighter.

   These selectors are scoped under #site-header purely for specificity: the
   Tailwind Play CDN injects utility classes at the same weight, and an id in
   the selector guarantees the compact sizes win regardless of stylesheet
   order. Measured clearances: 6px at 320px, 15px with the extra tier.
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  #site-header .acct-btn {
    height: 2.25rem;
    padding-inline: 0.45rem;
  }

  #site-header .header-controls {
    gap: 0.375rem;
  }

  #site-header #menu-btn,
  #site-header #cart-btn {
    width: 2.25rem;
    height: 2.25rem;
  }

  #site-header .brand-mark {
    width: 1.75rem;
    height: 1.75rem;
  }

  #site-header .brand-lockup {
    gap: 0.375rem;
  }
}

@media (max-width: 320px) {
  #site-header .header-row {
    padding-inline: 0.5rem;
  }
}

/* 280px and below (Galaxy Fold covers, very old handsets). Nothing here is
   seen on a mainstream phone, but the centred-logo contract should hold at
   every width rather than at every "realistic" one. */
@media (max-width: 300px) {
  #site-header .header-row {
    padding-inline: 0.25rem;
  }

  #site-header #menu-btn,
  #site-header #cart-btn {
    width: 2rem;
    height: 2rem;
  }

  #site-header .acct-btn {
    height: 2rem;
    padding-inline: 0.4rem;
  }
}

/* ==========================================================================
   REDUCED MOTION
   --------------------------------------------------------------------------
   Kept as an OS-level media query only. The in-app "reduce motion" switch was
   removed along with the rest of the settings modal, but honouring the OS
   preference is an accessibility baseline, not a theme preference.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   PRODUCT PAGE  (#view-product)
   --------------------------------------------------------------------------
   Two columns on a wide screen, one on a narrow one. The gallery is sticky so
   that a long description does not scroll the picture off the top of the screen
   before the customer has finished reading the title — the whole reason a
   product page beats a modal is that you can look at both at once.

   The stage is sized with aspect-ratio rather than a fixed height, so the single
   category illustration fills the space without being cropped or letterboxed,
   and without needing per-image dimensions that a data-URI SVG cannot give.
   ========================================================================== */

.pdp {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

.pdp-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.pdp-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sand-200);
  border-radius: 1.25rem;
  background-color: var(--sand-100);
  aspect-ratio: 4 / 3;
  /* Vertical panning stays with the browser so the page scrolls under the
     photo; horizontal gestures are left to the swipe handler in app.js. */
  touch-action: pan-y;
}

.pdp-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The preview swaps its src in place, so the change itself cannot be animated:
   the new frame is already painted by the time CSS sees it. Re-triggering this
   keyframe from syncProductGallery(), only when the image actually changed, is
   what produces the fade. Reduced-motion is handled globally. */
@keyframes pdp-image-in {
  from { opacity: 0; transform: scale(1.015); }
  to   { opacity: 1; transform: scale(1); }
}

.pdp-stage > img.is-swapping {
  animation: pdp-image-in 0.28s ease-out;
}

.pdp-arrow {
  position: absolute;
  top: 50%;
  z-index: var(--z-card-interactive);
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--sand-800);
  box-shadow: rgba(36, 24, 17, 0.35) 0 4px 12px -4px;
  transform: translateY(-50%);
  transition: background-color 0.15s, transform 0.15s;
}

.pdp-arrow:hover {
  background-color: #fff;
  transform: translateY(-50%) scale(1.06);
}

.pdp-arrow:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

/* The chevrons already point the right way (two separate icons, not one rotated
   with CSS), so these only decide which EDGE of the stage each one sits on. */
.pdp-arrow.is-prev {
  inset-inline-end: 0.75rem;
}

.pdp-arrow.is-next {
  inset-inline-start: 0.75rem;
}

.pdp-counter {
  position: absolute;
  inset-block-end: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: var(--z-card-interactive);
  border-radius: 9999px;
  background-color: rgba(36, 24, 17, 0.65);
  padding: 0.2rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.pdp-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  /* One row that can be dragged sideways on a phone, rather than a block of
     thumbnails that wraps and pushes the buy box off screen. A mouse still
     scrolls it, and the scrollbar is kept thin. */
  overflow-x: auto;
  padding-block-end: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.pdp-thumb {
  flex: 0 0 auto;
  overflow: hidden;
  width: 4.5rem;
  border: 2px solid var(--sand-200);
  border-radius: 0.7rem;
  transition: border-color 0.15s, transform 0.15s;
}

.pdp-thumb img {
  display: block;
  width: 100%;
  height: 3.4rem;
  object-fit: cover;
}

.pdp-thumb:hover {
  transform: translateY(-2px);
}

.pdp-thumb.is-current {
  border-color: var(--coffee-500);
}

.pdp-thumb:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

.pdp-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.7rem;
}

.pdp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pdp-tag {
  border-radius: 9999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  transition: filter 0.15s;
}

.pdp-tag.is-cat {
  background-color: var(--sand-100);
  color: var(--coffee-600);
}

.pdp-tag.is-cat:hover {
  filter: brightness(0.96);
}

.pdp-tag.is-tier {
  color: #fff;
}

.pdp-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--sand-900);
}

.pdp-title:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

.pdp-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sand-600);
}

.pdp-stars {
  display: inline-flex;
  color: #f59e0b;
}

.pdp-rating-num {
  font-weight: 800;
  color: var(--sand-900);
}

/* The review count, deliberately quieter than the score it qualifies. It was
   emitted with no rule at all, so it inherited the row's 700 weight and colour and
   the pair read as one number — "4.9 (128 تقييم)" is easy to take for a score out
   of 128. Caught by the product-page harness, which checks every class the page
   emits against the stylesheet. */
.pdp-rating-count {
  font-weight: 600;
  color: var(--sand-500);
}

.pdp-stock {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ok);
}

.pdp-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  border-block: 1px solid var(--sand-200);
  padding-block: 0.75rem;
}

.pdp-price-now {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--sand-900);
}

.pdp-save {
  border-radius: 9999px;
  background-color: var(--ok);
  padding: 0.15rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
}

/* ---- buy box ---- */

.pdp-buy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdp-qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.pdp-qty-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sand-700);
}

.pdp-stock-left {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sand-500);
}

.pdp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdp-qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.pdp-add,
.pdp-express,
.pdp-buy-now {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 800;
  transition: filter 0.15s, transform 0.1s, background-color 0.15s, border-color 0.15s;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}

.pdp-add {
  background-color: var(--coffee-500);
  color: #fff;
  border: 2px solid var(--coffee-500);
  box-shadow: rgba(36, 24, 17, 0.25) 0 10px 22px -12px;
}

.pdp-express {
  background-color: transparent;
  color: var(--coffee-600);
  border: 2px solid var(--coffee-600);
  box-shadow: none;
}

.pdp-buy-now {
  border: 2px solid var(--sand-300);
  background-color: var(--sand-50);
  color: var(--sand-800);
}

.pdp-add:hover {
  filter: brightness(0.95);
  background-color: var(--coffee-600);
  border-color: var(--coffee-600);
}

.pdp-express:hover {
  background-color: var(--coffee-50);
  color: var(--coffee-700);
}

.pdp-buy-now:hover {
  filter: brightness(0.95);
  background-color: var(--sand-100);
  border-color: var(--sand-400);
}

.pdp-add:active,
.pdp-express:active,
.pdp-buy-now:active {
  transform: scale(0.985);
}

.pdp-add:focus-visible,
.pdp-express:focus-visible,
.pdp-buy-now:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

.pdp-note {
  font-size: 0.68rem;
  line-height: 1.8;
  color: var(--sand-500);
}

.pdp-sold-out {
  border: 1px solid #fecdd3;
  border-radius: 0.9rem;
  background-color: #fff1f2;
  padding: 0.85rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--danger);
}

.pdp-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pdp-meta-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sand-500);
}

/* ---- description / specs / shipping ---- */

.pdp-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  grid-column: 1 / -1;
}

.pdp-block {
  border: 1px solid var(--sand-200);
  border-radius: 1.1rem;
  background-color: var(--sand-50);
  padding: 1.1rem 1.25rem;
}

.pdp-block-title {
  margin-block-end: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sand-900);
}

.pdp-prose {
  font-size: 0.85rem;
  line-height: 2;
  color: var(--sand-700);
}

.pdp-specs {
  display: flex;
  flex-direction: column;
}

.pdp-spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-block-end: 1px dashed var(--sand-200);
  padding-block: 0.45rem;
  font-size: 0.78rem;
}

.pdp-spec-row:last-child {
  border-block-end: 0;
  padding-block-end: 0;
}

.pdp-spec-row dt {
  font-weight: 700;
  color: var(--sand-500);
}

.pdp-spec-row dd {
  font-weight: 800;
  text-align: end;
  color: var(--sand-900);
}

.pdp-notes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--sand-700);
}

.pdp-notes li {
  position: relative;
  padding-inline-start: 1rem;
}

.pdp-notes li::before {
  position: absolute;
  inset-inline-start: 0;
  content: "•";
  color: var(--coffee-400);
}

.pdp-link {
  font-weight: 800;
  color: var(--coffee-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   PRODUCT REVIEWS

   The one part of the product page that a customer writes to. Two rules worth
   stating, because both were arrived at by breaking them:

   The radio input is hidden with opacity and kept in the layout, NOT
   display:none or visibility:hidden. Either of those removes it from the
   accessibility tree and from tab order, so the stars stop being a control and
   become five pictures. The label carries the ring instead.

   The star rows are laid out with logical properties and never with `left`/`right`,
   so the input row and the read-only row stay mirrored the same way in both
   directions. app.js writes both rows in ascending order precisely because an RTL
   flex row puts the first child at the right — see reviewFormHTML().
   ========================================================================== */

.pdp-reviews-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.pdp-reviews-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sand-500);
}

.pdp-review-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-block: 0.9rem 1rem;
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
  background-color: var(--sand-50, #faf8f6);
  padding: 0.9rem;
}

.pdp-review-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.pdp-review-legend,
.pdp-review-label {
  display: block;
  margin-block-end: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sand-700);
}

.pdp-star-input {
  display: flex;
  flex-direction: row;
  gap: 0.15rem;
}

.pdp-star-choice {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  line-height: 0;
}

/* Hidden, not removed. `opacity: 0` over a real layout box keeps the input in
   the tab order and in the accessibility tree, which `display: none` would not. */
.pdp-star-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

/* The ring is drawn on the LABEL, because that is what the pointer and the
   keyboard focus land on. `:focus-within` rather than `:focus-visible` on the
   input: the input cannot be styled visibly at all while it is transparent, and
   this still only shows for keyboard users because the mouse path goes through
   the label's own hover. */
.pdp-star-choice:focus-within .pdp-star {
  border-radius: 0.3rem;
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

.pdp-star {
  display: inline-flex;
  color: var(--sand-300, #e7dcd2);
}

.pdp-star.is-on {
  color: #f59e0b;
}

.pdp-review-text {
  display: block;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--sand-200);
  border-radius: 0.75rem;
  background-color: #fff;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--sand-900);
}

.pdp-review-text:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 1px;
}

.pdp-review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.pdp-review-hint {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sand-600);
  min-height: 1em;
}

.pdp-review-guest {
  margin-block: 0.9rem 1rem;
  font-size: 0.8rem;
  color: var(--sand-600);
}

.pdp-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdp-review {
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
  background-color: #fff;
  padding: 0.75rem 0.85rem;
}

/* The reader's own review, so they can find it in a list that is sorted by date
   rather than by author. A left border in an RTL layout has to be written as
   `border-inline-start` — `border-left` would put it on the wrong side of an
   Arabic page. */
.pdp-review.is-mine {
  border-inline-start: 3px solid var(--coffee-500);
  background-color: var(--sand-50, #faf8f6);
}

.pdp-review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-block-end: 0.35rem;
}

.pdp-review-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--sand-900);
}

.pdp-review-mine {
  border-radius: 9999px;
  background-color: var(--coffee-100, #f0f9ff);
  padding: 0.1rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--coffee-700, #1e40af);
}

/* Pushed to the far end of the review head. A logical auto margin, so the button
   sits on the left in this RTL document without a hard-coded direction. */
.pdp-review-delete {
  margin-inline-start: auto;
  border: 1px solid var(--sand-300);
  border-radius: 9999px;
  background-color: #fff;
  padding: 0.15rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #b91c1c;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.pdp-review-delete:hover {
  border-color: #fecaca;
  background-color: #fef2f2;
}

.pdp-review-delete:focus-visible {
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

.pdp-star-row {
  display: inline-flex;
  gap: 0.1rem;
}

.pdp-star-row .pdp-star {
  width: 0.85rem;
  height: 0.85rem;
}

.pdp-review-body {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--sand-700);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pdp-review-empty {
  border: 1px dashed var(--sand-200);
  border-radius: 1rem;
  padding: 0.9rem;
  font-size: 0.78rem;
  color: var(--sand-500);
  text-align: center;
}

.crumb-link {
  font-weight: 700;
  color: var(--sand-500);
  transition: color 0.15s;
}

.crumb-link:hover {
  color: var(--coffee-600);
}

.crumb-link:focus-visible {
  border-radius: 0.25rem;
  outline: 2px solid var(--coffee-500);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .pdp {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 2.5rem;
  }

  /* The gallery column stays at the top of its grid cell without sticky
     positioning. This prevents the image from overlapping the footer or
     other sections when scrolling down. */
  .pdp-gallery {
    position: relative;
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-arrow:hover,
  .pdp-thumb:hover,
  .pdp-add:active,
  .pdp-express:active,
  .pdp-buy-now:active {
    transform: none;
  }
}

/* ==========================================================================
   INITIAL LOAD SKELETONS + MAINTENANCE MODE
   ========================================================================== */

/* Fast first paint: the grids get a lightweight shimmer until the first
   Firestore snapshot arrives, instead of looking broken and empty. */
@keyframes ds-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.is-loading::before {
  content: '';
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 1.25rem;
  background: linear-gradient(90deg, #F3EDE3 25%, #FBF8F2 50%, #F3EDE3 75%);
  background-size: 400px 100%;
  animation: ds-shimmer 1.25s linear infinite;
}
.rail.is-loading::before {
  width: min(100%, 21rem);
}
@media (prefers-reduced-motion: reduce) {
  .is-loading::before { animation: none; }
}

/* A full-screen, calm maintenance screen that cannot be dismissed by any
   route or hash. Admin lives in admin.html and is unaffected. */
.maintenance-view {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: #F8F2E9;
}
.maintenance-view[hidden] { display: none !important; }
.maintenance-card {
  width: min(100%, 30rem);
  padding: 2.5rem 1.75rem;
  border: 1px solid #EFE5D6;
  border-radius: 1.5rem;
  background: #FFFFFF;
  box-shadow: 0 18px 50px rgba(58, 47, 37, 0.08);
  text-align: center;
}
.maintenance-icon { font-size: 3rem; line-height: 1; }
.maintenance-eyebrow {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #8B5A2B;
}
.maintenance-title {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: #2A221A;
}
.maintenance-text {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #7D6B55;
}
.maintenance-reload {
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 0.75rem;
  background: #6F4E37;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}
.maintenance-reload:hover { background: #5A3D2B; }

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  #global-backdrop,
  #toast-container,
  #wa-fab,
  #sidebar-drawer,
  #cart-drawer,
  header {
    display: none !important;
  }
}
