/* =========================================================
   EXCLUSIVE TRAINING — sistema visual
   Tienda de suplementación en claro, al estilo de las grandes del
   sector (AMIX Store, Nutritienda, Prozis): fondo blanco, mucho aire,
   la foto del producto como protagonista y un solo color de marca
   para lo que importa (precio, oferta, botón de compra).
   ========================================================= */

:root {
  /* --- Color --- */
  --ink: #14161a;          /* texto principal, casi negro */
  --ink-soft: #3d434e;     /* texto secundario */
  --muted: #6b7280;        /* texto de apoyo */
  --faint: #9aa1ad;        /* rótulos pequeños */

  --bg: #ffffff;           /* fondo de la página */
  --surface: #ffffff;      /* tarjetas */
  --surface-2: #f6f7f9;    /* bloques y fondos de foto */
  --surface-3: #eef0f4;    /* separadores suaves */
  --line: #e3e6ec;         /* bordes */
  --line-strong: #cfd4dd;

  --brand: #e8451c;        /* rojo-naranja de marca */
  --brand-dark: #c2360f;
  --brand-soft: #fdece7;   /* fondo tenue del color de marca */
  --accent: #14161a;       /* segundo color: negro */

  --ok: #0f8a4d;
  --ok-soft: #e6f5ec;
  --warn: #b7791f;
  --warn-soft: #fdf3e2;
  --danger: #d92d20;
  --danger-soft: #fdeceb;

  /* --- Tipografía --- */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* --- Formas --- */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --container: 1280px;

  /* --- Sombras: suaves y en capas, no cajas grises --- */
  --sh-sm: 0 1px 2px rgba(20, 22, 26, 0.05);
  --sh: 0 2px 6px rgba(20, 22, 26, 0.06), 0 1px 2px rgba(20, 22, 26, 0.04);
  --sh-md: 0 8px 20px rgba(20, 22, 26, 0.08), 0 2px 6px rgba(20, 22, 26, 0.04);
  --sh-lg: 0 18px 44px rgba(20, 22, 26, 0.12), 0 4px 12px rgba(20, 22, 26, 0.06);

  --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.021em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Rótulo pequeño en mayúsculas: categoría, "novedad", etiquetas de dato. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

/* =========================================================
   ANIMACIONES
   Discretas y con intención: entrada al hacer scroll, elevación al
   pasar por encima y un brillo que recorre los botones de compra.
   Se desactivan solas si el sistema pide menos movimiento.
   ========================================================= */
@keyframes subir {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes entrarDerecha {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes latido {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes brilloBoton {
  from { transform: translateX(-120%) skewX(-20deg); }
  to { transform: translateX(320%) skewX(-20deg); }
}

.reveal { opacity: 1; }
/* Solo se esconde para animar cuando hay JavaScript (ver head.ejs): así, si
   el JS fallara, la página se ve entera en vez de quedarse en blanco. */
.js .reveal { opacity: 0; }
.js .reveal.visible { animation: subir var(--t-slow) forwards; }
.reveal-delay-1.visible { animation-delay: 0.06s; }
.reveal-delay-2.visible { animation-delay: 0.12s; }
.reveal-delay-3.visible { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .js .reveal { opacity: 1; }
}

/* =========================================================
   BOTONES
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { border-color: var(--ink); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232, 69, 28, 0.28);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  box-shadow: 0 6px 18px rgba(232, 69, 28, 0.34);
}
/* Reflejo que cruza el botón al pasar por encima. */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%) skewX(-20deg);
}
.btn-primary:hover::after { animation: brilloBoton 0.7s ease; }

.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }

.btn-whatsapp { background: #25d366; border-color: #25d366; color: #06331b; }
.btn-whatsapp:hover { background: #1eb856; border-color: #1eb856; color: #06331b; }

.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { transform: none; }

/* Sólo dentro de estos contenedores los botones reparten el ancho. */
.card-actions .btn,
.product-detail .actions .btn { flex: 1; }

/* =========================================================
   CABECERA
   ========================================================= */
/* Franja fina de arriba: los mensajes de confianza que usan todas las
   tiendas del sector (envío, plazo, distribuidor). */
.topbar {
  background: var(--ink);
  color: #d7dae0;
  font-size: 12.5px;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.topbar-claims { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar-claims span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar-claims b { color: #fff; font-weight: 600; }
.topbar a { color: #d7dae0; }
.topbar a:hover { color: #fff; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow var(--t);
}
.site-header.scrolled { box-shadow: var(--sh-md); }
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* --- Logo --- */
.logo { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.logo svg { display: block; height: 36px; width: auto; }
.logo-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.logo-name .dot { color: var(--brand); }

/* Versión destacada: la de la cabecera principal de la tienda. */
.logo-grande svg { height: 50px; }
.logo-grande .logo-name { font-size: 27px; }

/* --- Buscador --- */
.search-form { flex: 1; min-width: 200px; display: flex; position: relative; }
.search-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--ink);
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-form input::placeholder { color: var(--faint); }
.search-form input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
/* La lupa es un dibujo de fondo: sin icono extra que cargar. */
.search-form::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  pointer-events: none;
}
.search-form button {
  height: 44px;
  background: var(--ink);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 0 20px;
  margin-left: 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.search-form button:hover { background: var(--brand); }

/* --- Acciones de cuenta y carrito --- */
.nav-actions { display: flex; align-items: center; gap: 8px; font-size: 14px; flex: 0 0 auto; }
.nav-actions > span { color: var(--muted); }
.nav-actions a {
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-actions a:hover { background: var(--surface-2); color: var(--ink); }

/* Los botones oscuros de la cabecera (Mi historial y el del pedido) comparten
   la MISMA altura y el mismo redondeo que el botón "Buscar": 44px de alto y
   esquinas totalmente redondas. Antes el del pedido salía un pelín más alto
   por la burbuja del número, y se notaba desigual. Con una altura fija los
   tres quedan idénticos. */
.nav-actions a.pill-dark {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--t-fast), transform var(--t-fast);
}
.nav-actions a.pill-dark:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff !important;
  padding: 0 18px !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--t-fast), transform var(--t-fast);
}
.cart-pill:hover { background: var(--brand) !important; border-color: var(--brand); transform: translateY(-1px); }
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.cart-pill:hover .cart-count { background: #fff; color: var(--brand); }

/* =========================================================
   MENÚ DE DEPARTAMENTOS (escritorio)
   ========================================================= */
.mega-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 40;
}
.mega-nav-inner { display: flex; flex-wrap: wrap; gap: 2px; }
.mega-item { position: relative; }
/* Aunque el departamento ya no navega a ninguna parte (solo abre su
   panel), sigue teniendo aspecto pulsable. */
.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  transition: color var(--t-fast);
}
/* Subrayado que crece desde el centro al pasar por encima. */
.mega-trigger::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform var(--t);
}
.mega-item:hover .mega-trigger { color: var(--brand); }
.mega-item:hover .mega-trigger::after { transform: scaleX(1); }

.mega-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 760px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brand);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--sh-lg);
  padding: 22px 24px;
}
.mega-item:hover .mega-panel { display: block; animation: aparecer var(--t-fast) both; }
.mega-panel-inner { column-width: 165px; column-gap: 28px; }
.mega-panel-simple { width: 240px; }
.mega-panel-simple .mega-panel-inner { column-count: 1; }
.mega-col {
  min-width: 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 20px;
}
.mega-cat-link {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color var(--t-fast);
}
.mega-cat-link:hover { color: var(--brand); }
.mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.mega-col ul li a {
  font-size: 12.5px;
  color: var(--muted);
  transition: color var(--t-fast), padding-left var(--t-fast);
}
.mega-col ul li a:hover { color: var(--brand); padding-left: 4px; }

