:root {
  --azul-oscuro: #131921;
  --azul-medio: #232f3e;
  --naranja: #ff9900;
  --naranja-oscuro: #e88a00;
  --rosa-temu: #ff3466;
  --rosa-claro: #fff0f3;
  --gris-fondo: #f2f2f2;
  --texto: #0f1111;
  --texto-suave: #565959;
  --borde: #e3e6e6;
  --verde: #007600;
  /* sombra suave y difusa (estilo 2026, sin bordes duros) */
  --sombra: 0 1px 2px rgba(16,24,40,.05), 0 10px 26px -14px rgba(16,24,40,.18);
  --sombra-alta: 0 24px 48px -24px rgba(16,24,40,.35);
  --radio: 14px;
  --radio-lg: 20px;
  --pill: 999px;
  /* degradados de marca usados en botones, chips y badges */
  --grad-primario: linear-gradient(135deg, #ff3466 0%, #ff6a3d 100%);
  --grad-secundario: linear-gradient(135deg, #ffb020 0%, #ff8a00 100%);
  --fuente: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* superficies para el tema oscuro (claro por defecto) */
  --fondo: #f5f6f8;
  --superficie: #ffffff;
  --superficie-2: #f3f4f6;
  --input-fondo: #ffffff;
  /* Capas de la tienda, de abajo a arriba. El fondo de las ventanas es
     UNO solo (#overlay): cuando hay una ventana abierta sube a la capa
     69 para quedar justo debajo de ella (70) y por encima del carrito
     (50). Así nunca se suman dos fondos ni tapan una ventana abierta. */
  --capa-fab: 35;
  --capa-fondo: 40;
  --capa-carrito: 50;
  --capa-aviso: 60;
  --capa-fondo-ventana: 69;
  --capa-ventana: 70;
  --capa-aviso-superior: 100;
}

/* ============================================================
   TEMA OSCURO — se activa con data-tema="oscuro" en <html>
   (ver js/company.js: botón 🌙/☀️ y preferencia en localStorage)
   ============================================================ */
html[data-tema="oscuro"] {
  --fondo: #0f1419;
  --superficie: #1a2129;
  --superficie-2: #232f3e;
  --texto: #e8eaed;
  --texto-suave: #9aa4ad;
  --borde: #2d3742;
  --input-fondo: #121a22;
  --rosa-claro: #3a1420;
  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -16px rgba(0,0,0,.75);
  --sombra-alta: 0 24px 48px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--fuente);
  background: var(--fondo);
  color: var(--texto);
  transition: background .2s ease, color .2s ease;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- ICONOS SVG (sprite inline, estilo Lucide) ---------- */
/* El sprite queda oculto pero accesible vía <use href="#i-..."></use> */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 1.05em;
  height: 1.05em;
  stroke: currentColor;
  flex-shrink: 0;
  vertical-align: -.16em;
}

/* ---------- HEADER ---------- */
header.top {
  /* barra fija y semitransparente con desenfoque (glassmorphism) */
  background: rgba(19, 25, 33, .92);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.logo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  display: flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
}
.logo span {
  background: var(--grad-secundario);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* El logo subido es una imagen: sin una altura fija válida crecía a 100 px
   y agrandaba todo el header (la regla anterior tenía "height: px", inválida) */
.logo-img { height: 60px; width: auto; max-width: 150px; object-fit: contain; display: block; }

.buscador {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--pill);
  min-width: 200px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 3px 3px 3px 6px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.buscador:focus-within {
  border-color: rgba(255, 153, 0, .85);
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 4px rgba(255, 153, 0, .18);
}
.buscador input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  color: #fff;
}
.buscador input::placeholder { color: rgba(255, 255, 255, .6); }
.buscador button {
  background: var(--grad-secundario);
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  color: #241500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: transform .15s ease, filter .15s ease;
}
.buscador button:hover { transform: scale(1.06); filter: brightness(1.06); }

.acciones-header {
  display: flex;
  align-items: center;
  gap: 18px;
}
.icono-carrito {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: #fff;
  /* fondo y borde propios: sin esto, el navegador pinta el botón con su
     gris por defecto (claro en modo light, oscuro en dark) y desaparece */
  background: var(--grad-secundario);
  border: none;
  border-radius: var(--pill);
  padding: 9px 16px;
  font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(255, 138, 0, .85);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.icono-carrito:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 22px -8px rgba(255, 138, 0, .95); }
.icono-carrito:active { transform: scale(.97); }
.icono-carrito .contador {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--rosa-temu);
  color: #fff;
  border: 2px solid #131921;
  border-radius: var(--pill);
  font-size: 10.5px;
  font-weight: 800;
  min-width: 20px;
  padding: 0 4px;
  line-height: 17px;
  text-align: center;
}
/* botones "fantasma" del header (cuenta, soporte, panel) en pastilla */
.btn-admin,
.btn-cuenta,
.btn-soporte {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn-admin:hover,
.btn-cuenta:hover,
.btn-soporte:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .35);
}

/* barra de categorías + rastreo de pedido */
nav.categorias {
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  flex-wrap: wrap;
}
#categorias-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 120px;
  padding: 2px 0;
}
#categorias-scroll button {
  background: var(--superficie-2);
  border: 1px solid transparent;
  color: var(--texto-suave);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--pill);
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
#categorias-scroll button:hover {
  background: var(--borde);
  color: var(--texto);
}
#categorias-scroll button.activa {
  background: var(--grad-primario);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(255, 52, 102, .9);
}

