/* ══════════════════════════════════════════════════════════════════════
   speedyrect-ui-v72.css — SpeedyRectCore v7.2
   Hoja NUEVA. No reemplaza a speedyrect-ui-v71.css: se carga despues.
   Trae solo lo agregado en v7.2 (buscador en el header, slider de fotos
   del hero, barra rapida de categorias abajo y boton de carrito en cada
   tarjeta). Todo generico: ningun color, texto ni categoria hardcodeada;
   los colores se toman de config.json via variables CSS.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* alto de la barra rapida inferior (lo usa el body para no tapar contenido) */
  --sr-bar-h: 62px;
  /* stack de botones flotantes: WhatsApp, TV, Ir arriba */
  --sr-fab-right: 16px;
  --sr-fab-wa-bottom: 18px;
  --sr-fab-tv-bottom: 86px;
  --sr-fab-top-bottom: 152px;
  --sr-borde: #e5e7eb;
  --sr-fondo-suave: #f3f4f6;
  --sr-texto: #1f2937;
}

/* ══════════════════════════════════════════════════════════════════════
   1) BUSCADOR EN LA BARRA DEL LOGO (header)
   Motivo: en el celular el teclado ocupa media pantalla; con el buscador
   dentro del hero el usuario no veia los resultados. Arriba, en la barra
   fija del logo, el teclado no tapa ni el campo ni la lista.
   ══════════════════════════════════════════════════════════════════════ */
.sr-header-busca-slot {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  margin: 0 10px;
  z-index: 40;
}

.sr-header-busca {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sr-fondo-suave);
  border: 1px solid var(--sr-borde);
  border-radius: 999px;
  padding: 8px 14px;
  transition: border-color .2s, background .2s;
}
.sr-header-busca:focus-within {
  background: #fff;
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sr-header-busca i { color: var(--primary-color, #2563eb); font-size: .9rem; }
.sr-header-busca input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .9rem;
  color: var(--sr-texto);
}
.sr-header-busca input::placeholder { color: #9ca3af; }

/* lista de resultados: cuelga del campo, por encima de todo */
.sr-hero-resultados {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--sr-borde);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .28);
  max-height: min(62vh, 380px);
  overflow: auto;
  padding: 6px;
  z-index: 90;
}
.sr-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
}
.sr-search-item:hover { background: #eff6ff; }
.sr-search-item img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 10px; background: var(--sr-fondo-suave); flex: 0 0 auto;
}
.sr-search-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sr-search-info b { color: #111827; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-search-info small { color: #6b7280; font-size: .75rem; }
.sr-search-precio { color: #b45309; font-weight: 800; font-size: .9rem; white-space: nowrap; }
.sr-search-vacio { padding: 14px; color: #6b7280; font-size: .9rem; text-align: center; }

/* En pantallas muy chicas el buscador se achica pero NUNCA se esconde:
   es el acceso principal del cliente desde el celular. */
@media (max-width: 420px) {
  .sr-header-busca-slot { margin: 0 6px; }
  .sr-header-busca { padding: 7px 10px; }
  .sr-header-busca input { font-size: .84rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   2) HERO CON SLIDER DE FOTOS (4 o mas)
   ══════════════════════════════════════════════════════════════════════ */
#hero-section { position: relative; overflow: hidden; min-height: 520px; }
#hero-section .sr-hero-slider {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
}
#hero-section .sr-hero-slider .swiper-wrapper,
#hero-section .sr-hero-slider .swiper-slide { width: 100%; height: 100%; }
#hero-section .sr-hero-slider .swiper-slide {
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
#hero-section .sr-hero-slider .swiper-pagination { bottom: 10px; z-index: 3; }
#hero-section .sr-hero-slider .swiper-pagination-bullet { background: #fff; opacity: .55; }
#hero-section .sr-hero-slider .swiper-pagination-bullet-active { opacity: 1; background: var(--accent-color, #fbbf24); }
#hero-section .sr-hero-contenido { position: relative; z-index: 2; }

/* ══════════════════════════════════════════════════════════════════════
   3) BARRA RAPIDA DE CATEGORIAS, PEGADA ABAJO
   El cliente pidio que la botonera de categorias este siempre a la vista,
   pegada al pie, tanto en PC como en celular.
   ══════════════════════════════════════════════════════════════════════ */
#sr-bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 880;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sr-borde);
  box-shadow: 0 -6px 22px rgba(0, 0, 0, .08);
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom, 0px));
}
#sr-bottom-bar .sr-menu-wrap { margin: 0; width: 100%; position: static; }
#sr-bottom-bar .sr-pills { display: flex; gap: 8px; padding: 0 12px; margin: 0; overflow: visible; }
#sr-bottom-bar .swiper { padding-bottom: 0 !important; }
#sr-bottom-bar .swiper-slide { width: auto; }

