/* Componentes UI reutilizables */

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-bg-secondary);
    border-color: var(--color-accent);
}

.btn--primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
}

.btn--large {
    padding: 16px 32px;
    font-size: 1rem;
}

/* Sección header styling */
.section-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background-color: var(--color-accent);
    color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Utility: Reveal element */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Resaltado de texto */
.highlight {
    background-color: rgba(255, 220, 100, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Imágenes responsive con object-fit */
:root {
  --hero-bg:          #F9F7F3;
  --hero-ink:         #1C1C1A;
  --hero-ink-mid:     #5C5A55;
  --hero-ink-muted:   #8B7355;
  --hero-accent:      #C4894A;
  --hero-border:      #E0DBD3;
  --hero-border-lt:   #D4C5B0;
  --hero-font-display:'Cormorant Garamond', Georgia, serif;
  --hero-font-body:   'DM Sans', system-ui, sans-serif;
  --hero-radius:      4px;
}


/* ─── Sección ─────────────────────────────────────────── */
.hero {
  background-color: var(--hero-bg);
  padding: 80px 0 96px;
  overflow: hidden;
  position: relative;
}

/* Textura grain sutil */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Grid layout ─────────────────────────────────────── */
.hero__container {
  display: grid;
  grid-template-columns: 54fr 46fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ─── Columna texto ───────────────────────────────────── */
.hero__content {
  max-width: 560px;
}

/* eyebrow / etiqueta editorial */
.hero__eyebrow {
  margin-bottom: 28px;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--hero-font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hero-ink-muted);
  padding: 7px 14px;
  border: 1px solid var(--hero-border-lt);
  border-radius: 2px;
}

.hero__tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--hero-accent);
  flex-shrink: 0;
}

/* Titular principal */
.hero__title {
  font-family: var(--hero-font-display);
  font-size: clamp(2.8rem, 4.2vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--hero-ink);
  margin: 0 0 22px;
}

/* Itálica decorativa en el titular */
.hero__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--hero-accent);
}

/* Subtítulo */
.hero__subtitle {
  font-family: var(--hero-font-body);
  font-size: 16.5px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--hero-ink-mid);
  margin: 0 0 42px;
  max-width: 460px;
}

/* ─── CTAs ────────────────────────────────────────────── */
.hero__ctas {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

/* CTA primario: dark pill con flecha */
.hero .btn--primary.hero-btn-primary,
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--hero-font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--hero-bg);
  background-color: var(--hero-ink);
  padding: 14px 26px;
  border-radius: 2px;
  text-decoration: none;
  border: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.hero .btn--primary.hero-btn-primary:hover,
.hero-btn-primary:hover {
  background-color: #2e2e2b;
  transform: translateY(-1px);
}

.hero-btn-primary svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.hero-btn-primary:hover svg {
  transform: translateX(3px);
}

/* CTA secundario: texto con underline accent */
.hero .btn--secondary.hero-btn-ghost,
.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hero-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--hero-ink);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hero-accent);
  border-radius: 0;
  padding: 0 0 2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero .btn--secondary.hero-btn-ghost:hover,
.hero-btn-ghost:hover {
  color: var(--hero-accent);
}

/* ─── Stats ───────────────────────────────────────────── */
.hero__stats {
  display: flex;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--hero-border);
}

.hero__stats .stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 36px;
}

.hero__stats .stat__divider {
  width: 1px;
  height: 36px;
  background: var(--hero-border-lt);
  margin-right: 36px;
  flex-shrink: 0;
}

.hero__stats .stat__number {
  font-family: var(--hero-font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--hero-ink);
  letter-spacing: -0.025em;
}

.hero__stats .stat__label {
  font-family: var(--hero-font-body);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--hero-ink-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ─── Columna imagen ──────────────────────────────────── */
.hero__image {
  position: relative;
}

/* Dot-grid decorativo (esquina sup. derecha) */
.hero__image::before {
  content: '';
  position: absolute;
  top: -24px;
  right: -24px;
  width: 110px;
  height: 110px;
  background-image: radial-gradient(circle, #C4894A 1px, transparent 1px);
  background-size: 11px 11px;
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}

/* Línea vertical decorativa (lateral izquierdo) */
.hero__image::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 10%;
  height: 80%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--hero-accent) 40%, var(--hero-accent) 60%, transparent);
  opacity: 0.35;
  pointer-events: none;
}

