/* ────────────────────────────────────────────────────────────────
   Design tokens — tomados de proyecto-isumos (misma identidad visual)
   ──────────────────────────────────────────────────────────────── */
:root {
  --accent:          #2563EB;
  --accent-hover:    #1D4ED8;
  --accent-light:    #EFF6FF;
  --accent-muted:    #BFDBFE;

  --success:         #16A34A;
  --success-light:   #DCFCE7;
  --warning:         #D97706;
  --warning-light:   #FEF3C7;
  --danger:          #DC2626;
  --danger-light:    #FEE2E2;
  --info:            #0891B2;
  --info-light:      #CFFAFE;

  --white:           #FFFFFF;
  --bg:              #F8FAFC;
  --bg-subtle:       #F1F5F9;
  --border:          #E2E8F0;
  --border-strong:   #CBD5E1;
  --text-muted:      #64748B;
  --text-secondary:  #475569;
  --text-primary:    #0F172A;
  --surface:         #FFFFFF;

  --font-sans:       'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;

  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  --leading-tight:   1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

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

  --radius-sm:   0.25rem;
  --radius:      0.5rem;
  --radius-md:   0.75rem;
  --radius-lg:   1rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.10), 0 1px 2px -1px rgb(0 0 0 / 0.10);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.10), 0 4px 6px -4px rgb(0 0 0 / 0.10);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10);

  --transition-fast: 150ms ease;
  --transition:      200ms ease;
  --transition-slow: 300ms ease;

  --drawer-width:      420px;
  --header-height:     64px;
  --content-max-width: 1200px;
}

/* ── Reset mínimo ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; line-height: var(--leading-tight); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

body.modal-open { overflow: hidden; }

/* ── Header ───────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  max-width: 1640px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
  gap: var(--space-3);
}

@media (min-width: 1024px) {
  .app-header__inner { padding-inline: var(--space-6); }
}

.app-header__brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }

.app-header__logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__logo svg { width: 22px; height: 22px; color: var(--white); }

.app-header__title { font-size: var(--text-lg); font-weight: var(--font-bold); color: var(--text-primary); letter-spacing: -0.01em; white-space: nowrap; }
.app-header__subtitle { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }

.app-header__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

@media (max-width: 480px) {
  .btn-label-full { display: none; }
}

/* ── Botón "Mi pedido" (abre el drawer) ────────────────────────── */
.btn-cart-header {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--font-semibold);
  color: var(--white); background: var(--accent);
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.btn-cart-header:hover { background: var(--accent-hover); }
.btn-cart-header svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.btn-cart-header.is-bump { animation: cart-bump 320ms ease; }

@keyframes cart-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── Main ─────────────────────────────────────────────────────── */
.app-main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
}

@media (min-width: 1024px) { .app-main { padding-inline: var(--space-6); } }

/* ── Buscador ─────────────────────────────────────────────────── */
.search-bar { margin-bottom: var(--space-5); }
.search-bar__wrap { position: relative; }

.search-bar__icon {
  position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  width: 1.25rem; height: 1.25rem; color: var(--text-muted); pointer-events: none;
}

.search-bar__input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-3) + 1.25rem + var(--space-2));
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.search-bar__input::placeholder { color: var(--text-muted); }
.search-bar__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.search-bar__input::-webkit-search-cancel-button { display: none; }

/* ── Sugerencias de búsqueda ───────────────────────────────────── */
.search-suggestions {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0; right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.search-suggestion {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.search-suggestion:hover, .search-suggestion.is-active { background: var(--accent-light); }
.search-suggestion + .search-suggestion { border-top: 1px solid var(--bg-subtle); }
.search-suggestion__category { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Chips de categoría ───────────────────────────────────────── */
.chips-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .chips-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--space-4) * -1);
    padding-inline: var(--space-4);
    mask-image: linear-gradient(to right, transparent 0, black var(--space-4), black calc(100% - var(--space-8)), transparent 100%);
  }
  .chips-bar::-webkit-scrollbar { display: none; }
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.chip--active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.chip--active:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--white); }

.results-count { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); min-height: 1.25rem; }

/* ── Grid de productos ────────────────────────────────────────── */
.product-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1440px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

.empty-state { grid-column: 1 / -1; text-align: center; padding: var(--space-16) var(--space-4); color: var(--text-muted); font-size: var(--text-base); }

