/* =====================================================================
   Apothecary Coffee Co — The Dispensary
   Design System & Component Styles
   ===================================================================== */

:root {
  /* Backgrounds */
  --color-bg-deep:        #141D16;
  --color-bg-card:        #1F3326;
  --color-bg-elevated:    #263B2A;
  --color-bg-input:       #1B2A1B;

  /* Brand */
  --color-amber:          #D4860A;
  --color-amber-light:    #F0A832;
  --color-cream:          #F0E8D0;
  --color-cream-muted:    #B8A882;

  /* Actions */
  --color-cta:            #C4582E;
  --color-cta-hover:      #D96940;
  --color-success:        #5A9B6A;
  --color-error:          #C45B4A;

  /* Borders */
  --color-border:         #2E4836;
  --color-border-amber:   #6B4A0A;

  /* Flavor note colors */
  --flavor-chocolate:     #6B3A2A;
  --flavor-citrus:        #B8850A;
  --flavor-fruity:        #8B3A4A;
  --flavor-floral:        #6A4A7A;
  --flavor-nutty:         #7A5A2A;
  --flavor-caramel:       #9A6A1A;
  --flavor-spice:         #8A4A1A;
  --flavor-tropical:      #2A6A5A;

  /* Typography */
  --font-display: 'Cormorant Garant', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg-deep);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* ---- Typography ---- */
h1, h2, .hero-headline {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h3, .section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

a { color: var(--color-amber); text-decoration: none; }
a:hover { color: var(--color-amber-light); }

.label-small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-cream-muted);
}

.price-display {
  font-family: var(--font-display);
  font-weight: 600;
}

/* ---- Layout ---- */
.site-wrapper {
  position: relative;
  z-index: 1;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
  /* align-items removed: columns stretch to equal height so sticky sidebar works (vi) */
}

/*
 * form-column gets its own stacking context (z=2) so that:
 * 1. Open dropdowns/tooltips at z=1000 beat the dosage/other form sections
 * 2. The form column beats the sticky sidebar column (z=auto due to sticky)
 */
.form-column {
  position: relative;
  z-index: 2;
}

@media (max-width: 1023px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding-top: 60px; /* room for mobile sticky bar */
  }
  .total-column { display: none; }
}

/* ---- Header ---- */
.site-header {
  background: var(--color-bg-deep);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  position: relative;
  z-index: 10;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  height: 44px;
  width: auto;
}

.header-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--color-cream-muted);
}

.header-manage-link {
  font-size: 13px;
  color: var(--color-cream-muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--color-border);
  transition: color 0.2s;
}
.header-manage-link:hover { color: var(--color-amber); border-color: var(--color-amber); }

