*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F3F6EF;
  --surface: #FFFFFF;
  --surface2: #EBF0E5;
  --border: #DEE3D5;
  --border2: #B7C2A8;
  --text: #24261F;
  --text-2: #6B7566;
  --text-3: #9CA392;
  --accent: #56684A;
  --accent-hover: #465539;
  --accent-fg: #FFFFFF;
  --red: #B91C1C;
  --red-bg: #FEF2F2;
  --green: #15803D;
  --green-bg: #F0FDF4;
  --amber: #92400E;
  --amber-bg: #FFFBEB;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(28,43,24,0.08), 0 1px 2px rgba(28,43,24,0.04);
  --shadow-md: 0 4px 16px rgba(28,43,24,0.1), 0 2px 4px rgba(28,43,24,0.06);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; -webkit-text-size-adjust: 100%; }

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; z-index: 100;
}

.nav-logo .brand {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 500; color: var(--text); letter-spacing: -0.2px;
}

.nav-logo .sub {
  font-size: 10px; color: var(--text-3); letter-spacing: 0.5px;
  text-transform: uppercase; display: none; margin-top: 1px;
}

@media (min-width: 600px) { .nav-logo .sub { display: block; } .nav-logo .brand { font-size: 19px; } }

.nav-right { display: flex; align-items: center; gap: 8px; }

.nav-link { font-size: 14px; color: var(--text-2); text-decoration: none; transition: color 0.15s; display: none; }
.nav-link:hover { color: var(--text); }
@media (min-width: 700px) { .nav-link { display: inline; } .nav-right { gap: 12px; } }

.nav-btn {
  background: none; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 6px 11px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  color: var(--text); cursor: pointer; transition: background 0.15s; white-space: nowrap;
}

.nav-btn:hover { background: var(--surface2); }
.nav-btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.nav-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Hide "Sign up" text on very small screens, show icon-only */
@media (max-width: 400px) {
  .nav-btn { padding: 6px 9px; font-size: 12px; }
}

.cart-btn {
  background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 13px;
  font-family: 'Inter', sans-serif; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  position: relative; transition: background 0.15s; flex-shrink: 0;
}

.cart-btn:hover { background: var(--accent-hover); }

.cart-badge {
  background: #E53E3E; color: #fff;
  border-radius: 50%; width: 17px; height: 17px;
  font-size: 10px; font-weight: 500;
  display: none; align-items: center; justify-content: center;
  position: absolute; top: -6px; right: -6px;
}

.cart-badge.show { display: flex; }

/* ── HERO ── */
.hero {
  position: relative;
  text-align: center;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  background: #252B1F; /* matches the banner artwork's own background so the strip blends seamlessly into the text below */
}

/* Rotating designed banners — shown in full, untouched, at their native 1920×660 ratio */
.hero-banner-strip {
  position: relative;
  width: 100%;
  max-width: 1920px;
  aspect-ratio: 1920 / 660;
}

.hero-banner-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-banner-slide.active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-banner-slide { transition: none; }
}

/* ── OUR STORY (brand message under How it works) ── */
.story-section {
  background: #252B1F; /* same dark green as the banner artwork */
  border-radius: var(--radius);
  text-align: center;
  padding: 2.25rem 1.25rem 2.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) { .story-section { padding: 3.5rem 2rem 3.75rem; margin-bottom: 3rem; } }

.story-section h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 8vw, 52px);
  font-weight: 400; color: #fff; line-height: 1.2; margin-bottom: 1rem;
}

.story-section h1 em { font-style: italic; color: rgba(255,255,255,0.85); }

.story-eyebrow {
  display: block; margin-bottom: 0.9rem;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.5;
  color: rgba(255,255,255,0.6);
}
@media (min-width: 600px) { .story-eyebrow { font-size: 12px; } }

.story-section p {
  font-size: 14px; color: rgba(255,255,255,0.8);
  line-height: 1.75; max-width: 580px; margin: 0 auto 1.75rem;
}

.story-section p em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: rgba(255,255,255,0.85);
}

@media (min-width: 600px) { .story-section p { font-size: 15px; } }

.hero-cta {
  display: inline-block; background: #fff; color: var(--accent);
  border: none; border-radius: var(--radius-sm);
  padding: 11px 24px; font-size: 14px;
  font-family: 'Inter', sans-serif; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: opacity 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.hero-cta:hover { opacity: 0.9; }

/* ── TRUST BAR ── */
.trust-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex; justify-content: center; gap: 1rem 1.5rem; flex-wrap: wrap;
}

.trust-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* ── MAIN ── */
main { max-width: 1080px; margin: 1.75rem auto; padding: 0 1rem; }
@media (min-width: 600px) { main { margin: 2.5rem auto; padding: 0 1.5rem; } }

.section-header { margin-bottom: 1.5rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; color: var(--text); margin-bottom: 4px; }
@media (min-width: 600px) { .section-title { font-size: 26px; } }
.section-sub { font-size: 13px; color: var(--text-2); }

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem; margin-bottom: 1.5rem;
}

@media (min-width: 500px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 800px) { .product-grid { grid-template-columns: repeat(5, 1fr); gap: 1rem; } }

.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
  transform: translateY(0);
}

.product-card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 24px rgba(28,43,24,0.12), 0 2px 6px rgba(28,43,24,0.06);
  transform: translateY(-4px);
}

.product-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(86,104,74,0.15);
  transform: translateY(-4px);
}

.product-img-wrap {
  background: var(--surface2); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: background 0.22s;
  position: relative;
}

.product-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease, opacity 0.6s ease;
  opacity: 0;
}

.product-img-wrap img.active { opacity: 1; }

.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.product-card:hover .product-img-wrap { background: #E2EDE0; }

.product-card-body { padding: 0.625rem 0.75rem 0.875rem; }
@media (min-width: 600px) { .product-card-body { padding: 0.875rem 1rem 1rem; } }
.product-card-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
@media (min-width: 600px) { .product-card-name { font-size: 14px; } }
.product-card-desc { font-size: 11px; color: var(--text-3); margin-bottom: 8px; line-height: 1.4; display: none; }
@media (min-width: 500px) { .product-card-desc { display: block; } }
.product-card-price { font-size: 14px; font-weight: 500; color: var(--accent); }
@media (min-width: 600px) { .product-card-price { font-size: 16px; } }
.product-card-price span { font-size: 11px; font-weight: 400; color: var(--text-3); }

/* ── ORDER SECTION ── */
.order-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; display: none;
}

@media (min-width: 600px) { .order-section { padding: 2rem; margin-bottom: 3rem; } }

.order-section.open { display: block; }

.order-layout {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start;
}

@media (min-width: 680px) { .order-layout { grid-template-columns: 1fr 1.1fr; gap: 2.5rem; } }

.order-preview {
  background: var(--surface2); border-radius: var(--radius);
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.order-preview-img {
  width: 75%; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(28,43,24,0.18);
  object-fit: cover; aspect-ratio: 1; display: none;
}

.order-preview-placeholder {
  width: 60%; aspect-ratio: 1; border-radius: 10px;
  border: 1.5px dashed var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  color: var(--text-3); font-size: 12px; text-align: center; padding: 1rem;
}

.order-preview-placeholder svg { width: 24px; height: 24px; opacity: 0.4; }

.order-form h2 { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 400; margin-bottom: 4px; }
@media (min-width: 600px) { .order-form h2 { font-size: 21px; } }
.order-desc { font-size: 13px; color: var(--text-2); margin-bottom: 1.25rem; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1rem; }
.form-group { margin-bottom: 0.875rem; }

.form-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }

select, input[type="email"], input[type="password"], input[type="text"], input[type="tel"], textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; /* 16px prevents iOS zoom */ font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--bg); transition: border-color 0.15s;
}
textarea { resize: vertical; min-height: 90px; }

