/* Baswara Bali — design tokens */

:root {
  /* Warm artisan palette (default) */
  --bg: #f5ede1;          /* cream */
  --bg-alt: #ebdfc9;      /* deeper cream */
  --surface: #fffaf0;     /* paper */
  --ink: #2a1a10;         /* deep cocoa */
  --ink-soft: #5a4232;
  --ink-muted: #8b7560;
  --line: #d9c8ad;
  --cocoa: #4a2d1a;       /* dark chocolate */
  --cocoa-deep: #2a1810;
  --gold: #b48a3c;        /* gold leaf */
  --gold-soft: #d9b46a;
  --accent: var(--gold);
  --danger: #8b3a2a;

  /* Type */
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(42,24,16,0.06), 0 1px 1px rgba(42,24,16,0.04);
  --shadow-md: 0 6px 18px -8px rgba(42,24,16,0.18), 0 2px 6px rgba(42,24,16,0.06);
  --shadow-lg: 0 24px 48px -20px rgba(42,24,16,0.28);
}

/* Tropical palette */
[data-palette="tropical"] {
  --bg: #f1efe4;
  --bg-alt: #e3e0cf;
  --surface: #fbf9f0;
  --ink: #1f3527;
  --ink-soft: #3a5240;
  --ink-muted: #6f8576;
  --line: #cdd5c2;
  --cocoa: #2f4a37;
  --cocoa-deep: #1a2a20;
  --gold: #c46a3a;     /* terracotta */
  --gold-soft: #e2a07a;
  --accent: var(--gold);
}

/* Mono palette */
[data-palette="mono"] {
  --bg: #f4f3ee;
  --bg-alt: #e8e6dd;
  --surface: #ffffff;
  --ink: #15120e;
  --ink-soft: #3a3530;
  --ink-muted: #7a736a;
  --line: #d8d4c8;
  --cocoa: #2a2622;
  --cocoa-deep: #15120e;
  --gold: #15120e;
  --gold-soft: #3a3530;
  --accent: var(--gold);
}

/* Type pairings */
[data-typeface="classic"] {
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}
[data-typeface="editorial"] {
  --font-display: "Cormorant Garamond", "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}
[data-typeface="modern"] {
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Geist", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #1a120c;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* App canvas */
.app {
  --safe-top: calc(env(safe-area-inset-top, 0px) + 16px);
  --content-max: 1200px;
  background: var(--bg);
  color: var(--ink);
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  font-family: var(--font-body);
}

.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Responsive: center content on wide screens */
.screen { display: flex; flex-direction: column; }
.screen:not(.pd-screen) > * {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}
/* Sticky bottom action bars stay at the bottom even when the page is short */
.screen > [style*="position: sticky"][style*="bottom: 0px"] { margin-top: auto; }
.screen > .wa-fab { width: 56px; max-width: none; margin: 0; }
.screen[data-screen-label="04 Cart"],
.screen[data-screen-label="05 Checkout"],
.screen[data-screen-label="06 Confirmation"] { --content-max: 720px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
}

/* Product detail: photo left, details right on wide screens */
@media (min-width: 900px) {
  .pd-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .pd-hero {
    grid-row: 1 / span 2;
    position: sticky !important;
    top: 0;
    height: 100vh !important;
    height: 100dvh !important;
    background: #fff !important;
  }
  .pd-hero img { object-fit: contain !important; }
  .pd-info {
    margin-top: 0 !important;
    border-radius: 0 !important;
    padding: calc(var(--safe-top) + 56px) 48px 0 !important;
    max-width: 640px;
  }
  .pd-bar { grid-column: 2; max-width: 640px; padding-left: 48px !important; padding-right: 48px !important; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s, color 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--cocoa-deep);
  color: var(--bg);
  border-radius: 999px;
  padding: 16px 24px;
  width: 100%;
  font-size: 16px;
}
.btn-primary:hover { background: var(--cocoa); }

.btn-gold {
  background: var(--gold);
  color: var(--cocoa-deep);
  border-radius: 999px;
  padding: 14px 22px;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
}

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--bg-alt); }

/* Pill / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
}
.chip[data-active="true"] {
  background: var(--cocoa-deep);
  color: var(--bg);
  border-color: var(--cocoa-deep);
}

/* Section labels */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.h-sans {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Placeholder image (cocoa stripes) */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--cocoa) 10%, var(--surface)),
      color-mix(in oklab, var(--cocoa) 10%, var(--surface)) 8px,
      color-mix(in oklab, var(--cocoa) 16%, var(--surface)) 8px,
      color-mix(in oklab, var(--cocoa) 16%, var(--surface)) 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cocoa);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ph-label {
  background: var(--surface);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* Scroll snap horizontal */
.scroller {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 12px;
  padding: 0 20px;
}
.scroller::-webkit-scrollbar { height: 0; }
.scroller > * { scroll-snap-align: start; flex: 0 0 auto; }

/* Dividers */
.hr-dot {
  height: 1px;
  background:
    radial-gradient(circle, var(--line) 1px, transparent 1px) 0 0 / 6px 1px repeat-x;
  border: 0;
  margin: 0;
}

/* Floating WA button */
.wa-fab {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -4px rgba(37, 211, 102, 0.5);
  cursor: pointer;
  border: none;
  z-index: 50;
}
.wa-fab:active { transform: scale(0.95); }

/* Form fields */
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: block;
}
.field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  transition: border 0.15s;
}
.field:focus { border-color: var(--cocoa); }
.field::placeholder { color: var(--ink-muted); }

textarea.field {
  resize: none;
  min-height: 80px;
  font-family: var(--font-body);
}

/* Step indicator */
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}
.step-dot[data-state="done"] {
  background: var(--cocoa-deep);
  color: var(--bg);
  border-color: var(--cocoa-deep);
}
.step-dot[data-state="active"] {
  background: var(--gold);
  color: var(--cocoa-deep);
  border-color: var(--gold);
}
.step-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.step-line[data-state="done"] {
  background: var(--cocoa-deep);
}

/* Cocoa hatching ornament */
.ornament {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}
.ornament::before, .ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}

/* Animations */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.anim-slide-up { animation: slideUp 0.32s cubic-bezier(0.2, 0.9, 0.2, 1); }
.anim-fade { animation: fadeIn 0.25s ease; }