/* Wrapper con efectos */
.hero__image-wrapper {
  position: relative;
  border-radius: var(--hero-radius);
  overflow: hidden;
  line-height: 0;
}

/* Marco interior sobre la imagen */
.hero__image-wrapper::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
}

/* Cast de color cálido */
.hero__image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(196, 137, 74, 0.07) 0%, rgba(196, 137, 74, 0) 55%);
  z-index: 1;
  pointer-events: none;
}

/* Imagen */
.hero__img {
    width: 100%;
    height: auto;
    display: block;
}

/* Badge flotante sobre la imagen */
.hero__image-badge {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(249, 247, 243, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--hero-font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hero-ink);
  padding: 8px 14px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.hero__image-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5a9e6f;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .hero {
    padding: 56px 0 64px;
  }

  .hero__container {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* imagen arriba en móvil */
  .hero__image {
    order: -1;
    margin-bottom: 40px;
  }

  .hero__image::before,
  .hero__image::after {
    display: none;
  }

  .hero__img {
    aspect-ratio: 16 / 9;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__ctas {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 40px;
  }

  .hero__stats {
    padding-top: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hero__stats::-webkit-scrollbar {
    display: none;
  }

  .hero__stats .stat {
    padding-right: 24px;
  }

  .hero__stats .stat__divider {
    margin-right: 24px;
  }
}

@media (max-width: 600px) {
  .hero__title {
    font-size: 2.4rem;
  }

  .hero__subtitle {
    font-size: 15.5px;
  }
}


.comparative-card__img,
.article-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.comparative-card:hover .comparative-card__img,
.article-card:hover .article-card__img {
    transform: scale(1.05);
}

.trust__img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.newsletter__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    opacity: 0.9;
}

.hero__img,
.comparative-card__img,
.article-card__img,
.trust__img,
.newsletter__img {
    display: block;       /* elimina el gap de inline-block */
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ── 2. Hero: eliminar el conflicto aspect-ratio 3/2 (layout.css)
         frente al 4/5 que queremos en portrait ───────────────── */
.hero__image-wrapper {
    overflow: hidden;
    border-radius: 6px;
}

.hero__img {
    /* Asegurar portrait independientemente del wrapper */
    aspect-ratio: 4 / 5;
    height: auto;          /* no forzar height: 100% cuando no hay padre definido */
}

/* ── 3. Contenedores de cards: position relative para overlays ── */
.comparative-card__image,
.article-card__image {
    position: relative;
    overflow: hidden;
}

/* Overlay hover — gradiente warm sutil desde abajo */
.comparative-card__image::after,
.article-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(28, 28, 26, 0.25) 0%,
        rgba(28, 28, 26, 0.05) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.comparative-card:hover .comparative-card__image::after,
.article-card:hover .article-card__image::after {
    opacity: 1;
}

/* Scale suave en hover (ya estaba, confirmamos también en img) */
.comparative-card__img,
.article-card__img {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.comparative-card:hover .comparative-card__img,
.article-card:hover .article-card__img {
    transform: scale(1.04);
}

/* ── 4. Trust section — aspect-ratio correcto y object-fit ──── */
.trust__img {
    aspect-ratio: 3 / 2;
    height: auto;          /* sobreescribe height: auto de base + fuerza ratio */
    object-fit: cover;
    object-position: center top;  /* prioriza la parte superior (persona/objeto) */
    border-radius: var(--radius-md, 8px);
    box-shadow: none;      /* el shadow lo da el .trust__visual-card */
}

/* ── 5. Newsletter — imagen cuadrada limpia ────────────────── */
.newsletter__img {
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: var(--radius-xl, 16px);
    object-position: center;
    opacity: 1;            /* sobreescribe el opacity: 0.9 original → más fidelidad */
}

.newsletter__visual {
    max-width: 280px;      /* un poco más pequeño para mejor proporción */
}

/* ── 6. Fallback — fondo mientras carga la imagen ──────────── */
.comparative-card__image,
.article-card__image,
.trust__visual-card {
    background-color: #F0EDE8;  /* warm off-white como placeholder */
}

.hero .hero__image-wrapper {
    background-color: #F0EDE8;
}

/* ── 7. Atributo loading="lazy" en Safari: fix flash ───────── */
img[loading="lazy"] {
    content-visibility: auto;
}