/* ---- Hero ---- */
.hero {
  padding: 56px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 55%;
  height: 100%;
  background: radial-gradient(ellipse at 85% 50%, rgba(212, 134, 10, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero-content { max-width: 680px; }

.hero-kicker {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-amber);
  margin-bottom: 12px;
}

.hero h1 { color: var(--color-cream); margin-bottom: 16px; }

.hero-sub {
  font-size: 16px;
  color: var(--color-cream-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* Steam cup in header */
.steam-cup {
  width: 36px;
  height: 36px;
}

/* Rotating coffee bean decoration */
.hero-bean {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  opacity: 0.13;
  pointer-events: none;
}

/* ---- Form Sections ---- */
.form-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s, transform 0.5s;
}

.form-section.visible {
  opacity: 1;
  transform: none;
}

.form-section::before {
  content: attr(data-step);
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--color-amber);
  color: var(--color-bg-deep);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: 1.25rem;
  color: var(--color-cream);
  margin-bottom: 20px;
}

/* ---- Line Items ---- */
.line-items-list { display: flex; flex-direction: column; gap: 10px; }

.line-item {
  display: grid;
  grid-template-columns: auto auto auto auto 32px;
  gap: 8px 10px;
  align-items: end;
  padding: 14px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.2s;
  position: relative;
}

.line-item:focus-within { border-color: var(--color-amber); }

/* Row 1: coffee selector spans all 5 columns */
.line-item > div:first-child {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
}

/* Row 2: controls — nth-child counts DOM position (x-show:false items still count) */
/* Two size divs share col 1; only the visible one occupies space */
.line-item > div:nth-child(2),
.line-item > div:nth-child(3) { grid-row: 2; grid-column: 1; }
.line-item > div:nth-child(4) { grid-row: 2; grid-column: 2; } /* grind */
.line-item > div:nth-child(5) { grid-row: 2; grid-column: 3; } /* qty */
.line-item > div:nth-child(6) { grid-row: 2; grid-column: 4; } /* price */
.line-item > button:last-child { grid-row: 2; grid-column: 5; align-self: center; }

@media (max-width: 768px) {
  .line-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .line-item > div:first-child,
  .line-item > div:nth-child(2),
  .line-item > div:nth-child(3),
  .line-item > div:nth-child(4),
  .line-item > div:nth-child(5),
  .line-item > div:nth-child(6),
  .line-item > button:last-child {
    grid-row: auto;
    grid-column: auto;
  }
}

.add-item-btn {
  margin-top: 12px;
  background: transparent;
  border: 1px dashed var(--color-border-amber);
  color: var(--color-amber);
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  transition: all 0.2s;
}
.add-item-btn:hover {
  background: rgba(212, 134, 10, 0.06);
  border-color: var(--color-amber);
}

.remove-item-btn {
  background: transparent;
  border: none;
  color: var(--color-cream-muted);
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.remove-item-btn:hover { background: rgba(196, 91, 74, 0.15); color: var(--color-error); }

/* ---- Frequency Cards ---- */
.frequency-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.frequency-card {
  flex: 1;
  min-width: 120px;
  padding: 20px 16px;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: var(--color-bg-input);
}

.frequency-card.selected {
  border-color: var(--color-amber);
  background: rgba(212, 134, 10, 0.08);
}

.frequency-card:hover:not(.selected) {
  border-color: var(--color-border-amber);
}

.frequency-card__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-cream);
  display: block;
  margin-bottom: 4px;
}

.frequency-card__sub {
  font-size: 12px;
  color: var(--color-cream-muted);
}

/* ---- Fulfillment Cards ---- */
.fulfillment-cards { display: flex; gap: 12px; }
.fulfillment-card {
  flex: 1;
  padding: 20px;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--color-bg-input);
}
.fulfillment-card.selected {
  border-color: var(--color-amber);
  background: rgba(212, 134, 10, 0.08);
}
.fulfillment-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.fulfillment-card__desc { font-size: 13px; color: var(--color-cream-muted); }

/* ---- Delivery zone info ---- */
.zone-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 134, 10, 0.1);
  border: 1px solid var(--color-border-amber);
  border-radius: 6px;
  padding: 8px 14px;
  margin-top: 10px;
  font-size: 13px;
}

.zone-badge__fee { color: var(--color-amber); font-weight: 600; }

.zone-manual-selector {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-option {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--color-bg-input);
  transition: all 0.2s;
  text-align: left;
}
.zone-option:hover { border-color: var(--color-border-amber); }
.zone-option.selected { border-color: var(--color-amber); background: rgba(212, 134, 10, 0.07); }
.zone-option__label { font-weight: 500; }
.zone-option__fee { font-size: 12px; color: var(--color-cream-muted); }

/* ---- Form fields ---- */
.field-group { margin-bottom: 18px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-cream-muted);
  margin-bottom: 6px;
}

.field-select,
.field-input,
.field-textarea {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-cream);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.field-select:focus,
.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--color-amber);
  box-shadow: 0 0 0 3px rgba(212, 134, 10, 0.15);
}

.field-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B8A882' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.form-error {
  color: var(--color-error);
  font-size: 12px;
  margin-top: 4px;
}

/* ---- Tooltip / hover card ---- */
.product-tooltip-wrap { position: relative; display: inline-block; }

.tooltip-trigger {
  background: transparent;
  border: none;
  color: var(--color-amber);
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
  line-height: 1;
}