/* =========================================================
   PANEL LATERAL (móvil)
   ========================================================= */
.drawer-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.burger-bars { position: relative; display: block; }
.burger-bars,
.burger-bars::before,
.burger-bars::after {
  width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform var(--t);
}
.burger-bars::before, .burger-bars::after { content: ''; position: absolute; left: 0; }
.burger-bars::before { top: -6px; }
.burger-bars::after { top: 6px; }

.cart-pill-compact { display: none; padding: 9px 13px !important; }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 22, 26, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--t);
  z-index: 90;
}
.drawer-backdrop.is-visible { opacity: 1; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(88vw, 350px);
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--t-slow), visibility 0s linear 0.4s;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform var(--t-slow), visibility 0s; }
body.drawer-open { overflow: hidden; }

.drawer-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
}
.drawer-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.drawer-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; line-height: 1; padding: 8px 10px; cursor: pointer;
  transition: color var(--t-fast);
}
.drawer-close:hover { color: #fff; }

.drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 32px; }

.drawer-user {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.drawer-user-name { color: var(--muted); font-size: 13px; }
.drawer-user a { color: var(--brand); font-size: 14px; font-weight: 700; }

.drawer-nav { display: flex; flex-direction: column; }
.drawer-link, .drawer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 15px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.drawer-link:active, .drawer-row:active { background: var(--surface-2); }
.drawer-group.is-open > .drawer-row { color: var(--brand); background: var(--brand-soft); }

.drawer-chevron {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform var(--t);
}
.drawer-group.is-open > .drawer-row > .drawer-chevron { transform: rotate(45deg); border-color: var(--brand); }

.drawer-panel { max-height: 0; overflow: hidden; background: var(--surface-2); transition: max-height var(--t); }
.drawer-sublink {
  display: block;
  padding: 12px 18px 12px 32px;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  transition: color var(--t-fast), background var(--t-fast);
}
.drawer-sublink:active { color: var(--brand); }
.drawer-sublink-all { color: var(--brand); font-weight: 700; }
.drawer-row-sub { padding-left: 32px; font-size: 14px; font-weight: 500; }
.drawer-sublink-deep,
.drawer-group-sub > .drawer-panel > .drawer-sublink { padding-left: 48px; font-size: 13px; color: var(--muted); }

.drawer-foot { display: flex; flex-direction: column; margin-top: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.drawer-foot a { padding: 13px 18px; font-size: 14px; color: var(--muted); }

/* =========================================================
   CARRUSEL DE BANNERS (portada)
   ========================================================= */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-top: 24px;
  box-shadow: var(--sh-md);
}
.banner-pistas { display: flex; transition: transform var(--t-slow); }
/* Cada anuncio trae su color desde el panel, en las variables
   --anuncio-fondo / --anuncio-texto / --anuncio-sobre. */
.banner-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 44px 48px;
  min-height: 340px;
  background: var(--anuncio-fondo, var(--surface-2));
  color: var(--anuncio-texto, var(--ink));
}
.banner-slide .b-titulo { color: inherit; }
.banner-slide .b-texto > * { animation: subir var(--t-slow) both; }
.banner-slide .b-texto > *:nth-child(2) { animation-delay: 0.08s; }
.banner-slide .b-texto > *:nth-child(3) { animation-delay: 0.16s; }
.banner-slide .b-texto > *:nth-child(4) { animation-delay: 0.24s; }
.b-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--anuncio-texto, var(--brand));
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.b-titulo { font-size: clamp(26px, 3.4vw, 42px); margin-bottom: 12px; }
.b-sub { color: inherit; opacity: 0.88; font-size: 15px; margin: 0 0 22px; max-width: 44ch; }
.b-precio { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.b-precio .ahora { font-family: var(--font-display); font-weight: 800; font-size: 32px; color: inherit; }
.b-precio .antes { color: inherit; opacity: 0.62; text-decoration: line-through; font-size: 16px; }
/* Botón del anuncio: cada paleta trae su propio par fondo/texto para el
   botón (--anuncio-sobre y --anuncio-sobre-texto), porque hay paletas claras
   (lima, oro) en las que el botón tiene que ser oscuro con letra blanca y
   otras oscuras en las que va al revés. Si se fijara un color de letra único
   se quedaba texto oscuro sobre botón oscuro y no se leía nada. */
.b-boton {
  background: var(--anuncio-sobre, #fff);
  border-color: transparent;
  color: var(--anuncio-sobre-texto, #14161a);
  font-weight: 700;
}
.banner-slide .b-boton { color: var(--anuncio-sobre-texto, #14161a); }
.b-boton:hover {
  border-color: transparent;
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.banner-foto {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 300px;
}
.banner-foto img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(20, 22, 26, 0.16));
  animation: entrarDerecha var(--t-slow) both;
}
/* Halo claro detrás del producto, para despegarlo del fondo de color. */
.banner-slide::before {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  width: 380px; height: 380px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.28) 0%, transparent 66%);
  pointer-events: none;
}
.banner-slide > * { position: relative; }

.banner-flecha {
  position: absolute;
  bottom: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--sh);
  color: var(--ink);
  font-size: 17px;
  z-index: 3;
  transition: background var(--t-fast), transform var(--t-fast);
}
.banner-flecha:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.banner-punto { background: rgba(255, 255, 255, 0.45); }
.banner-punto.activo { background: #fff; }
.banner-prev { right: 66px; }
.banner-next { right: 20px; }

.banner-puntos {
  position: absolute;
  bottom: 18px; left: 48px;
  display: flex; gap: 7px;
  z-index: 3;
}
.banner-punto {
  width: 26px; height: 4px;
  border-radius: 999px;
  border: none;
  background: var(--line-strong);
  cursor: pointer;
  padding: 0;
  transition: background var(--t-fast), width var(--t-fast);
}
.banner-punto.activo { width: 40px; }

/* =========================================================
   BARRA DE CONFIANZA
   ========================================================= */
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0 8px;
}
.trust-item {
  background: var(--surface);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 14px;
  transition: background var(--t-fast);
}
.trust-item:hover { background: var(--surface-2); }
.trust-icono {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 18px;
}
.trust-item b { display: block; font-size: 14px; font-weight: 700; }
.trust-item span { display: block; font-size: 12.5px; color: var(--muted); }

/* =========================================================
   TÍTULOS DE SECCIÓN
   ========================================================= */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 52px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 27px; min-width: 0; }
