/* bento-home.css — rediseño móvil bento; cargar DESPUÉS de style.css (override legacy). Breakpoint único 760px. */

:root {
  --sv-verde: #009546;
  --sv-esmeralda: #00713a;
  --sv-profundo: #0a3d23;
  --sv-whatsapp: #25d366;
  --sv-fondo: #f6f8f5;
  --sv-panel: #ffffff;
  --sv-tinta: #11221a;
  --sv-gris: #5f6f66;
  --sv-linea: #e4eae3;
  --bento-radius: 18px;
  --bento-gap: 8px;
  /* sombra tintada verde profundo, no gris (DESIGN.md) */
  --bento-shadow: 0 1px 8px rgba(10, 61, 35, 0.07);
}

/* ---------- Ritmo de secciones + títulos display ---------- */

.product_section,
.noticias_section,
.proveedores {
  background: var(--sv-fondo);
  padding: clamp(28px, 6vw, 56px) 0;
}

.product_section h2,
.noticias_section .noticias-title,
.proveedores .prov_container h2 {
  font-family: "Poppins", sans-serif;
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--sv-tinta);
  text-align: center;
  margin: 0 auto clamp(18px, 4vw, 30px);
  padding: 0 16px;
}

/* ---------- Carousel hero (solo móvil) ---------- */

@media (max-width: 759.98px) {
  /* altura contenida: override del height:100vh/auto legacy de style.css */
  .carousel-section,
  .carousel-section .carousel-item,
  .carousel-section .carousel-item img {
    min-height: 0;
    height: min(72svh, 620px);
  }

  .carousel-section .carousel-item img {
    width: 100%;
    object-fit: cover;
  }

  /* Caption como tarjeta glass anclada abajo, texto fluido sin <br> */
  .carousel-caption,
  .carousel-section .carousel-caption,
  .carousel-section .carousel-caption.d-md-block {
    top: auto;
    bottom: clamp(56px, 9svh, 88px);
    left: 16px;
    right: 16px;
    transform: none;
    width: auto;
    max-width: none;
    background: rgba(10, 61, 35, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: var(--bento-radius);
    padding: 14px 16px;
    text-align: left;
  }

  .carousel-caption h5,
  .carousel-section .carousel-caption h5 {
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    line-height: 1.35;
    text-align: left;
  }

  /* Los saltos manuales del copy están pensados para desktop */
  .carousel-caption h5 br {
    display: none;
  }

  /* Swipe nativo de Bootstrap: las flechas de 40px estorban en móvil */
  .carousel-section .carousel-control-prev,
  .carousel-section .carousel-control-next {
    display: none;
  }

  .carousel-section .carousel-indicators {
    margin-bottom: 1.25rem;
  }

  .carousel-section .carousel-indicators [data-bs-target] {
    width: 22px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    /* Área táctil de 24px; solo la franja central de 4px es visible */
    padding: 10px 0;
    background-clip: content-box;
  }
}

/* ---------- Categorías: bento grid ---------- */

.matriz.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bento-gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.bento-tile {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  background: var(--sv-panel);
  border-radius: var(--bento-radius);
  overflow: hidden;
  box-shadow: var(--bento-shadow);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bento-tile--wide {
  grid-column: 1 / -1;
}

.bento-tile:active {
  transform: scale(0.98);
}

.bento-tile:hover {
  box-shadow: 0 4px 16px rgba(10, 61, 35, 0.12);
  text-decoration: none;
}

.bento-tile__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.bento-tile--wide .bento-tile__img {
  aspect-ratio: 21 / 10;
}

.bento-tile__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  flex: 1;
}

.bento-tile__label {
  font-family: "Poppins", sans-serif;
  font-size: clamp(0.92rem, 3.6vw, 1.05rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--sv-tinta);
  line-height: 1.25;
  margin: 0;
}

.bento-tile__hint {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4ef;
  color: var(--sv-esmeralda);
}

.bento-tile__hint i {
  font-size: 13px;
}

@media (min-width: 760px) {
  .matriz.bento-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  /* 8 categorías = 2 filas exactas de 4; sin celdas vacías */
  .bento-tile--wide {
    grid-column: span 1;
  }

  .bento-tile--wide .bento-tile__img {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Noticias: tarjetas bento ---------- */

.noticias_section .noticias_matriz {
  display: flex;
  flex-direction: column;
  gap: var(--bento-gap);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.noticias_section .noticia {
  background: var(--sv-panel);
  border-radius: var(--bento-radius);
  overflow: hidden;
  box-shadow: var(--bento-shadow);
  display: flex;
  flex-direction: column;
}

.noticias_matriz .noticia img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  display: block;
}

.noticias_section .noticia h3 {
  font-size: clamp(1.05rem, 4.2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--sv-tinta);
  margin: 0;
  padding: 14px 16px 0;
}

.noticias_section .noticia p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--sv-gris);
  margin: 0;
  padding: 8px 16px 0;
}

.noticias_section .noticia h5 {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--sv-tinta);
  margin: 0;
  padding: 10px 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "Leer más" como botón real ≥44px, no link gris suelto */
.noticias_section .noticia a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 44px;
  padding: 10px 20px;
  margin: 12px 16px 16px;
  background: var(--sv-esmeralda);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.noticias_section .noticia a:hover {
  background: var(--sv-profundo);
  color: #ffffff;
}

.noticias_section .noticias-laterales {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bento-gap);
}

