:root {
  --azul: #0096E6;
  --azul-oscuro: #04649B;
  --azul-claro: #E6F5FD;
  --rosa: #F01E82;
  --lima: #6FA800;
  --fondo: #FAFBF9;
  --blanco: #FFFFFF;
  --borde: #E3E9E5;
  --texto: #18231C;
  --texto-sec: #7A867F;
}

* { box-sizing: border-box; }

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

img { max-width: 100%; }

button { font-family: inherit; }

button, a, input, .lvs-categoria, .lvs-producto {
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .1s ease;
}

:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
}

/* ===== Header ===== */
.lvs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  background: var(--blanco);
  border-bottom: 1px solid var(--borde);
}

.lvs-header-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lvs-btn-categorias-mobile {
  display: none;
  border: 1px solid var(--borde);
  background: var(--blanco);
  border-radius: 9px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--texto);
  cursor: pointer;
  flex-shrink: 0;
}

.lvs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.lvs-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.lvs-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.lvs-brand-title { font-size: 15px; font-weight: 700; }
.lvs-brand-sub { font-size: 9px; color: var(--texto-sec); }

.lvs-search {
  flex: 1 1 auto;
  max-width: 500px;
  height: 43px;
  background: #F5F7F5;
  border: 1px solid var(--borde);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.lvs-search:focus-within {
  background: var(--blanco);
  border-color: var(--azul);
  box-shadow: 0 0 0 3px var(--azul-claro);
}
.lvs-search-icon { color: var(--texto-sec); flex-shrink: 0; }
.lvs-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--texto);
}
.lvs-search input::placeholder { color: var(--texto-sec); }

.lvs-btn-pedido {
  margin-left: auto;
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  background: var(--azul-claro);
  color: var(--azul);
  border: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.lvs-btn-pedido:hover { background: #D3EEFC; }
.lvs-btn-pedido:active { transform: scale(0.96); }
.lvs-btn-categorias-mobile:hover { background: var(--fondo); border-color: #BFE4F7; }
.lvs-btn-categorias-mobile:active { transform: scale(0.94); }

/* Solo mobile -- boton lupa que despliega la busqueda en el lugar del logo (ver JS: clase
   "lvs-buscando-mobile" en .lvs-header). En desktop el buscador ya esta siempre visible. */
.lvs-btn-buscar-mobile {
  display: none;
  border: 1px solid var(--borde);
  background: var(--blanco);
  border-radius: 9px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--texto);
  cursor: pointer;
  flex-shrink: 0;
}
.lvs-btn-buscar-mobile:hover { background: var(--fondo); border-color: #BFE4F7; }
.lvs-btn-buscar-mobile:active { transform: scale(0.94); }
.lvs-badge {
  background: var(--azul);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.lvs-badge:not([hidden]) { display: flex; }

/* ===== Layout ===== */
.lvs-main { max-width: 1180px; margin: 0 auto; padding: 34px 24px 80px; }
.lvs-layout { display: grid; grid-template-columns: 190px 1fr; gap: 30px; align-items: start; }

/* ===== Categorías ===== */
/* position:sticky en desktop -- si no, al hacer scroll largo hasta una seccion el
   menu de categorias (junto con logo/busqueda/carrito del header) desaparecia de
   la vista en vez de quedar siempre accesible. En mobile esto se pisa con
   position:fixed dentro de la media query (menu desplegable, no columna fija). */
.lvs-categorias {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(23, 37, 29, 0.03);
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 88px - 24px);
  overflow-y: auto;
}
.lvs-categorias-titulo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--texto-sec);
  margin: 0 0 8px;
  font-weight: 700;
}
.lvs-categorias-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lvs-categoria {
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--texto);
  cursor: pointer;
  text-align: left;
}
.lvs-categoria { position: relative; }
.lvs-categoria::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--azul);
  opacity: 0;
  transition: opacity .15s ease;
}
/* overflow-x:hidden (no overflow:hidden a secas) para no tapar el scroll vertical
   sticky agregado arriba -- sigue recortando el borde -14px del acento activo. */
