/* === ESTILOS - Mariscos del Puerto ===
   Colores tomados del logo y del catálogo: azul mar, celeste ola, azul pez,
   y un toque naranja (camarón) para los acentos. */

:root {
  --azul: #2b7fb8;
  --azul-prof: #164a70;
  --azul-hero: #1d5f8f;
  --pez: #6f95bd;
  --ola: #b8dcea;
  --espuma: #eaf4f9;
  --naranja: #f28c28;
  --naranja-osc: #d97614;
  --verde-wa: #25d366;
  --tinta: #26323b;
  --gris: #6b7782;
  --linea: #dbe7ee;
  --blanco: #ffffff;
  --rojo: #c0392b;
  --sombra: 0 6px 18px rgba(22, 74, 112, 0.10);
  --sombra-sm: 0 2px 8px rgba(22, 74, 112, 0.08);
  --radio: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  background: var(--espuma);
  color: var(--tinta);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Evita que algo más ancho que la pantalla (el anuncio al entrar, la lancha) agrande
     la página a lo ancho: en celular eso hace que todo, incluido el carrito, "se corra". */
  overflow-x: clip;
}

[hidden] { display: none !important; }

/* ---------- Cabecera con logo y olas ---------- */
.hero {
  background: linear-gradient(175deg, #d4ecf7 0%, #a9d6ea 55%, #7fbfdf 100%);
  padding: 1.4rem 1rem 5.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-contenido { position: relative; z-index: 2; }
.logo-hero {
  display: block;
  margin: 0 auto;
  width: min(300px, 78vw);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.55));
  animation: flotar 6s ease-in-out infinite;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.hero-datos {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.8rem;
}
.hero-datos li {
  background: rgba(255, 255, 255, 0.62);
  color: var(--azul-prof);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Olas suaves al fondo: tres capas que se desplazan despacio */
.olas { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; z-index: 1; pointer-events: none; }
.ola {
  position: absolute;
  left: 0; bottom: 0;
  width: 200%;
  height: 100%;
  will-change: transform;
}
.ola-1 { fill: rgba(43, 127, 184, 0.20); animation: ola-mover 20s linear infinite, ola-subir 6s ease-in-out infinite; }
.ola-2 { fill: rgba(43, 127, 184, 0.36); height: 78%; animation: ola-mover 27s linear infinite reverse, ola-subir 7.5s ease-in-out infinite -2s; }
.ola-3 { fill: var(--espuma); height: 52%; animation: ola-mover 36s linear infinite, ola-bajar 9s ease-in-out infinite -4s; }
/* sube y baja (propiedad "translate", aparte del desplazamiento lateral) */
@keyframes ola-subir {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}
/* la última capa solo baja, para no dejar hueco bajo ella */
@keyframes ola-bajar {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 9px; }
}
@keyframes ola-mover {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Pestañas ---------- */
.tabs-barra {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(234, 244, 249, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
  padding: 0.55rem 0;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.1rem 1rem;
  max-width: 960px;
  margin: 0 auto;
}
.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 2px solid var(--ola);
  background: var(--blanco);
  color: var(--azul-prof);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.tab-icono { font-size: 1rem; line-height: 1; }
.tab-largo { display: none; }
.tab:active { transform: scale(0.97); }
.tab.activa {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--blanco);
  box-shadow: var(--sombra-sm);
}
.tab-pedido { border-color: var(--naranja); color: var(--naranja-osc); }
.tab-pedido.activa { background: var(--naranja); border-color: var(--naranja); color: var(--blanco); }
.tab-cuenta {
  background: var(--naranja);
  color: var(--blanco);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab.activa .tab-cuenta, .tab-pedido.activa .tab-cuenta { background: var(--blanco); color: var(--azul-prof); }

/* ---------- Contenido ---------- */
.main {
  /* sin "anclaje de scroll": al cambiar de pantalla el navegador no debe reacomodar
     la posición por su cuenta (eso dejaba "Mi pedido" a media página) */
  overflow-anchor: none;
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 6.5rem;
}
.titulo-vista {
  font-size: 1.25rem;
  color: var(--azul-prof);
  margin: 0.4rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.8rem;
}

/* ---------- Tarjeta de producto ---------- */
.producto {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 0.9rem 1rem 0.8rem;
  box-shadow: var(--sombra-sm);
  border: 2px solid transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "info control" "sub sub";
  align-items: center;
  gap: 0.35rem 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.producto.agotado { background: #fff8ee; border-color: #f0c98a; box-shadow: var(--sombra-sm); }
.producto.agotado h3 { color: var(--tinta); }
.producto.agotado .precio { color: var(--gris); }
.producto.agotado .control { pointer-events: none; opacity: 0.4; }
.etiqueta-agotado { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; background: #f28c28; color: #fff; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.01em; }
.producto.elegido { border-color: var(--azul); box-shadow: var(--sombra); }
.producto-info { grid-area: info; min-width: 0; }
.producto-info h3 { font-size: 1.02rem; font-weight: 650; color: var(--tinta); overflow-wrap: anywhere; }
.precio { color: var(--azul); font-weight: 700; font-size: 0.98rem; margin-top: 0.1rem; }
.precio span { color: var(--gris); font-weight: 500; font-size: 0.8rem; }
.control { grid-area: control; display: flex; align-items: center; gap: 0.35rem; }
.subtotal { grid-area: sub; font-size: 0.82rem; color: var(--gris); min-height: 1.1rem; }
.subtotal strong { color: var(--azul-prof); }
.sugerencia { opacity: 0.8; }

.paso {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 2px solid var(--ola);
  background: var(--espuma);
  color: var(--azul-prof);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s;
}
.paso:active { transform: scale(0.93); }
.paso-mas { background: var(--azul); border-color: var(--azul); color: var(--blanco); }
.cantidad {
  width: 62px; height: 42px;
  text-align: center;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--azul-prof);
  border: 2px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco);
  -moz-appearance: textfield;
  appearance: textfield;
}
.cantidad::-webkit-outer-spin-button, .cantidad::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cantidad:focus, .campo input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(43, 127, 184, 0.18); }

/* ---------- Mi pedido ---------- */
.tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
  box-shadow: var(--sombra-sm);
  margin-bottom: 0.9rem;
}
#vista-pedido { max-width: 560px; margin: 0 auto; }
.tarjeta h4 { color: var(--azul-prof); font-size: 0.95rem; margin: 0.6rem 0 0.25rem; }
.tarjeta h4:first-child { margin-top: 0; }
.tarjeta ul { list-style: none; }
.tarjeta li {
  display: flex; justify-content: space-between; gap: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--linea);
  font-size: 0.95rem;
}
.tarjeta li:last-child { border-bottom: none; }
.tarjeta li small { color: var(--gris); margin-left: 0.3rem; }
.tarjeta li b { color: var(--azul-prof); white-space: nowrap; }
.vacio { text-align: center; color: var(--gris); padding: 1.2rem 0.5rem; }

.formulario h3 { font-size: 1rem; color: var(--azul-prof); margin-bottom: 0.8rem; }
.campo { margin-bottom: 0.9rem; }
.campo label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--azul-prof); margin-bottom: 0.35rem; }
.campo input {
  width: 100%; height: 48px; padding: 0 1rem;
  font: inherit; font-size: 1rem;
  border: 2px solid var(--linea);
  border-radius: 12px;
  color: var(--tinta);
  background: var(--blanco);
}
.campo label small { font-weight: 500; color: var(--gris); }
.campo textarea {
  width: 100%; padding: 0.7rem 1rem; min-height: 78px; resize: vertical;
  font: inherit; font-size: 1rem; line-height: 1.35;
  border: 2px solid var(--linea); border-radius: 12px;
  color: var(--tinta); background: var(--blanco);
}
.campo textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(43, 127, 184, 0.18); }
.campo textarea::placeholder { color: #a3adb5; }
.campo input.error { border-color: var(--rojo); background: #fff6f5; }
.campo input::placeholder { color: #a3adb5; }
.aviso-form { color: var(--rojo); font-size: 0.88rem; font-weight: 600; }

.total-caja {
  background: linear-gradient(135deg, var(--azul-prof), var(--azul));
  color: var(--blanco);
  border-radius: var(--radio);
  padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--sombra);
  margin-bottom: 0.9rem; /* separa del formulario "Tus datos" que ahora va debajo */
}
.total-caja span { font-size: 0.95rem; opacity: 0.9; }
.total-caja strong { font-size: 1.7rem; }

.btn-whatsapp {
  width: 100%; height: 58px;
  margin-top: 0.9rem;
  background: var(--verde-wa);
  color: var(--blanco);
  border: none;
  border-radius: 16px;
  font: inherit; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.32);
  transition: transform 0.1s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-whatsapp svg { width: 26px; height: 26px; flex: none; }
.wa-total {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 1.02rem;
  white-space: nowrap;
}
.btn-whatsapp:active { transform: scale(0.98); }
.btn-whatsapp:disabled { background: #a7d9bb; box-shadow: none; cursor: not-allowed; }
/* Botón secundario: se nota como botón, pero no compite con el verde de WhatsApp */
.btn-volver {
  width: 100%;
  min-height: 58px;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem 0.55rem 0.6rem;
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--blanco);
  border: 2px solid var(--ola);
  border-radius: 16px;
  box-shadow: var(--sombra-sm);
  color: var(--azul-prof);
  font: inherit; text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, background 0.15s;
}
.volver-icono {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--espuma);
  color: var(--azul);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s, transform 0.2s;
}
.volver-icono svg { width: 22px; height: 22px; }
.volver-texto { flex: 1; display: flex; flex-direction: column; line-height: 1.2; font-weight: 700; font-size: 1rem; }
.volver-texto small { font-weight: 500; font-size: 0.8rem; color: var(--gris); margin-top: 0.15rem; }
.volver-pez { flex: none; font-size: 1.5rem; line-height: 1; transition: transform 0.3s; }
.btn-volver:hover { border-color: var(--azul); box-shadow: var(--sombra); }
.btn-volver:hover .volver-icono { background: var(--azul); color: var(--blanco); transform: translateX(-3px); }
.btn-volver:hover .volver-pez { transform: rotate(-12deg) scale(1.1); }
.btn-volver:active { transform: scale(0.98); background: var(--espuma); }
.btn-volver:focus-visible { outline: 3px solid var(--naranja); outline-offset: 3px; }

/* ---------- Fecha de entrega en el pedido ---------- */
/* Un haz de luz naranja recorre el borde sin parar para que el cliente vea la fecha.
   Truco: un degradado cónico que gira (--giro) y una máscara que solo deja ver un
   anillo de 3px (el borde). Si el navegador no puede animarlo, queda un borde fijo. */
@property --giro {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.entrega-caja {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
}
.entrega-caja::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 3.5px; /* grosor del borde de luz */
  border-radius: inherit;
  background: conic-gradient(
    from var(--giro),
    var(--ola) 0deg 170deg,
    rgba(242, 140, 40, 0.5) 230deg,
    var(--naranja) 290deg,
    #ffe08a 325deg,
    #fffaf0 340deg,
    var(--naranja) 352deg,
    var(--ola) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 4px rgba(242, 140, 40, 0.9));
  animation: haz-luz 3s linear infinite;
  pointer-events: none;
}
@keyframes haz-luz { to { --giro: 360deg; } }
.entrega-icono { font-size: 1.6rem; line-height: 1; }
.entrega-datos { display: flex; flex-direction: column; line-height: 1.25; }
.entrega-etiqueta {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--gris);
}
.entrega-caja strong { font-size: 1.05rem; color: var(--azul-prof); }