.product-tooltip-card {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-amber);
  border-radius: 10px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.tooltip-product-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.tooltip-description {
  font-size: 12px;
  color: var(--color-cream-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Flavor text pills — used in tooltip card only */
.flavor-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

.flavor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Compact emoji dots shown below product select */
.flavor-dot-row {
  display: flex;
  gap: 5px;
  padding: 5px 0 2px;
}

.flavor-dot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  cursor: default;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.flavor-tag { background: #2E3E2E; color: var(--color-cream-muted); } /* fallback for unlisted tags */
.flavor-tag--chocolate    { background: var(--flavor-chocolate); color: #f0d0b0; }
.flavor-tag--citrus       { background: var(--flavor-citrus);    color: #f0e0a0; }
.flavor-tag--fruity       { background: var(--flavor-fruity);    color: #f0b0b8; }
.flavor-tag--floral       { background: var(--flavor-floral);    color: #d8b8f0; }
.flavor-tag--nutty        { background: var(--flavor-nutty);     color: #e8d090; }
.flavor-tag--caramel      { background: var(--flavor-caramel);   color: #f0d890; }
.flavor-tag--spice        { background: var(--flavor-spice);     color: #f0c090; }
.flavor-tag--tropical     { background: var(--flavor-tropical);  color: #a0e8d0; }
.flavor-tag--espresso     { background: #3A2A1A;                 color: #d0b898; }
.flavor-tag--med-dark     { background: #4A3020;                 color: #d8c090; }
.flavor-tag--berry        { background: #7A2A4A;                 color: #f4b8d0; }
.flavor-tag--honey        { background: #8A5A00;                 color: #f8e090; }
.flavor-tag--sweet        { background: #7A3A5A;                 color: #f0c8e0; }
.flavor-tag--dark         { background: #2A1A10;                 color: #c8a880; }
.flavor-tag--complex      { background: #4A3A5A;                 color: #d0c8e8; }
.flavor-tag--tea-like     { background: #3A5A3A;                 color: #b8e0b8; }
.flavor-tag--milk-based   { background: #5A4A3A;                 color: #f0e8d8; }
.flavor-tag--single-origin { background: #2A4A3A;               color: #b8d8c8; }
.flavor-tag--wine         { background: #6A1A3A;                 color: #f0b0c8; }
.flavor-tag--stone-fruit  { background: #7A3A1A;                 color: #f0c8a8; }
.flavor-tag--bright       { background: #7A6A1A;                 color: #f4e898; }

/* ================================================================
   Custom dropdown (cs-wrap / cs-trigger / cs-dropdown)
   Replaces native <select> for coffee type and product pickers
   ================================================================ */
.cs-wrap {
  position: relative;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-cream);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.4;
}

.cs-trigger:hover { border-color: rgba(212,134,10,0.5); }

.cs-trigger:focus {
  outline: none;
  border-color: var(--color-amber);
  box-shadow: 0 0 0 3px rgba(212,134,10,0.15);
}

.cs-trigger--placeholder { color: var(--color-cream-muted); }

.cs-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-arrow {
  flex-shrink: 0;
  color: var(--color-cream-muted);
  transition: transform 0.2s ease;
}

.cs-arrow--open { transform: rotate(180deg); }

.cs-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #1a2512;
  border: 1px solid rgba(212,134,10,0.5);
  border-radius: 8px;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(212,134,10,0.08);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.cs-option {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.12s;
}

.cs-option:last-child { border-bottom: none; }

.cs-option:hover { background: rgba(212,134,10,0.1); }

.cs-option--active {
  background: rgba(212,134,10,0.14);
}

.cs-option--active .cs-opt-name { color: var(--color-amber-light, #F0A832); }

.cs-option--placeholder .cs-opt-name { color: var(--color-cream-muted); }

.cs-opt-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-cream);
  line-height: 1.3;
  margin-bottom: 3px;
}

.cs-opt-sub {
  font-size: 11px;
  color: var(--color-cream-muted);
  line-height: 1.3;
}

.cs-opt-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

/* Small inline tags inside dropdown options */
.csd-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  background: #2E3E2E;
  color: var(--color-cream-muted);
  white-space: nowrap;
}

/* ================================================================
   Welcome reveal card (session-first page visit)
   ================================================================ */
.welcome-reveal {
  position: fixed;
  left: 0;
  right: 0;
  top: 80px;
  margin: 0 auto;
  width: min(580px, 92vw);
  z-index: 800;
  pointer-events: none;
}

.welcome-reveal__card {
  pointer-events: all;
  position: relative;
  display: flex;
  background: linear-gradient(135deg, #141e0c 0%, #1e2e12 55%, #13201a 100%);
  border: 1px solid rgba(212,134,10,0.45);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(212,134,10,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: welcomeSlide 0.55s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes welcomeSlide {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-reveal__body {
  flex: 1;
  padding: 22px 16px 16px 24px;
}

.welcome-reveal__kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 6px;
}

.welcome-reveal__heading {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-cream);
  line-height: 1.2;
  margin-bottom: 8px;
  font-family: var(--font-heading, Georgia, serif);
}

.welcome-reveal__heading em {
  font-style: italic;
  color: var(--color-amber-light, #F0A832);
}

.welcome-reveal__sub {
  font-size: 12.5px;
  color: var(--color-cream-muted);
  line-height: 1.55;
}

.welcome-reveal__art {
  width: 120px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  border-left: 1px solid rgba(212,134,10,0.12);
  opacity: 0.85;
}

.welcome-reveal__close {
  position: absolute;
  top: 9px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--color-cream-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.welcome-reveal__close:hover {
  color: var(--color-cream);
  background: rgba(255,255,255,0.06);
}

.welcome-reveal__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(212,134,10,0.15);
}

.welcome-reveal__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-amber), #F0A832);
  animation: wRevealCountdown 6s linear forwards;
}

@keyframes wRevealCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ================================================================
   Product selection reveal card (slides in from right)
   ================================================================ */
.prod-reveal {
  position: fixed;
  right: 18px;
  top: 90px;
  width: 290px;
  z-index: 799;
  pointer-events: none;
}

@media (max-width: 520px) {
  .prod-reveal { right: 10px; left: 10px; width: auto; }
}

.prod-reveal__card {
  pointer-events: all;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 40px 0 15px;
  background: linear-gradient(135deg, #1a2412 0%, #243420 100%);
  border: 1px solid rgba(212,134,10,0.45);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 44px rgba(0,0,0,0.65), 0 0 0 1px rgba(212,134,10,0.06);
  animation: prodRevealSlide 0.38s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes prodRevealSlide {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.prod-reveal__icon {
  font-size: 22px;
  flex-shrink: 0;
  padding-top: 1px;
}

.prod-reveal__content {
  flex: 1;
  min-width: 0;
  padding-bottom: 13px;
}

.prod-reveal__kicker {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-amber);
  margin-bottom: 3px;
}

.prod-reveal__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-cream);
  line-height: 1.3;
  margin-bottom: 7px;
}

.prod-reveal__tags { display: flex; flex-wrap: wrap; gap: 4px; }

.prod-reveal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--color-cream-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  transition: color 0.15s;
}

.prod-reveal__close:hover { color: var(--color-cream); }

.prod-reveal__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(212,134,10,0.12);
}

.prod-reveal__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-amber), #F0A832);
  animation: prCountdown 4s linear forwards;
}

@keyframes prCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ---- Running total (desktop sticky) ---- */
.running-total {
  position: sticky;
  top: 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-amber);
  border-radius: 12px;
  padding: 24px;
}

.running-total__header {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--color-cream-muted);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--color-border);
  margin-bottom: 16px;
}

.running-total__header::before { content: '— '; }
.running-total__header::after  { content: ' —'; }

.running-total__line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--color-cream-muted);
}

.running-total__line.highlight { color: var(--color-cream); font-weight: 500; }

.running-total__divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 12px 0;
}

.running-total__total {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-amber);
  text-align: center;
  margin-bottom: 4px;
}

.running-total__label {
  text-align: center;
  font-size: 11px;
  color: var(--color-cream-muted);
  margin-bottom: 16px;
}

.running-total__first-delivery {
  background: rgba(212, 134, 10, 0.08);
  border: 1px solid var(--color-border-amber);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  text-align: center;
  color: var(--color-cream-muted);
  margin-bottom: 16px;
}

.running-total__first-delivery strong { color: var(--color-amber); display: block; font-size: 14px; }

.running-total__disclaimer {
  font-size: 11px;
  color: var(--color-cream-muted);
  text-align: center;
  line-height: 1.5;
  margin-top: 12px;
}

/* ---- Running total (mobile sticky bar) ---- */
.running-total-mobile {
  display: none;
}

@media (max-width: 1023px) {
  .running-total-mobile {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border-amber);
    padding: 10px 20px;
    justify-content: space-between;
    align-items: center;
  }
}

.mobile-total__amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-amber);
}

.mobile-total__label { font-size: 11px; color: var(--color-cream-muted); }

/* ---- CTA Button ---- */
.btn-cta {
  background: var(--color-cta);
  color: var(--color-cream);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 18px 48px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-cta:hover { background: var(--color-cta-hover); transform: translateY(-1px); }
.btn-cta:active { transform: translateY(0); }
.btn-cta:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border-amber);
  color: var(--color-amber);
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(212, 134, 10, 0.08); }

/* ---- Collection info box ---- */
.collection-info {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 18px;
  margin-top: 12px;
}

.collection-info__label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-amber); margin-bottom: 6px; }
.collection-info__address { font-weight: 500; margin-bottom: 4px; }
.collection-info__hours { font-size: 13px; color: var(--color-cream-muted); }

/* ---- Success page ---- */
.success-hero {
  text-align: center;
  padding: 60px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.success-icon { font-size: 64px; display: block; margin-bottom: 16px; }

.delivery-callout {
  background: rgba(212, 134, 10, 0.1);
  border: 1px solid var(--color-border-amber);
  border-radius: 10px;
  padding: 20px 24px;
  text-align: center;
  margin: 24px 0;
}

.delivery-callout__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-amber); margin-bottom: 4px; }
.delivery-callout__date { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--color-cream); }

.order-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.order-summary-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-cream-muted);
  border-bottom: 1px solid var(--color-border);
}

.order-summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.order-summary-table tr:last-child td { border-bottom: none; }

/* ---- Portal ---- */
.portal-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}

.status-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge--active   { background: rgba(90, 155, 106, 0.2); color: #5A9B6A; border: 1px solid #5A9B6A; }
.status-badge--paused   { background: rgba(212, 134, 10, 0.15); color: var(--color-amber); border: 1px solid var(--color-border-amber); }
.status-badge--cancelled { background: rgba(196, 91, 74, 0.15); color: var(--color-error); border: 1px solid var(--color-error); }
.status-badge--pending_payment { background: rgba(184, 168, 130, 0.15); color: var(--color-cream-muted); border: 1px solid var(--color-border); }
.status-badge--payment_failed  { background: rgba(196, 91, 74, 0.15); color: var(--color-error); border: 1px solid var(--color-error); }

/* ---- Login page ---- */
.login-card {
  max-width: 440px;
  margin: 80px auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
}

.login-card h2 { margin-bottom: 10px; }
.login-card p { color: var(--color-cream-muted); margin-bottom: 24px; font-size: 14px; }

/* ---- Utility ---- */
.text-muted { color: var(--color-cream-muted); }
.text-amber { color: var(--color-amber); }
.text-small { font-size: 13px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }

/* ---- Coffee plant background (xiv) ---- */
.coffee-plant-bg {
  position: fixed;
  right: -80px;
  top: 0;
  height: 100vh;
  width: auto;
  opacity: 0.30;
  pointer-events: none;
  z-index: 0;
  transform-origin: 50% 100%;
  animation: leafSway 14s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(58, 104, 38, 0.25));
}

/* ---- Zone required warning (xi) ---- */
.zone-required-warning {
  background: rgba(196, 88, 46, 0.1);
  border: 1px solid rgba(196, 88, 46, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-cta);
}

/* ---- Billing explanation (ix) ---- */
.billing-explanation {
  background: rgba(212, 134, 10, 0.06);
  border-left: 3px solid var(--color-amber);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin-bottom: 4px;
}

/* ---- Calendar (xiii) ---- */
.billing-calendar {
  margin-top: 20px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  overflow: hidden;
}

.calendar-header {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-cream);
  text-align: center;
  margin-bottom: 12px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-cream-muted);
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  position: relative;
  text-align: center;
  padding: 5px 2px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--color-cream-muted);
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.calendar-day--other-month { opacity: 0.25; }