/* ── Card de producto ─────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  outline: none;
}

.product-card:hover, .product-card:focus-visible {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-muted);
  transform: translateY(-2px);
}

.product-card__img-wrap { position: relative; aspect-ratio: 1 / 1; background: var(--bg-subtle); overflow: hidden; }
.product-card__img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-4); }

.product-card__controlled {
  position: absolute; top: var(--space-2); left: var(--space-2);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px var(--space-2);
  background: var(--danger); color: var(--white);
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  border-radius: var(--radius-full); line-height: 1;
}

.product-card__popular {
  position: absolute; top: var(--space-2); right: var(--space-2);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px var(--space-2);
  background: var(--accent); color: var(--white);
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  border-radius: var(--radius-full); line-height: 1;
}

.product-card__body { padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; flex: 1; }

.product-card__category { font-size: var(--text-xs); font-weight: var(--font-medium); color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.product-card__name { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-primary); line-height: var(--leading-tight); margin-bottom: 2px; }

.product-card__meta-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: 2px; }
.product-card__presentation { font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.product-card__footer { margin-top: auto; padding-top: var(--space-2); }

/* ── Badge de disponibilidad ──────────────────────────────────── */
.availability-badge { display: inline-flex; align-items: center; flex-shrink: 0; padding: 2px var(--space-2); font-size: var(--text-xs); font-weight: var(--font-semibold); border-radius: var(--radius-full); line-height: 1.5; }
.badge--disponible { background: var(--success-light); color: var(--success); }
.badge--a_consultar { background: var(--warning-light); color: var(--warning); }
.badge--sin_stock { background: var(--bg-subtle); color: var(--text-muted); }

/* ── Botones ──────────────────────────────────────────────────── */
.btn-add-cart {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--font-semibold);
  color: var(--white); background: var(--accent);
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
}
.btn-add-cart svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.btn-add-cart:hover:not(:disabled) { background: var(--accent-hover); }
.btn-add-cart:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; opacity: 1; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--text-secondary); background: transparent;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.btn-ghost svg { width: 1rem; height: 1rem; }

.btn-ghost--danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: var(--font-semibold);
  color: var(--white); background: var(--accent);
  border: none; border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-primary svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.btn-whatsapp { background: #25D366; }
.btn-whatsapp:hover:not(:disabled) { background: #1DA851; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: var(--font-semibold);
  color: var(--accent); background: var(--accent-light);
  border: 1.5px solid var(--accent-muted); border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-secondary:hover { background: var(--accent-muted); }
.btn-secondary svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ── Stepper de cantidad (múltiplos) ──────────────────────────── */
.qty-stepper { display: flex; align-items: center; gap: var(--space-1); }

.btn-qty {
  display: flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.btn-qty:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-qty:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-qty svg { width: 0.9rem; height: 0.9rem; }

.qty-value { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-primary); min-width: 1.75rem; text-align: center; }
.qty-multiple-hint { font-size: var(--text-xs); color: var(--text-muted); }

.qty-input {
  width: 3.25rem;
  height: 1.75rem;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  appearance: textfield;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }

/* ── Drawer del pedido ─────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgb(15 23 42 / 0.5);
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.drawer-overlay:not([hidden]) { display: block; }
.drawer-overlay.is-open { opacity: 1; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 201;
  width: 100%;
  max-width: var(--drawer-width);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}
.drawer-overlay.is-open .cart-drawer { transform: translateX(0); }

@media (max-width: 640px) {
  .cart-drawer {
    top: auto;
    max-width: none;
    max-height: 88dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .drawer-overlay.is-open .cart-drawer { transform: translateY(0); }
}

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

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

.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 var(--space-1);
  background: var(--white); color: var(--accent);
  font-size: var(--text-xs); font-weight: var(--font-bold);
  border-radius: var(--radius-full); line-height: 1;
}

.cart-empty { font-size: var(--text-sm); color: var(--text-muted); text-align: center; padding: var(--space-8) var(--space-4); }

#cart-items { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }

.cart-item { display: flex; align-items: flex-start; gap: var(--space-3); }
.cart-item__img { width: 3rem; height: 3rem; object-fit: contain; border-radius: var(--radius); background: var(--bg-subtle); flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-item__name { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); line-height: var(--leading-tight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item__meta { font-size: var(--text-xs); color: var(--text-muted); }
.cart-item__controls { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); flex-wrap: wrap; }
.cart-item__unit { font-size: var(--text-xs); color: var(--text-muted); }

.btn-item-remove {
  display: flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border: none; background: transparent;
  color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-item-remove:hover { color: var(--danger); background: var(--danger-light); }
.btn-item-remove svg { width: 1rem; height: 1rem; }

.cart-panel__footer { border-top: 1px solid var(--border); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex-shrink: 0; }
#cart-summary { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-secondary); text-align: center; }

/* ── Overlay + Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgb(15 23 42 / 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  opacity: 0; transition: opacity var(--transition-slow);
  backdrop-filter: blur(2px);
}
.modal-overlay:not([hidden]) { display: flex; }
.modal-overlay.is-open { opacity: 1; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - var(--space-8));
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modal-in var(--transition-slow) ease both;
}
.modal--wide { max-width: 640px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.modal__close {
  position: absolute; top: var(--space-3); right: var(--space-3); z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: var(--radius); border: none;
  background: var(--bg-subtle); color: var(--text-muted); cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.modal__close:hover { background: var(--border); color: var(--text-primary); }
.modal__close svg { width: 1rem; height: 1rem; }

.modal__img-wrap { position: relative; aspect-ratio: 16 / 9; background: var(--bg-subtle); overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; flex-shrink: 0; }
.modal__img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-6); }

.modal__body { padding: var(--space-5) var(--space-6) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }

.modal__name { font-size: var(--text-xl); font-weight: var(--font-bold); color: var(--text-primary); line-height: var(--leading-tight); }
.modal__presentation { font-size: var(--text-sm); color: var(--text-muted); }
.modal__description { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); padding: var(--space-3); background: var(--bg-subtle); border-radius: var(--radius); }

.modal__meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.modal__sku { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

.modal__title { font-size: var(--text-xl); font-weight: var(--font-bold); color: var(--text-primary); margin-bottom: var(--space-1); }

.alert { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.alert--warning { background: var(--warning-light); color: var(--warning); }
.alert--info { background: var(--info-light); color: var(--info); }
.alert svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 1px; }

/* ── Indicador de pasos (checkout) ─────────────────────────────── */
.step-indicator {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

/* ── Resumen de pedido (dentro del modal) ────────────────────── */
.confirm-items { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-4); max-height: 30vh; overflow-y: auto; padding-right: var(--space-1); }
.confirm-category__title { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-2); }
.confirm-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--bg-subtle); font-size: var(--text-sm); }
.confirm-row__name { color: var(--text-primary); flex: 1; min-width: 0; }
.confirm-row__qty { font-weight: var(--font-semibold); color: var(--text-primary); white-space: nowrap; }
.confirm-row__unit { font-weight: var(--font-normal); color: var(--text-muted); }

