/* ==========================================================================
   Lorivoa Mochis — sistema claymorphic
   ========================================================================== */

:root {
  /* Paleta base */
  --bg-top: #f8eefb;
  --bg-bottom: #eaf1fc;
  --surface: #fffdfb;
  --surface-2: #fbf5ff;
  --ink: #3a2e4d;
  --ink-soft: #6a5d82;
  --ink-faint: #9b8fb3;

  --brand: #8b5fbf;
  --brand-ink: #5b3a8a;
  --brand-light: #e6d9f7;
  --accent: #ff7aa2;
  --accent-ink: #c23f68;

  --success: #3fa66a;
  --success-bg: #dff5e6;
  --warn: #d68d1f;
  --warn-bg: #fbeed0;
  --error: #d64545;
  --error-bg: #fbe2e2;

  /* Sabores (ciclan por índice de producto) */
  --f1: #ffc2d1; /* fresa */
  --f1-ink: #a83a5a;
  --f2: #d9c2f0; /* taro */
  --f2-ink: #6b4498;
  --f3: #bdeed1; /* matcha */
  --f3-ink: #2f7d55;
  --f4: #ffe3a3; /* maracuya */
  --f4-ink: #9c6b0d;
  --f5: #e6c9a8; /* chocolate */
  --f5-ink: #7a4f22;
  --f6: #c9e4ff; /* coco */
  --f6-ink: #3a6f9c;

  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow-clay:
    8px 10px 22px rgba(120, 90, 160, 0.16),
    -6px -6px 14px rgba(255, 255, 255, 0.75);
  --shadow-clay-sm:
    5px 6px 14px rgba(120, 90, 160, 0.14),
    -4px -4px 10px rgba(255, 255, 255, 0.7);
  --shadow-pressed:
    inset 4px 4px 10px rgba(120, 90, 160, 0.22),
    inset -3px -3px 8px rgba(255, 255, 255, 0.6);
  --shadow-float: 0 18px 40px rgba(107, 68, 152, 0.22);

  --focus-ring: 0 0 0 4px rgba(139, 95, 191, 0.35);

  --font-display: 'Fredoka', 'Quicksand', sans-serif;
  --font-body: 'Quicksand', sans-serif;

  --dur: 180ms;
  --ease: cubic-bezier(0.34, 1.2, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-ink);
  margin: 0 0 0.4em;
  line-height: 1.15;
}

p { margin: 0 0 1em; color: var(--ink-soft); line-height: 1.6; }

a { color: var(--brand); }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 40px; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: #ffe3ec;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

/* Reduced motion: kill transitions/animation globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Reduced decoration: users who ask for more contrast get flat surfaces + real borders
   instead of relying on soft clay shadows to convey depth */
@media (prefers-contrast: more) {
  .clay, .clay-card, .clay-btn, .clay-input, .product-card, .cart-panel, .segmented, .zone-option {
    box-shadow: none !important;
    border: 2px solid var(--ink) !important;
  }
}

/* ==========================================================================
   Botones
   ========================================================================== */

.btn {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(160deg, #a67bd6, var(--brand));
  color: #fff;
  box-shadow: var(--shadow-clay-sm), 0 6px 0 var(--brand-ink);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-pressed), 0 2px 0 var(--brand-ink);
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand-ink);
  box-shadow: var(--shadow-clay-sm), 0 4px 0 #d8c8ee;
}
.btn-secondary:hover { transform: translateY(-2px); }
.btn-secondary:active { transform: translateY(2px); box-shadow: var(--shadow-pressed); }

.btn-ghost {
  background: transparent;
  color: var(--brand-ink);
  box-shadow: none;
  padding: 10px 16px;
}
.btn-ghost:hover { background: var(--brand-light); }

.btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-clay-sm); }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after { border-color: rgba(139,95,191,0.3); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ==========================================================================
   Clay surfaces
   ========================================================================== */

.clay {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-clay);
  border: 1px solid rgba(255,255,255,0.6);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 0;
  background: rgba(248, 238, 251, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(139,95,191,0.1);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--brand), var(--accent));
  box-shadow: var(--shadow-clay-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Georgia', serif; font-weight: 700; color: #fff; font-size: 19px;
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--brand-ink); }
.logo-text small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; color: var(--accent-ink); text-transform: uppercase; }

.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  transition: background var(--dur), color var(--dur);
}
.nav-links a:hover { background: var(--brand-light); color: var(--brand-ink); }
.nav-links a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.cart-btn {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-clay-sm);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--brand-ink);
  transition: transform var(--dur) var(--ease);
}
.cart-btn:hover { transform: translateY(-2px); }
.cart-btn:active { transform: translateY(1px); box-shadow: var(--shadow-pressed); }
.cart-btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-clay-sm); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  min-width: 22px; height: 22px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--accent-ink);
  padding: 0 4px;
}
.cart-count[hidden] { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 56px 0 40px; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-title { font-size: clamp(36px, 5vw, 56px); }
.hero-title .accent-word { color: var(--accent); }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--f2), var(--f1) 60%, var(--f4));
  box-shadow: var(--shadow-float);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero-photo, .hero-blob {
  width: 78%; aspect-ratio: 1;
  border-radius: 46% 54% 58% 42% / 48% 42% 58% 52%;
  box-shadow: var(--shadow-clay);
}
.hero-photo {
  object-fit: cover;
  background: var(--surface);
}
.hero-blob {
  background: linear-gradient(155deg, var(--f2), var(--f1) 60%, var(--f4));
}
.hero-chip {
  position: absolute;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-clay-sm);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--brand-ink);
  display: flex; align-items: center; gap: 8px;
}
.hero-chip.c1 { top: 8%; left: 4%; }
.hero-chip.c2 { bottom: 10%; right: 4%; }

/* ==========================================================================
   Menú / catálogo
   ========================================================================== */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.product-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-clay);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--dur) var(--ease);
}
.product-card:hover { transform: translateY(-4px); }

.product-thumb {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.stock-badge {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.85);
  color: var(--brand-ink);
  box-shadow: var(--shadow-clay-sm);
}
.stock-badge.is-agotado { background: rgba(58,46,77,0.85); color: #fff; }
.stock-badge.is-bajo { color: var(--accent-ink); }

.product-card.is-agotado { opacity: 0.6; }

.product-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0; color: var(--ink); }
.product-desc { font-size: 13.5px; margin: 0; color: var(--ink-soft); flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.product-price { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--brand-ink); }

.stepper {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-pressed);
}
.stepper button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-clay-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur);
}
.stepper button:hover { transform: scale(1.08); }
.stepper button:active { transform: scale(0.94); box-shadow: var(--shadow-pressed); }
.stepper button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.stepper .qty { min-width: 20px; text-align: center; font-weight: 700; font-family: var(--font-display); }