@media (min-width: 600px) {
  select, input[type="email"], input[type="password"], input[type="text"], input[type="tel"], textarea {
    font-size: 14px;
  }
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23556650' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-color: var(--bg); cursor: pointer;
}

select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }

/* Checkout: address autocomplete suggestions dropdown */
.addr-autocomplete-wrap { position: relative; }

.addr-suggestions {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 220px; overflow-y: auto; z-index: 20;
}

.addr-suggestions.open { display: block; }

.addr-suggestion {
  padding: 9px 12px; font-size: 13px; color: var(--text); cursor: pointer;
}

.addr-suggestion:not(:last-child) { border-bottom: 1px solid var(--border); }

.addr-suggestion:hover, .addr-suggestion.active { background: var(--surface2); }

/* Checkout: highlights a required field left blank when "Continue to payment" is clicked.
   !important ensures this always wins over the base input/select border and focus styles above,
   regardless of which field currently has focus. Clears automatically as the customer types. */
.field-error {
  border-color: var(--red) !important;
  background: var(--red-bg) !important;
}

.price-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 0.875rem;
}

.price-row .lbl { font-size: 13px; color: var(--text-2); }
.price-row .amt { font-size: 16px; font-weight: 500; color: var(--accent); }

/* ── SHIPPING ── */
.shipping-options { margin-bottom: 0.875rem; }
.shipping-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 6px;
  transition: border-color 0.15s, background 0.15s; background: var(--bg);
}

.shipping-option:hover { border-color: var(--border2); background: var(--surface2); }
.shipping-option.selected { border-color: var(--accent); background: #EEF1E8; }

.shipping-option input[type="radio"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer; padding: 0;
}

.shipping-option-info { flex: 1; min-width: 0; }
.shipping-option-name { font-size: 13px; font-weight: 500; color: var(--text); }
.shipping-option-desc { font-size: 11px; color: var(--text-3); }
.shipping-option-price { font-size: 13px; font-weight: 500; color: var(--accent); white-space: nowrap; }

.order-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--accent);
  border-radius: var(--radius-sm); margin-bottom: 0.875rem;
}

.order-total-row .lbl { font-size: 13px; color: rgba(255,255,255,0.8); }
.order-total-row .amt { font-size: 17px; font-weight: 500; color: #fff; }

/* ── UPLOAD ── */
.upload-zone {
  border: 1.5px dashed var(--border2); border-radius: var(--radius);
  padding: 1rem; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 0.75rem; background: var(--bg);
}

.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--surface2); }
.upload-zone svg { width: 22px; height: 22px; color: var(--text-3); margin-bottom: 5px; }
.upload-zone p { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.upload-zone strong { color: var(--accent); }
#fileInput { display: none; }

.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.75rem; }

.thumb-wrap { position: relative; width: 48px; height: 48px; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.thumb-remove {
  position: absolute; top: -5px; right: -5px;
  width: 16px; height: 16px; background: var(--red); color: #fff;
  border: none; border-radius: 50%; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.upload-status { font-size: 12px; color: var(--text-2); margin-bottom: 0.875rem; }
.upload-status.warn { color: var(--red); }
.upload-status.uploading { color: var(--accent); }
.upload-status.done { color: var(--green); }

.upload-progress-bar {
  width: 100%; height: 4px;
  background: var(--border); border-radius: 2px;
  margin-bottom: 0.875rem; overflow: hidden; display: none;
}
.upload-progress-bar.show { display: block; }
.upload-progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px; transition: width 0.3s ease;
  width: 0%;
}

.res-warning {
  background: var(--amber-bg); border: 1px solid #FDE68A;
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 12px; color: var(--amber); margin-bottom: 0.75rem;
  display: none; line-height: 1.5;
}
.res-warning.show { display: block; }

.thumb-wrap .thumb-status {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: var(--border); border-radius: 0 0 6px 6px; overflow: hidden;
}
.thumb-wrap .thumb-status-fill {
  height: 100%; background: var(--accent);
  transition: width 0.3s ease; width: 0%;
}
.thumb-wrap .thumb-status-fill.done { background: var(--green); }
.thumb-wrap .thumb-status-fill.error { background: var(--red); }

/* ── BUTTONS ── */
.btn {
  width: 100%; background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--radius-sm);
  padding: 12px; font-size: 15px;
  font-family: 'Inter', sans-serif; font-weight: 500;
  cursor: pointer; transition: background 0.15s; touch-action: manipulation;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { background: var(--border2); cursor: not-allowed; color: var(--text-3); }
.btn.outline { background: none; color: var(--text); border: 1px solid var(--border2); }
.btn.outline:hover { background: var(--surface2); }
.btn.sm { padding: 8px 16px; font-size: 13px; width: auto; }

/* ── HOW IT WORKS ── */
.how-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.25rem; margin-bottom: 2rem;
}

@media (min-width: 600px) { .how-section { padding: 2.5rem 2rem; margin-bottom: 3rem; } }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step { padding: 1rem; background: var(--surface2); border-radius: var(--radius-sm); }
.step-num { font-size: 10px; font-weight: 500; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.step h3 { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.step p { font-size: 12px; color: var(--text-2); line-height: 1.55; }

/* ── INSTAGRAM ── */
.instagram-section { margin-bottom: 2rem; }
@media (min-width: 600px) { .instagram-section { margin-bottom: 3rem; } }

.instagram-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-top: 1.25rem;
}

@media (min-width: 600px) { .instagram-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; } }

.instagram-post {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface2);
  border: 1px solid var(--border); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s; display: block; text-decoration: none;
}

.instagram-post:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.instagram-post img { width: 100%; height: 100%; object-fit: cover; display: block; }

.instagram-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; color: var(--text-3); font-size: 10px; text-align: center; padding: 6px;
}

.instagram-placeholder svg { width: 20px; height: 20px; opacity: 0.4; }

.instagram-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 0.875rem; font-size: 13px; color: var(--text-2); flex-wrap: wrap;
}

.instagram-cta a { color: var(--accent); text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.instagram-cta a:hover { text-decoration: underline; }

.ig-setup-note {
  background: var(--amber-bg); border: 1px solid #FDE68A;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 12px; color: var(--amber); margin-top: 0.75rem; line-height: 1.6;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,43,24,0.5);
  z-index: 300; display: none;
  align-items: flex-end; justify-content: center; padding: 0;
}

@media (min-width: 500px) {
  .modal-overlay { align-items: center; padding: 1rem; }
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
  overflow: hidden; max-height: 92vh; overflow-y: auto;
}

@media (min-width: 500px) {
  .modal { border-radius: var(--radius); max-height: none; }
}

.modal-header {
  padding: 1.25rem 1.5rem 0;
  display: flex; justify-content: space-between; align-items: flex-start;
}

.modal-header h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 0; min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 1rem 1.5rem 1.75rem; }

.modal-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.modal-tab { flex: 1; padding: 10px; text-align: center; font-size: 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s; }
.modal-tab.active { color: var(--accent); font-weight: 500; border-bottom-color: var(--accent); }

.input-group { margin-bottom: 0.875rem; }
.input-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }

.modal-error { font-size: 13px; color: var(--red); background: var(--red-bg); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 1rem; display: none; }
.modal-error.show { display: block; }
.modal-success { font-size: 13px; color: var(--green); background: var(--green-bg); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 1rem; display: none; }
.modal-success.show { display: block; }

/* ── CART DRAWER ── */
.cart-overlay { position: fixed; inset: 0; background: rgba(28,43,24,0.4); z-index: 200; display: none; }
.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed; top: 0; right: -100%;
  width: 100%; max-width: 420px;
  height: 100vh; /* fallback for browsers without dvh support */
  height: 100dvh; /* correctly accounts for the browser's own toolbar, which
                     iOS Chrome and Safari size differently even though they
                     share the same rendering engine — 100vh alone could push
                     the checkout button below the visible screen with no way
                     to scroll to it */
  background: var(--surface); z-index: 201;
  transition: right 0.28s ease; display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}