.confirm-summary {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-secondary);
  padding: var(--space-4) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}
.confirm-summary__dot { color: var(--border-strong); }

/* ── Formulario de datos de contacto ──────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.form-field__label { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-secondary); }
.form-field__label .required { color: var(--danger); }

.form-field__input, .form-field__textarea {
  padding: 0 var(--space-4);
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-field__textarea { height: auto; padding: var(--space-3) var(--space-4); resize: vertical; min-height: 72px; }

.form-field__input::placeholder, .form-field__textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.form-field__input:focus, .form-field__textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.form-field__input.is-error, .form-field__textarea.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 480px) { .form-grid--2col { grid-template-columns: 1fr 1fr; gap: 0 var(--space-3); } }

.form-section-title { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-primary); margin-bottom: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.form-section-title:first-child { border-top: none; padding-top: 0; }

/* ── Éxito / texto del pedido ─────────────────────────────────── */
.modal__body--success { text-align: center; }

.success-icon {
  display: flex; align-items: center; justify-content: center;
  width: 4rem; height: 4rem;
  background: var(--success-light); border-radius: var(--radius-full);
  margin: 0 auto var(--space-4); color: var(--success);
}
.success-icon svg { width: 2.5rem; height: 2.5rem; }

.order-text-wrap { margin-bottom: var(--space-4); text-align: left; }
.order-text {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
}

.success-actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* ── Historial de pedidos ──────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 60vh; overflow-y: auto; padding-right: var(--space-1); }
.history-empty { font-size: var(--text-sm); color: var(--text-muted); text-align: center; padding: var(--space-8) var(--space-4); }

.history-order { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }

.history-order__summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer; user-select: none; list-style: none;
  background: var(--surface);
  transition: background var(--transition-fast);
}
.history-order__summary:hover { background: var(--bg-subtle); }
.history-order__summary::-webkit-details-marker { display: none; }

.history-order__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-order__date { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
.history-order__stats { font-size: var(--text-xs); color: var(--text-muted); }

.history-order__chevron { width: 1.25rem; height: 1.25rem; color: var(--text-muted); flex-shrink: 0; transition: transform var(--transition); }
.history-order[open] .history-order__chevron { transform: rotate(180deg); }

.history-order__detail { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); background: var(--bg-subtle); display: flex; flex-direction: column; gap: var(--space-2); }

.history-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--text-sm); }
.history-row__name { color: var(--text-primary); flex: 1; min-width: 0; }
.history-row__qty { font-weight: var(--font-semibold); color: var(--text-primary); white-space: nowrap; }
.history-row__unit { font-weight: var(--font-normal); color: var(--text-muted); }

.btn-repeat-order {
  display: inline-flex; align-items: center; gap: var(--space-1);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--accent); background: var(--accent-light);
  border: 1.5px solid var(--accent-muted); border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-repeat-order:hover { background: var(--accent-muted); }
.btn-repeat-order svg { width: 0.875rem; height: 0.875rem; }

/* ── Toast ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  max-width: min(480px, calc(100vw - var(--space-8)));
  text-align: center;
  pointer-events: none;
}
.toast--visible { opacity: 1; transform: translateY(0); }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer { text-align: center; padding: var(--space-8) var(--space-4); font-size: var(--text-xs); color: var(--text-muted); }
