/* ══════════════════════════════════════════════════════════════
   GREENFROST — Premium Design System
   Ice Cream Shop · Santo Domingo, Ecuador
   ══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
  /* Brand Colors */
  --green: #8dc63f;
  --green-dark: #6da82e;
  --green-darker: #4a7a1a;
  --green-light: #b5e06a;
  --green-glow: rgba(141, 198, 63, 0.45);
  --fuchsia: #e6007e;
  --fuchsia-dark: #c4006a;
  --fuchsia-light: #ff3da6;
  --fuchsia-glow: rgba(230, 0, 126, 0.35);

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Surfaces */
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-card: var(--white);
  --bg-card-hover: var(--gray-50);
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --bg-overlay: rgba(15, 23, 42, 0.55);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --border-color: var(--gray-200);
  --border-color-focus: var(--green);
  --input-bg: var(--white);

  /* Typography */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-xs: 0.6875rem;   /* 11px */
  --fs-sm: 0.8125rem;   /* 13px */
  --fs-base: 0.9375rem; /* 15px */
  --fs-md: 1rem;        /* 16px */
  --fs-lg: 1.125rem;    /* 18px */
  --fs-xl: 1.375rem;    /* 22px */
  --fs-2xl: 1.75rem;    /* 28px */
  --fs-3xl: 2.25rem;    /* 36px */
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.14), 0 8px 20px rgba(0,0,0,0.08);
  --shadow-green: 0 8px 30px rgba(141,198,63,0.25);
  --shadow-fuchsia: 0 8px 30px rgba(230,0,126,0.2);
  --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.04);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 280ms;
  --duration-slow: 450ms;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 500;
  --z-modal: 600;
  --z-toast: 700;
  --z-loading: 800;

  /* Tab bar */
  --tab-bar-height: 4.25rem;
}

/* ─── DARK MODE ─── */
body.dark-mode {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --bg-card: var(--gray-800);
  --bg-card-hover: var(--gray-700);
  --bg-glass: rgba(30, 41, 59, 0.78);
  --bg-glass-hover: rgba(30, 41, 59, 0.9);
  --bg-overlay: rgba(0, 0, 0, 0.65);
  --text-primary: var(--gray-100);
  --text-secondary: var(--gray-400);
  --text-tertiary: var(--gray-500);
  --border-color: var(--gray-700);
  --input-bg: var(--gray-800);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.4);
}

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px) + 0.5rem);
  overflow-x: hidden;
  transition: background var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
body.dark-mode ::-webkit-scrollbar-thumb { background: var(--gray-600); }

/* ═══════════════════════════════════════════════════════════
   LAYOUT — Views & Router
   ═══════════════════════════════════════════════════════════ */
.view {
  display: none;
  animation: fadeSlideIn var(--duration-slow) var(--ease-out);
}
.view.active { display: block; }

.sub-view { animation: fadeSlideIn var(--duration-normal) var(--ease-out); }

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

.section-wrapper {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ═══════════════════════════════════════════════════════════
   HEADER — Delivery Scene
   ═══════════════════════════════════════════════════════════ */
.delivery-header {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: var(--sp-6) var(--sp-4) var(--sp-8);
  overflow: hidden;
  border-radius: var(--radius-xl);
  max-width: 600px;
  margin: var(--sp-4) auto;
  box-shadow: var(--shadow-md);
}

.delivery-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(141,198,63,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.delivery-header h1 {
  text-align: center;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
  text-shadow: none;
  margin-bottom: var(--sp-6);
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
}

/* Road */
.road-scene {
  position: relative;
  height: 72px;
  margin-top: var(--sp-4);
  z-index: 2;
}

.road {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--fuchsia);
  border-radius: var(--radius-full);
  margin: 0 var(--sp-4);
  box-shadow: 0 2px 10px var(--fuchsia-glow);
}

.road::after {
  display: none;
}

.scene-item {
  position: absolute;
  bottom: 16px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
  z-index: 3;
}

.scene-store { left: 8%; }
.scene-moto {
  animation: motoMove 8s linear infinite, motoBounce 0.4s ease-in-out infinite alternate;
}
.scene-house { right: 8%; }

@keyframes motoMove {
  0%   { left: 15%; transform: translateX(-50%) scaleX(1); }
  48%  { left: 85%; transform: translateX(-50%) scaleX(1); }
  50%  { left: 85%; transform: translateX(-50%) scaleX(-1); }
  98%  { left: 15%; transform: translateX(-50%) scaleX(-1); }
  100% { left: 15%; transform: translateX(-50%) scaleX(1); }
}

@keyframes motoBounce {
  0% { bottom: 16px; }
  100% { bottom: 20px; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION TITLES
   ═══════════════════════════════════════════════════════════ */
.section-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin: var(--sp-8) 0 var(--sp-4);
  padding-left: var(--sp-1);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.section-title .emoji {
  font-size: var(--fs-xl);
}

.section-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: calc(-1 * var(--sp-2)) 0 var(--sp-4) var(--sp-1);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
  box-shadow: var(--shadow-green);
}

/* ═══════════════════════════════════════════════════════════
   GLASS CARD
   ═══════════════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-out),
              background var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
  background: var(--bg-glass-hover);
}

.glass-card.elevated {
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════════════════════
   SIZE CARDS — Step 1
   ═══════════════════════════════════════════════════════════ */
.size-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.size-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  transition: all var(--duration-normal) var(--ease-spring);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Sombreado más claro */
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
  aspect-ratio: 1/1.1;
}

.size-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.size-card .size-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.size-card .size-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-4);
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 45%, transparent 100%);
  z-index: 2;
}