.cart-drawer.open { right: 0; }

.cart-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}

.cart-header h2 { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 400; }
.close-cart { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-3); min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; }

.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; -webkit-overflow-scrolling: touch; }
.cart-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 3rem 0; line-height: 1.7; }

.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }

.cart-item-img {
  width: 52px; height: 52px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0; background: var(--surface2);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 500; }
.cart-item-detail { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 14px; font-weight: 500; color: var(--accent); margin-top: 4px; }
.cart-item-remove { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 22px; padding: 0; align-self: flex-start; min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center; }

.cart-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); flex-shrink: 0; }

.cart-subtotals { margin-bottom: 12px; }
.cart-subtotal-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.cart-subtotal-row.total { font-size: 15px; font-weight: 500; color: var(--text); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

.checkout-note { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 8px; line-height: 1.5; }

/* ── ACCOUNT PAGE ── */
.account-page { display: none; }
.account-page.open { display: block; }

.account-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}

.account-avatar {
  width: 44px; height: 44px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 500; color: var(--accent); flex-shrink: 0;
}

.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 16px; font-weight: 500; }
.account-email { font-size: 13px; color: var(--text-3); }

/* ── ACCOUNT TABS ── */
.account-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; gap: 0; overflow-x: auto; }
.account-tab {
  padding: 10px 16px; font-size: 14px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
  font-family: 'Inter', sans-serif;
}
.account-tab.active { color: var(--accent); font-weight: 500; border-bottom-color: var(--accent); }

.account-panel { display: none; }
.account-panel.open { display: block; }

/* Settings panel */
.settings-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}

.settings-section-title {
  font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}

.settings-save-row { display: flex; justify-content: flex-end; margin-top: 1rem; gap: 8px; }

.settings-status {
  font-size: 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  margin-top: 0.75rem; display: none;
}
.settings-status.show { display: block; }
.settings-status.ok { background: var(--green-bg); color: var(--green); }
.settings-status.err { background: var(--red-bg); color: var(--red); }

/* Orders */
.orders-grid { display: flex; flex-direction: column; gap: 12px; }

.order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}

.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.order-card-id { font-size: 13px; font-weight: 500; }
.order-card-date { font-size: 12px; color: var(--text-3); }
.order-status { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 100px; }
.order-status.pending { background: #FEF3C7; color: #92400E; }
.order-status.processing { background: #EFF6FF; color: #1D4ED8; }
.order-status.shipped { background: var(--green-bg); color: #166534; }
.order-status.delivered { background: var(--green-bg); color: #166534; }
.order-card-items { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.order-card-total { font-size: 15px; font-weight: 500; color: var(--accent); }
.order-thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.order-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.empty-orders { text-align: center; padding: 3rem 0; color: var(--text-3); font-size: 14px; line-height: 1.7; }

/* ── FOOTER ── */
footer {
  background: #24261F; color: rgba(255,255,255,0.5);
  padding: 2rem 1.25rem; font-size: 13px; margin-top: 1rem;
}

@media (min-width: 600px) { footer { padding: 2.5rem 2rem; } }

.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start;
}

@media (min-width: 600px) { .footer-inner { grid-template-columns: 1fr auto; gap: 2rem; } }

.footer-brand { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 400; color: rgba(255,255,255,0.85); margin-bottom: 6px; }
.footer-tagline { font-size: 12px; margin-bottom: 0.875rem; }
.footer-email a { color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-email a:hover { color: #fff; }

.footer-social { display: flex; gap: 10px; align-items: center; margin-top: 1rem; }
@media (min-width: 600px) { .footer-social { margin-top: 0; } }

.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.social-link:hover { border-color: rgba(255,255,255,0.6); color: #fff; background: rgba(255,255,255,0.08); }

.footer-copy { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 1.25rem; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%;
  transform: translateX(-50%) translateY(64px);
  background: var(--text); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 400;
  transition: transform 0.25s ease; white-space: nowrap;
  box-shadow: var(--shadow-md); max-width: calc(100vw - 2rem); text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }

.scroll-anchor { scroll-margin-top: 72px; }

/* ── CHECKOUT PAGE ── */
.checkout-page {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 250;
  display: none; overflow-y: auto;
}
.checkout-page.open { display: block; }

.checkout-page-inner {
  max-width: 960px; margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
  min-height: 100vh;
}

@media (max-width: 720px) {
  .checkout-page-inner { grid-template-columns: 1fr; }
}

.checkout-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -1.5rem -1.5rem 2rem;
  grid-column: 1 / -1;
}

.checkout-nav .brand {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 500;
}

.checkout-nav-back {
  font-size: 13px; color: var(--text-2);
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  font-family: 'Inter', sans-serif;
}

.checkout-nav-back:hover { color: var(--accent); }

.checkout-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.checkout-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 400;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.checkout-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.checkout-tab {
  flex: 1; padding: 10px;
  text-align: center; font-size: 13px;
  color: var(--text-2); cursor: pointer;
  background: var(--bg); border: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.checkout-tab.active {
  background: var(--accent);
  color: #fff;
}

.checkout-tab-panel { display: none; }
.checkout-tab-panel.open { display: block; }

.checkout-order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 76px;
}

.checkout-summary-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 400;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.checkout-summary-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.checkout-summary-thumb {
  width: 48px; height: 48px;
  border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface2);
}

.checkout-summary-info { flex: 1; }
.checkout-summary-name { font-size: 13px; font-weight: 500; }
.checkout-summary-detail { font-size: 12px; color: var(--text-3); }
.checkout-summary-price { font-size: 14px; font-weight: 500; color: var(--accent); }

.checkout-totals { margin-top: 1rem; }
.checkout-total-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-2); margin-bottom: 6px;
}
.checkout-total-row.final {
  font-size: 16px; font-weight: 500; color: var(--text);
  padding-top: 10px; margin-top: 4px;
  border-top: 1px solid var(--border);
}

.co-error {
  font-size: 13px; color: var(--red); background: var(--red-bg);
  border-radius: var(--radius-sm); padding: 9px 12px;
  margin-bottom: 1rem; display: none;
}
.co-error.show { display: block; }

/* ── PAYMENT MODAL ── */
.payment-overlay {
  position: fixed; inset: 0;
  background: rgba(28,43,24,0.55);
  z-index: 210; display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.payment-overlay.open { display: flex; }

.payment-modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-md);
  overflow: hidden; max-height: 92vh; overflow-y: auto;
}

.payment-header {
  padding: 1.25rem 1.5rem 0;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.payment-header h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; }
.payment-close { background: none; border: none; font-size: 24px; color: var(--text-3); cursor: pointer; min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center; }

.payment-body { padding: 1rem 1.5rem 1.75rem; }

.payment-summary {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1.25rem;
}
.payment-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.payment-summary-row.total { font-size: 15px; font-weight: 500; color: var(--text); padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); margin-bottom: 0; }

#stripe-payment-element { margin-bottom: 1.25rem; }

.payment-error {
  font-size: 13px; color: var(--red); background: var(--red-bg);
  border-radius: var(--radius-sm); padding: 9px 12px;
  margin-bottom: 1rem; display: none;
}
.payment-error.show { display: block; }

.payment-secure {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--text-3); margin-top: 10px;
}

/* ── SUCCESS SCREEN ── */
.success-screen {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 220;
  display: none; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; padding: 2rem;
}
.success-screen.open { display: flex; }
.success-icon { width: 64px; height: 64px; background: var(--green-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }
.success-screen h2 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 400; margin-bottom: .75rem; }
.success-screen p { font-size: 14px; color: var(--text-2); max-width: 380px; line-height: 1.7; margin-bottom: 2rem; }
.success-details {
  width: min(760px, 100%);
  max-height: 58vh;
  overflow: auto;
  margin: 0 auto 1.5rem;
  text-align: left;
}

