/* =============================================
   HARVESTCHILE — DESKTOP FIX v2
   Agregar al final de los CSS en header.php:
   <link rel="stylesheet" href="/assets/style_desktop_fix.css">
   ============================================= */

/* ══════════════════════════════════════════════
   DESKTOP (≥ 641px)
   El HTML de index.php tiene 3 hijos en .product-card:
     1. .product-card__img
     2. .product-card__body
     3. .product-card__chevron
   (NO hay .product-card__circle en el HTML)
   → grid de 3 columnas: imagen | texto | flecha
══════════════════════════════════════════════ */

@media (min-width: 641px) {

  /* ── LAYOUT BODY / MAIN ── */
  html { height: 100%; overflow: hidden; }
  body { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .site-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* ── HERO INDEX ── */
  .hero-inner {
    grid-template-columns: 1fr 1.1fr !important;
    min-height: 480px !important;
    align-items: stretch !important;
  }
  .hero-text-wrap {
    padding: 52px 40px 52px 0 !important;
  }
  .hero-text-wrap h1 {
    font-size: clamp(1.6rem, 4.5vw, 2.8rem) !important;
    line-height: 1.1 !important;
    margin-bottom: 14px !important;
  }
  .eyebrow       { font-size: .68rem !important; margin-bottom: 10px !important; }
  .hero-desc     { display: block !important; }
  .hero-badges   { display: flex !important; }
  .hero-dots     { display: flex !important; }
  .hero-actions  { gap: 10px !important; margin-bottom: 24px !important; flex-direction: row !important; }
  .hero-actions .btn { font-size: .85rem !important; padding: 12px 24px !important; }
  .hero-visual   { padding: 32px 0 !important; justify-content: center !important; }
  .hero-visual img { max-width: 560px !important; width: 100% !important; }

  /* ── PRODUCT CARDS — 3 columnas reales (sin círculo) ── */
  .product-card__circle { display: none !important; }   /* no está en el HTML → ocultar siempre */

  .product-card {
    display: grid !important;
    grid-template-columns: 140px 1fr 32px !important;   /* img | texto | flecha */
    grid-template-rows: auto !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 20px 24px !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }

  /* Imagen: columna 1 */
  .product-card__img {
    width: 140px !important;
    height: 110px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    background: none !important;
  }
  .product-card__img img {
    width: auto !important;
    height: auto !important;
    max-width: 140px !important;
    max-height: 110px !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Texto: columna 2 */
  .product-card__body { padding: 0 !important; min-width: 0 !important; }
  .product-card__body h3 {
    font-size: .95rem !important;
    font-weight: 900 !important;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    color: var(--text) !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
  }
  .product-card__body p {
    font-size: .83rem !important;
    margin-bottom: 6px !important;
    line-height: 1.6 !important;
    display: block !important;
    color: var(--text-soft) !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  .product-card__cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: .78rem !important;
    font-weight: 700 !important;
    color: var(--teal-dark) !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
  }

  /* Flecha: columna 3 */
  .product-card__chevron {
    font-size: 1.6rem !important;
    color: var(--gray-light) !important;
    align-self: center !important;
    text-align: right !important;
    flex-shrink: 0 !important;
  }
  .product-card:hover .product-card__chevron { color: var(--teal-mid) !important; }

  /* ── PAGE HERO SPLIT ── */
  .page-hero__inner--split {
    flex-direction: row !important;
    align-items: center !important;
    gap: 32px !important;
    padding: 44px 20px 40px !important;
    flex-wrap: nowrap !important;
  }
  .page-hero__text { flex: 1 !important; min-width: 0 !important; }
  .page-hero__inner--split h1   { font-size: clamp(1.6rem, 4.5vw, 2.8rem) !important; line-height: 1.1 !important; }
  .page-hero__inner--split p    { font-size: 1rem !important; }
  .page-hero__inner--split .hero-checks { display: flex !important; }
  .page-hero__inner--split .btn { font-size: .85rem !important; padding: 12px 24px !important; }
  .page-hero__img-wrap {
    flex: 0 0 auto !important;
    width: 420px !important;
    justify-content: flex-end !important;
  }
  .page-hero__product-img { max-width: 420px !important; width: 100% !important; }

  /* ── INDUSTRIES ── */
  .industries-grid     { grid-template-columns: repeat(6, 1fr) !important; gap: 12px !important; }
  .industries-grid--7  { grid-template-columns: repeat(7, 1fr) !important; }
  .industry-icon       { width: 52px !important; height: 52px !important; font-size: 1.4rem !important; }
  .industry-card h4    { font-size: .68rem !important; }

  /* ── FOOTER ── */
  .footer-compact { display: flex !important; }
  .footer-brands  { display: block !important; }
  .footer-bottom-bar {
    flex-direction: row !important;
    justify-content: space-between !important;
    padding: 8px 20px !important;
  }
  .footer-bottom-links a:nth-child(1),
  .footer-bottom-links a:nth-child(2) { display: inline !important; }

  /* ── SPACER: nunca en desktop ── */
  .below-fold-spacer { display: none !important; }
}

/* ══════════════════════════════════════════════
   TABLET (641px – 900px)
══════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr !important; min-height: auto !important; }
  .hero-text-wrap { padding: 40px 0 20px !important; }
  .hero-visual { padding: 20px 0 36px !important; }
  .hero-visual img { max-width: 340px !important; }

  .page-hero__img-wrap   { width: 280px !important; }
  .page-hero__product-img { max-width: 280px !important; }

  .industries-grid    { grid-template-columns: repeat(3, 1fr) !important; }
  .industries-grid--7 { grid-template-columns: repeat(4, 1fr) !important; }

  .product-card {
    grid-template-columns: 110px 1fr 24px !important;
    gap: 16px !important;
    padding: 16px 20px !important;
  }
  .product-card__img     { width: 110px !important; height: 90px !important; }
  .product-card__img img { max-width: 110px !important; max-height: 90px !important; }
}

/* ══════════════════════════════════════════════
   MÓVIL (≤ 640px): imágenes un poco más pequeñas
   sin romper los espacios del spacer
══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .product-card__circle { display: none !important; }

  .product-card {
    grid-template-columns: 80px 1fr 14px !important;
    padding: 0 14px !important;
    gap: 10px !important;
    height: calc((100dvh - 68px) * 0.58 / 3) !important;
  }
  .product-card__img {
    width: 80px !important;
    height: calc((100dvh - 68px) * 0.58 / 3 - 20px) !important;
    max-height: 86px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }
  .product-card__img img {
    width: auto !important;
    height: auto !important;
    max-width: 80px !important;
    max-height: 86px !important;
    object-fit: contain !important;
    display: block !important;
  }
  .product-card__body h3 {
    font-size: .78rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }
  .product-card__body p  { font-size: .65rem !important; -webkit-line-clamp: 2 !important; display: -webkit-box !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
  .product-card__cta     { font-size: .6rem !important; }
  .product-card__chevron { font-size: 1rem !important; }
}

@media (max-width: 380px) {
  .product-card {
    grid-template-columns: 64px 1fr 12px !important;
    padding: 0 10px !important;
    gap: 8px !important;
    height: calc((100dvh - 68px) * 0.60 / 3) !important;
  }
  .product-card__img {
    width: 64px !important;
    max-height: 72px !important;
  }
  .product-card__img img {
    max-width: 64px !important;
    max-height: 72px !important;
  }
  .product-card__body h3 { font-size: .68rem !important; }
  .product-card__body p  { font-size: .58rem !important; }
}