/* ==========================================================================
   PROSERMAT — Premium HERO 2026
   --------------------------------------------------------------------------
   FASE 3 · Sección 7 del plan UX/UI 2026.
   Refinamiento visual del hero principal del home: fondo verde profundo
   (brand-950), overlay de grain SVG, halo radial brand-600, tipografía
   editorial Playfair y CTAs jerarquizados.

   Convenciones:
     - Usa tokens de premium-tokens-2026.css (--color-brand-*, --space-*).
     - NO redefine variables — sólo aplica.
     - Se carga DESPUÉS de styles.css y de premium-home.css para sobre-escribir.
     - Compatible con markup existente: .hero-section / .hero-content /
       .hero-title (legacy) — aplicamos también el selector .hero por si el
       markup HOME usa la clase nueva.
   ========================================================================== */

/* ── Contenedor principal ─────────────────────────────────────────────── */
.hero-section,
.hero {
  position: relative;
  overflow: hidden;
  /* [FIX 2026-05-30] El markup del home NO tiene una 2ª columna real
     (la imagen va como background en .hero-bg, y los stats viven DENTRO
     de .hero-content). El grid 2-col anterior dejaba a .hero-content en una
     columna de ~336px → el texto se exprimía y el hero crecía a ~220vh.
     Ahora .hero es 1 columna: .hero-content ocupa el ancho completo y su
     propio grid interno (texto | stats, definido en premium-home.css) hace
     el layout de 2 columnas correctamente. */
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: clamp(500px, 80vh, 720px);

  /* Verde marca casi negro — base del hero */
  background-color: var(--color-brand-950);
  background-image:
    linear-gradient(135deg,
      var(--color-brand-950) 0%,
      var(--color-brand-900) 55%,
      var(--color-brand-800) 100%);
  isolation: isolate;
}

/* Si la vista trae imagen de fondo (--hero-bg-image), la mezclamos con el
   degradado oscuro para legibilidad sin perder presencia visual. */
.hero-section.hero-has-image,
.hero.hero-has-image {
  background-image:
    linear-gradient(135deg,
      rgba(10, 46, 26, 0.86) 0%,
      rgba(15, 69, 41, 0.72) 55%,
      rgba(21, 92, 56, 0.78) 100%),
    var(--hero-bg-image) center/cover no-repeat;
}

/* ── Overlay grain SVG noise (textura sutil) ──────────────────────────── */
.hero-section::before,
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ── Halo radial verde brand-600 desde lado derecho ───────────────────── */
.hero-section::after,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 75% at 92% 50%,
      rgba(31, 122, 77, 0.45) 0%,
      rgba(31, 122, 77, 0.18) 35%,
      transparent 70%),
    radial-gradient(ellipse 40% 60% at 8% 92%,
      rgba(10, 46, 26, 0.55) 0%,
      transparent 60%);
}

/* ── Contenido textual (lado izquierdo) ───────────────────────────────── */
.hero-content,
.hero__content {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 6vw, 88px) clamp(20px, 4vw, 64px);
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 20px);
}

/* ── Eyebrow / pretítulo ──────────────────────────────────────────────── */
.hero__eyebrow,
.hero-section .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 7px 16px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(61, 201, 126, 0.10);
  border: 1px solid rgba(61, 201, 126, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider, 0.08em);
  color: var(--color-brand-400, #3dc97e);
  margin-bottom: 0;
}

/* ── Título editorial (Playfair) ──────────────────────────────────────── */
.hero__title,
.hero-section .hero-title,
.hero .hero-title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  /* [FIX 2026-06-01] Antes usaba --text-hero (hasta 5.5rem ≈ 88px) → el título
     se comía toda la pantalla y parecía landing page, no ecommerce. Ahora una
     escala compacta y proporcional para que los productos se vean pronto. */
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight, -0.02em);
  color: #fff;
  margin: 0;
  text-wrap: balance;
}

/* El span dentro del hero-title actúa como el `<em>` decorativo de la
   especificación (italic + verde brand-400). NO requiere markup nuevo. */