.success-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.success-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.success-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 3px;
}

.success-ref { font-size: 13px; font-weight: 500; color: var(--text); word-break: break-word; }
.success-date { font-size: 12px; color: var(--text-2); white-space: nowrap; }

.success-items { margin-bottom: 0.875rem; }
.success-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.success-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.success-item-info { flex: 1; min-width: 0; }
.success-item-name { font-size: 13px; font-weight: 500; color: var(--text); }
.success-item-detail { font-size: 12px; color: var(--text-3); }
.success-item-price { font-size: 13px; font-weight: 500; color: var(--accent); white-space: nowrap; }

.success-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 13px;
  color: var(--text-2);
  margin: 0.875rem 0;
}

.success-totals {
  border-top: 1px solid var(--border);
  padding-top: 0.875rem;
}
.success-totals div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.success-totals .success-total {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-top: 8px;
}

@media (max-width: 600px) {
  .success-screen { justify-content: flex-start; overflow: auto; }
  .success-detail-header, .success-info-grid { grid-template-columns: 1fr; flex-direction: column; }
  .success-date { white-space: normal; }
}

</style>

/* Product package preview cards - replaces broken inline base64 card images */
.magnet-preview {
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #E7EDE1);
  box-shadow: 0 10px 24px rgba(36,38,31,0.12);
  padding: 13%;
}

.magnet-preview-grid {
  width: 100%;
  display: grid;
  gap: 7px;
}

.magnet-preview.single .magnet-preview-grid { grid-template-columns: 1fr; }
.magnet-preview.four .magnet-preview-grid { grid-template-columns: repeat(2, 1fr); }
.magnet-preview.six .magnet-preview-grid { grid-template-columns: repeat(3, 1fr); }
.magnet-preview.many .magnet-preview-grid { grid-template-columns: repeat(3, 1fr); }

.magnet-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: linear-gradient(145deg, #C7D3BA, #F3F6EF);
  border: 1px solid rgba(86,104,74,0.18);
  box-shadow: 0 2px 5px rgba(36,38,31,0.08);
}

.magnet-preview-count {
  position: absolute;
  right: -8px;
  bottom: -8px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 15px;
  border: 3px solid var(--surface2);
}

/* Product image fallback shown only if a package image is missing */
.magnet-image-fallback {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-size: 42px;
}

/* ── LOGO ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 2px;
  background: var(--accent);
  border: 1px solid var(--border2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-logo-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.checkout-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkout-brand .nav-logo-mark {
  width: 36px;
  height: 36px;
}

.checkout-brand .nav-logo-mark img {
  width: 29px;
  height: 29px;
}

@media (max-width: 420px) {
  .nav-logo-mark { width: 34px; height: 34px; }
  .nav-logo-mark img { width: 28px; height: 28px; }
  .nav-logo .brand { font-size: 14px; }
}

/* ── 50x50 MAGNET PREVIEW ── */
.order-preview {
  background:
    radial-gradient(circle at 16% 10%, rgba(255,255,255,.98), rgba(255,255,255,0) 34%),
    linear-gradient(145deg, #F0F3EB 0%, #E3E9DB 48%, #F5F7F1 100%);
  border: 1px solid var(--border);
  position: relative;
}

.magnet-preview-board {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 16px;
  padding: clamp(18px, 4vw, 34px);
}

.magnet-preview-title {
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.35;
  flex: 0 0 auto;
}

.magnet-preview-tray {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 24px);
  filter: drop-shadow(0 14px 18px rgba(36,38,31,0.20));
}

.magnet-preview-tile {
  width: clamp(94px, 27%, 150px);
  aspect-ratio: 1;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.75),
    inset 5px 5px 12px rgba(255,255,255,0.42),
    inset -5px -6px 12px rgba(0,0,0,0.22),
    0 2px 0 rgba(255,255,255,0.92),
    0 10px 18px rgba(36,38,31,0.25);
  transform: rotate(var(--tilt, -1deg));
}

.magnet-preview-count-1 .magnet-preview-tile { width: min(72%, 300px); }
.magnet-preview-count-2 .magnet-preview-tile,
.magnet-preview-count-3 .magnet-preview-tile { width: clamp(125px, 35%, 190px); }
.magnet-preview-count-4 .magnet-preview-tile { width: clamp(118px, 34%, 175px); }
.magnet-preview-count-5 .magnet-preview-tile,
.magnet-preview-count-6 .magnet-preview-tile { width: clamp(108px, 30%, 155px); }
.magnet-preview-count-7 .magnet-preview-tile,
.magnet-preview-count-8 .magnet-preview-tile,
.magnet-preview-count-9 .magnet-preview-tile { width: clamp(96px, 28%, 140px); }
.magnet-preview-count-10 .magnet-preview-tile,
.magnet-preview-count-11 .magnet-preview-tile,
.magnet-preview-count-12 .magnet-preview-tile { width: clamp(82px, 22%, 118px); }

.magnet-preview-tile:nth-child(2n) { --tilt: 1.5deg; }
.magnet-preview-tile:nth-child(3n) { --tilt: -2deg; }
.magnet-preview-tile:nth-child(5n) { --tilt: 2deg; }

.magnet-preview-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.58), rgba(255,255,255,0.07) 36%, rgba(0,0,0,0.08) 100%);
  z-index: 1;
  pointer-events: none;
}

.magnet-preview-tile::after {
  content: '50×50';
  position: absolute;
  right: 5px;
  bottom: 4px;
  z-index: 2;
  font-size: 9px;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: .2px;
}

.magnet-preview-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 680px) {
  .order-preview { }
}

@media (max-width: 420px) {
  .magnet-preview-board { padding: 16px; }
  .magnet-preview-tray { gap: 10px; }
  .magnet-preview-tile { width: clamp(82px, 29%, 120px); }
  .magnet-preview-count-10 .magnet-preview-tile,
  .magnet-preview-count-11 .magnet-preview-tile,
  .magnet-preview-count-12 .magnet-preview-tile { width: clamp(68px, 22%, 92px); }
}

/* ── CHECKOUT SAVE DETAILS ── */
.checkout-save-details {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: -0.25rem 0 1rem;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

.checkout-save-details input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.success-photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.success-magnet-mini {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  box-shadow: inset -2px -2px 5px rgba(0,0,0,.2), 0 2px 5px rgba(0,0,0,.14);
}

.success-magnet-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ── PATCH: larger 50x50 magnet preview that fills the preview box ── */
.order-preview {
  align-items: stretch;
  justify-content: stretch;
}

.magnet-preview-board {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: clamp(14px, 2.4vw, 24px);
  gap: 12px;
}

.magnet-preview-title {
  font-size: clamp(12px, 1.4vw, 14px);
  margin-bottom: 2px;
}

.magnet-preview-tray {
  flex: 1 1 auto;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: clamp(10px, 1.8vw, 18px);
  place-content: center;
  align-content: center;
  justify-content: center;
}

.magnet-preview-tile {
  width: 100% !important;
  max-width: none;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.magnet-preview-count-1 .magnet-preview-tray { grid-template-columns: minmax(220px, 78%); }
.magnet-preview-count-2 .magnet-preview-tray { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
.magnet-preview-count-3 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(105px, 1fr)); }
.magnet-preview-count-4 .magnet-preview-tray { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
.magnet-preview-count-5 .magnet-preview-tray,
.magnet-preview-count-6 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(105px, 1fr)); }
.magnet-preview-count-7 .magnet-preview-tray,
.magnet-preview-count-8 .magnet-preview-tray,
.magnet-preview-count-9 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(92px, 1fr)); }
.magnet-preview-count-10 .magnet-preview-tray,
.magnet-preview-count-11 .magnet-preview-tray,
.magnet-preview-count-12 .magnet-preview-tray { grid-template-columns: repeat(4, minmax(72px, 1fr)); }