.noticias_section .noticias-laterales .noticia img {
  aspect-ratio: 16 / 10;
}

.noticias_section .noticias-laterales .noticia a {
  min-height: 44px;
  padding: 8px 14px;
  margin: 10px 12px 12px;
  font-size: 0.82rem;
}

@media (min-width: 992px) {
  .noticias_section .noticias_matriz {
    flex-direction: row;
    align-items: stretch;
  }

  .noticias_section .noticia-principal {
    flex: 1.4;
  }

  .noticias_section .noticia-principal .noticia {
    height: 100%;
  }

  .noticias_section .noticias-laterales {
    flex: 1;
    grid-template-columns: 1fr;
  }
}

/* ---------- Proveedores: 2 filas deslizables, auto-scroll + drag ----------
   js/proveedores-marquee.js mueve scrollLeft solo mientras nadie la toca, en mouse y touch por
   igual. overflow-x:auto real (no transform/overflow:hidden): así el drag nativo funciona sin
   JS de por medio y no depende de mask-image, que renderiza mal en algunos navegadores Android.
   Sin panel propio -DESIGN.md: nunca panel sobre panel-: los logos van sobre el fondo blanco
   que ya tenía .prov_container (style.css). */

.proveedores .prov_container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.sv-partners {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 0;
}

.sv-partners__row {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sv-partners__row::-webkit-scrollbar {
  display: none;
}

@media (pointer: fine) {
  .sv-partners__row {
    cursor: grab;
  }

  .sv-partners__row.sv-partners__row--arrastrando {
    cursor: grabbing;
    user-select: none;
  }
}

.sv-partners__track {
  display: flex;
  width: max-content;
}

.sv-partners__group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 28px;
  padding: 0 16px;
}

.sv-partners__group img {
  flex: 0 0 auto;
  height: 48px;
  width: auto;
  object-fit: contain;
  -webkit-user-drag: none;
}

@media (min-width: 760px) {
  .sv-partners__group {
    gap: 56px;
    padding: 0 28px;
  }

  .sv-partners__group img {
    height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sv-partners__group:nth-child(2) {
    display: none;
  }
}

/* ---------- Banner SAGRILAFT: compacto en móvil ---------- */

#banner-toggle {
  display: none;
}

@media (max-width: 759.98px) {
  #banner {
    font-size: 0.78rem;
    flex-wrap: wrap;
    align-items: flex-start;
    text-align: left;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -2px 10px rgba(10, 61, 35, 0.15);
  }

  #banner p {
    flex: 1;
    margin: 0;
    padding: 10px 4px 10px 14px;
  }

  /* Colapsado: 2 líneas + "Ver más"; el legal completo queda a un tap */
  #banner:not(.expanded) p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #banner:not(.expanded) p br {
    display: none;
  }

  #banner-toggle {
    display: inline-flex;
    align-items: center;
    order: 3;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    background: none;
    border: 0;
    color: var(--sv-esmeralda);
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
  }

  #banner #close-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- Motion funcional (DESIGN.md) ---------- */

@media (prefers-reduced-motion: reduce) {
  .bento-tile,
  .noticias_section .noticia a {
    transition: none;
  }

  .bento-tile:active {
    transform: none;
  }
}