.hero__title em,
.hero__title span,
.hero-section .hero-title span,
.hero .hero-title span {
  display: inline;
  font-style: italic;
  font-weight: 700;
  color: var(--color-brand-400, #3dc97e);
  background: linear-gradient(135deg,
    var(--color-brand-300, #6ddca0) 0%,
    var(--color-brand-400, #3dc97e) 60%,
    var(--color-brand-500, #22a05e) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Subtítulo ────────────────────────────────────────────────────────── */
.hero__sub,
.hero-section .hero-sub,
.hero .hero-sub {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: clamp(0.98rem, 0.9rem + 0.4vw, 1.18rem);
  line-height: var(--leading-relaxed, 1.7);
  color: rgba(255, 255, 255, 0.82);
  max-width: 56ch;
  margin: 0;
}

/* ── Group de CTAs ────────────────────────────────────────────────────── */
.hero__cta-group,
.hero-section .hero-actions,
.hero .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  align-items: center;
  margin: var(--space-4, 16px) 0 0;
}

/* Refuerzo visual del CTA primario en el hero */
.hero-section .hero-actions .btn-white,
.hero .hero-actions .btn-white {
  box-shadow: var(--shadow-xl, 0 20px 32px rgba(0, 0, 0, 0.25));
  transition: transform var(--duration-base, 220ms) var(--ease-out,
              cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow var(--duration-base, 220ms) ease;
}
.hero-section .hero-actions .btn-white:hover,
.hero .hero-actions .btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 42px rgba(0, 0, 0, 0.32);
}

/* Texto de envío (legacy) */
.hero-section .hero-shipping,
.hero .hero-shipping {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.86rem;
  margin: var(--space-3, 12px) 0 0;
  max-width: 56ch;
}

/* ── Stats laterales (lado derecho) ───────────────────────────────────── */
/* El bloque .ph-hero-stats vive ya en premium-home.css; aquí sólo lo
   reposicionamos para que ocupe la 2ª columna del grid en desktop. */
.hero-section .ph-hero-stats,
.hero .ph-hero-stats {
  position: relative;
  z-index: 2;
  align-self: stretch;
}

/* ── Trust strip inferior (legacy .hero-trust) ────────────────────────── */
.hero-section .hero-trust,
.hero .hero-trust {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
  margin: var(--space-6, 24px) clamp(20px, 4vw, 64px) clamp(24px, 4vw, 48px);
  padding-top: var(--space-5, 20px);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* ── Responsive: mobile <768 — stack vertical, centrado ───────────────── */
@media (max-width: 768px) {
  .hero-section,
  .hero {
    grid-template-columns: 1fr;
    min-height: clamp(440px, 78vh, 620px);
    text-align: center;
  }
  .hero-content,
  .hero__content {
    align-items: center;
    padding: clamp(36px, 8vw, 56px) clamp(18px, 5vw, 28px);
  }
  .hero__eyebrow,
  .hero-section .hero-badge { margin-inline: auto; }

  .hero__sub,
  .hero-section .hero-sub,
  .hero .hero-sub { margin-inline: auto; }

  .hero__cta-group,
  .hero-section .hero-actions,
  .hero .hero-actions { justify-content: center; }

  /* En mobile, el halo derecho se mueve al centro-abajo para no competir */
  .hero-section::after,
  .hero::after {
    background:
      radial-gradient(ellipse 80% 60% at 50% 100%,
        rgba(31, 122, 77, 0.40) 0%,
        rgba(31, 122, 77, 0.12) 40%,
        transparent 70%);
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-section .hero-actions .btn-white,
  .hero .hero-actions .btn-white { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   [FIX 2026-06-01] TÍTULO DEL HERO EN MÓVIL — evitar que se corte
   --------------------------------------------------------------------------
   El título traía un <br> que forzaba "Nutrición mineral para" en una sola
   línea; con la tipografía grande, en pantallas ≤600px esa línea era más ancha
   que el viewport y el overflow:hidden del hero la RECORTABA (se veía cortado).
   Aquí: tamaño proporcional al ancho, dejamos que el texto fluya natural
   (quitamos el <br>) y permitimos partir palabras larguísimas como respaldo.
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .hero-section .hero-title,
  .hero .hero-title,
  .hero-section .hero__title,
  .hero .hero__title {
    font-size: clamp(1.55rem, 7.6vw, 2.15rem) !important;
    line-height: 1.08 !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  /* En móvil el salto manual estorba: que el título fluya y envuelva solo. */
  .hero-section .hero-title br,
  .hero .hero-title br,
  .hero-section .hero__title br,
  .hero .hero__title br { display: none; }
}