.calendar-day--today {
  background: rgba(212, 134, 10, 0.12);
  border-color: rgba(212, 134, 10, 0.45);
  color: var(--color-amber);
  font-weight: 700;
}

.calendar-day--delivery {
  background: rgba(90, 155, 106, 0.12);
  border-color: rgba(90, 155, 106, 0.35);
  color: #6ABF7A;
  font-weight: 600;
}

.calendar-day--first-delivery {
  background: rgba(90, 155, 106, 0.25);
  border-color: rgba(90, 155, 106, 0.65);
  color: #7DD98A;
  font-weight: 700;
}

.calendar-day--billing {
  background: rgba(196, 88, 46, 0.12);
  border-color: rgba(196, 88, 46, 0.4);
  border-style: dashed;
  color: #E07050;
  font-weight: 600;
}

.calendar-day__badge {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  opacity: 0.9;
}

.calendar-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--color-cream-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot--today    { background: rgba(212,134,10,0.3); border: 1px solid var(--color-amber); }
.legend-dot--first    { background: rgba(90,155,106,0.45); border: 1px solid #7DD98A; }
.legend-dot--delivery { background: rgba(90,155,106,0.25); border: 1px solid #6ABF7A; }
.legend-dot--billing  { background: rgba(196,88,46,0.25); border: 1px dashed #E07050; }

/* ---- Error toast (xv) ---- */
.error-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-error);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.65);
  max-width: min(500px, calc(100vw - 32px));
  width: 100%;
}