.lvs-categorias { overflow-x: hidden; }
.lvs-categoria:hover { background: var(--fondo); }
.lvs-categoria.activa { background: var(--azul-claro); color: var(--azul); font-weight: 700; }
.lvs-categoria.activa::before { opacity: 1; }
.lvs-cat-icono { flex-shrink: 0; opacity: 0.7; }
.lvs-cat-nombre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvs-cat-flecha { flex-shrink: 0; opacity: 0.5; transition: transform .15s ease; }
.lvs-categoria.activa .lvs-cat-flecha { transform: translateX(2px); opacity: 0.9; }
.lvs-categoria-ofertas { color: var(--rosa); font-weight: 700; margin-bottom: 4px; border-bottom: 1px solid var(--borde); border-radius: 8px 8px 0 0; }
.lvs-categoria-ofertas .lvs-cat-icono { color: var(--rosa); }
.lvs-categoria-ofertas:hover { background: #FDECF4; }
.lvs-categoria-ofertas.activa { background: #FDECF4; color: var(--rosa); }
.lvs-categoria-ofertas.activa::before { background: var(--rosa); }

/* ===== Resultados ===== */
.lvs-resultados-header { margin-bottom: 16px; }
.lvs-contador { font-size: 11px; color: var(--texto-sec); margin: 0; }

.lvs-estado {
  padding: 40px 16px;
  text-align: center;
  color: var(--texto-sec);
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 11px;
  font-size: 13px;
}

/* Cada categoria es una seccion propia dentro de la misma pagina -- el menu de
   categorias ya no filtra/recarga, solo hace scroll hasta la seccion (ver lvs.js). */
.lvs-seccion { margin-bottom: 28px; scroll-margin-top: 12px; }
.lvs-seccion:last-child { margin-bottom: 0; }
.lvs-seccion-titulo {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--texto-sec);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--borde);
}
@media (min-width: 601px) {
  .lvs-seccion { scroll-margin-top: 88px; }
}

.lvs-productos { flex-direction: column; gap: 9px; }
.lvs-productos:not([hidden]) { display: flex; }

.lvs-producto {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 11px;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  box-shadow: 0 1px 2px rgba(23, 37, 29, 0.03);
}
.lvs-producto:hover {
  border-color: #BFE4F7;
  box-shadow: 0 4px 14px rgba(23, 37, 29, 0.07);
  transform: translateY(-1px);
}
.lvs-producto.sin-stock:hover { transform: none; box-shadow: 0 1px 2px rgba(23, 37, 29, 0.03); }

.lvs-producto-img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--azul-claro);
  border: 1px solid #E4EFE9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lvs-producto-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.lvs-producto:hover .lvs-producto-img img { transform: scale(1.06); }

.lvs-producto-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lvs-producto-categoria { font-size: 10px; font-weight: 700; color: var(--lima); text-transform: uppercase; }
.lvs-producto-nombre {
  font-size: 14px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.lvs-producto-presentacion { font-size: 11px; color: var(--texto-sec); }
.lvs-producto-stock { display: none; font-size: 11px; color: var(--texto-sec); }
.lvs-producto-stock strong { color: var(--azul); font-weight: 700; }
.lvs-producto.sin-stock .lvs-producto-nombre { color: var(--texto-sec); }
.lvs-producto-bulto { font-size: 11px; color: var(--lima); font-weight: 600; }

.lvs-producto-precio-cant {
  flex-shrink: 0;
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lvs-producto-precio { font-size: 15px; font-weight: 700; }
.lvs-producto-oferta-tachado { font-size: 12px; color: var(--texto-sec); text-decoration: line-through; }
.lvs-producto-badge-oferta {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--rosa);
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em;
}
.lvs-producto-sinstock-txt { font-size: 11px; color: var(--texto-sec); }

.lvs-btn-agregar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--azul);
  background: var(--azul-claro);
  color: var(--azul);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.lvs-btn-agregar:hover:not(:disabled) { background: var(--azul); color: #fff; }
.lvs-btn-agregar:active:not(:disabled) { transform: scale(0.92); }
.lvs-btn-agregar:disabled { opacity: 0.4; cursor: not-allowed; border-color: var(--borde); background: var(--fondo); color: var(--texto-sec); }

.lvs-stepper {
  align-items: center;
  gap: 10px;
  border: 1px solid var(--azul);
  border-radius: 9px;
  padding: 4px 8px;
  background: var(--azul-claro);
}
.lvs-stepper:not([hidden]) { display: flex; }
.lvs-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.lvs-stepper button:hover { background: rgba(0, 150, 230, 0.14); }
.lvs-stepper button:active { transform: scale(0.9); }
.lvs-stepper-cant { font-size: 13px; font-weight: 700; min-width: 16px; text-align: center; }

/* ===== Carrito flotante (mobile) ===== */
/* Solo mobile -- en desktop el acceso al pedido es el boton "Mi pedido" del header. */
.lvs-carrito-flotante { display: none; }

@media (max-width: 600px) {
  .lvs-carrito-flotante {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 25;
  }
  .lvs-carrito-flotante:not([hidden]) { display: block; }
}
.lvs-carrito-flotante button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--azul);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Panel pedido ===== */
@keyframes lvs-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lvs-slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes lvs-pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.lvs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 37, 29, 0.45);
  z-index: 30;
  animation: lvs-fade-in .18s ease;
}
.lvs-panel-pedido {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 450px;
  background: var(--blanco);
  z-index: 31;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,0.12);
  animation: lvs-slide-in .2s ease;
}
.lvs-panel-pedido:not([hidden]) { display: flex; }
.lvs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--borde);
}
.lvs-panel-header h2 { margin: 0; font-size: 17px; }
.lvs-panel-header button {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--texto-sec);
}
.lvs-panel-lineas { flex: 1; overflow-y: auto; padding: 12px 20px; flex-direction: column; gap: 14px; }
.lvs-panel-lineas:not([hidden]) { display: flex; }