/* Normaliza las "cintas" azules: cualquier pastilla vuelve a ser pastilla,
   redonda y legible, en cualquier navegador. */
#sr-bottom-bar .sr-pill,
.sr-pill-normal {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: var(--sr-fondo-suave);
  color: var(--sr-texto);
  border: 1px solid var(--sr-borde);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: none !important;
  transform: none !important;
  clip-path: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  overflow: visible !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  position: static !important;
}
#sr-bottom-bar .sr-pill:hover { background: #e0e7ff; }
#sr-bottom-bar .sr-pill.sr-pill-activo {
  background: var(--primary-color, #2563eb);
  color: #fff;
  border-color: var(--primary-color, #2563eb);
}
#sr-bottom-bar .sr-pill i { font-size: .8rem; }

/* el contenido no queda tapado por la barra */
body.sr-con-barra { padding-bottom: calc(var(--sr-bar-h) + env(safe-area-inset-bottom, 0px)); }

/* los botones flotantes suben para no chocar con la barra */
body.sr-con-barra .whatsapp-fab { bottom: calc(var(--sr-fab-wa-bottom) + var(--sr-bar-h)) !important; }
body.sr-con-barra #sr-tv-fab    { bottom: calc(var(--sr-fab-tv-bottom) + var(--sr-bar-h)) !important; }
body.sr-con-barra .sr-btn-arriba{ bottom: calc(var(--sr-fab-top-bottom) + var(--sr-bar-h)) !important; }
/* el panel de Falero TV tambien */
body.sr-con-barra #sr-tv-flotante { bottom: calc(216px + var(--sr-bar-h)) !important; }

@media (max-width: 1023px) {
  :root { --sr-bar-h: 56px; }
  #sr-bottom-bar .sr-pill { padding: 7px 12px; font-size: .8rem; }
}
@media (max-height: 620px) {
  #sr-bottom-bar { padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px)); }
}

/* ══════════════════════════════════════════════════════════════════════
   4) BOTON "SUMAR AL CARRITO" EN CADA TARJETA DE PRODUCTO
   Faltaba por completo: el cliente no tenia como agregar nada.
   ══════════════════════════════════════════════════════════════════════ */
.slide-card { position: relative; }
.sr-card-add {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-color, #2563eb);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .45);
  transition: transform .15s, background .15s;
}
.sr-card-add:hover { transform: translateY(-2px); }
.sr-card-add:active { transform: scale(.96); }
.sr-card-add.sr-add-ok { background: #10b981; box-shadow: 0 8px 20px rgba(16, 185, 129, .45); }
.sr-card-add i { font-size: .82rem; }

/* el overlay de la tarjeta no debe tapar el boton */
.slide-card-overlay { z-index: 2; }

/* ══════════════════════════════════════════════════════════════════════
   5) AJUSTES DE CONVIVENCIA CON v71 (no romper nada de lo que ya anda)
   ══════════════════════════════════════════════════════════════════════ */
#header { z-index: 100; }
#header .sr-top { position: relative; z-index: 41; }
/* el titulo del header se achica antes de que el buscador se comprima */
@media (max-width: 640px) {
  #header .sr-brand-name { display: none; }
}
@media (max-width: 860px) and (min-width: 641px) {
  #header .sr-brand-name { font-size: .95rem; }
}
/* accesibilidad: foco visible */
.sr-pill:focus-visible,
.sr-card-add:focus-visible,
.sr-header-busca:focus-within { outline: 2px solid var(--primary-color, #2563eb); outline-offset: 2px; }