.size-card .size-name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--white);
  margin-bottom: var(--sp-1);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.size-card .size-price {
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--green-light);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.size-card .size-toppings-count {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.95);
  margin-top: var(--sp-1);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.size-card:hover .size-bg,
.size-card:active .size-bg {
  transform: scale(1.06);
}

.size-card[data-size="extragrande"] .size-bg {
  transform: scale(1.1);
  object-position: 65% 100%;
}
.size-card[data-size="extragrande"]:hover .size-bg,
.size-card[data-size="extragrande"]:active .size-bg {
  transform: scale(1.15);
  object-position: 65% 100%;
}

.size-card:active {
  transform: scale(0.97);
}

.size-card.selected {
  border-color: var(--green);
  box-shadow: var(--shadow-green), var(--shadow-lg);
}

.size-card.selected::after {
  content: '✓';
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  z-index: 3;
  animation: popIn var(--duration-normal) var(--ease-spring);
}

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

/* ═══════════════════════════════════════════════════════════
   TOPPINGS — Step 2
   ═══════════════════════════════════════════════════════════ */
.toppings-section {
  margin-top: var(--sp-6);
}

.topping-category-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--fuchsia);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: var(--sp-6) 0 var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.toppings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.topping-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
  white-space: nowrap;
}

.topping-chip .chip-emoji {
  font-size: 1.1em;
  line-height: 1;
}

.topping-chip:hover {
  border-color: var(--green);
  background: rgba(141,198,63,0.08);
}

.topping-chip:active {
  transform: scale(0.95);
}

.topping-chip.selected {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  border-color: var(--green);
  box-shadow: 0 2px 10px var(--green-glow);
}

.topping-chip[data-count="2"]::after {
  content: 'x2';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--fuchsia);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
}

.topping-chip.extra {
  background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-dark));
  border-color: var(--fuchsia);
  box-shadow: 0 2px 10px var(--fuchsia-glow);
}

.limit-message {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin-top: var(--sp-3);
  transition: all var(--duration-normal) var(--ease-out);
}

.limit-message.ok {
  background: rgba(141,198,63,0.1);
  color: var(--green-dark);
  border: 1px solid rgba(141,198,63,0.25);
}

.limit-message.extra {
  background: rgba(230,0,126,0.08);
  color: var(--fuchsia);
  border: 1px solid rgba(230,0,126,0.2);
}

body.dark-mode .limit-message.ok {
  background: rgba(141,198,63,0.12);
  color: var(--green-light);
}
body.dark-mode .limit-message.extra {
  background: rgba(230,0,126,0.12);
  color: var(--fuchsia-light);
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: var(--sp-10);
}

/* Password toggle wrapper */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-right: 3rem;
}

.input-toggle {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--sp-1);
  color: var(--text-tertiary);
  font-size: var(--fs-lg);
  line-height: 1;
  transition: color var(--duration-fast);
}
.input-toggle:hover { color: var(--text-primary); }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

/* Primary — Green */
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  box-shadow: var(--shadow-green);
}
.btn-primary:hover {
  box-shadow: 0 10px 36px var(--green-glow);
  transform: translateY(-1px);
}

