/* Tide to Wellness — mobile-first catalog */
:root {
  --teal: #1ABCB0;
  --teal-dark: #138a82;
  --navy: #003366;
  --navy-2: #0a2547;
  --ink: #0f1722;
  --muted: #5a6776;
  --line: #e7ecef;
  --bg: #fafbfc;
  --card: #ffffff;
  --warn: #b54708;
  --shadow-sm: 0 1px 2px rgba(15, 23, 34, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 34, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 34, 0.16);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { padding-bottom: calc(96px + var(--safe-bottom)); }
button { font-family: inherit; cursor: pointer; }
input, textarea, button { font: inherit; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.logo { width: 26px; height: 26px; color: var(--teal); }
.brand-text { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

.cart-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.cart-btn:active { transform: scale(0.96); background: #f3f6f9; }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--teal); color: white;
  font-size: 11px; font-weight: 700;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: white;
  padding: 28px 16px 32px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; left: -10%; right: -10%; bottom: -40px; height: 80px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(26,188,176,0.25), transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.kicker {
  margin: 0 0 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal); font-weight: 600;
}
.hero h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
.hero .sub { margin: 0; opacity: .82; font-size: 14px; }

/* Filters */
.filters {
  position: sticky;
  top: 57px;
  z-index: 20;
  background: var(--bg);
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.filters-row { max-width: 720px; margin: 0 auto 10px; }
.search {
  position: relative;
  display: flex; align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  gap: 8px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.search input {
  flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px;
}
.search input::placeholder { color: var(--muted); }

.chips {
  max-width: 720px; margin: 0 auto;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 4px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: all .15s ease;
}
.chip[aria-selected="true"] {
  background: var(--navy); color: white; border-color: var(--navy);
}
.chip:active { transform: scale(0.97); }

/* Grid */
main { max-width: 720px; margin: 0 auto; padding: 14px 12px 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.card:active { transform: scale(0.985); box-shadow: var(--shadow-md); }
.card-img {
  aspect-ratio: 1 / 1;
  background: #f3f6f9;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 8px;
  transition: transform .25s ease;
}
.card:active .card-img img { transform: scale(1.04); }
.card-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.card-name {
  font-size: 14px; font-weight: 600; line-height: 1.25;
  color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: 2.5em;
}
.card-cat { font-size: 11px; color: var(--muted); font-weight: 500; }
.card-foot {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-price { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-price .from { font-size: 10px; font-weight: 500; color: var(--muted); display: block; line-height: 1; }
.add-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 0;
  background: var(--teal);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
  box-shadow: 0 2px 8px rgba(26,188,176,0.35);
}
.add-btn:active { transform: scale(0.9); background: var(--teal-dark); }
.add-btn svg { width: 18px; height: 18px; stroke-width: 2.5; }

.empty {
  text-align: center; color: var(--muted); padding: 40px 12px;
}

/* Cart bar */
.cart-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(250,251,252,0.95) 30%, rgba(250,251,252,1) 100%);
  pointer-events: none;
}
.cart-bar-btn {
  pointer-events: auto;
  width: 100%; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: white;
  border: 0; border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: transform .12s ease, background .15s ease;
}
.cart-bar-btn:active { transform: translateY(1px) scale(0.99); background: var(--navy-2); }
.cart-bar-left { display: inline-flex; align-items: center; gap: 10px; }
.cart-bar-badge {
  background: var(--teal); color: white;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.cart-bar-total { font-variant-numeric: tabular-nums; }

/* Drawer */
.drawer {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,34,0.5);
  animation: fadeIn .2s ease;
}
.drawer-panel {
  position: relative;
  width: 100%; max-width: 560px;
  background: white;
  border-radius: 22px 22px 0 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
  border-bottom: 1px solid var(--line);
}
.drawer-head::before {
  content: ''; position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 2px; background: #d6dde2;
}
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px; border: 0; background: #f3f6f9; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: #e7ecef; }
.drawer-body {
  overflow-y: auto;
  padding: 12px 18px 16px;
  flex: 1;
}
.cart-empty {
  text-align: center; color: var(--muted); padding: 24px 12px;
}
.cart-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-row:last-of-type { border-bottom: 0; }
.cart-thumb {
  width: 56px; height: 56px; border-radius: 10px; background: #f3f6f9;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cart-info { min-width: 0; }
.cart-info-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.cart-info-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cart-info-price { font-size: 13px; color: var(--navy); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: white;
}
.qty button {
  width: 30px; height: 30px; border: 0; background: transparent;
  font-size: 16px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.qty button:active { background: #f3f6f9; }
.qty button:disabled { color: var(--muted); }
.qty span {
  min-width: 24px; text-align: center; font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.order-form { margin-top: 10px; }
.order-form hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 16px; /* 16px prevents iOS zoom */
  background: white; color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,188,176,0.18);
}
.field select {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 16px;
  background: white; color: var(--ink);
  outline: none; font-family: inherit;
  -webkit-appearance: none; appearance: none;
  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 fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Two-line / multi-column rows for the address grid */
.field-row { display: flex; gap: 10px; margin-bottom: 12px; }
.field-row .field { flex: 1; margin-bottom: 0; }
.field-row .flex-1 { flex: 1; }
.field-row .flex-2 { flex: 2; }
@media (max-width: 380px) {
  .field-row { flex-wrap: wrap; }
  .field-row .field { flex-basis: 100%; }
}

/* Delivery method toggle (Ship / Pickup) */
.delivery-toggle { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.field-legend { font-size: 13px; font-weight: 600; color: var(--ink); }
.radio-row { display: flex; gap: 10px; }
.radio-pill {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: white; cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 2px; }
.radio-pill:has(input:checked) {
  border-color: var(--teal);
  background: rgba(26,188,176,0.08);
  box-shadow: 0 0 0 2px rgba(26,188,176,0.18);
}
.radio-pill:has(input:checked) em { color: var(--teal-dark); font-weight: 600; }

/* Hide ship fields with smooth collapse when pickup chosen */
.ship-fields { display: block; }
.ship-fields[hidden] { display: none; }

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px calc(14px + var(--safe-bottom));
  background: white;
}
.totals { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.totals span { color: var(--muted); font-size: 13px; }
.totals strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.totals-grand { padding-top: 8px; margin-top: 4px; margin-bottom: 12px; border-top: 1px solid var(--line); }
.totals-grand span strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.totals-grand strong { font-size: 20px; font-weight: 800; color: var(--ink); }
.primary-btn {
  width: 100%; padding: 14px;
  background: var(--teal); color: white;
  border: 0; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s ease, transform .12s ease;
  box-shadow: 0 4px 14px rgba(26,188,176,0.3);
}
.primary-btn:active { transform: translateY(1px); background: var(--teal-dark); }
.primary-btn:disabled { background: #b3c0c8; box-shadow: none; cursor: not-allowed; }
.btn-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: white;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fineprint {
  margin: 10px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; text-align: center;
}
.ghost-btn {
  width: 100%; padding: 12px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; font-weight: 600;
  margin-top: 8px;
}
.ghost-btn:active { background: #f3f6f9; }

/* Size modal */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15,23,34,0.5); animation: fadeIn .15s ease; }
.modal-panel {
  position: relative;
  width: 100%; max-width: 380px;
  background: white; border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: scale(0.95); opacity: 0; } }
.modal-panel h3 { margin: 0 0 14px; font-size: 16px; }
.size-option {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: white; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; font-size: 14px; font-weight: 500;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.size-option:active { background: #f3f6f9; border-color: var(--teal); }
.size-option strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.size-option.oos { opacity: 0.45; cursor: not-allowed; background: #f7f7f7; }
.size-option.oos:active { background: #f7f7f7; border-color: #e3e6ea; }
.size-option.oos span { color: #999; }

/* Success */
.success { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.success-card {
  text-align: center; max-width: 380px; padding: 32px 24px;
  animation: pop .3s cubic-bezier(.2,.8,.2,1);
}
.success-icon {
  width: 72px; height: 72px; border-radius: 999px;
  background: var(--teal); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(26,188,176,0.4);
}
.success-card h2 { margin: 0 0 6px; font-size: 22px; }
.success-card p { color: var(--muted); margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.success-ref { font-size: 13px; margin: 16px 0 22px; }
.success-ref strong { color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* Footer */
.page-footer {
  text-align: center; padding: 24px 16px 12px;
  color: var(--muted); font-size: 12px;
  max-width: 720px; margin: 0 auto;
}
.page-footer p { margin: 0 0 4px; }
.page-footer a { color: var(--navy); }

/* Larger screens */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .hero { padding: 40px 16px 44px; }
  .hero h1 { font-size: 28px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Rep banner ---- */
.rep-banner {
  background: linear-gradient(135deg, #003366 0%, #1ABCB0 100%);
  color: #fff;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.rep-banner-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
}
.rep-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.7);
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
}
.rep-meta { flex: 1; min-width: 0; }
.rep-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin: 0 0 2px;
  font-weight: 500;
}
.rep-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.2;
}
.rep-welcome {
  font-size: 14px;
  line-height: 1.45;
  margin: 4px 0 0;
  opacity: 0.95;
}
.rep-contact {
  font-size: 13px;
  margin: 6px 0 0;
  opacity: 0.95;
}
.rep-contact a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}
@media (max-width: 480px) {
  .rep-photo { width: 52px; height: 52px; }
  .rep-name { font-size: 17px; }
  .rep-welcome { font-size: 13px; }
}

/* Nested sub-reps under each top-level rep */
.subrep-children {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(1, 105, 111, 0.04);
  border-left: 3px solid #01696F;
  border-radius: 6px;
}
.subrep-children-label {
  font-size: 12px;
  font-weight: 600;
  color: #0C4E54;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.subrep-row.subrep-nested {
  background: #fff;
  border: 1px solid #E5E2DA;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
}
.subrep-row.subrep-nested .subrep-name {
  font-size: 14px;
}

/* Customers table */
.customers-table-wrap {
  overflow-x: auto;
  border: 1px solid #E5E2DA;
  border-radius: 8px;
}
.customers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}
.customers-table th {
  text-align: left;
  background: #F9F8F5;
  color: #0C4E54;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #E5E2DA;
  white-space: nowrap;
}
.customers-table th:hover { background: #F0EFEA; }
.customers-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F0EFEA;
  vertical-align: top;
}
.customers-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.customers-table tbody tr:last-child td { border-bottom: none; }
.customer-name { font-weight: 600; color: #28251D; }
.customer-email { font-size: 12px; color: #7A7974; margin-top: 2px; }

/* =================== SUMMER SCULPT PROMO =================== */

/* ==========================================================================
   Peptide Stack product cards + Stack detail modal
   ========================================================================== */

/* Stack card on the grid — feels different from a regular product */
.card.card-stack {
  background: linear-gradient(180deg, #FBF6EF 0%, #F4EAE0 100%);
  border: 1px solid #E7D8C7;
  position: relative;
  overflow: hidden;
}
.card.card-stack::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(184,164,212,0.18), transparent 55%);
  pointer-events: none;
}
.card.card-stack .card-img {
  background: transparent;
}
.card.card-stack .card-img-stack {
  position: relative;
}
.stack-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #B8A4D4;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}
.card.card-stack .card-cat-stack {
  color: #8B7AAB;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card.card-stack .card-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #2B2622;
}
.card.card-stack .card-price .strike {
  color: #9D8E81;
  text-decoration: line-through;
  font-weight: 400;
  margin-right: 6px;
  font-size: 0.85em;
}
.card.card-stack .stack-view-btn {
  width: auto;
  height: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #B8A4D4;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.card.card-stack .stack-view-btn:hover {
  background: #A682CE;
}

/* ---- Stack detail modal ---- */
.stack-modal .modal-panel.stack-panel {
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: 92vh;
  padding: 0;
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* body scrolls inside; panel itself is fixed-height */
}
.stack-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Subtle bottom fade hints there's more content below */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
}
.stack-scroll.at-bottom {
  mask-image: none;
  -webkit-mask-image: none;
}
.stack-cta {
  flex: 0 0 auto;
  padding: 14px 24px 18px;
  background: #fff;
  border-top: 1px solid #EFE3D2;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}
.stack-cta .stack-add-btn { margin: 0; }
.stack-cta .stack-fine { margin: 8px 0 0; }
.stack-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.stack-hero {
  position: relative;
  background: linear-gradient(135deg, #F4EAE0 0%, #EBDCC8 100%);
  height: 220px; /* fixed on desktop so pricing + CTA are visible without scrolling */
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
@media (max-width: 600px) {
  .stack-hero { height: auto; aspect-ratio: 4/3; }
}
.stack-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stack-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stack-stars span {
  position: absolute;
  color: #B8A4D4;
  text-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.stack-stars span:nth-child(1) { top: 18%; left: 8%;  font-size: 26px; }
.stack-stars span:nth-child(2) { top: 62%; left: 14%; font-size: 18px; opacity: 0.7; }
.stack-stars span:nth-child(3) { top: 22%; right: 10%; font-size: 22px; opacity: 0.85; }
.stack-content {
  padding: 24px 24px 28px;
}
.stack-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8B7AAB;
  font-weight: 600;
  margin: 0 0 6px;
}
.stack-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.05;
  margin: 0 0 6px;
  color: #2B2622;
}
.stack-tagline {
  font-size: 15px;
  color: #6A5E55;
  font-style: italic;
  margin: 0 0 14px;
}
.stack-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #45403A;
  margin: 0 0 18px;
}
.stack-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.stack-benefit h4 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B8A4D4;
  margin: 0 0 6px;
  font-weight: 700;
}
.stack-benefit ul {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #45403A;
}
.stack-section-h {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6A5E55;
  margin: 18px 0 10px;
  font-weight: 700;
}
.stack-items {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #FBF6EF;
  border: 1px solid #EFE3D2;
  border-radius: 10px;
}
.stack-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  color: #2B2622;
  border-bottom: 1px dashed #E7D8C7;
}
.stack-items li:last-child { border-bottom: none; }
.stack-item-price { font-weight: 600; color: #45403A; }

.stack-pricing {
  border-top: 1px solid #E7D8C7;
  padding-top: 14px;
  margin-bottom: 16px;
}
.stack-price-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: #45403A;
}
.stack-price-strike {
  color: #9D8E81;
  text-decoration: line-through;
}
.stack-price-discount { color: #6DAA45; font-weight: 600; }
.stack-price-total {
  border-top: 1px solid #E7D8C7;
  padding-top: 10px;
  margin-top: 6px;
  font-size: 16px;
}
.stack-price-total strong { font-size: 18px; color: #2B2622; }
.stack-add-btn {
  width: 100%;
  background: #B8A4D4;
  color: #fff;
  font-size: 16px;
  padding: 14px 18px;
}
.stack-add-btn:hover { background: #A682CE; }
.stack-add-btn.added { background: #6DAA45; pointer-events: none; }
.stack-fine {
  font-size: 12px;
  color: #6A5E55;
  text-align: center;
  margin: 10px 0 0;
}

/* ---- Cart drawer additions ---- */
.cart-row-bundled .cart-info-name { color: #2B2622; }
.cart-info-bundle {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #8B7AAB;
  font-weight: 600;
  margin-top: 2px;
}
.totals-discount strong { color: #6DAA45; }
.cart-totals .strike { color: #9D8E81; text-decoration: line-through; font-weight: 400; margin-right: 6px; }

@media (max-width: 560px) {
  .stack-title { font-size: 30px; }
  .stack-hero { aspect-ratio: 4/3; }
  .stack-content { padding: 20px 18px 24px; }
  .stack-benefits { grid-template-columns: 1fr; }
}

/* SMS consent checkbox at checkout */
.sms-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f0f7f7;
  border: 1px solid #cce3e3;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 14px 0 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #2a3845;
  cursor: pointer;
}
.sms-consent input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
  accent-color: #01696F;
  width: 16px;
  height: 16px;
}
.sms-consent .sms-consent-text { flex: 1; }
.sms-consent a { color: #01696F; text-decoration: underline; }

/* ===========================================================
   SLEEP THEME — Restful Nights stacks
   Palette: midnight indigo, dusty lavender, moonlit silver
   =========================================================== */
.card.card-stack[data-theme="sleep"] .stack-badge {
  background: #6E5DA8;
  box-shadow: 0 2px 6px rgba(27,27,58,0.22);
}
.card.card-stack[data-theme="sleep"] .card-cat-stack {
  color: #6E5DA8;
}
.card.card-stack[data-theme="sleep"] .card-name {
  color: #1B1B3A;
}
.card.card-stack[data-theme="sleep"] .stack-view-btn {
  background: #6E5DA8;
}
.card.card-stack[data-theme="sleep"] .stack-view-btn:hover {
  background: #56489A;
}
.card.card-stack[data-theme="sleep"] .card-price .strike {
  color: #8B86A8;
}
/* Sleep card adds a soft moonlit halo on hover */
.card.card-stack[data-theme="sleep"] {
  transition: box-shadow .25s ease, transform .25s ease;
}
.card.card-stack[data-theme="sleep"]:hover {
  box-shadow: 0 8px 28px rgba(110,93,168,0.22);
}

/* Sleep modal — restful palette */
.stack-modal[data-theme="sleep"] .stack-hero {
  background: linear-gradient(135deg, #1B1B3A 0%, #2E2A5C 50%, #4A3F8C 100%);
}
.stack-modal[data-theme="sleep"] .stack-cta {
  background: #FAF8FF;
  border-top-color: #E2DCF1;
  box-shadow: 0 -4px 12px rgba(27,27,58,0.06);
}
.stack-modal[data-theme="sleep"] .stack-eyebrow {
  color: #6E5DA8;
}
.stack-modal[data-theme="sleep"] .stack-title {
  color: #1B1B3A;
}
.stack-modal[data-theme="sleep"] .stack-tagline {
  color: #4A3F8C;
}
.stack-modal[data-theme="sleep"] .stack-section-h {
  color: #1B1B3A;
  border-bottom-color: #E2DCF1;
}
.stack-modal[data-theme="sleep"] .stack-benefit h4 {
  color: #6E5DA8;
}
.stack-modal[data-theme="sleep"] .stack-benefit ul li::marker {
  color: #B19CD9;
}
.stack-modal[data-theme="sleep"] .stack-items li {
  border-bottom-color: #EDE7F8;
}
.stack-modal[data-theme="sleep"] .stack-add-btn {
  background: linear-gradient(135deg, #4A3F8C 0%, #6E5DA8 100%);
  color: #FAF8FF;
}
.stack-modal[data-theme="sleep"] .stack-add-btn:hover {
  background: linear-gradient(135deg, #3A2E7A 0%, #56489A 100%);
}
.stack-modal[data-theme="sleep"] .stack-close {
  background: rgba(250,248,255,0.92);
  color: #1B1B3A;
}
/* Replace teal stars overlay with silver moon-glow specks */
.stack-modal[data-theme="sleep"] .stack-stars span {
  color: #E8E4F5;
  text-shadow: 0 2px 8px rgba(200,200,216,0.55);
}

/* v10d — research-use disclaimer */
.page-footer .ruo-disclaimer {
  max-width: 760px;
  margin: 0 auto 10px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted, #6b7280);
  text-align: center;
  opacity: 0.85;
}

/* === Research Use Waiver (inline in checkout drawer) === */
.waiver-block {
  margin: 14px 0 12px;
  padding: 14px 14px 12px;
  background: #f7fafa;
  border: 1.5px solid #d8e3e5;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #1f3a40;
}
.waiver-title {
  font-weight: 700;
  font-size: 14px;
  color: #0b2e33;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.waiver-required {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #01696F;
  background: #e6f4f4;
  border: 1px solid #b8dbdc;
  padding: 2px 7px;
  border-radius: 999px;
}
.waiver-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 0;
  cursor: pointer;
}
.waiver-row input[type="checkbox"] {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: #01696F;
  cursor: pointer;
}
.waiver-row span { flex: 1; }
.waiver-row strong { color: #0b2e33; }
.waiver-sig-label {
  display: block;
  margin: 12px 0 5px;
  font-weight: 600;
  font-size: 12.5px;
  color: #1f3a40;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.waiver-sig-input {
  width: 100%;
  padding: 11px 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px;
  font-style: italic;
  background: #fff;
  border: 1.5px solid #c8d5d8;
  border-radius: 8px;
  color: #0b2e33;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.waiver-sig-input:focus {
  border-color: #01696F;
  box-shadow: 0 0 0 3px rgba(1,105,111,0.15);
}
.waiver-sig-input::placeholder {
  color: #95a8ad;
  font-style: italic;
}
.waiver-fineprint {
  margin-top: 8px;
  font-size: 11.5px;
  color: #5a6e72;
  line-height: 1.4;
}
.waiver-row.waiver-invalid {
  background: rgba(220,38,38,0.06);
  border-radius: 6px;
  padding: 6px 6px;
  margin: 0 -6px;
}
.waiver-sig-input.waiver-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