.payment-loading-note {
  border: 1px dashed var(--border2);
  background: var(--bg);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 520px) {
  .order-preview { }
  .magnet-preview-board { padding: 12px; }
  .magnet-preview-tray { gap: 9px; }
  .magnet-preview-count-1 .magnet-preview-tray { grid-template-columns: minmax(190px, 85%); }
  .magnet-preview-count-2 .magnet-preview-tray,
  .magnet-preview-count-3 .magnet-preview-tray,
  .magnet-preview-count-4 .magnet-preview-tray,
  .magnet-preview-count-5 .magnet-preview-tray,
  .magnet-preview-count-6 .magnet-preview-tray,
  .magnet-preview-count-7 .magnet-preview-tray,
  .magnet-preview-count-8 .magnet-preview-tray,
  .magnet-preview-count-9 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(74px, 1fr)); }
  .magnet-preview-count-10 .magnet-preview-tray,
  .magnet-preview-count-11 .magnet-preview-tray,
  .magnet-preview-count-12 .magnet-preview-tray { grid-template-columns: repeat(4, minmax(54px, 1fr)); }
}

/* ── FIX: keep the upload preview inside its column and make it responsive ── */
.order-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  align-items: start;
}

.order-layout > * { min-width: 0; }

.order-preview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: none;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}

.order-preview-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: var(--radius-sm);
}

.magnet-preview-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(12px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.magnet-preview-title {
  flex: 0 0 auto;
  font-size: clamp(11px, 1.2vw, 13px);
  margin: 0 0 10px;
  text-align: center;
}

.magnet-preview-tray {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  display: grid;
  gap: clamp(8px, 1.3vw, 14px);
  align-content: center;
  justify-content: center;
  place-items: center;
}

.magnet-preview-tile {
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}

.magnet-preview-count-1 .magnet-preview-tray { grid-template-columns: minmax(0, 78%); }
.magnet-preview-count-2 .magnet-preview-tray { grid-template-columns: repeat(2, minmax(0, 46%)); }
.magnet-preview-count-3 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(0, 31%)); }
.magnet-preview-count-4 .magnet-preview-tray { grid-template-columns: repeat(2, minmax(0, 42%)); }
.magnet-preview-count-5 .magnet-preview-tray,
.magnet-preview-count-6 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(0, 30%)); }
.magnet-preview-count-7 .magnet-preview-tray,
.magnet-preview-count-8 .magnet-preview-tray,
.magnet-preview-count-9 .magnet-preview-tray { grid-template-columns: repeat(3, minmax(0, 29%)); }
.magnet-preview-count-10 .magnet-preview-tray,
.magnet-preview-count-11 .magnet-preview-tray,
.magnet-preview-count-12 .magnet-preview-tray { grid-template-columns: repeat(4, minmax(0, 23%)); }

@media (max-width: 679px) {
  .order-layout { grid-template-columns: 1fr; }
  .order-preview { max-height: none; }
}

/* Make checkout payment errors readable but not layout-breaking. */
.co-error.show, .payment-error.show {
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* ══ PREVIEW BOX ══ */
.order-section { overflow: visible; }
.order-layout { display:grid !important; grid-template-columns:minmax(0,0.9fr) minmax(0,1.1fr) !important; align-items:start !important; gap:2rem !important; }
.order-layout > * { min-width:0 !important; }
.order-preview { position:relative !important; width:100% !important; aspect-ratio:1/1 !important; max-height:none !important; overflow:hidden !important; display:flex !important; align-items:stretch !important; justify-content:stretch !important; align-self:start !important; flex-shrink:0 !important; top:auto !important; }
.order-preview-placeholder { position:absolute !important; inset:0 !important; width:auto !important; height:auto !important; aspect-ratio:auto !important; margin:0 !important; border:1.5px dashed var(--border2) !important; border-radius:var(--radius-sm) !important; display:flex !important; align-items:center !important; justify-content:center !important; flex-direction:column !important; gap:8px !important; padding:1rem !important; z-index:1 !important; }
.order-preview-img { display:none !important; }
.magnet-preview-board { position:absolute !important; inset:0 !important; width:100% !important; height:100% !important; overflow:hidden !important; box-sizing:border-box !important; z-index:2 !important; }
@media (min-width:680px) { .order-preview { position:relative !important; top:auto !important; } }
@media (max-width:679px) { .order-layout { grid-template-columns:1fr !important; } }
.account-tabs { scrollbar-width:none !important; -ms-overflow-style:none !important; }
.account-tabs::-webkit-scrollbar { display:none !important; }
.order-detail-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:1.25rem; padding-bottom:1rem; border-bottom:1px solid var(--border); }
.order-detail-ref { font-family:'Playfair Display',serif; font-size:18px; font-weight:400; color:var(--text); }
.order-detail-date { font-size:13px; color:var(--text-2); margin-top:3px; }
.order-detail-section { margin-bottom:1rem; padding-bottom:1rem; border-bottom:1px solid var(--border); }
.order-detail-section:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }
.order-detail-label { font-size:11px; font-weight:500; color:var(--text-3); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:5px; }
.order-detail-total { font-size:18px; font-weight:500; color:var(--text); }
.order-detail-photos { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.order-detail-photo { width:60px; height:60px; object-fit:cover; border-radius:6px; box-shadow:0 2px 6px rgba(0,0,0,0.15); }
.orders-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:1rem; }
.orders-toolbar select { font-size:13px; padding:6px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg); color:var(--text); cursor:pointer; min-width:130px; }

/* ══════════════════════════════════════════════
   LEGAL / STATIC PAGES
   (contact, privacy-policy, returns-policy, shipping-policy, terms)
   Scoped under .legal-page so it never touches the storefront's own
   nav/footer/form/button rules above.
   ══════════════════════════════════════════════ */

body.legal-page { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; }

.legal-page main { max-width: 740px; margin: 2.5rem auto; padding: 0 1.5rem 4rem; }
@media (max-width: 600px) { .legal-page main { padding: 0 1rem 3rem; } }

.legal-page .page-hero {
  background: var(--text); border-radius: var(--radius);
  padding: 2.5rem 2rem; margin-bottom: 2.5rem; color: #fff;
}
.legal-page .page-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(24px, 4vw, 36px); font-weight: 400; margin-bottom: 0.5rem; }
.legal-page .page-hero p { font-size: 13px; color: rgba(255,255,255,0.55); }

.legal-page .highlight-box {
  background: var(--surface2); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.875rem 1rem; margin: 0.75rem 0; font-size: 13px; color: var(--text-2);
}
.legal-page .highlight-box a { color: var(--accent); }

.legal-page .nav-back { font-size: 13px; color: var(--text-2); text-decoration: none; display: flex; align-items: center; gap: 6px; transition: color 0.15s; }
.legal-page .nav-back:hover { color: var(--accent); }

/* ── Simple legal pages: privacy, returns, shipping, terms ── */
.simple-legal-page nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; z-index: 10;
}
.simple-legal-page .nav-logo .brand { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 500; color: var(--text); text-decoration: none; display: block; }
.simple-legal-page .nav-logo .sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; text-transform: uppercase; }

