:root {
  --verde-whatsapp: #25D366;
  --verde-whatsapp-oscuro: #1DA851;
  --azul-marca: #0B3D91;
  --fondo: #f5f6f8;
  --tarjeta: #ffffff;
  --texto: #1a1a1a;
  --texto-secundario: #6b6b6b;
  --borde: #e2e4e8;
  --radio: 10px;
  --sombra: 0 1px 3px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}

/* ---------- Encabezado (estilo distribuidor) ---------- */

.contenedor {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  background: #0a2a5e;
  color: #dbe4f3;
  font-size: 0.8rem;
}

.topbar-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.topbar a { color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }

.topbar-contacto { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.topbar-contacto a { font-weight: 400; color: #dbe4f3; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header-in {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.marca { line-height: 0; }

.logo {
  height: 34px;
  width: auto;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#buscador,
#filtro-categoria {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--borde);
  font-size: 0.95rem;
  background: #f1f3f6;
  color: var(--texto);
}

#buscador:focus,
#filtro-categoria:focus {
  outline: 2px solid var(--azul-marca);
  background: #fff;
}

.llamar { display: none; }

.menu { background: #1565c0; }

.menu-in {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.menu-in::-webkit-scrollbar { display: none; }

.menu button,
.menu a {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 12px;
  cursor: pointer;
  text-decoration: none;
}

.menu button:hover,
.menu a:hover { background: rgba(255,255,255,0.15); }

.franja {
  background: #f3efe6;
  font-size: 0.85rem;
  color: #333;
}

.franja-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 16px;
  padding-top: 9px;
  padding-bottom: 9px;
  text-align: center;
}

.franja strong { color: #1565c0; }

.franja a {
  background: #1565c0;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 4px;
  text-decoration: none;
}

@media (min-width: 640px) {
  .controls { flex-direction: row; }
  #buscador { flex: 1; }
  #filtro-categoria { width: 220px; }
}

@media (min-width: 900px) {
  .header-in {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .logo { height: 44px; }
  .llamar {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0a2a5e;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }
  .llamar small { display: block; font-weight: 400; color: var(--texto-secundario); font-size: 0.75rem; }
  .llamar-icono {
    width: 42px; height: 42px; border-radius: 50%;
    background: #0a2a5e; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
  }
  .menu-in { justify-content: center; }
  .menu button, .menu a { font-size: 0.95rem; padding: 14px 18px; }
}

/* ---------- Banner (hero) ---------- */

.hero {
  --oro: #c9a14a;
  margin: 12px 0 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, rgba(201,161,74,0.25), transparent 45%),
    linear-gradient(135deg, #0a2a5e 0%, #0B3D91 60%, #12509f 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px 18px;
  box-shadow: 0 4px 16px rgba(11, 61, 145, 0.22);
}

.hero[hidden] { display: none; }

.hero-etiqueta {
  margin: 0 0 6px;
  color: var(--oro);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.hero-sub {
  margin: 0 0 16px;
  color: #dbe4f3;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 34em;
}

.hero-botones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.hero-btn-wa { background: var(--verde-whatsapp); color: #fff; }
.hero-btn-wa:hover { background: var(--verde-whatsapp-oscuro); }
.hero-btn-ver { border: 2px solid var(--oro); color: #fff; }
.hero-btn-ver:hover { background: rgba(201,161,74,0.18); }

.hero-datos {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255,255,255,0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.82rem;
  color: #dbe4f3;
}

.hero-datos strong { color: var(--oro); }

.hero-fotos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hero-fotos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@media (min-width: 800px) {
  .hero {
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    padding: 36px 40px;
    gap: 32px;
  }
  .hero h2 { font-size: 2.3rem; }
  .hero-fotos { grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 420px; justify-self: center; }
  .hero-fotos img:nth-child(3n+2) { transform: translateY(14px); }
}

/* Tarjetas de grupos (estilo "General / Dominican catalog") */

.grupos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.grupos[hidden] { display: none; }

.grupo {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 18px 22px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(21,101,192,0.25);
  transition: background 0.15s ease;
}

.grupo:hover { background: #0d4fa0; }

.grupo-icono { font-size: 2rem; line-height: 1; }

.grupo strong { display: block; font-size: 1.05rem; letter-spacing: 0.02em; }

.grupo small { display: block; margin-top: 3px; color: #dbe7fb; font-size: 0.82rem; }

@media (min-width: 700px) {
  .grupos { grid-template-columns: 1fr 1fr; }
}

/* ---------- Main / grid ---------- */

main {
  padding: 12px 16px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.contador {
  color: var(--texto-secundario);
  font-size: 0.85rem;
  margin: 12px 0 8px;
}

.sin-resultados {
  text-align: center;
  color: var(--texto-secundario);
  padding: 40px 0;
}

.grid-productos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-productos { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .grid-productos { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1200px) {
  .grid-productos { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Tarjeta de producto ---------- */

.tarjeta {
  background: var(--tarjeta);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tarjeta-imagen {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #eef0f3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tarjeta-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tarjeta-imagen .placeholder {
  color: #b8bcc4;
  font-size: 0.75rem;
  text-align: center;
  padding: 8px;
}

.tarjeta-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.tarjeta-categoria {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-secundario);
}

.tarjeta-nombre {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.2em;
}

.tarjeta-precio {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--azul-marca);
  margin-top: auto;
}

.tarjeta-unidad {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--texto-secundario);
}

.tarjeta-precio.consultar {
  color: var(--texto-secundario);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Imagen y nombre clicables (abren la ficha) */
.tarjeta-abrir,
.tarjeta-nombre {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tarjeta-abrir { display: block; width: 100%; }
.tarjeta-abrir:hover img { transform: scale(1.04); }
.tarjeta-imagen img { transition: transform 0.2s ease; }
.tarjeta-nombre { font-size: 0.85rem; font-weight: 600; }
.tarjeta-nombre:hover { color: #1565c0; text-decoration: underline; }

.btn-agregar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: #1565c0;
  color: #fff;
  border: 0;
  padding: 10px 8px;
  border-radius: var(--radio);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-agregar:hover, .btn-agregar:active { background: #0a2a5e; }
.btn-agregar span { font-size: 1.1rem; line-height: 1; }

/* ---------- Botones del carrito ---------- */
.abrir-carrito { font: inherit; cursor: pointer; border: 0; }
.carrito-cantidad {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  background: #e53935; color: #fff;
  font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.carrito-cantidad[hidden] { display: none; }

.carrito-header { display: none; }

.carrito-flotante {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 20;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #1565c0; color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
}
.carrito-flotante .carrito-cantidad { position: absolute; top: -2px; right: -2px; }

@media (min-width: 900px) {
  .header-in { grid-template-columns: auto 1fr auto auto; }
  .carrito-header {
    display: flex; align-items: center; gap: 8px;
    background: #1565c0; color: #fff;
    padding: 10px 16px; border-radius: 24px;
    font-weight: 700; white-space: nowrap;
  }
  .carrito-header:hover { background: #0a2a5e; }
  .carrito-icono { font-size: 1.2rem; }
  .carrito-flotante { display: none; }
}

/* ---------- Aviso "Agregado" ---------- */
.aviso {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 32px);
  background: #1a1a1a; color: #fff;
  padding: 10px 16px; border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aviso[hidden] { display: none; }

/* ---------- Ventanas (ficha y carrito) ---------- */
body.sin-scroll { overflow: hidden; }

.ventana { position: fixed; inset: 0; z-index: 50; }
.ventana[hidden] { display: none; }
.ventana-fondo { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }

.cerrar {
  background: #f1f3f6; border: 0;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; cursor: pointer; color: #333;
}

/* Ficha */
.ficha-caja {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.ficha-caja > .cerrar { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ficha-contenido { display: grid; grid-template-columns: 1fr; }
.ficha-imagen {
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--borde);
}
.ficha-imagen img { width: 100%; height: 100%; object-fit: contain; }
.ficha-imagen .placeholder { color: #b8bcc4; }
.ficha-info { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ficha-nombre { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.ficha-precio { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--azul-marca); }
.ficha-precio.consultar { font-size: 1.05rem; color: var(--texto-secundario); }
.ficha-sku { margin: 0; color: var(--texto-secundario); font-size: 0.85rem; }
.btn-grande { font-size: 1rem; padding: 14px; }
.ficha-consulta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--verde-whatsapp-oscuro); font-weight: 600; font-size: 0.9rem;
  text-decoration: none; padding: 8px;
}
.ficha-consulta svg { width: 18px; height: 18px; }

@media (min-width: 720px) {
  .ficha-contenido { grid-template-columns: 1fr 1fr; }
  .ficha-imagen { border-bottom: 0; border-right: 1px solid var(--borde); }
  .ficha-info { padding: 28px 24px; justify-content: center; }
}

/* Cantidad (+ / −) */
.cantidad { display: flex; align-items: center; gap: 6px; }
.cantidad button {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--borde); background: #f1f3f6;
  font-size: 1.2rem; cursor: pointer; color: var(--texto);
}
.cantidad input {
  width: 64px; height: 40px; text-align: center;
  border: 1px solid var(--borde); border-radius: 8px; font-size: 1rem;
}
.cantidad-chica button { width: 30px; height: 30px; font-size: 1rem; }
.cantidad-chica span { min-width: 24px; text-align: center; font-weight: 700; }
.cantidad .carrito-quitar {
  width: auto; height: auto; border: 0; background: none;
  color: #c62828; font-size: 0.8rem; text-decoration: underline; margin-left: 6px;
}

/* Panel del carrito */
.carrito-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
}
.carrito-cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--borde);
}
.carrito-cabecera h2 { margin: 0; font-size: 1.2rem; color: #0a2a5e; }
.carrito-paso { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.carrito-paso[hidden] { display: none; }
.carrito-vacio { text-align: center; color: var(--texto-secundario); padding: 40px 20px; line-height: 1.6; }
.carrito-vacio[hidden] { display: none; }
.carrito-lista { list-style: none; margin: 0; padding: 0 16px; flex: 1; }
.carrito-fila {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--borde);
}
.carrito-foto {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #eef0f3;
  display: flex; align-items: center; justify-content: center;
}
.carrito-foto img { width: 100%; height: 100%; object-fit: cover; }
.carrito-foto .placeholder { font-size: 0.55rem; color: #b8bcc4; text-align: center; }
.carrito-detalle { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.carrito-nombre { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.carrito-precio { font-size: 0.78rem; color: var(--texto-secundario); }
.carrito-subtotal { font-weight: 700; font-size: 0.9rem; color: var(--azul-marca); white-space: nowrap; }
.carrito-pie {
  position: sticky; bottom: 0;
  background: #fff; border-top: 1px solid var(--borde);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.carrito-pie[hidden] { display: none; }
.carrito-total-linea { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.carrito-total-linea strong { font-size: 1.35rem; color: #0a2a5e; }
.carrito-nota { margin: 0; font-size: 0.78rem; color: #8a5a00; }
.carrito-nota[hidden] { display: none; }

.btn-pedido {
  width: 100%; border: 0; border-radius: var(--radio);
  padding: 13px; font: inherit; font-weight: 700; font-size: 0.95rem;
  color: #fff; cursor: pointer;
}
.btn-wa { background: var(--verde-whatsapp); }
.btn-wa:hover { background: var(--verde-whatsapp-oscuro); }
.btn-correo { background: #1565c0; }
.btn-correo:hover { background: #0a2a5e; }
.btn-correo:disabled { opacity: 0.6; }
.btn-vaciar {
  background: none; border: 0; color: var(--texto-secundario);
  font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; padding: 6px;
}

/* Formulario del pedido */
#form-pedido { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.form-intro { margin: 0 0 4px; color: var(--texto-secundario); font-size: 0.9rem; }
#form-pedido label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
#form-pedido input, #form-pedido textarea {
  padding: 10px 12px; border: 1px solid var(--borde); border-radius: 8px;
  font: inherit; font-weight: 400; font-size: 1rem;
}
.form-error { margin: 0; color: #c62828; font-size: 0.85rem; }
.form-error[hidden] { display: none; }

.carrito-listo { align-items: center; justify-content: center; text-align: center; padding: 30px 20px; gap: 6px; }
.listo-icono {
  width: 64px; height: 64px; border-radius: 50%; margin: 0;
  background: var(--verde-whatsapp); color: #fff; font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}
.carrito-listo h3 { margin: 8px 0 0; color: #0a2a5e; }
.carrito-listo p { color: var(--texto-secundario); }

/* ---------- Lo más pedido (carrusel) ---------- */
.mas-pedidos { margin: 26px 0 8px; }
.mas-pedidos[hidden] { display: none; }
.titulo-seccion {
  display: flex; align-items: center; gap: 16px;
  margin: 0 0 16px; font-size: 1.6rem; font-weight: 500;
  color: #1565c0; text-align: center;
}
.titulo-seccion::before, .titulo-seccion::after {
  content: ""; flex: 1; height: 1px; background: #1565c0; opacity: 0.6;
}
.titulo-seccion em { font-style: italic; }
.carrusel { position: relative; }
.carrusel-lista {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.carrusel-lista::-webkit-scrollbar { display: none; }
.carrusel-lista .tarjeta { scroll-snap-align: start; }
.carrusel-flecha {
  position: absolute; top: 38%; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #c9d6ea; background: #fff; color: #1565c0;
  font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: none; align-items: center; justify-content: center;
}
.carrusel-flecha:hover { background: #1565c0; color: #fff; }
.carrusel-prev { left: -10px; }
.carrusel-next { right: -10px; }
@media (min-width: 640px) {
  .carrusel-lista { grid-auto-columns: calc((100% - 28px) / 3); }
  .carrusel-flecha { display: flex; }
}
@media (min-width: 900px) {
  .carrusel-lista { grid-auto-columns: calc((100% - 42px) / 4); }
  .carrusel-prev { left: -20px; }
  .carrusel-next { right: -20px; }
}
@media (min-width: 1200px) {
  .carrusel-lista { grid-auto-columns: calc((100% - 56px) / 5); }
}

/* ---------- Ventanita de contacto (computadora) ---------- */
.contacto-caja {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  background: #fff; border-radius: 14px;
  padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.contacto-caja > .cerrar { position: absolute; top: 10px; right: 10px; }
.contacto-caja h2 { margin: 0 0 6px; font-size: 1.15rem; color: #0a2a5e; }
.contacto-dato { margin: 0 0 18px; font-size: 1.35rem; font-weight: 800; color: var(--azul-marca); word-break: break-all; }
.contacto-opciones { display: flex; flex-direction: column; gap: 10px; }
.contacto-opciones a.btn-pedido { display: block; text-decoration: none; text-align: center; }
.btn-gris { background: #eef1f6; color: #0a2a5e; }
.btn-gris:hover { background: #dde3ee; }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 20px 20px 90px;
  color: var(--texto-secundario);
  font-size: 0.8rem;
}


