/* ============================================================================
 * WhatsVend - Hoja de estilos principal (styles.css)
 * Organizada por bloques: variables, 5 filas superiores dinámicas, barra de
 * categorías pegajosa, módulos de productos (cuadrícula/lista), módulos extra,
 * modal de producto/ver-más (deslizar en móvil / centrada en PC), carrito y
 * pie de página "Desarrollado por WhatsVend".
 * ============================================================================ */

:root {
  --wv-primario: #16a34a;
  --wv-primario-oscuro: #15803d;
  --wv-fondo: #ffffff;
  --wv-superficie: #f9fafb;
  --wv-texto: #111827;
  --wv-texto-suave: #6b7280;
  --wv-borde: #e5e7eb;
  --wv-fuente-base: 'Poppins', system-ui, -apple-system, sans-serif;
  --wv-altura-header-dinamica: 64px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--wv-fuente-base);
  background-color: var(--wv-fondo);
  color: var(--wv-texto);
  overflow-x: hidden;
}

.wv-cargando {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--wv-texto-suave);
}

/* ----------------------------------------------------------------------------
 * PORTADA MODULAR
 * ---------------------------------------------------------------------------- */
.wv-portada {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.wv-portada-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  background: #111827;
  color: #ffffff;
  margin-bottom: 28px;
}

.wv-portada-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.wv-portada-hero-contenido {
  position: relative;
  z-index: 2;
  padding: 28px 22px;
  max-width: 640px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
  width: 100%;
}

.wv-portada-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.wv-portada-hero p {
  margin: 0 0 18px;
  color: #f3f4f6;
  font-size: 0.98rem;
}

.wv-btn-primario {
  background: var(--wv-primario);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.wv-btn-primario:hover {
  background: var(--wv-primario-oscuro);
}

.wv-btn-primario:active {
  transform: scale(0.98);
}

.wv-destacados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.wv-destacado-card {
  border: 1px solid var(--wv-borde);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.wv-destacado-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.wv-destacado-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.wv-destacado-card-body {
  padding: 12px;
}

.wv-destacado-precio {
  font-weight: 700;
  color: var(--wv-primario-oscuro);
  margin-top: 6px;
}

/* ----------------------------------------------------------------------------
 * FILAS 1 Y 2: AVISOS SUPERIORES
 * ---------------------------------------------------------------------------- */
.wv-aviso-fila {
  width: 100%;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

/* ----------------------------------------------------------------------------
 * FILA 3: BARRA DE MENÚ PRINCIPAL DINÁMICA + FILA 6: CATEGORÍAS PEGAJOSA
 * ---------------------------------------------------------------------------- */
.wv-sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wv-main-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: padding 0.2s ease, min-height 0.2s ease;
}

/* Cuando el usuario baja más allá del inicio, la barra se hace un poco más fina */
.wv-sticky-wrapper.is-compact .wv-main-bar {
  padding: 6px 14px;
}

.wv-sticky-wrapper.is-compact .wv-logo-img {
  width: 34px;
  height: 34px;
}

.wv-marca-grupo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wv-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  transition: width 0.2s ease, height 0.2s ease;
}

.wv-nombre-negocio {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buscador en PC: va en el centro de la barra principal */
.wv-buscador-pc {
  flex: 1;
  max-width: 420px;
  display: none;
}

.wv-buscador-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--wv-borde);
  background: var(--wv-superficie);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.wv-buscador-input:focus {
  border-color: var(--wv-primario);
  background: #ffffff;
}

.wv-carrito-btn-pc {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--wv-superficie);
  border: 1px solid var(--wv-borde);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.wv-carrito-badge {
  background: var(--wv-primario);
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
}

/* Resumen de carrito en la barra principal para MÓVIL cuando hay productos y se baja */
.wv-resumen-movil-bar {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--wv-primario);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

@media (max-width: 767px) {
  .wv-sticky-wrapper.is-scrolled-past-hero.has-cart .wv-marca-grupo {
    display: none;
  }
  .wv-sticky-wrapper.is-scrolled-past-hero.has-cart .wv-resumen-movil-bar {
    display: flex;
  }
}

@media (min-width: 768px) {
  .wv-buscador-pc {
    display: block;
  }
  .wv-carrito-btn-pc {
    display: inline-flex;
  }
}

/* Barra de categorías (se pega bajo la barra principal) */
.wv-categorias-bar {
  border-top: 1px solid var(--wv-borde);
  background: #ffffff;
}

.wv-categorias-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wv-categorias-inner::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .wv-categorias-inner {
    justify-content: center;
    flex-wrap: wrap;
  }
  /* En PC el buscador está arriba en la barra principal, ocultamos lupa móvil */
  .wv-lupa-movil-btn {
    display: none !important;
  }
}

.wv-lupa-movil-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--wv-borde);
  background: var(--wv-superficie);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1rem;
}

.wv-cat-pill {
  border: 1px solid var(--wv-borde);
  background: #ffffff;
  color: var(--wv-texto);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wv-cat-pill.is-active {
  background: var(--wv-primario);
  border-color: var(--wv-primario);
  color: #ffffff;
}

.wv-buscador-movil-drawer {
  display: none;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--wv-borde);
  background: #ffffff;
}

.wv-buscador-movil-drawer.is-open {
  display: block;
}

/* ----------------------------------------------------------------------------
 * FILA 4: BANNER PRINCIPAL (PC Y MÓVIL) + FILA 5: BARRA DE ESTADO
 * ---------------------------------------------------------------------------- */