.error-toast__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
}

.error-toast__title {
  color: var(--color-error);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
}

.error-toast__close {
  background: none;
  border: none;
  color: var(--color-cream-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}
.error-toast__close:hover { color: var(--color-cream); }

.error-toast__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.error-toast__list li {
  font-size: 13px;
  color: var(--color-cream);
  padding-left: 12px;
  position: relative;
}
.error-toast__list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-error);
}

/* ---- CTA pulse (xiv) ---- */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 88, 46, 0.45); }
  60%       { box-shadow: 0 0 0 10px rgba(196, 88, 46, 0); }
}

.btn-cta:not(:disabled) {
  animation: ctaPulse 2.5s ease-out infinite;
}

/* ═══════════════════════════════════════════════
   ORDER FANFARE OVERLAY
   ═══════════════════════════════════════════════ */

.order-fanfare {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 5, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---- Falling particles ---- */
.fanfare-cherries {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes cherryFall {
  0%   { transform: translateY(-60px) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--rot, 360deg)); opacity: 0; }
}

.f-cherry {
  position: absolute;
  top: 0;
  left: var(--x, 50%);
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 10%;
  background: radial-gradient(circle at 35% 35%, #e05d5d, #a02020);
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4);
  animation: cherryFall var(--dur, 2s) var(--delay, 0s) ease-in forwards;
}