.lvs-panel-confirmacion {
  flex: 1;
  padding: 32px 24px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
/* [hidden] vs display: mismo bug ya documentado varias veces en este proyecto
   (ver neuronas/lvs-catalogo-web.md) -- un display fijo en la clase le gana al
   atributo [hidden] real. Igual criterio que el resto del archivo. */
.lvs-panel-confirmacion:not([hidden]) { display: flex; }
#confirmacion-texto { font-size: 15px; color: var(--texto); margin: 0 0 6px; }
.lvs-btn-whatsapp {
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
}
.lvs-btn-whatsapp:not([hidden]) { display: flex; }
.lvs-btn-volver {
  width: 100%;
  height: 42px;
  border: 1px solid var(--borde);
  background: var(--blanco);
  color: var(--texto);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lvs-btn-volver:hover { background: var(--fondo); }

.lvs-linea-pedido { display: flex; gap: 12px; align-items: center; }
.lvs-linea-img { width: 48px; height: 48px; border-radius: 8px; background: var(--azul-claro); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lvs-linea-img img { width: 100%; height: 100%; object-fit: contain; }
.lvs-linea-info { flex: 1; min-width: 0; }
.lvs-linea-nombre { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvs-linea-precio { font-size: 11px; color: var(--texto-sec); }
.lvs-linea-cant { display: flex; align-items: center; gap: 8px; }
.lvs-linea-cant button { width: 24px; height: 24px; border: 1px solid var(--borde); border-radius: 6px; background: var(--fondo); cursor: pointer; }
.lvs-linea-subtotal { font-size: 13px; font-weight: 700; width: 70px; text-align: right; }
.lvs-linea-quitar { border: 0; background: transparent; color: var(--texto-sec); cursor: pointer; font-size: 16px; }

.lvs-panel-footer { border-top: 1px solid var(--borde); padding: 16px 20px 20px; }
.lvs-panel-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.lvs-panel-total strong { font-size: 19px; }
.lvs-mensaje-error { background: #FDEDED; color: #A32020; font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }
.lvs-mensaje-info { background: var(--azul-claro); color: var(--azul); font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }

/* Un solo grupo compacto: celular + referencia + domicilio, sin parrafos de
   ayuda intercalados (los placeholders ya explican que va en cada campo) --
   antes eran 2 bloques separados con textos de ayuda y quedaba muy alto. */
.lvs-panel-identificacion { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.lvs-input-ubicacion { display: flex; gap: 8px; }
.lvs-input-ubicacion .lvs-input { flex: 1 1 auto; min-width: 0; }
.lvs-btn-ubicar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--azul);
  background: var(--azul-claro);
  color: var(--azul);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lvs-btn-ubicar:hover:not(:disabled) { background: var(--azul); color: #fff; }
.lvs-btn-ubicar:active:not(:disabled) { transform: scale(0.92); }
.lvs-btn-ubicar:disabled { opacity: 0.5; cursor: not-allowed; }
.lvs-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.lvs-input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 2px rgba(0, 150, 230, 0.15); }
.lvs-input.lvs-input-error { border-color: #A32020; }
.lvs-btn-confirmar {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--azul);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 150, 230, 0.25);
}
.lvs-btn-confirmar:hover:not(:disabled) { background: var(--azul-oscuro); box-shadow: 0 4px 12px rgba(0, 150, 230, 0.3); }
.lvs-btn-confirmar:active:not(:disabled) { transform: scale(0.98); }
.lvs-btn-confirmar:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.lvs-panel-header button { border-radius: 8px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.lvs-panel-header button:hover { background: var(--fondo); color: var(--texto); }
.lvs-linea-cant button:hover { background: var(--azul-claro); border-color: var(--azul); }
.lvs-linea-quitar { border-radius: 6px; width: 26px; height: 26px; }
.lvs-linea-quitar:hover { background: #FDEDED; color: #A32020; }
.lvs-carrito-vacio { text-align: center; color: var(--texto-sec); font-size: 13px; padding: 30px 0; }

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .lvs-layout { grid-template-columns: 150px 1fr; gap: 18px; }
  .lvs-search { max-width: none; }
}

@media (max-width: 600px) {
  /* height fijo (no "auto") -- una sola fila real: hamburguesa | marca/busqueda | lupa | carrito.
     position:sticky se hereda de la regla base (ya no se pisa con "relative" aca) para que el
     header no desaparezca al hacer scroll largo hasta una seccion. */
  .lvs-header { height: 64px; }
  .lvs-header-inner {
    display: grid;
    grid-template-columns: 40px 1fr 40px 40px;
    grid-template-areas: "ham marca buscar cart";
    align-items: center;
    gap: 8px;
    padding: 0 14px;
  }
  .lvs-btn-categorias-mobile { grid-area: ham; display: flex; }
  .lvs-brand { grid-area: marca; justify-content: flex-start; min-width: 0; }
  .lvs-brand-title, .lvs-brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lvs-btn-buscar-mobile { grid-area: buscar; display: flex; }
  .lvs-btn-pedido { grid-area: cart; margin-left: 0; justify-self: end; width: 40px; height: 40px; padding: 0; justify-content: center; }
  .lvs-btn-pedido-texto { display: none; }

  /* La busqueda ocupa el mismo lugar de la marca (grid-area "marca") y arranca oculta --
     JS agrega/saca "lvs-buscando-mobile" en .lvs-header al tocar la lupa. */
  .lvs-search { grid-area: marca; max-width: none; width: 100%; display: none; }
  .lvs-header.lvs-buscando-mobile .lvs-brand { display: none; }
  .lvs-header.lvs-buscando-mobile .lvs-search { display: flex; }

  .lvs-main { padding: 14px 14px 90px; }
  .lvs-layout { display: block; }

  /* Categorias: en mobile es un menu desplegable (oculto por defecto), no la columna fija de
     desktop -- se abre con el boton hamburguesa, JS le agrega/saca la clase "abierta". */
  .lvs-overlay-categorias { z-index: 22; }
  .lvs-categorias {
    display: none;
    position: fixed;
    /* "top" real se fija por JS (altura real del header, que varia) al abrir. */
    left: 14px;
    right: 14px;
    z-index: 23;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    margin-top: 6px;
  }
  .lvs-categorias.abierta { display: block; animation: lvs-pop-in .16s ease; }

  .lvs-producto { padding: 8px 10px; gap: 10px; }
  .lvs-producto-img { width: 64px; height: 64px; }
  .lvs-producto-precio-cant { width: auto; align-items: flex-end; }
  .lvs-producto-presentacion { display: none; }

  .lvs-panel-pedido { max-width: none; }

  /* Header mobile ahora mide 64px de alto y es sticky -- el offset base de
     12px (definido mas arriba, pensado para header no-sticky) no alcanza. */
  .lvs-seccion { scroll-margin-top: 76px; }
}