/* Accent — Fuchsia */
.btn-accent {
  background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-dark));
  color: var(--white);
  box-shadow: var(--shadow-fuchsia);
}
.btn-accent:hover {
  box-shadow: 0 10px 36px var(--fuchsia-glow);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-ghost:hover {
  background: rgba(141,198,63,0.08);
}

/* Full width */
.btn-block {
  width: 100%;
  padding: var(--sp-4) var(--sp-6);
}

/* WhatsApp button */
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: var(--white);
  box-shadow: 0 8px 30px rgba(37,211,102,0.25);
}
.btn-whatsapp:hover {
  box-shadow: 0 10px 36px rgba(37,211,102,0.35);
  transform: translateY(-1px);
}

/* Small */
.btn-sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}

/* Disabled */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Link button */
.btn-link {
  background: none;
  color: var(--fuchsia);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  padding: var(--sp-1) 0;
}
.btn-link:hover { text-decoration: underline; }
.btn-link::after { display: none; }

/* ═══════════════════════════════════════════════════════════
   CART
   ═══════════════════════════════════════════════════════════ */
.cart-section {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 2px dashed var(--border-color);
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: var(--sp-3);
  animation: slideIn var(--duration-normal) var(--ease-spring);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-dark));
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-size {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.cart-item-toppings {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: var(--sp-1);
  line-height: var(--lh-relaxed);
}

.cart-item-price {
  font-weight: var(--fw-bold);
  color: var(--green);
  font-size: var(--fs-base);
  margin-top: var(--sp-1);
}

.cart-item-remove {
  padding: var(--sp-1);
  color: var(--error);
  font-size: var(--fs-lg);
  opacity: 0.6;
  transition: opacity var(--duration-fast);
}
.cart-item-remove:hover { opacity: 1; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(141,198,63,0.1), rgba(141,198,63,0.05));
  border: 1px solid rgba(141,198,63,0.2);
  margin-top: var(--sp-4);
}

.cart-total-label {
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}

.cart-total-price {
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--green);
}

.delivery-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  color: var(--warning);
  line-height: var(--lh-relaxed);
}

.empty-cart {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-tertiary);
}
.empty-cart .empty-emoji {
  font-size: 3rem;
  margin-bottom: var(--sp-3);
}
.empty-cart p {
  font-size: var(--fs-sm);
}

/* ═══════════════════════════════════════════════════════════
   FIDELIDAD — LOGIN / REGISTER
   ═══════════════════════════════════════════════════════════ */
.auth-container {
  min-height: calc(100dvh - var(--tab-bar-height) - 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-4);
}

.auth-logo {
  width: 120px;
  margin-bottom: var(--sp-6);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.auth-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: var(--sp-1);
}

.auth-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-form {
  width: 100%;
  max-width: 380px;
}

.auth-footer {
  text-align: center;
  margin-top: var(--sp-6);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   QR CODE
   ═══════════════════════════════════════════════════════════ */
.qr-section {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
}

.qr-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-6);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 2px solid transparent;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: qrGlow 3s ease-in-out infinite;
}

@keyframes qrGlow {
  0%, 100% {
    border-color: var(--green);
    box-shadow: var(--shadow-lg), 0 0 20px var(--green-glow);
  }
  50% {
    border-color: var(--fuchsia);
    box-shadow: var(--shadow-lg), 0 0 20px var(--fuchsia-glow);
  }
}

#qr-canvas {
  border-radius: var(--radius-sm);
}

.qr-timer {
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}

.qr-timer span {
  color: var(--fuchsia);
  font-variant-numeric: tabular-nums;
}

.qr-note {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  max-width: 280px;
}

/* ═══════════════════════════════════════════════════════════
   POINTS CARDS
   ═══════════════════════════════════════════════════════════ */
.points-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.point-card {
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-spring);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.point-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.point-card-branch {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.point-card-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--green);
  line-height: var(--lh-tight);
  margin-top: auto;
}

.point-card-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}

body.dark-mode .progress-track { background: var(--gray-700); }

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transition: width 1s var(--ease-out);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: progressShine 2.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.point-card-action {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.point-card-action.remaining {
  color: var(--text-tertiary);
}

.btn-redeem {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  animation: redeemPulse 2s ease-in-out infinite;
  border: none;
  cursor: pointer;
}

@keyframes redeemPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50%      { box-shadow: 0 0 0 8px rgba(141,198,63,0); }
}

/* ═══════════════════════════════════════════════════════════
   REWARDS
   ═══════════════════════════════════════════════════════════ */