.section-head .back-link { font-size: 13.5px; color: var(--muted); }
.section-head .back-link:hover { color: var(--brand); }

/* =========================================================
   CATEGORÍAS
   ========================================================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  margin: 26px 0 56px;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.category-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--t);
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: var(--line-strong);
}
.category-card:hover::before { transform: scaleY(1); }
.category-card .cat-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.015em; }
.category-card .cat-count { font-family: var(--font-mono); color: var(--muted); font-size: 12px; margin-top: 6px; display: block; }

/* =========================================================
   TARJETA DE PRODUCTO
   ========================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 60px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
  border-color: var(--line-strong);
}
.product-card .thumb {
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.product-card .thumb.no-image {
  background: var(--surface-2) url('/img/placeholder.svg') center/52% no-repeat;
}
.product-card .thumb img {
  width: 100%; height: 100%; max-height: 100%;
  object-fit: contain;
  padding: 14px;
  transition: transform var(--t-slow);
}
.product-card:hover .thumb img { transform: scale(1.06); }

.badge-ribbon {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
}

.product-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.product-card .cat-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}
.product-card .name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
  color: var(--ink);
  transition: color var(--t-fast);
}
.product-card .name:hover { color: var(--brand); }
.product-card .code { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.05em; }

/* Precio: el que paga, grande y en negro; el tachado y el -15% al lado. */
.plate {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-block;
  width: fit-content;
}
.price-block { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-original { font-size: 13px; color: var(--faint); text-decoration: line-through; }
.discount-badge {
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
}
.product-detail .price-block .price-original { font-size: 16px; }
.product-detail .price-block .discount-badge { font-size: 13px; padding: 5px 10px; }

.card-actions { display: flex; gap: 8px; margin-top: 6px; }

/* Cinta horizontal de novedades. */
.scroll-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  margin-bottom: 52px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.scroll-row .product-card { min-width: 230px; max-width: 230px; scroll-snap-align: start; }

/* =========================================================
   FICHA DE PRODUCTO
   ========================================================= */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 36px 0 48px;
  align-items: start;
}
.product-detail .thumb-large {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  aspect-ratio: 1/1;
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-detail .thumb-large img {
  max-height: 86%; max-width: 86%;
  object-fit: contain;
  transition: transform var(--t-slow);
}
.product-detail .thumb-large:hover img { transform: scale(1.05); }
.product-detail h1 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 10px; }
.product-detail .price-row { display: flex; align-items: center; gap: 16px; margin: 22px 0; flex-wrap: wrap; }
.product-detail .price-row .plate { font-size: 34px; }
.product-detail .qty-row { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.qty-input {
  width: 74px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: center;
}
.product-detail .actions { display: flex; gap: 12px; margin-top: 24px; }
.product-detail .description {
  margin-top: 28px;
  color: var(--ink-soft);
  overflow-wrap: break-word;
  word-break: break-word;
  max-height: 260px;
  overflow: hidden;
  position: relative;
  transition: max-height var(--t);
}
.product-detail .description.expanded { max-height: none; }
.product-detail .description::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 52px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.product-detail .description.expanded::after,
.product-detail .description.no-fade::after { display: none; }
.description-toggle {
  margin-top: 8px;
  background: none; border: none;
  color: var(--brand);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  padding: 0;
}
.description-toggle:hover { text-decoration: underline; }

/* El <select> nativo se sigue usando por debajo, pero oculto: manda el
   selector bonito de al lado. Se deja accesible (no display:none) por si el
   JS no cargara, en cuyo caso vuelve a verse el nativo. */
.flavor-select {
  color: var(--ink);
  background: var(--surface);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}
.flavor-select-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* =========================================================
   SELECTOR BONITO (sustituye al desplegable nativo)
   ========================================================= */
.selector { position: relative; width: 100%; }
.selector-boton {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.selector-boton:hover { border-color: var(--brand); }
.selector.abierto .selector-boton {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.selector-valor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selector-valor.es-placeholder { color: var(--muted); font-weight: 500; }
.selector-flecha {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--t-fast);
}
.selector.abierto .selector-flecha { transform: rotate(-135deg) translate(-1px, -1px); }

.selector-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-lg);
  max-height: 240px;
  overflow-y: auto;
  animation: selectorAbre var(--t-fast) ease;
}
@keyframes selectorAbre {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.selector-opcion {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.selector-opcion:hover { background: var(--surface-2); color: var(--ink); }
.selector-opcion.elegida {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}
/* Mientras un desplegable está abierto dentro de una tarjeta, se levanta el
   recorte de la tarjeta para que el panel no se corte y quede por encima. */
.product-card.selector-encima { overflow: visible; z-index: 6; }

/* =========================================================
   CANTIDAD CON + / −
   ========================================================= */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.qty-stepper .qty-btn {
  width: 42px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-user-select: none;
  user-select: none;
}
.qty-stepper .qty-btn:hover { background: var(--brand); color: #fff; }
.qty-stepper .qty-btn:active { background: var(--brand); color: #fff; }
.qty-stepper .qty-input {
  width: 46px;
  height: 44px;
  border: none;
  border-left: 1.5px solid var(--line);
  border-right: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  -moz-appearance: textfield;
}
.qty-stepper .qty-input::-webkit-outer-spin-button,
.qty-stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Versión compacta para las líneas del carrito. */
.qty-stepper-sm .qty-btn { width: 34px; height: 38px; font-size: 19px; }
.qty-stepper-sm .qty-input { width: 38px; height: 38px; font-size: 14px; }

/* =========================================================
   CARRITO
   ========================================================= */
.cart-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  transition: box-shadow var(--t-fast);
}
.cart-item:hover { box-shadow: var(--sh); }
.cart-item img { width: 64px; height: 64px; object-fit: contain; background: var(--surface-2); border-radius: var(--radius-sm); }
.cart-item .info { flex: 1; }
.cart-item .info .name { font-weight: 600; font-size: 14.5px; }
.cart-item .info .code { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.cart-summary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
.cart-summary .total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* =========================================================
   FORMULARIOS Y ACCESO
   ========================================================= */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, var(--brand-soft), transparent 45%),
    radial-gradient(circle at 85% 85%, #eef1f6, transparent 45%),
    var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--sh-lg);
  animation: subir var(--t-slow) both;
}
.auth-card .logo { margin-bottom: 8px; }
.auth-card p.tag { color: var(--muted); font-size: 13.5px; margin: 0 0 28px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: #96201a;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; max-width: 760px; }
.form-grid .full { grid-column: 1 / -1; }

/* =========================================================
   PANEL DE ADMINISTRACIÓN
   ========================================================= */
.admin-topbar {
  background: var(--ink);
  color: #fff;
  padding: 10px 0;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 45;
}
.admin-topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.admin-topbar-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}
.admin-nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.admin-nav-links a {
  color: rgba(255,255,255,0.82);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.admin-nav-links a:hover { background: rgba(255,255,255,0.12); color: #fff; }
/* Separación entre bloques del menú (gestión | dinero | herramientas). */
.admin-nav-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 6px;
  background: rgba(255,255,255,0.18);
}

.stat-row { display: flex; gap: 14px; margin: 26px 0; flex-wrap: wrap; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  min-width: 150px;
  flex: 1 1 auto;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.stat-box:hover { box-shadow: var(--sh); transform: translateY(-2px); }
.stat-box .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.stat-box .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.filter-bar { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 56px;
  font-size: 13.5px;
  background: var(--surface);
}
table.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}
table.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.admin-table tbody tr { transition: background var(--t-fast); }
table.admin-table tbody tr:hover { background: var(--surface-2); }

/* Miniatura de producto: `max-width: none` para que la regla global de
   imágenes no la encoja al ancho libre de su celda. */
.thumb-mini {
  width: 52px; height: 52px;
  max-width: none;
  flex: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: contain;
}
table.admin-table th.col-thumb,
table.admin-table td.cell-thumb { width: 52px; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-on { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(15,138,77,0.3); }
.badge-off { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(217,45,32,0.3); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }
table.admin-table td.row-actions { min-width: 200px; }

/* Desglose de productos dentro de una celda. */
.items-table { font-size: 12.5px; }
.items-table th { background: none; border: none; padding: 2px 8px 4px 0; text-transform: none; letter-spacing: 0; }
.items-table td { border: none; padding: 3px 8px 3px 0; }

/* Plazo de entrega en el historial del cliente. */
.plazo {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.plazo-entregado { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(15,138,77,0.3); }
.plazo-en-plazo { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(183,121,31,0.3); }
.plazo-ultimo-dia { background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(232,69,28,0.35); }
.plazo-fuera-plazo, .plazo-sin-pagar { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(217,45,32,0.3); }
.plazo-detalle { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.45; }

/* =========================================================
   VENTANA DE AVISO
   ========================================================= */
.modal-fondo {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 22, 26, 0.5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: aparecer var(--t-fast);
}
.modal-fondo[hidden] { display: none; }
body.modal-abierto { overflow: hidden; }
.modal-caja {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--sh-lg);
  animation: subir var(--t-slow) both;
}
.modal-caja h3 { font-size: 22px; margin: 0 0 16px; }
.modal-destacado {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 15px;
}
.modal-nota { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.modal-botones { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-botones .btn { flex: 1; min-width: 140px; }

/* =========================================================
   AVISOS FLOTANTES (toast)
   ========================================================= */
/* Sustituyen a los alert() del navegador. Se apilan abajo y en el centro,
   por encima de todo, y no bloquean el resto de la página. */
.avisos-zona {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.aviso {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px;
  box-shadow: var(--sh-lg);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  max-width: 100%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity var(--t), transform var(--t);
}
.aviso.visible { opacity: 1; transform: translateY(0) scale(1); }
.aviso-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 14px;
}
/* Cada tipo con su color, sin gritar: una barrita/aro de color y ya. */
.aviso-aviso { border-left: 4px solid var(--warn); }
.aviso-aviso .aviso-icono { background: rgba(183, 121, 31, 0.22); }
.aviso-ok { border-left: 4px solid var(--ok); }
.aviso-ok .aviso-icono { background: rgba(15, 138, 77, 0.24); color: #7ee2ab; }
.aviso-error { border-left: 4px solid var(--danger); }
.aviso-error .aviso-icono { background: rgba(217, 45, 32, 0.24); }

/* Desplegable al que le falta una opción (p. ej. el sabor): tiembla y se
   enmarca en rojo un momento para que salte a la vista. */
@keyframes temblorFalta {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.falta {
  animation: temblorFalta 0.4s ease;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.18) !important;
}

@media (max-width: 560px) {
  .avisos-zona { bottom: 16px; width: calc(100vw - 24px); }
  .aviso { width: 100%; }
}

/* =========================================================
   ESTADO VACÍO Y PIE
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty-state h2 { color: var(--ink); margin-bottom: 8px; font-size: 20px; }

.site-footer {
  background: var(--ink);
  color: #a8aeb9;
  padding: 26px 0;
  margin-top: 64px;
  font-size: 13.5px;
}
.footer-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .logo-name { color: #fff; }
.site-footer .legal { font-size: 12.5px; color: #7c828d; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 901px) {
  .drawer, .drawer-backdrop { display: none !important; }
}

@media (max-width: 900px) {
  .drawer-toggle, .cart-pill-compact { display: inline-flex; }
  .mega-nav, .nav-actions { display: none; }

  .site-header .wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "burger logo cart" "search search search";
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .drawer-toggle { grid-area: burger; }
  .site-header .logo { grid-area: logo; justify-content: center; }
  .site-header .logo svg { height: 34px; }
  .site-header .logo-name { font-size: 17px; }
  .site-header .logo { gap: 8px; }
  .cart-pill-compact { grid-area: cart; }
  .site-header .search-form { grid-area: search; min-width: 0; }

  /* --- Tablas en tarjetas --- */
  table.admin-table { display: block; font-size: 14px; margin-bottom: 36px; background: none; }
  table.admin-table thead { display: none; }
  table.admin-table tbody, table.admin-table tr, table.admin-table td { display: block; width: 100%; }
  table.admin-table tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 15px;
    margin-bottom: 12px;
    box-shadow: var(--sh-sm);
  }
  table.admin-table tbody tr:hover { background: var(--surface); }
  table.admin-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-3);
    text-align: right;
  }
  table.admin-table tr td:last-child { border-bottom: none; }
  table.admin-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: left;
  }
  table.admin-table td:not([data-label]),
  table.admin-table td[data-label=""],
  table.admin-table td[colspan] { text-align: left; }
  table.admin-table td:not([data-label])::before,
  table.admin-table td[data-label=""]::before,
  table.admin-table td[colspan]::before { display: none; }
  table.admin-table td.cell-block { display: block; text-align: left; }
  table.admin-table td.cell-block::before { display: block; max-width: none; margin-bottom: 7px; }
  table.admin-table td .row-actions { justify-content: flex-start; flex-wrap: wrap; }

  /* Desglose de productos dentro de la celda. */
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table thead { display: none; }
  .items-table tr { padding: 9px 0; border-bottom: 1px solid var(--surface-3); }
  .items-table tr:last-child { border-bottom: none; }
  .items-table td { padding: 0 !important; }
  .items-table td.it-name { font-weight: 600; margin-bottom: 5px; }
  .items-table td.it-num {
    display: inline-block; width: auto; margin-right: 12px;
    font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  }
  .items-table td.it-num::before { content: attr(data-label) " "; letter-spacing: 0.05em; }

  /* Menú del panel en una fila que se desliza. */
  .admin-topbar .wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .admin-nav-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 4px;
  }
  .admin-nav-links::-webkit-scrollbar { display: none; }
  .admin-nav-links a {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 8px 14px;
  }
  .admin-nav-sep { display: none; }

  /* Banner apilado. */
  .banner-slide {
    grid-template-columns: 1fr;
    padding: 30px 24px 54px;
    min-height: 0;
    text-align: center;
  }
  .banner-slide::before { display: none; }
  .banner-foto { order: -1; max-height: 210px; }
  .b-precio { justify-content: center; }
  .banner-puntos { left: 50%; transform: translateX(-50%); bottom: 16px; }
  .banner-flecha { display: none; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  /* En el móvil se ven los cuatro mensajes: en vez de esconderlos, la franja
     se desliza a lo ancho y se pasan con el dedo. Así caben todos sin partirse
     ni amontonarse. */
  .topbar { font-size: 11px; }
  .topbar .wrap { justify-content: center; gap: 8px; padding-top: 7px; padding-bottom: 7px; }
  /* Se ven los cuatro mensajes: se reparten en dos líneas centradas en vez de
     esconderse. */
  .topbar-claims {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 14px;
    width: 100%;
  }
  .form-grid { grid-template-columns: 1fr; }

  .section-head { flex-direction: column; align-items: flex-start; margin: 34px 0 18px; gap: 8px; }
  .section-head h2 { font-size: 23px; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar > div { width: 100%; }
  .filter-bar input, .filter-bar select, .filter-bar .btn, .filter-bar button { width: 100%; }

  .stat-row { gap: 10px; }
  .stat-box { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 14px 16px; }
  .stat-box .num { font-size: 21px; }

  .product-detail { padding: 22px 0; gap: 24px; grid-template-columns: 1fr; }
  .product-detail .actions { flex-direction: column; }

  .cart-item { flex-wrap: wrap; }
  .cart-item .info { flex: 1 1 100%; order: 3; }
  .cart-summary { padding: 18px; }

  .footer-simple { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-footer { padding: 22px 0; margin-top: 44px; }

  .btn { padding: 12px 16px; }
  .btn-sm { padding: 9px 12px; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 40px; }
  .product-card .body { padding: 11px 12px 13px; gap: 5px; }
  .product-card .name { font-size: 13px; }
  .product-card .thumb img { padding: 9px; }
  .card-actions { flex-direction: column; }
  .plate { font-size: 16px; }
  .price-original, .discount-badge { font-size: 11px; }

  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0 40px; }
  .category-card { padding: 15px; }
  .category-card .cat-name { font-size: 14px; }

  .scroll-row .product-card { min-width: 168px; max-width: 168px; }
  .section-head h2 { font-size: 20px; }
  .b-titulo { font-size: 23px; }
  .modal-caja { padding: 22px; }
  .modal-botones { flex-direction: column; }
}
