/*
       NOTA PARA REPLICACIÓN:
       - Plantilla A (con bolsas): usar .brand-hero-img + <img>
       - Plantilla B (sin bolsas): usar .brand-hero-img.brand-hero-img-gradient
       - Plantilla mixta (esta página): hero con imagen + sub-líneas con
         mezcla de .pcard-img (bolsas) y .pcard-img-icon (íconos)
       El resto de la estructura es idéntica.
    */

    /* ── Override de variables de marca (naranja Ecofértil) ──
       Las variables --brand-ecofertil-* están definidas en
       /css/agcagro.css. Este bloque solo las mapea a las variables
       genéricas --brand-accent-* que consumen los componentes. */
    :root {
      --brand-accent:        var(--brand-ecofertil);
      --brand-accent-dark:   var(--brand-ecofertil-dark);
      --brand-accent-lite:   var(--brand-ecofertil-lite);
      --brand-accent-tint:   var(--brand-ecofertil-tint);
      --brand-accent-border: var(--brand-ecofertil-border);
    }
/* ─── FIX RESPONSIVE ECOFERTIL ─── */
@media (max-width: 900px) {
  .eco-hero, .hero, section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
  }
  .eco-grid, .products-grid, .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
  }
  table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
  }
  [style*="width: 400px"], [style*="width: 260px"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ─── FIX REAL: Apilado de tarjetas en móvil ─── */
@media (max-width: 900px) {
  .subline-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .subline-grid > div, .subline-grid > a {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
  }
}

/* ─── FIX DEFINITIVO INTRO Y HERO (CIAMSA / ECOFERTIL) ─── */
@media (max-width: 900px) {
  /* 1. Apilar la intro (Logo arriba, texto abajo) */
  .brand-intro-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    padding: 2rem 1rem !important;
  }

  /* 2. Apilar las viñetas de beneficios */
  .brand-benefits {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.2rem !important;
    width: 100% !important;
  }

  /* 3. Asegurar que el texto no se desborde */
  .brand-intro-text, 
  .brand-benefit p, 
  .brand-intro-title {
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  /* 4. Arreglar el Hero de CIAMSA (el que tiene el gradiente) */
  .hero-groups {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    padding: 1rem !important;
  }
  
  .hero-group {
    width: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
  }

  .brand-hero {
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
  }

  .brand-hero-left, .brand-hero-right-inner {
    padding: 2rem 1rem !important;
    width: 100% !important;
  }

  /* 5. Reforzar las tarjetas de productos (por si acaso) */
  .subline-grid {
    grid-template-columns: 1fr !important;
  }
}
