/* ==========================================================================
   Kenzy 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;
  --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);
}

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

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

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

#toast-container,
#wa-fab,
body > noscript > div {
  z-index: var(--z-toast);
}

#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;
}

/* ==========================================================================
   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;
  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);
}

.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;
}

.product-quick-view-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  background-image: linear-gradient(
    to top,
    rgba(36, 24, 17, 0.7) 0%,
    rgba(36, 24, 17, 0) 55%
  );
}

.product-card:hover .product-quick-view-overlay,
.product-card:focus-within .product-quick-view-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.product-quick-view-btn {
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 0.4rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--sand-800);
  box-shadow: rgba(36, 24, 17, 0.6) 0 8px 20px -8px;
  transition: transform 0.2s, background-color 0.2s;
}

.product-quick-view-btn:hover {
  background-color: #fff;
  transform: translateY(-2px);
}

.product-quick-view-btn:active {
  transform: scale(0.95);
}

@media (hover: none) {
  /* Touch devices have no hover, so the quick view is always reachable. */
  .product-quick-view-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    background-image: linear-gradient(
      to top,
      rgba(36, 24, 17, 0.55) 0%,
      rgba(36, 24, 17, 0) 45%
    );
  }
}

.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;
}

.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);
}

.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);
}

.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);
}

/* OTP / SMS code boxes */
.otp-row {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  direction: ltr;
}

.otp-box {
  height: 3rem;
  width: 2.6rem;
  border: 1px solid var(--sand-200);
  border-radius: 0.7rem;
  background-color: #fff;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--sand-800);
  outline: none;
}

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

.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);
}

.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;
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sand-200);
  padding: 0.7rem 0;
}

.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;
}

.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;
  }
}

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

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