.rastreo-pedido {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.rastreo-pedido input {
  padding: 8px 14px;
  border: 1.5px solid var(--borde);
  background: var(--input-fondo);
  border-radius: var(--pill);
  font-size: 12.5px;
  width: 170px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rastreo-pedido input:focus {
  border-color: var(--rosa-temu);
  box-shadow: 0 0 0 4px rgba(255, 52, 102, .14);
}
.rastreo-pedido button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-primario);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--pill);
  white-space: nowrap;
  box-shadow: 0 8px 16px -10px rgba(255, 52, 102, .9);
  transition: transform .15s ease, filter .15s ease;
}
.rastreo-pedido button:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* Resultado del rastreo dentro del modal */
.rastreo-resultado { font-size: 14px; }
.rastreo-resultado .fila { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--borde); }
.rastreo-resultado .fila span:first-child { color: var(--texto-suave); }
.rastreo-estado-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; margin-top: 6px;
}
.rastreo-estado-pill.pendiente { background: #fff3cd; color: #8a6d00; }
.rastreo-estado-pill.en-proceso { background: #dbeafe; color: #1d4ed8; }
.rastreo-estado-pill.proceso-de-entrega { background: #e0f2fe; color: #0369a1; }
.rastreo-estado-pill.completado { background: #e6f7e6; color: var(--verde); }
.rastreo-estado-pill.cancelado { background: #fdecec; color: #c0392b; }
.rastreo-link-factura {
  display: inline-block; margin-top: 14px; background: var(--rosa-temu); color: #fff;
  padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.rastreo-link-factura:hover { background: #e01f52; }
.rastreo-error { color: #c0392b; font-size: 13.5px; padding: 10px 0; }

/* ---------- HERO ---------- */
.hero {
  /* degradado de marca + brillo radial para dar profundidad */
  background:
    radial-gradient(900px 320px at 12% -20%, rgba(255, 176, 32, .55), transparent 62%),
    var(--grad-primario);
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 30px 18px;
  text-align: center;
  transition: background-image .25s ease;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.28);
}
.hero.con-imagen::before { display: block; }
/* Banner de categoría de fondo: cubre sin deformar (se recorta lo que sobra) */
.hero.con-imagen {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero:not(.con-imagen)::before { display: none; }
.hero h1, .hero p { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.i-hero { width: .95em; height: .95em; }
.hero p { margin: 0; opacity: .95; font-size: 14px; }
.hero .hero-texto { position: relative; z-index: 1; }

/* ---------- CARRUSEL DE PROMOCIONES (en el hero) ---------- */
.hero-carrusel {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto 14px;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: rgba(0,0,0,.18);
}
.hero-carrusel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;           /* Firefox: sin barra */
}
.hero-carrusel-track::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  min-width: 0;
}
/* La foto del carrusel conserva SIEMPRE su proporción (nunca se estira ni
   se achata): se recorta solo lo que sobra, centrada, y el alto sale del
   ancho según la proporción de cada pantalla. */
.hero-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 8;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #222;
}
.hero-slide .hero-slide-titulo {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 14px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(0, 0, 0, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.hero-arrow:hover { background: rgba(0,0,0,.72); }
.hero-arrow-left { left: 10px; }
.hero-arrow-right { right: 10px; }
.hero-carrusel-pips {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.hero-carrusel-pips .pip {
  width: 8px; height: 8px;
  border-radius: var(--pill);
  border: none;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  padding: 0;
  transition: width .2s ease, background .2s ease;
}
/* la píldora activa se alarga (estilo carrusel moderno) */
.hero-carrusel-pips .pip.activa { background: #fff; width: 22px; }

/* ---------- COMBOS (tienda) ---------- */
.grid-combos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.tarjeta-combo {
  background: linear-gradient(135deg, #fff4e8, #fff);
  border: 1px solid #ffd9a8;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
}
.tarjeta-combo .combo-img { width: 100%; height: 130px; object-fit: cover; background: #f0f0f0; }
.tarjeta-combo .combo-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tarjeta-combo .combo-nombre { font-weight: 700; font-size: 14px; }
.tarjeta-combo .combo-items { font-size: 12px; color: var(--texto-suave); }
.tarjeta-combo .combo-precios { display: flex; align-items: baseline; gap: 8px; }
.tarjeta-combo .combo-precio { color: var(--rosa-temu); font-size: 19px; font-weight: 800; }
.tarjeta-combo .combo-precio-normal { font-size: 12.5px; color: #999; text-decoration: line-through; }
.tarjeta-combo .btn-agregar { margin-top: auto; }

/* tarjetas de combo clicables */
.tarjeta-combo { cursor: pointer; }
.tarjeta-combo:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.15); transition: transform .15s ease, box-shadow .15s ease; }

/* grid de productos dentro del modal de combo */
.combo-grid-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.combo-grid-productos .item-combo {
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}
.combo-grid-productos .item-combo img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.combo-grid-productos .item-combo .nombre {
  font-size: 12px;
  padding: 6px 8px 2px;
  line-height: 1.3;
  height: 32px;
  overflow: hidden;
}
.combo-grid-productos .item-combo .precio {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rosa-temu);
  padding: 0 8px 8px;
}
.combo-grid-productos .item-combo .cantidad {
  font-size: 11px;
  color: var(--texto-suave);
  padding-bottom: 6px;
}
#combo-lista-items .fila-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--borde);
  font-size: 13.5px;
}
#combo-lista-items .fila-item span:first-child { color: var(--texto-suave); }

/* ---------- CONTENIDO ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 18px; }

.barra-resultados {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--texto-suave);
  flex-wrap: wrap;
  gap: 8px;
}
.barra-resultados select {
  padding: 8px 12px;
  border-radius: var(--pill);
  border: 1.5px solid var(--borde);
  background: var(--superficie);
  color: var(--texto);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease;
}
.barra-resultados select:hover { border-color: var(--rosa-temu); }

.grid-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s ease, border-color .2s ease;
}
.tarjeta:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-alta);
  border-color: rgba(255, 52, 102, .35);
}

.tarjeta .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--grad-primario);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--pill);
  box-shadow: 0 4px 10px -4px rgba(255, 52, 102, .8);
  z-index: 2;
}
.tarjeta .imagen-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--superficie-2);
  overflow: hidden;
}
.tarjeta img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
/* zoom suave de la foto al pasar el cursor */
.tarjeta:hover img { transform: scale(1.07); }
.tarjeta .info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.tarjeta .nombre {
  font-size: 13.5px;
  line-height: 1.3;
  height: 34px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tarjeta .rating {
  font-size: 12px;
  color: var(--texto-suave);
}
.tarjeta .rating .estrellas { color: #f5a524; }

.tarjeta .precios {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.tarjeta .precio {
  color: var(--rosa-temu);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.tarjeta .precio-original {
  font-size: 12.5px;
  color: #999;
  text-decoration: line-through;
}

/* ---------- SUPERFICIES COMPATIBLES CON AMBOS TEMAS ---------- */
.carrito-drawer,
.modal-producto,
.modal-checkout,
.barra-resultados select,
.rastreo-pedido input,
.modal-checkout input,
.modal-checkout textarea {
  background: var(--superficie);
}
.modal-checkout input,
.modal-checkout textarea {
  color: var(--texto);
  border-color: var(--borde);
}
.rastreo-pedido input {
  color: var(--texto);
}
.tarjeta-combo { background: linear-gradient(135deg, var(--rosa-claro), var(--superficie)); }
.estado-vacio { color: var(--texto-suave); }
.carrito-drawer .carrito-header,
.carrito-drawer .carrito-footer { border-color: var(--borde); }
.carrito-item { border-color: var(--borde); }
.carrito-item .cantidad-ctrl button {
  background: var(--superficie);
  border-color: var(--borde);
  color: var(--texto);
}
.carrito-item .detalle { color: var(--texto); }
.rastreo-resultado .fila { border-color: var(--borde); }
.rastreo-resultado .fila span:first-child { color: var(--texto-suave); }

/* el header y la nav conservan su azul oscuro en ambos temas */
.tarjeta .descuento {
  font-size: 11px;
  background: var(--rosa-claro);
  color: var(--rosa-temu);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.tarjeta .vendidos {
  font-size: 11px;
  color: var(--texto-suave);
}

.tarjeta .btn-agregar {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--grad-secundario);
  border: none;
  color: #241500;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 0;
  border-radius: 12px;
  box-shadow: 0 8px 16px -10px rgba(255, 138, 0, .9);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.tarjeta .btn-agregar:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.tarjeta .btn-agregar:active:not(:disabled) { transform: scale(.98); }

.estado-vacio {
  text-align: center;
  padding: 60px 20px;
  color: var(--texto-suave);
}

/* ---------- CARRITO (drawer) ---------- */
/* Fondo compartido por el carrito y por TODAS las ventanas.
   Antes había uno por ventana: se apilaban y la pantalla se oscurecía
   más con cada apertura (0.4 + 0.4 + 0.4...). */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  z-index: var(--capa-fondo);
}
.overlay.visible { display: block; }
/* Con una ventana abierta el fondo sube por encima del carrito y del
   botón flotante, para que nada de la tienda se cuele por delante. */
body.ventana-abierta .overlay { z-index: var(--capa-fondo-ventana); }
/* La página no se desplaza por detrás de la ventana abierta. */
body.ventana-abierta { overflow: hidden; }

.carrito-drawer {
  position: fixed;
  top: 0; right: -420px;
  width: 400px; max-width: 92vw;
  height: 100%;
  background: var(--superficie);
  color: var(--texto);
  z-index: var(--capa-carrito);
  display: flex;
  flex-direction: column;
  transition: right .28s cubic-bezier(.2, .7, .3, 1);
  border-radius: var(--radio-lg) 0 0 var(--radio-lg);
  box-shadow: -20px 0 60px -30px rgba(0, 0, 0, .55);
}
.carrito-drawer.abierto { right: 0; }

.carrito-header {
  padding: 16px;
  border-bottom: 1px solid var(--borde);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.carrito-header button {
  background: var(--superficie-2); border: 1px solid var(--borde); color: var(--texto);
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.carrito-header button:hover { background: var(--rosa-temu); border-color: var(--rosa-temu); color: #fff; transform: scale(1.06); }
.carrito-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.carrito-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--borde);
  padding-bottom: 10px;
}
.carrito-item img {
  width: 54px; height: 54px; object-fit: cover; border-radius: 12px;
}
.carrito-item .detalle { flex: 1; font-size: 13px; }
.carrito-item .cantidad-ctrl {
  display: flex; align-items: center; gap: 6px;
}
.carrito-item .cantidad-ctrl button {
  width: 26px; height: 26px; border: 1px solid var(--borde); border-radius: 50%;
  /* Tema claro y oscuro: fondo/texto por variables. Antes había un
     "background: #fff" posterior que anulaba el tema oscuro y dejaba los
     símbolos + / − (texto claro) invisibles sobre fondo blanco. */
  background: var(--superficie);
  color: var(--texto);
  font-weight: 700; line-height: 1;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.carrito-item .cantidad-ctrl button:hover:not(:disabled) { background: var(--rosa-temu); border-color: var(--rosa-temu); color: #fff; transform: scale(1.08); }
.carrito-item .quitar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--rosa-temu);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
}
.carrito-item .quitar:hover { text-decoration: underline; }
.carrito-item .stock-aviso { font-size: 11px; color: #b45309; margin-top: 2px; }
.carrito-item .cantidad-ctrl button:disabled {
  opacity: .35; cursor: not-allowed;
}

.carrito-footer {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--borde);
}
.carrito-footer .total {
  display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 12px; font-size: 16px;
}
.btn-checkout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-primario);
  color: #fff;
  border: none;
  padding: 13px 18px;
  border-radius: var(--radio);
  font-weight: 700;
  font-size: 14.5px;
  box-shadow: 0 12px 26px -12px rgba(255, 52, 102, .95);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.btn-checkout:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 16px 30px -12px rgba(255, 52, 102, 1); }
.btn-checkout:active { transform: scale(.985); }
/* estado desactivado (sin existencias, próximamente): se ve apagado */
.btn-checkout:disabled,
.btn-agregar:disabled {
  opacity: .5;
  filter: grayscale(.45);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-checkout:disabled:hover,
.btn-agregar:disabled:hover { transform: none; filter: grayscale(.45); }

/* ---------- MODAL DE PRODUCTO (galería) ---------- */
.modal-producto {
  position: fixed;
  top: 50%; left: 50%;
  /* la entrada animada (.abierto) hace el efecto de escala */
  transform: translate(-50%, -50%);
  width: 900px; max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--superficie);
  color: var(--texto);
  border-radius: var(--radio-lg);
  z-index: var(--capa-ventana);
  display: none;
  overscroll-behavior: contain;
  box-shadow: var(--sombra-alta);
}
.modal-producto.abierto { display: block; animation: modal-in .24s cubic-bezier(.2, .7, .3, 1); }
/* Botón ✕ de los modales: fondo oscuro semitransparente con glifo blanco,
   visible sobre CUALQUIER fondo (foto clara, tema claro u oscuro) y en
   cualquier navegador. Antes usaba el mismo color que el modal y se
   camuflaba (reportado en Firefox). En modales altos es sticky para
   seguir visible al hacer scroll. */
.cerrar-modal {
  position: sticky; top: 10px; float: right; margin-right: 10px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  border-radius: 50%;
  width: 34px; height: 34px; font-size: 15px; line-height: 1;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.cerrar-modal .i { width: 17px; height: 17px; }
.cerrar-modal:hover { background: rgba(0, 0, 0, .8); transform: scale(1.08); }
.modal-contenido {
  display: flex; gap: 24px; padding: 16px 24px 24px; flex-wrap: wrap;
}
.modal-galeria { flex: 1 1 320px; min-width: 280px; }
.modal-imagen-grande {
  width: 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: #f5f5f5;
}
.modal-imagen-grande img { width: 100%; height: 100%; object-fit: cover; }
.modal-miniaturas { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.modal-miniaturas img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; opacity: .75;
}
.modal-miniaturas img:hover { opacity: 1; }
.modal-miniaturas img.activa { border-color: var(--rosa-temu); opacity: 1; }

.modal-info { flex: 1 1 280px; min-width: 260px; }
.modal-info h2 { margin: 4px 0 8px; font-size: 20px; }
.modal-info .rating { font-size: 13px; color: var(--texto-suave); margin-bottom: 8px; }
.modal-info .precios { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.modal-info .precios .precio { font-size: 26px; font-weight: 800; color: var(--rosa-temu); }
.modal-info .precios .precio-original { font-size: 15px; color: #999; text-decoration: line-through; }
.modal-info p { font-size: 14px; color: var(--texto); line-height: 1.5; }
.tarjeta .nombre, .tarjeta .imagen-wrap { cursor: pointer; }

/* ---------- MODAL DE CHECKOUT (nombre + nota -> WhatsApp) ---------- */
.modal-checkout {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 380px; max-width: 92vw;
  background: var(--superficie);
  color: var(--texto);
  border-radius: var(--radio-lg);
  z-index: var(--capa-ventana);
  display: none;
  padding: 24px;
  /* Las ventanas altas (perfil + carnet, mis pedidos, cuenta) se cortaban
     por arriba y por abajo en pantallas pequeñas: ahora tienen tope de
     alto y su propio scroll. */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--sombra-alta);
}
@supports (height: 100dvh) {
  .modal-checkout { max-height: calc(100dvh - 24px); }
}
.modal-checkout.abierto { display: block; animation: modal-in .24s cubic-bezier(.2, .7, .3, 1); }
.modal-checkout h2 { margin: 4px 0 6px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal-checkout-ayuda { font-size: 12.5px; color: var(--texto-suave); margin-bottom: 14px; line-height: 1.4; }
.modal-checkout label { font-size: 13px; color: var(--texto-suave); display: block; margin: 10px 0 4px; }
.modal-checkout input, .modal-checkout textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--borde); border-radius: 12px; font-size: 14px;
  font-family: inherit; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* Las casillas NO heredan el ancho del 100%: con width:100% la casilla de
   "Acepto los términos" se estiraba y empujaba su texto a la línea de abajo. */
.modal-checkout input[type="checkbox"],
.modal-checkout input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  accent-color: var(--rosa-temu);
  flex-shrink: 0;
}
.modal-checkout input[type="checkbox"]:focus,
.modal-checkout input[type="radio"]:focus { box-shadow: none; }

.modal-checkout input:focus, .modal-checkout textarea:focus {
  outline: none;
  border-color: var(--rosa-temu);
  box-shadow: 0 0 0 4px rgba(255, 52, 102, .14);
}
.modal-checkout .btn-checkout { margin-top: 16px; }

/* Fila del celular con selector de código de país (🇨🇺 +53, 🇺🇸 +1, ...):
   el desplegable del país ocupa lo justo y el número se estira al resto. */
.fila-telefono { display: flex; gap: 8px; align-items: stretch; }
.fila-telefono select {
  flex: 0 1 auto;
  width: auto;
  max-width: 56%;
  min-width: 0;
  padding: 11px 8px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie);
  color: var(--texto);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fila-telefono select:focus {
  outline: none;
  border-color: var(--rosa-temu);
  box-shadow: 0 0 0 4px rgba(255, 52, 102, .14);
}
.fila-telefono input { flex: 1 1 auto; min-width: 0; width: auto; }

/* --- Selector de país con buscador (registro de clientes) --- */
.selector-pais { position: relative; flex: 0 0 auto; }
.selector-pais input[type="hidden"] { display: none; }
.selector-pais-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 10px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie);
  color: var(--texto);
  font-family: inherit;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.selector-pais-btn:hover { border-color: var(--rosa-temu); }
.selector-pais-btn:focus-visible {
  outline: none;
  border-color: var(--rosa-temu);
  box-shadow: 0 0 0 4px rgba(255, 52, 102, .14);
}
.selector-pais-panel {
  position: absolute; z-index: 90; top: calc(100% + 6px); left: 0;
  width: 300px; max-width: 84vw;
  padding: 8px;
  background: var(--superficie);
  color: var(--texto);
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  box-shadow: var(--sombra-alta);
}
/* Abierto: el panel se cuelga de <body> y se coloca respecto a la
   pantalla (ver js/paises.js). Así no lo recorta el scroll de la ventana
   de la cuenta, que ahora tiene max-height + overflow-y. */
.selector-pais-panel.selector-pais-flotante {
  position: fixed;
}
.selector-pais-panel.selector-pais-flotante .selector-pais-lista {
  overflow-y: auto;
}
.selector-pais-buscar {
  width: 100%; margin: 0 0 6px; padding: 9px 11px;
  border: 1.5px solid var(--borde);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
.selector-pais-buscar:focus { outline: none; border-color: var(--rosa-temu); }
.selector-pais-lista { list-style: none; margin: 0; padding: 0; max-height: 236px; overflow-y: auto; }
.selector-pais-lista li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; border-radius: 9px;
  font-size: 13.5px; cursor: pointer;
}
.selector-pais-lista li:hover,
.selector-pais-lista li.elegido { background: rgba(255, 52, 102, .12); }
.pais-bandera { font-size: 16px; line-height: 1; }
.pais-nombre { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pais-prefijo { color: var(--texto-suave); font-variant-numeric: tabular-nums; }
.selector-pais-vacio { justify-content: center; color: var(--texto-suave); cursor: default; }
@media (max-width: 480px) {
  .fila-telefono select { font-size: 16px; padding: 10px 6px; } /* sin zoom automático en iOS */
  .fila-telefono input { font-size: 16px; }
}

footer {
  background: var(--azul-oscuro);
  color: #9aa4ad;
  text-align: center;
  padding: 26px 18px;
  font-size: 12.5px;
  margin-top: 44px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 26, 32, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: all .25s ease;
  /* Por encima de las ventanas: un aviso ("pedido enviado", "error") se
     tiene que ver aunque haya una ventana abierta. No intercepta clics. */
  z-index: var(--capa-aviso-superior);
  /* El aviso flota justo encima del botón "Finalizar compra" del carrito y
     del FAB. Sin esto se tragaba los toques en el móvil: el aviso ya casi
     invisible seguía ahí y el botón no respondía. Es solo información:
     nunca debe interceptar clics. */
  pointer-events: none;
}
.toast .i-alerta { color: #ffb020; }
.toast .i-ok { color: #4ade80; }
.toast .i-info { color: #7dd3fc; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- BOTÓN FLOTANTE DEL CARRITO (FAB) ---------- */
.fab-carrito {
  position: fixed;
  right: 18px;
  bottom: 18px;
  /* respeta la barra de inicio del iPhone con notch */
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--rosa-temu), #ff6a3d);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(255, 52, 102, .75), 0 0 0 7px rgba(255, 52, 102, .12);
  /* Por debajo del fondo (40): mientras hay una ventana o el carrito
     abiertos el botón queda detrás del fondo oscuro, sin poder pulsarse. */
  z-index: var(--capa-fab);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fab-carrito:hover { transform: scale(1.07); box-shadow: 0 8px 22px rgba(255, 52, 102, .55); }
.fab-carrito:active { transform: scale(.94); }

.fab-carrito .fab-contador {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--naranja);
  color: #fff;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}

/* pulso breve cuando se añade un producto */
@keyframes fab-latido {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  70% { transform: scale(.95); }
  100% { transform: scale(1); }
}
.fab-carrito.latido { animation: fab-latido .45s ease; }

/* oculto mientras el drawer del carrito está abierto */
body.carrito-abierto .fab-carrito { opacity: 0; pointer-events: none; transform: translateY(14px); }

@media (max-width: 560px) {
  .fab-carrito {
    width: 62px;
    height: 62px;
    /* respeta el borde curvo y la barra inferior del teléfono */
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: 26px;
    z-index: var(--capa-fab);
  }
}

/* ---------- SELECTOR DE MONEDA Y BOTÓN DE TEMA (header) ---------- */
.selector-moneda {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--pill);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
/* Opciones del select: por variables. Antes había un "color: #111" fijo
   que en tema oscuro quedaba texto oscuro sobre el menú oscuro del sistema. */
.selector-moneda option { background: var(--superficie); color: var(--texto); }
.selector-moneda:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }

/* Etiqueta visible al lado del selector: sin ella solo se ve una píldora
   con "CUP" y no queda claro que es el precio de la moneda. */
.etiqueta-moneda {
  color: rgba(255, 255, 255, .72);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}
/* En pantallas muy justas la etiqueta se va y la píldora se queda sola */
@media (max-width: 400px) { .etiqueta-moneda { display: none; } }

.btn-tema {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  /* el icono hereda el color del texto: en el header (oscuro) se blanquea
     abajo; en login/admin sobre superficie clara debe ser oscuro */
  color: var(--texto);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-tema:hover { transform: scale(1.08); background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }
/* dentro de la cabecera oscura (tienda y panel) el icono va en blanco */
header.top .btn-tema { color: #fff; }
header.top .btn-tema:hover { background: rgba(255, 255, 255, .16); }

/* ---------- CUENTA DE CLIENTE (header + modales) ---------- */
/* btn-cuenta y btn-soporte se estilizan junto a btn-admin (regla combinada
   en la sección del header). Aquí el botón secundario de los modales. */
.btn-secundario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--superficie-2);
  border: 1.5px solid var(--borde);
  color: var(--texto);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-secundario:hover { background: var(--borde); border-color: var(--rosa-temu); transform: translateY(-1px); }

.seccion-reseñas {
  margin-top: 18px;
  border-top: 1px solid var(--borde);
  padding-top: 14px;
}
.seccion-reseñas h3 { margin: 0 0 10px; font-size: 15px; }
.resumen-reseñas {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--texto-suave);
}
.resumen-reseñas .promedio { font-size: 22px; font-weight: 800; color: var(--texto); }

.estrellas-estaticas { color: #f5a524; font-size: 15px; letter-spacing: 2px; }
.estrellas-estaticas .apagada { color: var(--borde); }

.tarjeta-reseña {
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--superficie-2);
}
.tarjeta-reseña .fila-autor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.tarjeta-reseña .autor { font-weight: 700; font-size: 13px; }
.tarjeta-reseña .fecha { font-size: 11.5px; color: var(--texto-suave); }
.tarjeta-reseña .comentario { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.tarjeta-reseña .acciones-mia { margin-top: 6px; display: flex; gap: 10px; }
.tarjeta-reseña .acciones-mia button {
  border: none;
  background: none;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.tarjeta-reseña .acciones-mia .editar-mia { color: #0066c0; }
.tarjeta-reseña .acciones-mia .borrar-mia { color: var(--rosa-temu); }

.form-reseña {
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.form-reseña label { font-size: 13px; color: var(--texto-suave); display: block; margin-bottom: 4px; }
.form-reseña textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  background: var(--input-fondo);
  color: var(--texto);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-reseña textarea:focus {
  outline: none;
  border-color: var(--rosa-temu);
  box-shadow: 0 0 0 4px rgba(255, 52, 102, .14);
}
.selector-estrellas { display: flex; gap: 4px; margin: 4px 0 10px; }
.selector-estrellas button {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--borde);
  padding: 2px;
  line-height: 1;
  transition: transform .1s ease;
}
.selector-estrellas button.encendida { color: var(--naranja); }
.selector-estrellas button:hover { transform: scale(1.15); }
.aviso-login-reseña {
  background: var(--rosa-claro);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}
.aviso-login-reseña a, .aviso-login-reseña button-link { color: var(--rosa-temu); font-weight: 700; cursor: pointer; }

/* Scrollbar propia de las categorías: invisible en móvil (se navega con el dedo) */
#categorias-scroll { scrollbar-width: none; }
#categorias-scroll::-webkit-scrollbar { display: none; }

/* ---------- ESTADOS DE PRODUCTO: PRÓXIMAMENTE / PRERESERVA / AGOTADO ---------- */
.prod-estado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--pill);
  margin: 2px 0;
}
.prod-proximamente {
  background: #fff3cd;
  color: #8a6d00;
}
.prod-prereserva {
  background: #e8f1fd;
  color: #0b66c3;
}
.prod-agotado {
  background: #fdecec;
  color: #c0392b;
}
.btn-prereserva {
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px -10px rgba(37, 99, 235, .9) !important;
}
.btn-prereserva:hover { filter: brightness(1.07); }
.tarjeta-proximamente { opacity: .82; }
.tarjeta button[disabled], .tarjeta-proximamente button[disabled] {
  background: var(--borde) !important;
  color: var(--texto-suave) !important;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  /* CELULAR: logo a la izquierda y TODOS los botones ordenados a la derecha
     en UNA sola fila compacta: tema, moneda, Entrar (+campanita), Soporte,
     Panel y Carrito. Los textos se ocultan y quedan solo los iconos (el
     nombre del cliente se muestra acortado), para que el header no crezca. */
  header.top { padding: 8px 10px; gap: 8px; }
  .logo { font-size: 15px; min-width: 0; flex-shrink: 1; max-width: 84px; overflow: hidden; }
  .logo-img { height: 60px; max-width: 84px; }
  .buscador { flex: 1 1 100%; order: 3; min-width: 0; }
  .acciones-header { flex: 1 1 auto; min-width: 0; margin-left: auto; gap: 1px; flex-wrap: nowrap; justify-content: flex-end; }
  .acciones-header .i { width: 16px; height: 16px; }
  .header-preferencias { display: contents; }
  .txt-btn-header { display: none; }
  .btn-tema { width: 26px; height: 26px; font-size: 12.5px; }
  /* MONEDA en el celular: píldora con bandera + código (USD/CUP/EUR).
     Antes medía 32px y la flecha nativa del select se comía el texto: solo
     se veía la bandera recortada y no se entendía que fuera un selector.
     Sin flecha nativa, ancho justo y el texto centrado y legible. */
  .selector-moneda {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: auto;
    min-width: 56px;
    padding: 6px 16px 6px 7px;
    font-size: 11.5px;
    line-height: 1.1;
    text-align: center;
    text-align-last: center;
    /* flechita a la derecha: deja claro que la píldora es un selector */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5l4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' opacity='.75'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 10px 10px;
  }
  .zona-cuenta { gap: 4px; min-width: 0; }
  .btn-cuenta { max-width: 80px; padding: 6px 8px; gap: 4px; overflow: hidden; }
  #cuenta-texto { max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-admin, .btn-soporte { padding: 6px 5px; }
  .icono-carrito { padding: 6px 5px; }

  /* Rastreo de pedido: el campo se estira y el botón siempre visible */
  nav.categorias { gap: 8px; padding: 8px 12px; }
  .rastreo-pedido { flex: 1 1 100%; flex-shrink: 1; min-width: 0; margin-left: 0; }
  .rastreo-pedido input { flex: 1; width: auto; min-width: 0; }
  .rastreo-pedido button { padding: 9px 10px; }

  .hero h1 { font-size: 21px; }
  main { padding: 12px; }
  .grid-combos { grid-template-columns: 1fr; }

  /* ---- Vista miniatura: 2 columnas de tarjetas compactas (se ven 4 o
         más productos en pantalla, estilo tienda móvil) ---- */
  .grid-productos { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tarjeta .info { padding: 6px 8px 8px; gap: 3px; }
  .tarjeta .nombre { font-size: 12px; height: 31px; }
  .tarjeta .rating, .tarjeta .vendidos { display: none; }
  .tarjeta .precio { font-size: 15.5px; }
  .tarjeta .precio-original { font-size: 11px; }
  .tarjeta .descuento { font-size: 10px; padding: 1px 4px; }
  .tarjeta .badge { font-size: 9.5px; padding: 2px 6px; top: 6px; left: 6px; }
  .tarjeta .btn-agregar { font-size: 11px; padding: 7px 6px; }
  .prod-estado { font-size: 10.5px; padding: 3px 6px; }

  /* Carrusel: se navega deslizando el dedo; sin flechas */
  .hero-carrusel { margin-bottom: 10px; border-radius: 10px; }
  .hero-slide img { aspect-ratio: 16 / 9; height: auto; }
  .hero-arrow { display: none; }
  .hero-slide .hero-slide-titulo { font-size: 12.5px; padding: 22px 12px 20px; }

  .modal-producto .modal-contenido { padding: 12px 14px 18px; gap: 14px; }
  .modal-info h2 { font-size: 17px; }
  .modal-info .precios .precio { font-size: 22px; }
  footer { padding: 14px; font-size: 11.5px; }
}

/* Tablet / pantallas medianas: tarjetas un poco más pequeñas para que
   entren 4 o más productos por fila */
@media (max-width: 900px) and (min-width: 561px) {
  .grid-productos { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .tarjeta .nombre { font-size: 12.5px; }
  .tarjeta .btn-agregar { font-size: 12.5px; }
  .hero-slide img { aspect-ratio: 16 / 7; height: auto; }
}

/* ============ Contador de usuarios en línea (portada) ============ */
.en-linea {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 94%;
  margin: 14px auto 0;
  padding: 9px 20px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
  background: linear-gradient(135deg, rgba(255, 52, 102, 0.10), rgba(255, 140, 0, 0.13));
  border: 1px solid rgba(255, 122, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px -10px rgba(255, 90, 60, .35);
}
.en-linea-item { display: inline-flex; align-items: center; gap: 6px; }
.en-linea b { color: var(--rosa-temu); font-size: 14px; }
.en-linea-roles { color: var(--texto-suave); font-weight: 500; }
.punto-online {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: latido-online 2s infinite;
}
@keyframes latido-online {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (max-width: 560px) {
  .en-linea { font-size: 12px; padding: 7px 12px; gap: 4px 12px; margin-top: 10px; }
  .en-linea b { font-size: 13px; }
}

/* ============================================================
   CAPA DE POLISH — accesibilidad, animaciones y detalles finales
   ============================================================ */

/* Anillo de foco visible para navegar con teclado */
:focus-visible {
  outline: 2px solid var(--rosa-temu);
  outline-offset: 2px;
  border-radius: 4px;
}
header.top :focus-visible,
.hero :focus-visible { outline-color: #ffb020; }

/* Selección de texto y barras de desplazamiento acordes a la marca */
::selection { background: rgba(255, 52, 102, .22); }
* { scrollbar-width: thin; scrollbar-color: var(--borde) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--borde);
  border-radius: var(--pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: #c6cbd1; background-clip: content-box; }

/* Entrada suave de los modales */
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Aparición de las tarjetas al renderizar (sin rellenar: así el hover
   sigue funcionando después de la animación) */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tarjeta, .tarjeta-combo { animation: fade-up .45s cubic-bezier(.2, .7, .3, 1); }

/* Títulos con icono alineados */
.titulo-seccion {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
.modal-info h2, .seccion-reseñas h3 { display: flex; align-items: center; gap: 8px; }

/* Estados vacíos con icono grande y suave */
.estado-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  grid-column: 1 / -1;
}
.estado-vacio .i { width: 38px; height: 38px; opacity: .5; margin-bottom: 8px; }

/* Icono del botón flotante del carrito */
.fab-icono .i { width: 24px; height: 24px; }

/* Botón "agregar" genérico: combos y formulario de reseñas usan la misma
   clase que las tarjetas, pero fuera de .tarjeta no tenía estilos. */
.btn-agregar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--grad-secundario);
  border: none;
  color: #241500;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 16px -10px rgba(255, 138, 0, .9);
  transition: transform .15s ease, filter .15s ease;
}
.btn-agregar:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }

/* Respeto por quien prefiera menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   NOTIFICACIONES, MIS PEDIDOS Y VENTANAS AUXILIARES DEL CLIENTE
   ============================================================ */

/* Tema + moneda van agrupados. En escritorio el contenedor es transparente
   para el layout (display:contents), así que nada cambia; en el celular se
   convierte en una fila propia ENCIMA de "Entrar" y "Soporte". */
.header-preferencias { display: contents; }

/* La campanita vive JUNTO al botón Entrar (mismo grupo visual) y solo se
   muestra con sesión de cliente iniciada: app.js alterna el [hidden] */
.zona-cuenta { display: inline-flex; align-items: center; gap: 7px; }
.btn-notif[hidden] { display: none; }

/* Campanita de notificaciones */
.btn-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  border-radius: 50%;
  transition: background .15s ease, border-color .15s ease;
}
.btn-notif:hover { background: rgba(255, 255, 255, .16); }
.btn-notif .i { width: 18px; height: 18px; }
.btn-notif.con-novedad { border-color: rgba(255, 153, 0, .9); }
.badge-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--rosa-temu);
  color: #fff;
  border: 2px solid #131921;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 18px;
  padding: 0 4px;
  line-height: 15px;
  text-align: center;
}
.badge-notif[hidden] { display: none; }

/* Utilidades de las ventanitas */
.sin-datos { font-size: 13px; color: var(--texto-suave); margin: 6px 0; }
.separador-modal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--texto-suave);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.separador-modal::before,
.separador-modal::after { content: ''; flex: 1; height: 1px; background: var(--borde); }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--pill);
  border: 1px solid var(--borde);
  background: var(--superficie-2);
  color: var(--texto);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.btn-mini:hover { border-color: var(--rosa-temu); color: var(--rosa-temu); }

/* --- Carnet en el perfil del cliente (cada foto con su estado) --- */
#carnet-actual { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.foto-carnet-cliente {
  text-align: center;
  font-size: 11px;
  color: var(--texto-suave);
  text-decoration: none;
}
.foto-carnet-cliente img {
  width: 104px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--borde);
  display: block;
  margin-bottom: 2px;
}
.foto-estado {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  margin: 4px 0;
}
.foto-estado.ok { color: #1e7e46; }
.foto-estado.no { color: #c0392b; }
.foto-estado.pend { color: var(--texto-suave); }

/* --- Lista de notificaciones --- */
#lista-notif {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 2px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie);
}
.notif-item.nueva {
  border-color: rgba(255, 52, 102, .45);
  background: linear-gradient(135deg, rgba(255, 52, 102, .06), rgba(255, 140, 0, .08));
}
.notif-item.leida { opacity: .72; }
.notif-icono {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--superficie-2);
  flex-shrink: 0;
}
.notif-item.aviso .notif-icono { background: #fdecea; color: #c0392b; }
.notif-item.pedido .notif-icono { background: #e8f1ff; color: #2563eb; }
.notif-item.carnet .notif-icono { background: #fff4e5; color: #a35b00; }
.notif-item.cuenta .notif-icono { background: #eef1f5; color: #33507a; }
.notif-cuerpo { flex: 1; min-width: 0; }
.notif-titulo { font-size: 13.5px; font-weight: 700; }
.notif-texto { font-size: 12.8px; line-height: 1.45; margin-top: 2px; word-break: break-word; }
.notif-fecha { font-size: 11px; color: var(--texto-suave); margin-top: 4px; }
.notif-leer {
  align-self: flex-start;
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
  flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease;
}
.notif-leer:hover { color: #1e7e46; border-color: #1e7e46; }

/* --- Mis pedidos: en curso / completados / cancelados --- */
.mis-pedidos { max-height: 68vh; overflow-y: auto; padding-right: 2px; }
.pedidos-grupo { margin-bottom: 16px; }
.pedidos-grupo-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--borde);
}
.pedidos-grupo-titulo span {
  margin-left: auto;
  background: var(--superficie-2);
  border-radius: var(--pill);
  font-size: 11.5px;
  padding: 1px 9px;
  color: var(--texto-suave);
}
.pedidos-grupo-titulo.curso { color: #2563eb; }
.pedidos-grupo-titulo.ok { color: #1e7e46; }
.pedidos-grupo-titulo.no { color: #c0392b; }

.pedido-tarjeta {
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--superficie);
}
.pedido-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pedido-codigo { font-size: 13.5px; letter-spacing: .02em; }
.pedido-fecha { display: block; font-size: 11.5px; color: var(--texto-suave); margin-top: 2px; }
.pedido-items {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  font-size: 12.8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pedido-pie {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--borde);
  padding-top: 8px;
}
.pedido-acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.pedido-motivo {
  margin-top: 8px;
  font-size: 12.5px;
  color: #c0392b;
  background: #fdecea;
  border-radius: 10px;
  padding: 7px 10px;
  line-height: 1.4;
}
.pedido-pasos { list-style: none; display: flex; gap: 4px; padding: 0; margin: 10px 0 4px; }
.pedido-pasos li {
  flex: 1;
  font-size: 10.5px;
  text-align: center;
  color: var(--texto-suave);
  position: relative;
  padding-top: 12px;
}
.pedido-pasos li .punto {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--borde);
}
.pedido-pasos li.hecho { color: #1e7e46; }
.pedido-pasos li.hecho .punto { background: #1e7e46; }
.pedido-pasos li.actual { color: var(--rosa-temu); font-weight: 700; }
.pedido-pasos li.actual .punto { background: var(--rosa-temu); box-shadow: 0 0 0 3px rgba(255, 52, 102, .2); }

/* --- Código QR (factura y reportes) --- */
.qr-codigo {
  display: inline-block;
  background: #fff;
  padding: 3px;
  border-radius: 6px;
  line-height: 0;
}
.qr-codigo svg { width: 100%; height: 100%; display: block; }

/* ============ CELULAR: ajustes finales del header y ventanas ============ */
@media (max-width: 560px) {
  .btn-notif { width: 28px; height: 28px; flex-shrink: 0; }
  .mis-pedidos, #lista-notif { max-height: none; }
  .pedido-pasos li { font-size: 9.5px; }
}

/* Celulares muy angostos (360 px): el logo y el nombre ceden espacio */
@media (max-width: 380px) {
  .logo { max-width: 62px; font-size: 14px; }
  .logo-img { height: 22px; max-width: 62px; }
  /* Muy angosto: el botón de entrar queda solo con el icono (nada de "Ent…") */
  .btn-cuenta { max-width: none; padding: 7px; }
  #cuenta-texto { display: none; }
}

/* ---------- Límites de compra (mínimo / máximo / tope diario) ---------- */
.limites-compra {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--texto-suave);
  margin: 2px 0 4px;
}

/* ---------- Términos y condiciones en el registro ---------- */
.terminos-registro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie-2);
}
.terminos-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  min-width: 0;
}
/* La casilla va a la IZQUIERDA de "Acepto...", en la misma línea */
.terminos-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--rosa-temu);
  flex-shrink: 0;
  cursor: pointer;
}
.btn-leer-terminos {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--rosa-temu);
  color: var(--rosa-temu);
  border-radius: var(--pill);
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-leer-terminos:hover { background: rgba(255, 52, 102, .1); }

/* ---------- Olvidé mi contraseña y contraseña temporal (clientes) ---------- */
.fila-link-cuenta {
  text-align: center;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.fila-link-cuenta a { color: var(--rosa-temu); font-weight: 700; }
.fila-link-cuenta a:hover { text-decoration: underline; }

/* Respuesta al pedir la contraseña: verde si se envió, rojo si hubo error */
.msg-reset {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.msg-reset.ok { background: #e9f7ef; color: #1e7e46; border: 1px solid #b7e4c7; }
.msg-reset.error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }

/* Aviso dentro de "Mi cuenta" cuando la contraseña es la TEMPORAL */
.aviso-pass-temporal {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  background: #fff4e5;
  color: #a35b00;
  border: 1px solid #ffd8a8;
}
.aviso-pass-temporal .i { flex-shrink: 0; margin-top: 2px; }
html[data-tema="oscuro"] .aviso-pass-temporal { background: #3a2a12; color: #ffcf8a; border-color: #6b4a1c; }

/* ---------- Cuenta con eliminación programada (7 días) ---------- */
.aviso-baja-cuenta {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  background: #fdecea;
  color: #a02a1c;
  border: 1px solid #f5c2bb;
}
.aviso-baja-cuenta .i { flex-shrink: 0; margin-top: 2px; }
.aviso-baja-cuenta b { color: inherit; }
html[data-tema="oscuro"] .aviso-baja-cuenta { background: #3a1512; color: #ffb3a8; border-color: #6b2a22; }

/* Botón de acción destructiva (eliminar cuenta) */
.btn-peligro-suave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid #e0776a;
  color: #c0392b;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-peligro-suave:hover { background: rgba(192, 57, 43, .09); border-color: #c0392b; }
html[data-tema="oscuro"] .btn-peligro-suave { color: #ff9a8a; border-color: #7c342b; }
html[data-tema="oscuro"] .btn-peligro-suave:hover { background: rgba(255, 154, 138, .12); }

/* ---------- Panel: contraseña temporal generada ---------- */
.resultado-pass {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--superficie-2);
  border: 1.5px solid var(--rosa-temu);
}
.resultado-pass h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.resultado-pass p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.caja-pass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--superficie);
  border: 1px dashed var(--borde);
}
.caja-pass span {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 2px;
  word-break: break-all;
}
.resultado-pass .nota-pass { font-size: 12.5px; color: #a35b00; display: flex; align-items: flex-start; gap: 6px; }
.resultado-pass .nota-pass .i { flex-shrink: 0; margin-top: 2px; }