.rewards-section {
  margin-top: var(--sp-8);
}

.rewards-tabs {
  display: flex;
  gap: var(--sp-1);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: var(--sp-1);
  margin-bottom: var(--sp-4);
}

/* ══════════════════════════════════════════════════════════
   HOME MENU
   ══════════════════════════════════════════════════════════ */
.home-menu {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-4);
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.home-logo {
  width: 140px;
  margin-bottom: var(--sp-2);
  animation: floatLogo 4s ease-in-out infinite;
}

.home-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--sp-4);
}

.home-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.home-card:hover, .home-card:active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--green);
}

.home-card-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: var(--sp-4);
}

.home-card-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.home-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

/* Back Button (Header) */
.back-header {
  display: flex;
  align-items: center;
  padding: var(--sp-4);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  padding: var(--sp-2);
  margin-left: -var(--sp-2);
  transition: color var(--duration-fast);
}

.btn-back:hover {
  color: var(--green);
}

.rewards-tab {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
}

.rewards-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.reward-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: var(--sp-3);
  animation: slideIn var(--duration-normal) var(--ease-spring);
}

.reward-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.reward-details {
  flex: 1;
  min-width: 0;
}

.reward-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.reward-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}

.reward-status {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.reward-status.pending {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

.reward-status.delivered {
  background: rgba(34,197,94,0.1);
  color: var(--success);
}

.rewards-empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-tertiary);
}
.rewards-empty .empty-emoji {
  font-size: 3rem;
  margin-bottom: var(--sp-3);
}
.rewards-empty p {
  font-size: var(--fs-sm);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD HEADER
   ═══════════════════════════════════════════════════════════ */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
}

.dashboard-greeting {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.dashboard-greeting span {
  color: var(--green);
}

.btn-logout {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
  transition: all var(--duration-fast);
}
.btn-logout:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Refresh */
.refresh-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-8);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.btn-refresh {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  transition: all var(--duration-fast);
}
.btn-refresh:hover { background: rgba(141,198,63,0.1); }
.btn-refresh.spinning { animation: spin 0.8s linear infinite; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════ */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

#loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-300);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Skeleton screens ─── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

body.dark-mode .skeleton {
  background: linear-gradient(90deg, var(--gray-700) 25%, var(--gray-600) 50%, var(--gray-700) 75%);
  background-size: 200% 100%;
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-2);
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--sp-8));
  max-width: 420px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  pointer-events: all;
  animation: toastIn var(--duration-normal) var(--ease-spring);
  overflow: hidden;
  position: relative;
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--green);
  animation: toastTimer linear forwards;
}

.toast.leaving {
  animation: toastOut var(--duration-normal) var(--ease-out) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-16px) scale(0.96); }
}

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

.toast-icon {
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.success::after { background: var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.error::after   { background: var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning::after { background: var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.info::after    { background: var(--info); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-3);
}

.modal p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
  line-height: var(--lh-relaxed);
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
}

.modal-actions .btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════
   NOTES / EXTRAS
   ═══════════════════════════════════════════════════════════ */
.notes-section {
  margin-top: var(--sp-6);
}

.add-another-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transition: all var(--duration-normal) var(--ease-out);
  margin-top: var(--sp-3);
}

.add-another-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(141,198,63,0.04);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 480px) {
  .size-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .size-card {
    aspect-ratio: 3/4;
  }
}

@media (min-width: 640px) {
  :root {
    --fs-base: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.75rem;
  }

  .section-wrapper {
    max-width: 640px;
  }

  .points-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .delivery-header {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }
}

@media (min-width: 768px) {
  .section-wrapper {
    max-width: 720px;
    padding: 0 var(--sp-6);
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-bottom: max(env(safe-area-inset-bottom), 0.5rem);
  }
}

/* Cookie Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--bg-card); color: var(--text-primary); padding: var(--sp-4); box-shadow: 0 -4px 12px rgba(0,0,0,0.1); display: flex; flex-direction: column; gap: var(--sp-3); z-index: 1000; transform: translateY(100%); transition: transform 0.3s ease; text-align: left; font-size: 0.85rem; line-height: 1.4; border-top: 1px solid var(--border-color); }
.cookie-banner.visible { transform: translateY(0); }
@media (min-width: 768px) { .cookie-banner { flex-direction: row; justify-content: space-between; align-items: center; font-size: 0.9rem; } .cookie-banner p { margin-right: var(--sp-4); } }