/* ---------- Barra inferior (solo cuando hay productos) ---------- */
.barra-carrito {
  position: fixed;
  left: 0.7rem; right: 0.7rem;
  bottom: calc(0.7rem + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  z-index: 30;
  background: var(--azul-prof);
  color: var(--blanco);
  border-radius: 18px;
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  box-shadow: 0 10px 26px rgba(10, 35, 55, 0.35);
}
.barra-carrito[hidden] { display: none; }
.barra-info { display: flex; flex-direction: column; line-height: 1.2; }
.barra-info span { font-size: 0.78rem; opacity: 0.8; }
.barra-info strong { font-size: 1.2rem; }
.btn-ver {
  background: var(--naranja);
  color: var(--blanco);
  border: none;
  border-radius: 13px;
  padding: 0.75rem 1.15rem;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-ver:active { background: var(--naranja-osc); transform: scale(0.98); }

/* ---------- Carrito flotante (siempre visible, centro del lado derecho) ----------
   Queda FIJO en el centro vertical de la pantalla y no se mueve con el scroll:
   - Se ancla desde ABAJO, igual que la barra "Ver mi pedido". En el celular, al hacer
     scroll el navegador esconde/muestra la barra de direcciones y el borde de ARRIBA de
     la ventana se corre; el de abajo no. Anclado arriba, la burbuja subía y bajaba.
   - "svh" = alto pequeño de la ventana, que no cambia al esconderse esa barra, así la
     distancia desde abajo es siempre la misma. "vh" es respaldo para navegadores viejos.
   - Sin transform para posicionar: la animación de "pulso" y el toque solo escalan.
   - translateZ(0) lo pone en su propia capa para que no tiemble en el scroll de iPhone. */
.carrito-fab {
  position: fixed;
  right: max(0.6rem, env(safe-area-inset-right));
  bottom: calc(50vh - 26px);
  bottom: calc(50svh - 26px); /* centro de la pantalla menos media burbuja */
  transform: translateZ(0);
  backface-visibility: hidden;
  z-index: 30;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--azul-prof);
  color: var(--blanco);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(10, 35, 55, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.carrito-fab:active { transform: translateZ(0) scale(0.94); background: var(--azul); }
.carrito-fab:focus-visible { outline: 3px solid var(--naranja); outline-offset: 3px; }
.carrito-fab[hidden] { display: none; }
.carrito-icono { width: 24px; height: 24px; }
.carrito-cuenta {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--naranja);
  color: var(--blanco);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(10, 35, 55, 0.3);
}
.carrito-cuenta[hidden] { display: none; }
.carrito-fab.pulso { animation: pulso-carrito 0.45s ease; }
@keyframes pulso-carrito {
  0% { transform: translateZ(0) scale(1); }
  45% { transform: translateZ(0) scale(1.14); }
  100% { transform: translateZ(0) scale(1); }
}
@media (min-width: 700px) {
  .carrito-fab { right: 1.4rem; width: 60px; height: 60px; bottom: calc(50vh - 30px); bottom: calc(50svh - 30px); }
  .carrito-icono { width: 28px; height: 28px; }
}

/* ---------- Pie ---------- */
.pie { text-align: center; padding: 1rem 1rem 6rem; color: var(--gris); font-size: 0.85rem; }
.pie img { display: block; margin: 0 auto 0.3rem; width: 36px; height: auto; opacity: 0.9; }
.pie p:first-of-type { font-weight: 600; color: var(--azul-prof); }
.pie-nota { font-size: 0.75rem; margin-top: 0.15rem; }

@media (min-width: 700px) {
  .hero { padding-bottom: 5.8rem; }
  .olas { height: 110px; }
  /* En pantallas grandes se muestran los nombres completos de las categorías */
  .tab { font-size: 0.92rem; padding: 0.5rem 0.95rem; gap: 0.4rem; }
  .tab-corto { display: none; }
  .tab-largo { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}

/* ---------- Empaque en medios kilos ---------- */
.subtotal { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.7rem; }
.empaque { color: var(--azul); font-weight: 600; }
.medios {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.15rem;
  background: var(--espuma);
  border: 1.5px solid var(--ola);
  color: var(--azul-prof);
  font-size: 0.82rem; font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}
.medios input { width: 18px; height: 18px; accent-color: var(--azul); cursor: pointer; }
.tarjeta li .emp { display: block; font-style: normal; font-size: 0.78rem; color: var(--azul); margin-top: 0.1rem; }

.nota-precio { font-size: 0.78rem; color: var(--gris); margin-top: 0.1rem; }

/* ---------- Ajustar cantidades en "Mi pedido" ---------- */
.ajuste-ayuda { font-size: 0.82rem; color: var(--gris); margin-bottom: 0.4rem; }
.tarjeta li.linea {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "info precio" "ajuste ajuste";
  align-items: start;
  gap: 0.45rem 0.8rem;
  padding: 0.7rem 0;
}
.linea-info { grid-area: info; min-width: 0; }
.linea-nombre { font-weight: 650; overflow-wrap: anywhere; }
.tarjeta li.linea small { display: block; margin-left: 0; font-size: 0.8rem; }
.linea-precio { grid-area: precio; font-size: 1rem; }
.linea-ajuste { grid-area: ajuste; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; }
.linea-ajuste .paso { width: 40px; height: 40px; font-size: 1.3rem; }
.linea-ajuste .medios { margin-top: 0; }
.paso-quitar { font-size: 1.05rem !important; background: #fff6f5; border-color: #f1c6c0; }
.linea-cant {
  min-width: 7.6rem; /* mismo ancho en todas las filas: los "+" quedan alineados */
  height: 40px;
  padding: 0 0.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--linea);
  border-radius: 12px;
  font-weight: 700; font-size: 0.95rem;
  color: var(--azul-prof);
  white-space: nowrap;
}

/* ---------- Aleta y lancha: cruzan de vez en cuando, de una en una (ver app.js) ---------- */
.aleta, .lancha {
  position: absolute;
  left: 0;
  opacity: 0; /* solo se ven mientras cruzan */
  will-change: transform;
}
.aleta { bottom: 20px; width: 46px; height: 39px; animation: ola-subir 2.4s ease-in-out infinite; }
.lancha { bottom: 12px; width: 112px; height: 52px; animation: ola-subir 3.2s ease-in-out infinite -1s, cabeceo 4.5s ease-in-out infinite; }
@keyframes cabeceo {
  0%, 100% { rotate: -1.6deg; }
  50% { rotate: 1.6deg; }
}
.aleta-clara { fill: #3f85c7; }
.aleta-oscura { fill: #276aa7; }
.aleta-tajo { fill: none; stroke: #ffffff; stroke-width: 13; stroke-linecap: round; }
.aleta-estela { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 7; stroke-linecap: round; }
@media (min-width: 700px) {
  .aleta { bottom: 28px; width: 55px; height: 47px; }
  .lancha { bottom: 20px; width: 140px; height: 65px; }
}

/* Anuncio de próxima entrega: entra por la derecha y se queda en el cuarto derecho de la pantalla */
.anuncio {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 0;
  z-index: 40;
  width: max(25vw, 250px);
  max-width: 92vw;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--azul-prof);
  color: #fff;
  border-radius: 16px 0 0 16px;
  border-left: 5px solid var(--naranja);
  box-shadow: 0 8px 24px rgba(22, 74, 112, 0.35);
  transform: translateX(110%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.anuncio.visible { transform: translateX(0); }
.anuncio[hidden] { display: none; }
.anuncio-icono { font-size: 1.9rem; line-height: 1; }
.anuncio strong { display: block; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: #ffc98a; }
.anuncio span:not(.anuncio-icono) { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.anuncio #anuncio-texto::first-letter { text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { .anuncio { transition: opacity 0.3s; transform: none; opacity: 0; } .anuncio.visible { opacity: 1; } }

/* Cardumen: peces azul oscuro que nadan "detrás del agua" (bajo la ola 2) cuando pasa la lancha */
.cardumen { position: absolute; left: 0; bottom: 27px; width: 110px; height: 20px; opacity: 0; fill: #164a70; animation: nadar 2.2s ease-in-out infinite; }
@keyframes nadar { 0%, 100% { translate: 0 -3px; } 50% { translate: 0 3px; } }
@media (min-width: 700px) { .cardumen { bottom: 31px; width: 150px; height: 27px; } }

/* ---------- Lupa flotante (buscar producto), justo arriba de la burbuja del carrito ---------- */
.buscar-fab {
  position: fixed;
  right: max(0.6rem, env(safe-area-inset-right));
  bottom: calc(50vh + 38px);   /* carrito (52px) + 12px de separación */
  bottom: calc(50svh + 38px);
  transform: translateZ(0);
  backface-visibility: hidden;
  z-index: 30;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--naranja);
  color: var(--blanco);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(10, 35, 55, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.buscar-fab:active { transform: translateZ(0) scale(0.94); }
.buscar-fab:focus-visible { outline: 3px solid var(--azul-prof); outline-offset: 3px; }
.buscar-fab[hidden] { display: none; }
.buscar-icono { width: 24px; height: 24px; }
@media (min-width: 700px) {
  .buscar-fab { right: 1.4rem; width: 60px; height: 60px; bottom: calc(50vh + 42px); bottom: calc(50svh + 42px); }
  .buscar-icono { width: 28px; height: 28px; }
}

/* Ventana de búsqueda */
.buscador { position: fixed; inset: 0; z-index: 60; }
.buscador[hidden] { display: none; }
.buscador-fondo { position: absolute; inset: 0; background: rgba(15, 40, 60, 0.45); }
.buscador-caja {
  position: relative;
  width: min(92vw, 520px);
  margin: max(12px, env(safe-area-inset-top)) auto 0;
  background: var(--blanco);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(10, 35, 55, 0.35);
  overflow: hidden;
}
.buscador-campo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e3edf3; color: var(--azul-prof); }
.buscador-campo svg { width: 22px; height: 22px; flex: none; }
.buscador-campo input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font: inherit;
  font-size: 1.05rem; /* 16px o más: evita el zoom automático en iPhone */
  color: var(--tinta);
  background: transparent;
}
.buscador-campo button { border: none; background: #eaf2f7; color: var(--azul-prof); width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; cursor: pointer; flex: none; }
.buscador-lista { list-style: none; margin: 0; padding: 6px; max-height: min(58svh, 420px); overflow-y: auto; }
.buscador-ayuda { padding: 14px 12px; color: var(--gris); font-size: 0.92rem; }
.buscador-res {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--tinta);
}
.buscador-res:hover, .buscador-res:focus-visible { background: #eef6fb; outline: none; }
.res-icono { font-size: 1.4rem; flex: none; }
.res-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-texto b { font-weight: 700; }
.res-texto small, .res-precio small { color: var(--gris); font-size: 0.78rem; font-weight: 500; }
.res-precio { flex: none; font-weight: 700; color: var(--azul); text-align: right; display: flex; flex-direction: column; }

/* Producto encontrado: un destello naranja para ubicarlo */
.producto.resaltado { animation: resalte 0.7s ease-in-out 3; }
@keyframes resalte {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 140, 40, 0); }
  50% { box-shadow: 0 0 0 5px rgba(242, 140, 40, 0.75); }
}
@media (prefers-reduced-motion: reduce) { .producto.resaltado { animation: none; box-shadow: 0 0 0 4px rgba(242, 140, 40, 0.75); } }

/* ---------- Ubicación en Google Maps (pedido) ---------- */
.campo-mapa label small { font-weight: 500; color: var(--gris); }
.mapa-botones { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 0.6rem; }
@media (min-width: 480px) { .mapa-botones { grid-template-columns: 1fr 1fr; } }
.btn-mapa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 12px;
  border: 1.5px solid var(--azul);
  border-radius: 12px;
  background: #f1f8fc;
  color: var(--azul-prof);
  font: inherit; font-size: 0.92rem; font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-mapa svg { width: 20px; height: 20px; flex: none; }
.btn-mapa:active { background: #dcecf6; }
.mapa-ayuda { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--gris); }
.mapa-estado { margin: 0.5rem 0 0; font-size: 0.86rem; font-weight: 600; padding: 8px 10px; border-radius: 10px; }
.mapa-estado[hidden] { display: none; }
.mapa-estado.ok { background: #e9f7ee; color: #1d6b3a; }
.mapa-estado.mal { background: #fff3f1; color: var(--rojo); }
.mapa-estado.info { background: #eaf4fb; color: var(--azul-prof); }
.mapa-estado a { color: inherit; text-decoration: underline; margin-left: 4px; }

/* ---------- Mapa de Google empotrado (ventana a pantalla completa en celular) ---------- */
body.sin-scroll { overflow: hidden; }
.mapa-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15, 40, 60, 0.55); display: flex; align-items: stretch; justify-content: center; }
.mapa-modal[hidden] { display: none; }
.mapa-modal-caja { background: var(--blanco); width: 100%; max-width: 760px; display: flex; flex-direction: column; }
@media (min-width: 700px) { .mapa-modal { padding: 4vh 0; } .mapa-modal-caja { border-radius: 18px; overflow: hidden; box-shadow: 0 16px 40px rgba(10, 35, 55, 0.4); } }
.mapa-modal-cab { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); color: var(--azul-prof); }
.mapa-modal-cab button { border: none; background: #eaf2f7; color: var(--azul-prof); width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.mapa-busqueda { display: flex; gap: 8px; padding: 0 12px 10px; }
.mapa-busqueda input { flex: 1; min-width: 0; padding: 11px 12px; border: 1.5px solid #cfe0ea; border-radius: 12px; font: inherit; font-size: 1rem; color: var(--tinta); }
.mapa-busqueda input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(43, 127, 184, 0.18); }
.mapa-buscar-ir { border: none; border-radius: 12px; background: var(--azul); color: var(--blanco); font: inherit; font-weight: 700; padding: 0 16px; cursor: pointer; }
.mapa-resultados { list-style: none; margin: 0; padding: 0 12px 8px; max-height: 32vh; overflow-y: auto; }
.mapa-resultados[hidden] { display: none; }
.mapa-resultados button { width: 100%; text-align: left; border: none; background: #f1f8fc; padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; font: inherit; font-size: 0.88rem; color: var(--azul-prof); cursor: pointer; }
.mapa-resultados button:active { background: #dcecf6; }
.mapa-credito { margin: 0; padding: 2px 14px; font-size: 0.7rem; color: var(--gris); text-align: right; }
.mapa-credito a { color: inherit; }
.mapa-lienzo { flex: 1; min-height: 240px; background: #dfeaf1; }
.mapa-modal-msg { margin: 0; padding: 10px 14px; font-size: 0.88rem; color: var(--azul-prof); background: #f1f8fc; min-height: 2.6rem; }
.mapa-modal-pie { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.btn-confirmar-mapa { border: none; border-radius: 12px; background: var(--azul-prof); color: var(--blanco); font: inherit; font-weight: 700; padding: 12px; cursor: pointer; }
.btn-confirmar-mapa:disabled { background: #b8c7d2; cursor: not-allowed; }

.mapa-titulo { margin: 0 0 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--azul-prof); }
.mapa-titulo small { font-weight: 500; color: var(--gris); }

/* Casilla de dirección recién cargada desde el mapa: destello con los azules de la marca */
.campo input.cargada {
  border-color: var(--azul);
  animation: zona-pulso 0.95s ease-in-out 6, zona-fin 0.8s ease-out 5.7s forwards; /* 6 pulsos más lentos y se apaga: ~6,5 s */
}
@keyframes zona-pulso {
  0%, 100% { background: #cfe6f5; box-shadow: 0 0 0 0 rgba(43, 127, 184, 0.65); }
  50%      { background: #e6f2fa; box-shadow: 0 0 0 7px rgba(43, 127, 184, 0.38); }
}
@keyframes zona-fin {
  from { background: #d8ebf8; box-shadow: 0 0 0 3px rgba(43, 127, 184, 0.30); }
  to   { background: var(--blanco); box-shadow: 0 0 0 0 rgba(43, 127, 184, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .campo input.cargada { animation: none; background: #e3f1fa; }
}

/* ---------- Repetir mi último pedido ---------- */
.btn-repetir {
  display: flex; align-items: center; gap: 0.8rem; width: 100%;
  margin: 0 0 1rem; padding: 0.8rem 1rem; text-align: left;
  border: 2px dashed var(--azul); border-radius: var(--radio);
  background: #f1f8fc; color: var(--azul-prof); font: inherit; cursor: pointer;
}
.btn-repetir[hidden] { display: none; }
.btn-repetir:active { background: #dcecf6; }
.repetir-icono { width: 30px; height: 30px; flex: none; color: #1e9e4f; }
.repetir-icono svg { width: 100%; height: 100%; display: block; animation: repetir-giro 2.6s linear infinite; }
@keyframes repetir-giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .repetir-icono svg { animation: none; } }
.repetir-texto { font-weight: 700; font-size: 1rem; display: flex; flex-direction: column; }
.repetir-texto { flex: 1; min-width: 0; }
.repetir-lista { display: flex; flex-direction: column; gap: 0.15rem; margin: 0.35rem 0 0.3rem; font-weight: 500; font-size: 0.86rem; color: var(--tinta); }
.repetir-linea { display: flex; justify-content: space-between; gap: 0.8rem; }
.repetir-linea b { font-weight: 700; color: var(--azul-prof); white-space: nowrap; }
.repetir-linea em { font-style: normal; color: var(--gris); font-size: 0.78rem; }
.repetir-mas { color: var(--gris); }
.repetir-texto small { font-weight: 500; font-size: 0.8rem; color: var(--gris); margin-top: 0.1rem; }

/* ---------- Aviso al enviar el pedido ---------- */
.envio-modal { position: fixed; inset: 0; z-index: 90; background: rgba(15, 40, 60, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.envio-modal[hidden] { display: none; }
.envio-caja { background: var(--blanco); width: 100%; max-width: 380px; border-radius: 20px; padding: 1.4rem 1.2rem 1.2rem; text-align: center; box-shadow: 0 16px 40px rgba(10, 35, 55, 0.4); }
.envio-icono { font-size: 2.4rem; line-height: 1; }
.envio-caja h3 { margin: 0.4rem 0 0.5rem; color: var(--azul-prof); font-size: 1.3rem; }
.envio-caja p { margin: 0 0 0.6rem; color: var(--tinta); line-height: 1.4; }
.envio-btn { display: block; box-sizing: border-box; text-decoration: none; text-align: center; width: 100%; margin-top: 0.5rem; padding: 0.85rem 1rem; border-radius: 14px; border: 2px solid var(--linea); background: var(--blanco); color: var(--azul-prof); font: inherit; font-weight: 700; cursor: pointer; }
.envio-btn-wa { background: var(--verde-wa); border-color: var(--verde-wa); color: #fff; font-size: 1.05rem; padding: 0.95rem 1rem; }
.envio-btn-suave { border-color: transparent; color: var(--gris); font-weight: 600; }
.envio-btn-prim { background: var(--azul-prof); border-color: var(--azul-prof); color: var(--blanco); }

/* ---------- Aviso corto flotante ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(86px, calc(env(safe-area-inset-bottom) + 70px)); z-index: 95; width: min(92vw, 420px); padding: 0.7rem 1rem; border-radius: 14px; background: var(--azul-prof); color: var(--blanco); font-size: 0.9rem; font-weight: 600; text-align: center; box-shadow: 0 8px 22px rgba(10, 35, 55, 0.35); }
.toast[hidden] { display: none; }

/* Mientras llega el catálogo del servidor (fracción de segundo) */
.cargando { text-align: center; color: var(--gris); padding: 2.5rem 1rem; font-weight: 600; }