.wv-banner-principal {
  max-width: 1200px;
  margin: 0 auto;
}

.wv-banner-principal img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.wv-estado-bar {
  background: #18181b;
  color: #ffffff;
  font-size: 0.85rem;
}

.wv-estado-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wv-estado-izq {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wv-estado-indicador {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.wv-punto-estado {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.wv-punto-estado.is-cerrado {
  background: #ef4444;
}

.wv-estado-der {
  color: #e5e7eb;
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
 * CUERPO DEL CATÁLOGO: SECCIONES DE PRODUCTOS Y MÓDULOS EXTRA
 * ---------------------------------------------------------------------------- */
.wv-catalogo-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}

.wv-seccion-bloque {
  margin-bottom: 36px;
  scroll-margin-top: 118px;
}

.wv-seccion-header {
  margin-bottom: 14px;
}

.wv-seccion-titulo {
  margin: 0;
  font-weight: 800;
  line-height: 1.15;
}

.wv-seccion-subtitulo {
  margin: 6px 0 0;
  line-height: 1.4;
}

/* Estilo 1: Cuadrícula (2 en móvil, 3-4 en PC) */
.wv-grid-productos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

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

.wv-card-grid {
  border: 1px solid var(--wv-borde);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wv-card-img-wrap {
  position: relative;
  cursor: pointer;
}

.wv-card-img-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.wv-etiqueta-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.wv-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 10px;
}

.wv-prod-titulo {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.wv-prod-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--wv-texto-suave);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wv-prod-precio {
  font-weight: 800;
  font-size: 0.98rem;
  margin-bottom: 8px;
}

.wv-btn-tarjeta {
  width: 100%;
  background: var(--wv-primario);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.wv-btn-tarjeta:hover {
  background: var(--wv-primario-oscuro);
}

/* Estilo 2: Lista horizontal */
.wv-lista-productos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wv-card-lista {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--wv-borde);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.wv-card-lista-img {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
}

.wv-card-lista-info {
  flex: 1;
  min-width: 0;
}

.wv-card-lista-accion {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.wv-ver-mas-wrap {
  margin-top: 16px;
  text-align: center;
}

.wv-btn-secundario {
  background: var(--wv-superficie);
  color: var(--wv-texto);
  border: 1px solid var(--wv-borde);
  border-radius: 10px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ----------------------------------------------------------------------------
 * MÓDULOS DECORATIVOS Y LLAMADOS A LA ACCIÓN
 * ---------------------------------------------------------------------------- */
.wv-modulo-extra {
  margin: 26px 0;
}

.wv-cinta-wrap {
  overflow: hidden;
  padding: 10px 0;
}

.wv-cinta-banda {
  padding: 10px 16px;
  overflow: hidden;
  white-space: nowrap;
}

.wv-cinta-track {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: wv-mover-izquierda 18s linear infinite;
}

@keyframes wv-mover-izquierda {
  0% {
    transform: translateX(25%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.wv-cupon-box {
  border-radius: 14px;
  padding: 14px 18px;
  border-width: 1px;
  border-style: solid;
}

.wv-banner-extra img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.wv-img-solo-movil {
  display: none;
}

.wv-img-solo-pc {
  display: block;
}

@media (max-width: 767px) {
  .wv-img-solo-movil {
    display: block;
  }
  .wv-img-solo-pc {
    display: none;
  }
}

/* ----------------------------------------------------------------------------
 * BARRA FLOTANTE INFERIOR DEL CARRITO
 * ---------------------------------------------------------------------------- */
.wv-barra-carrito-flotante {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 680px;
  background: var(--wv-primario);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.35);
  z-index: 45;
  cursor: pointer;
}

/* ----------------------------------------------------------------------------
 * MODALES (PRODUCTO, VER MÁS CATEGORÍA, CARRITO, WHATSAPPVEND)
 * ---------------------------------------------------------------------------- */
.wv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.wv-modal-backdrop.is-open {
  display: flex;
}

.wv-modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  position: relative;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

/* Modal "Ver más" de categoría:
   - En móvil: pantalla completa y deslizable de izquierda a derecha para volver
   - En PC: ventana más compacta centrada dejando ver los costados */
.wv-modal-dialog.is-ver-mas {
  max-width: 820px;
}

@media (max-width: 767px) {
  .wv-modal-backdrop.is-ver-mas-backdrop {
    padding: 0;
  }
  .wv-modal-dialog.is-ver-mas {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    transition: transform 0.2s ease;
  }
}

.wv-modal-cerrar {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--wv-borde);
  background: #ffffff;
  color: var(--wv-texto);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
}

.wv-grupo-extras {
  border: 1px solid var(--wv-borde);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}

.wv-grupo-extras-titulo {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.wv-opcion-extra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
}

/* ----------------------------------------------------------------------------
 * PIE DE PÁGINA "DESARROLLADO POR WHATSAPPVEND"
 * ---------------------------------------------------------------------------- */
.wv-footer-whatsvend-wrap {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 0 16px;
}

.wv-footer-bar-btn {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--wv-borde);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.wv-footer-bar-izq {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wv-footer-logo-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wv-footer-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--wv-texto-suave);
  text-transform: uppercase;
}

.wv-footer-marca {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--wv-texto);
}

.wv-whatsvend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.wv-whatsvend-pill {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #ffedd5;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.wv-btn-whatsapp-creador {
  width: 100%;
  background: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