.f-cherry::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 9px;
  background: #4a7c3f;
  border-radius: 2px;
}

.f-cherry--leaf {
  width: 22px;
  height: 12px;
  border-radius: 50% 10% 50% 10%;
  background: linear-gradient(135deg, #5a9e4a, #3a6e2e);
  box-shadow: none;
}
.f-cherry--leaf::after { display: none; }

.f-cherry--bean {
  width: 16px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #8b5e3c, #4a2e10);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.15);
}
.f-cherry--bean::after { display: none; }

/* ---- Centre card ---- */
.fanfare-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 56px 40px;
  background: linear-gradient(160deg, var(--color-surface) 0%, #1a160e 100%);
  border: 1px solid rgba(196, 156, 78, 0.35);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(196,156,78,0.12);
  text-align: center;
  animation: fanfareCardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes fanfareCardIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---- Pulse rings ---- */
.fanfare-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--color-amber);
  opacity: 0;
  animation: pulseRing 1.8s ease-out infinite;
}

.fanfare-pulse-ring--1 { width: 160px; height: 160px; animation-delay: 0s; }
.fanfare-pulse-ring--2 { width: 220px; height: 220px; animation-delay: 0.35s; }
.fanfare-pulse-ring--3 { width: 290px; height: 290px; animation-delay: 0.7s; }

@keyframes pulseRing {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1); }
}

/* ---- Check stamp ---- */
.fanfare-check {
  position: relative;
  z-index: 1;
  animation: checkStamp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes checkStamp {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.fanfare-check svg circle {
  animation: checkCircle 0.6s ease-out 0.35s both;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
}

@keyframes checkCircle {
  to { stroke-dashoffset: 0; }
}

/* ---- Text ---- */
.fanfare-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  color: var(--color-amber);
  margin: 0;
  animation: fanfareFadeUp 0.4s ease-out 0.55s both;
}

.fanfare-sub {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0;
  animation: fanfareFadeUp 0.4s ease-out 0.7s both;
}

@keyframes fanfareFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Loading dots ---- */
.fanfare-dots {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  animation: fanfareFadeUp 0.4s ease-out 0.85s both;
}

.fanfare-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-amber);
  animation: dotBounce 1s ease-in-out infinite;
}

.fanfare-dots span:nth-child(2) { animation-delay: 0.15s; }
.fanfare-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%            { transform: translateY(-6px); opacity: 1; }
}