.add-btn {
  width: 100%;
  margin-top: 6px;
  background: var(--brand-light);
  color: var(--brand-ink);
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--dur), transform var(--dur);
}
.add-btn:hover { background: #ddc8f5; }
.add-btn:active { transform: scale(0.97); }
.add-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.add-btn.is-added { background: var(--success-bg); color: var(--success); }

.menu-skeleton { display: flex; flex-direction: column; gap: 10px; }
.skel {
  background: linear-gradient(90deg, #f1e9f9 25%, #f8f2fc 37%, #f1e9f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty-state, .error-state {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.error-state { color: var(--error); background: var(--error-bg); }

/* ==========================================================================
   Carrito (panel lateral)
   ========================================================================== */

.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(58, 46, 77, 0.35);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur);
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  box-shadow: -14px 0 40px rgba(107,68,152,0.22);
  z-index: 61;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 260ms var(--ease);
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}
.cart-panel.is-open { transform: translateX(0); }

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 12px;
}
.cart-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--surface-2);
  box-shadow: var(--shadow-clay-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.cart-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.cart-body { flex: 1; overflow-y: auto; padding: 4px 24px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e6fa;
}
.cart-item-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.cart-item-price { font-size: 12.5px; color: var(--ink-faint); }
.cart-item-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cart-item-remove {
  border: none; background: none; color: var(--error);
  cursor: pointer; line-height: 1;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-remove:hover { background: var(--error-bg); }
.cart-item-remove:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.cart-empty { text-align: center; padding: 50px 10px; color: var(--ink-faint); }

.cart-foot {
  padding: 18px 24px 24px;
  border-top: 1px solid #f0e6fa;
  background: var(--surface-2);
  border-bottom-left-radius: var(--radius-lg);
}

.delivery-toggle.segmented {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-pressed);
  margin-bottom: 14px;
}
.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}
.segmented button.is-active {
  background: linear-gradient(160deg, #a67bd6, var(--brand));
  color: #fff;
  box-shadow: var(--shadow-clay-sm);
}
.segmented button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.zone-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.zone-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-clay-sm);
  cursor: pointer;
  font-size: 13.5px;
  border: 2px solid transparent;
}
.zone-option input { accent-color: var(--brand); }
.zone-option.is-selected { border-color: var(--brand); background: var(--brand-light); }
.zone-option label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.zone-price { font-weight: 700; color: var(--brand-ink); }

.maps-helper { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.maps-helper .btn { flex: 1; }

.cart-totals { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; font-size: 14px; }
.cart-totals .row { display: flex; justify-content: space-between; color: var(--ink-soft); }
.cart-totals .row.total { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--brand-ink); padding-top: 8px; border-top: 1px dashed #d9c8ee; }

/* ==========================================================================
   Formulario checkout
   ========================================================================== */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: var(--surface-2);
  box-shadow: var(--shadow-pressed);
  color: var(--ink);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.field-error { display: none; color: var(--error); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.field.has-error .field-error { display: block; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:disabled, .field textarea:disabled, .field select:disabled { opacity: 0.55; cursor: not-allowed; }

/* ==========================================================================
   Ubicación
   ========================================================================== */

.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.location-card { padding: 30px; }
.location-row { display: flex; gap: 14px; margin-bottom: 18px; }
.location-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--brand-light);
}
.location-row h4 { margin: 0 0 4px; font-size: 15px; }
.location-row p { margin: 0; font-size: 14px; }
.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-clay);
  min-height: 320px;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }
.map-fallback {
  height: 100%; min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px;
  background: linear-gradient(155deg, var(--f6), var(--f2));
}

/* ==========================================================================
   Seguimiento de pedido
   ========================================================================== */

.tracking-steps { display: flex; flex-direction: column; }
.tracking-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 10px 4px;
}
.tracking-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: -50%;
  width: 2px;
  height: 100%;
  background: #e6d9f7;
}
.tracking-step:first-child::before { display: none; }
.tracking-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: var(--shadow-pressed);
  flex-shrink: 0;
  z-index: 1;
}
.tracking-label { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink-faint); }

.tracking-step.is-done .tracking-dot { background: var(--success); box-shadow: none; }
.tracking-step.is-done .tracking-label { color: var(--ink-soft); }
.tracking-step.is-done::before { background: var(--success); }

.tracking-step.is-current .tracking-dot {
  background: linear-gradient(160deg, #a67bd6, var(--brand));
  box-shadow: 0 0 0 5px var(--brand-light);
}
.tracking-step.is-current .tracking-label { color: var(--brand-ink); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-float);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur), transform var(--dur);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.is-error { background: var(--error); }
.toast.is-success { background: var(--success); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 40px 0 60px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.footer-whatsapp {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; margin: 0 auto; }
  .nav-links { display: none; }
  .location-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .cart-panel { width: 100%; border-radius: 0; }
  .section { padding: 44px 0; }
  .hero { padding: 32px 0 24px; }
}