.simple-legal-page .legal-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.simple-legal-page .legal-nav a {
  font-size: 12px; padding: 5px 12px; border-radius: 100px;
  border: 1px solid var(--border2); color: var(--text-2);
  text-decoration: none; transition: all 0.15s;
}
.simple-legal-page .legal-nav a:hover, .simple-legal-page .legal-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.simple-legal-page .policy-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem 2rem; margin-bottom: 1.25rem; }
.simple-legal-page .policy-section h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: var(--text); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.simple-legal-page .policy-section h3 { font-size: 14px; font-weight: 500; color: var(--text); margin: 1.25rem 0 0.5rem; }
.simple-legal-page .policy-section p { font-size: 14px; color: var(--text-2); margin-bottom: 0.875rem; line-height: 1.75; }
.simple-legal-page .policy-section p:last-child { margin-bottom: 0; }
.simple-legal-page .policy-section ul { margin: 0.5rem 0 0.875rem 1.25rem; }
.simple-legal-page .policy-section ul li { font-size: 14px; color: var(--text-2); margin-bottom: 0.375rem; line-height: 1.65; }
.simple-legal-page .policy-section a { color: var(--accent); text-decoration: none; }
.simple-legal-page .policy-section a:hover { text-decoration: underline; }

.simple-legal-page footer { background: var(--text); color: rgba(255,255,255,0.45); padding: 2rem 1.5rem; font-size: 13px; line-height: 1.8; text-align: center; }
.simple-legal-page footer strong { color: rgba(255,255,255,0.8); }
.simple-legal-page footer a { color: rgba(255,255,255,0.55); }
.simple-legal-page .footer-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 0.75rem; }
.simple-legal-page .footer-links a { color: rgba(255,255,255,0.45); text-decoration: none; font-size: 12px; }
.simple-legal-page .footer-links a:hover { color: #fff; }

@media (max-width: 600px) {
  .simple-legal-page main { padding: 0 1rem 3rem; }
  .simple-legal-page .policy-section { padding: 1.25rem; }
}

/* ── Contact page (its own richer nav/footer with logo mark and social icons) ── */
.contact-page nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; z-index: 10;
}
.contact-page .nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.contact-page .nav-logo-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.contact-page .nav-logo-mark img { width: 28px; height: 28px; object-fit: contain; }
.contact-page .nav-logo-text { display: flex; flex-direction: column; }
.contact-page .nav-brand { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 400; color: var(--text); line-height: 1.2; }
.contact-page .nav-sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; text-transform: uppercase; display: none; }
@media (min-width: 600px) { .contact-page .nav-sub { display: block; } .contact-page .nav-brand { font-size: 19px; } }

.contact-page .page-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.contact-page .page-nav a {
  font-size: 12px; padding: 5px 12px; border-radius: 100px;
  border: 1px solid var(--border2); color: var(--text-2);
  text-decoration: none; transition: all 0.15s;
}
.contact-page .page-nav a:hover, .contact-page .page-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.contact-page .section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem 2rem; margin-bottom: 1.25rem; }
@media (max-width: 600px) { .contact-page .section { padding: 1.25rem; } }
.contact-page .section h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: var(--text); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.contact-page .section h3 { font-size: 14px; font-weight: 500; color: var(--text); margin: 1.25rem 0 0.5rem; }
.contact-page .section p { font-size: 14px; color: var(--text-2); margin-bottom: 0.875rem; line-height: 1.75; }
.contact-page .section p:last-child { margin-bottom: 0; }
.contact-page .section a { color: var(--accent); text-decoration: none; }
.contact-page .section a:hover { text-decoration: underline; }

.contact-page .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1rem; }
@media (max-width: 480px) { .contact-page .form-row { grid-template-columns: 1fr; } }
.contact-page .form-group { margin-bottom: 1rem; }
.contact-page .form-label {
  display: block; font-size: 11px; font-weight: 500; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px;
}
.contact-page input[type="text"], .contact-page input[type="email"], .contact-page select, .contact-page textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Inter', sans-serif;
  background: var(--bg); color: var(--text);
  transition: border-color 0.15s; outline: none;
}
.contact-page input[type="text"]:focus, .contact-page input[type="email"]:focus, .contact-page select:focus, .contact-page textarea:focus {
  border-color: var(--accent);
}
.contact-page select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236B7566' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.contact-page textarea { resize: vertical; min-height: 120px; }
.contact-page .form-msg { font-size: 13px; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 1rem; display: none; }
.contact-page .form-msg.error { background: var(--red-bg); color: var(--red); }
.contact-page .form-msg.success { background: var(--green-bg); color: var(--green); }
.contact-page .btn-submit {
  background: var(--accent); color: var(--accent-fg); border: none;
  border-radius: var(--radius-sm); padding: 12px 28px;
  font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.contact-page .btn-submit:hover { background: var(--accent-hover); }
.contact-page .btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.contact-page footer { background: var(--text); color: rgba(255,255,255,0.5); padding: 2rem 1.25rem; font-size: 13px; margin-top: 1rem; }
@media (min-width: 600px) { .contact-page footer { padding: 2.5rem 2rem; } }
.contact-page .footer-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
@media (min-width: 600px) { .contact-page .footer-inner { grid-template-columns: 1fr auto; gap: 2rem; } }
.contact-page .footer-brand { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 400; color: rgba(255,255,255,0.85); margin-bottom: 6px; }
.contact-page .footer-tagline { font-size: 12px; margin-bottom: 0.875rem; }
.contact-page .footer-email a { color: rgba(255,255,255,0.6); text-decoration: none; }
.contact-page .footer-email a:hover { color: #fff; }
.contact-page .footer-social { display: flex; gap: 10px; align-items: center; margin-top: 1rem; }
@media (min-width: 600px) { .contact-page .footer-social { margin-top: 0; } }
.contact-page .social-link {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.contact-page .social-link:hover { border-color: rgba(255,255,255,0.6); color: #fff; background: rgba(255,255,255,0.08); }
.contact-page .footer-links { display: flex; flex-direction: column; gap: 6px; margin-top: 1.25rem; }
.contact-page .footer-links a { font-size: 12px; color: rgba(255,255,255,0.45); text-decoration: none; }
.contact-page .footer-links a:hover { color: #fff; }
.contact-page .footer-copy { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 1.25rem; }

/* ══════════════════════════════════════════════
   ADMIN DASHBOARD
   Scoped under .admin-page (with its own local colour variables,
   keeping its distinct forest-green theme) so nothing here touches
   the storefront or legal-page rules above.
   ══════════════════════════════════════════════ */

.admin-page {
  --bg: #F4F7F2;
  --surface: #FFFFFF;
  --surface2: #EDF2EA;
  --border: #D6E0D0;
  --border2: #BACFB2;
  --text: #1C2B18;
  --text-2: #556650;
  --text-3: #8FA688;
  --accent: #3A6B34;
  --accent-hover: #2E5429;
  --accent-fg: #FFFFFF;
  --red: #B91C1C;
  --red-bg: #FEF2F2;
  --green: #15803D;
  --green-bg: #F0FDF4;
  --amber: #92400E;
  --amber-bg: #FFFBEB;
  --blue: #1D4ED8;
  --blue-bg: #EFF6FF;
  --shadow: 0 1px 3px rgba(28,43,24,0.08);
  --shadow-md: 0 4px 16px rgba(28,43,24,0.1);
}

body.admin-page { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; }

/* ── Login screen ── */
.admin-page .login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.admin-page .login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.admin-page .login-card h1 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; margin-bottom: 4px; }
.admin-page .login-card p { font-size: 13px; color: var(--text-2); margin-bottom: 1.5rem; }

.admin-page .form-group { margin-bottom: 1rem; }
.admin-page .form-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }

.admin-page input[type="email"], .admin-page input[type="password"], .admin-page input.mfa-code {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--bg); transition: border-color 0.15s;
}
.admin-page input:focus { outline: none; border-color: var(--accent); }

.admin-page .btn {
  width: 100%; background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--radius-sm);
  padding: 11px; font-size: 14px; font-family: 'Inter', sans-serif;
  font-weight: 500; cursor: pointer; transition: background 0.15s;
}
.admin-page .btn:hover { background: var(--accent-hover); }
.admin-page .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-page .btn.sm { width: auto; padding: 6px 14px; font-size: 13px; }
.admin-page .btn.outline { background: none; color: var(--text); border: 1px solid var(--border2); }
.admin-page .btn.outline:hover { background: var(--surface2); }
.admin-page .btn.danger { background: var(--red); }
.admin-page .btn.danger:hover { background: #991b1b; }

.admin-page .error-msg { font-size: 13px; color: var(--red); background: var(--red-bg); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 1rem; display: none; }
.admin-page .error-msg.show { display: block; }

/* ── Main layout ── */
.admin-page .admin-wrap { display: none; min-height: 100vh; flex-direction: column; }
.admin-page .admin-wrap.open { display: flex; }

.admin-page header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.5rem; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.admin-page .header-left { display: flex; align-items: center; gap: 12px; }
.admin-page .header-logo { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 400; }
.admin-page .admin-badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 100px; letter-spacing: 0.5px; text-transform: uppercase; }
.admin-page .header-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }

.admin-page .admin-content { max-width: 1100px; margin: 1.5rem auto; padding: 0 1.5rem; flex: 1; width: 100%; }

/* ── Stat cards ── */
.admin-page .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.admin-page .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.admin-page .stat-label { font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.admin-page .stat-value { font-size: 26px; font-weight: 500; color: var(--text); line-height: 1; }
.admin-page .stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── Filters ── */
.admin-page .filters-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-page .filter-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 5px 14px; font-size: 12px;
  font-family: 'Inter', sans-serif; cursor: pointer; color: var(--text-2);
  transition: all 0.15s;
}
.admin-page .filter-btn:hover { border-color: var(--border2); color: var(--text); }
.admin-page .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.admin-page .search-input {
  flex: 1; min-width: 180px; max-width: 280px;
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: 'Inter', sans-serif; background: var(--surface);
  color: var(--text);
}
.admin-page .search-input:focus { outline: none; border-color: var(--accent); }

/* ── Orders table ── */
.admin-page .orders-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.admin-page .orders-loading { text-align: center; padding: 3rem; color: var(--text-3); font-size: 13px; }
.admin-page .orders-empty { text-align: center; padding: 3rem; color: var(--text-3); font-size: 13px; line-height: 1.7; }

/* min-width forces the table to scroll horizontally on narrow screens rather
   than squeezing every column down to unreadable widths. */
.admin-page table { width: 100%; min-width: 720px; border-collapse: collapse; }
.admin-page thead tr { background: var(--surface2); border-bottom: 1px solid var(--border); }
.admin-page th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.admin-page tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.admin-page tbody tr:last-child { border-bottom: none; }
.admin-page tbody tr:hover { background: var(--bg); }
.admin-page td { padding: 12px 14px; font-size: 13px; vertical-align: middle; }

.admin-page .order-id { font-weight: 500; font-family: monospace; font-size: 12px; color: var(--text-2); }
.admin-page .order-customer { font-weight: 500; }
.admin-page .order-email { font-size: 12px; color: var(--text-3); }

.admin-page .status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 100px; white-space: nowrap; }
.admin-page .status-badge.pending { background: var(--amber-bg); color: var(--amber); }
.admin-page .status-badge.processing { background: var(--blue-bg); color: var(--blue); }
.admin-page .status-badge.printed { background: #F3E8FF; color: #6B21A8; }
.admin-page .status-badge.shipped { background: var(--green-bg); color: var(--green); }
.admin-page .status-badge.delivered { background: var(--green-bg); color: var(--green); }
.admin-page .status-badge.resolved { background: var(--green-bg); color: var(--green); }

.admin-page .photo-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-page .photo-thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s; }
.admin-page .photo-thumb:hover { transform: scale(1.1); }

.admin-page .action-select {
  padding: 5px 26px 5px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px;
  font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text);
  cursor: pointer;
}
.admin-page .action-select:focus { outline: none; border-color: var(--accent); }

/* ── Order detail panel ── */
.admin-page .detail-overlay {
  position: fixed; inset: 0; background: rgba(28,43,24,0.45);
  z-index: 200; display: none; align-items: flex-start; justify-content: flex-end;
}
.admin-page .detail-overlay.open { display: flex; }
.admin-page .detail-panel {
  background: var(--surface); width: 100%; max-width: 480px; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md);
}
.admin-page .detail-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.admin-page .detail-header h2 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 400; }
.admin-page .close-panel { background: none; border: none; font-size: 22px; color: var(--text-3); cursor: pointer; }
.admin-page .detail-body { padding: 1.25rem 1.5rem; flex: 1; }
.admin-page .detail-section { margin-bottom: 1.5rem; }
.admin-page .detail-section-title { font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.admin-page .detail-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 12px; }
.admin-page .detail-row .key { font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.admin-page .detail-row .val { font-size: 13px; font-weight: 500; text-align: right; word-break: break-word; overflow-wrap: anywhere; min-width: 0; }
.admin-page .detail-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 8px; }
.admin-page .detail-photo { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.admin-page .detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.admin-page .detail-photo:hover img { transform: scale(1.05); }
.admin-page .detail-photo a { display: block; width: 100%; height: 100%; }
.admin-page .note-area {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: 'Inter', sans-serif; color: var(--text);
  background: var(--bg); resize: vertical; min-height: 80px;
}
.admin-page .note-area:focus { outline: none; border-color: var(--accent); }
.admin-page .detail-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); flex-shrink: 0; display: flex; gap: 8px; }

/* ── Lightbox ── */
.admin-page .lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 300; display: none; align-items: center; justify-content: center; padding: 1rem; }
.admin-page .lightbox.open { display: flex; }
.admin-page .lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); object-fit: contain; }
.admin-page .lightbox-close { position: absolute; top: 1rem; right: 1rem; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Toast ── */
.admin-page .toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(64px);
  background: var(--text); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 400; transition: transform 0.25s ease;
  white-space: nowrap; box-shadow: var(--shadow-md);
}
.admin-page .toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .admin-page th:nth-child(3), .admin-page td:nth-child(3),
  .admin-page th:nth-child(5), .admin-page td:nth-child(5) { display: none; }
}

/* ── HIRIWĀ COLLABORATION PAGE ── */
.collab-hero { margin-top: 0.5rem; }
.collab-eyebrow {
  font-size: 11px !important; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.6) !important; margin-bottom: 0.75rem !important;
}
.collab-hero a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.collab-price-note { font-size: 13px !important; color: rgba(255,255,255,0.65) !important; margin-bottom: 0 !important; }

.collab-section { margin-bottom: 2.5rem; }
.collab-card { cursor: default; display: flex; flex-direction: column; }
/* Stretch each card body so the button always sits at the bottom, lined up across a row */
.collab-card .product-card-body { flex: 1; display: flex; flex-direction: column; }
.collab-card .collab-add-btn { margin-top: auto; }
.collab-card .product-card-price { margin-bottom: 8px; }
.collab-english { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }

.collab-add-btn {
  display: block; width: 100%; margin-top: 8px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.collab-add-btn:hover { opacity: 0.9; }
.collab-add-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.collab-cart-bar {
  position: fixed; left: 50%; bottom: 1rem;
  transform: translateX(-50%) translateY(120px);
  width: calc(100% - 2rem); max-width: 640px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #252B1F; color: #fff;
  padding: 12px 16px; border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-size: 13px; z-index: 300;
  transition: transform 0.25s ease;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.collab-cart-bar.show { transform: translateX(-50%) translateY(0); }
.collab-cart-actions { display: flex; gap: 8px; flex-shrink: 0; }
.collab-cart-link { color: #fff; font-size: 13px; padding: 8px 10px; }
.collab-cart-checkout {
  background: #fff; color: var(--accent); text-decoration: none;
  border-radius: var(--radius-sm); padding: 8px 14px; font-weight: 500;
}
/* Keep the toast above the cart bar when both are showing */
body:has(.collab-cart-bar.show) .toast.show { transform: translateX(-50%) translateY(-72px); }

/* Promo card on the shop page linking to the Hiriwā page */
.collab-promo {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem; margin-bottom: 2rem;
  text-decoration: none; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.collab-promo:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.collab-promo img { width: 88px; height: 88px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.collab-promo-text { display: flex; flex-direction: column; gap: 2px; }
.collab-promo-eyebrow { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-3); }
.collab-promo-title { font-family: 'Playfair Display', serif; font-size: 18px; }
.collab-promo-sub { font-size: 13px; color: var(--text-2); }
@media (min-width: 600px) { .collab-promo { padding: 1rem 1.25rem; margin-bottom: 3rem; } .collab-promo img { width: 104px; height: 104px; } }

/* ── MOBILE FIXES ── */

/* Phone nav: stop the brand name wrapping into the buttons */
.nav-logo .brand { white-space: nowrap; }
@media (max-width: 519px) {
  nav { padding: 0 1rem; }
  .nav-signup, .nav-signout { display: none; } /* Sign up is a tab in the log-in window; Sign out is on the account page */
}
@media (max-width: 359px) {
  .nav-logo-text { display: none; } /* very small phones: logo, Log in and Cart only */
}

/* Phone banner: taller, cropped in from the sides so the logo and text are readable */
@media (max-width: 599px) {
  .hero-banner-strip { aspect-ratio: 1070 / 660; } /* phone banner is its own crop: logo plus a full column of magnets each side */
}

/* Hidden toasts and cart bars can peek above the browser toolbar on phones — fully hide them */
.toast { opacity: 0; visibility: hidden; transition: transform 0.25s ease, opacity 0.2s, visibility 0.2s; }
.toast.show { opacity: 1; visibility: visible; }
.collab-cart-bar { visibility: hidden; }
.collab-cart-bar.show { visibility: visible; }

/* The policy-page tab rows are <nav> elements, so they were picking up the main nav bar's styles */
.simple-legal-page .legal-nav, .contact-page .page-nav {
  position: static; height: auto; padding: 0; background: none; border: none;
  justify-content: flex-start;
}

/* Collab page: long design names on phone cards */
.collab-card .product-card-name { overflow-wrap: anywhere; }
@media (max-width: 380px) { .collab-cart-bar { font-size: 12px; } .collab-cart-link { padding: 8px 4px; } }

/* Pack size and quantity dropdowns: stack on small phones so "4 magnets — NZ$20" isn't cut off */
@media (max-width: 419px) { .pack-options-row { grid-template-columns: 1fr; display: grid; } }

/* ── HIRIWĀ: enlarged design view ── */
a.nav-btn { text-decoration: none; display: inline-block; }
.collab-zoom { border: none; padding: 0; width: 100%; cursor: zoom-in; font: inherit; }
.collab-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.collab-lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(20, 24, 17, 0.88);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.collab-lightbox.open { display: flex; }
.collab-lightbox-inner {
  position: relative; width: 100%; max-width: 640px;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.collab-lightbox-inner img {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  max-height: calc(100vh - 11rem); object-fit: contain; background: var(--surface2);
}
.collab-lightbox-info {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.875rem 1rem 1rem;
}
.collab-lightbox-name { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--text); }
.collab-lightbox-buy { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.collab-lightbox-buy .collab-add-btn { width: auto; margin-top: 0; padding: 9px 16px; }
.collab-lightbox-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer;
}
.collab-lightbox-nav {
  position: absolute; top: calc(50% - 2.5rem); transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
}
.collab-lightbox-nav.prev { left: 10px; }
.collab-lightbox-nav.next { right: 10px; }
.collab-lightbox-close:focus-visible, .collab-lightbox-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) {
  .collab-lightbox { padding: 0.5rem; }
  .collab-lightbox-info { flex-direction: column; align-items: stretch; }
  .collab-lightbox-buy { justify-content: space-between; }
}

@media (max-width: 519px) { .nav-btn.nav-signup, .nav-btn.nav-signout { display: none; } }

/* ── PHONE MENU ── */
nav { position: sticky; }
.nav-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 34px; padding: 0;
  background: none; border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
}
.mobile-menu {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  padding: 0.5rem 1rem 0.875rem; flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu a, .mobile-menu button {
  display: block; width: 100%; text-align: left;
  padding: 12px 4px; font-family: 'Inter', sans-serif; font-size: 15px;
  color: var(--text); text-decoration: none;
  background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer;
}
.mobile-menu > :last-child { border-bottom: none; }
.mobile-menu-divider { height: 6px; }
body.signed-in .mobile-menu [data-auth="out"], body:not(.signed-in) .mobile-menu [data-auth="in"] { display: none; }

@media (max-width: 699px) {
  .nav-menu-btn { display: inline-flex; }
  /* On phones the account buttons live in the menu, leaving room for the name, Cart and Menu */
  nav #authButtons, nav #accountButtons { display: none !important; }
}
@media (min-width: 700px) { .mobile-menu, .mobile-menu.open { display: none; } }

/* ── HIRIWĀ: All / Birds / Landscapes filter ── */
.collab-filter-bar {
  position: sticky; top: 60px; z-index: 50;
  background: var(--bg); padding: 0.75rem 0; margin-bottom: 1rem;
  display: flex; justify-content: center;
}
.collab-filter {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
}
.collab-filter button {
  border: none; background: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-2);
  padding: 8px 16px; border-radius: 100px; transition: background 0.15s, color 0.15s;
}
.collab-filter button:hover { color: var(--text); }
.collab-filter button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.collab-filter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.collab-filter-count { font-size: 12px; opacity: 0.7; margin-left: 2px; }
@media (max-width: 380px) { .collab-filter button { padding: 8px 11px; font-size: 13px; } }

/* Cart bar: stay out of the way of the cart drawer and checkout, and don't cover the footer */
body:has(#cartDrawer.open) .collab-cart-bar, body:has(#checkoutPage.open) .collab-cart-bar { visibility: hidden; transform: translateX(-50%) translateY(120px); }
body:has(.collab-cart-bar.show) footer { padding-bottom: 6rem; }

.cart-item-warning { font-size: 12px; color: #A23B2A; margin: 2px 0 4px; }

/* Admin link in the nav: only shown to admin accounts (set in main.js / hiriwa.js). On phones it lives in the menu instead. */
@media (max-width: 699px) { .nav-btn.nav-admin { display: none; } }

/* Admin two-step sign-in */
.admin-page .mfa-qr { display: block; width: 180px; height: 180px; margin: 0 auto 12px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-page .mfa-secret { font-size: 12px; color: var(--text-2); text-align: center; margin-bottom: 1.25rem; word-break: break-all; }
.admin-page .mfa-secret code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); letter-spacing: 1px; }
.admin-page input.mfa-code { font-size: 20px; letter-spacing: 6px; text-align: center; }
.admin-page .link-btn { background: none; border: none; color: var(--text-2); font-size: 13px; text-decoration: underline; cursor: pointer; margin-top: 12px; display: block; width: 100%; font-family: inherit; }

/* Order details and admin: the section already has a divider, so the last item row doesn't need its own */
.order-detail-section .success-items, .admin-page .detail-section .success-items { margin-bottom: 0; }
.order-detail-section .success-item:last-child, .admin-page .detail-section .success-item:last-child { border-bottom: none; padding-bottom: 0; }

/* Good to know (questions and answers) */
.faq-section { margin-bottom: 3rem; }
.faq-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; font-size: 14px; font-weight: 500; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 18px; font-weight: 300; color: var(--text-3); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.faq-item p { padding: 0 1.25rem 1.1rem; font-size: 13px; line-height: 1.7; color: var(--text-2); max-width: 640px; }
.faq-item p a { color: var(--accent); }
