/*
 * hero.css — Componente Hero
 * Regla de oro: CERO colores hardcoded. Todo referencia tokens CSS.
 * El layout no cambia por giro, personalidad ni densidad.
 * Solo cambian los valores de los tokens que ya están en :root.
 */

/* ── Contenedor raíz ─────────────────────────────────────────────────── */
#hero-root {
  background-color: var(--fw-bg);
  color: var(--fw-text);
  font-family: var(--fw-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
}

/* ── Hero: wrapper principal ─────────────────────────────────────────── */
.fw-hero {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.fw-hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Navegación ───────────────────────────────────────────────────────── */
.fw-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--fw-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fw-border);
  transition: background var(--fw-transition) ease;
}

.fw-nav-inner {
  max-width: var(--fw-max-width);
  margin: 0 auto;
  padding: 0 calc(var(--fw-space-md) * var(--fw-density));
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fw-space-md);
}

.fw-nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.fw-nav-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.fw-nav-logo-text {
  font-size: var(--fw-text-sm);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--fw-text);
  white-space: nowrap;
}

.fw-nav-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fw-text-sm);
  font-weight: 700;
  color: var(--fw-accent);
  min-height: 44px;
  padding: 0 12px 0 8px;
  border-radius: var(--fw-radius-full);
  border: 1.5px solid color-mix(in srgb, var(--fw-accent) 28%, transparent);
  transition: background var(--fw-transition) ease, color var(--fw-transition) ease;
  white-space: nowrap;
}

.fw-nav-phone:hover,
.fw-nav-phone:focus-visible {
  background: color-mix(in srgb, var(--fw-accent) 8%, transparent);
}

.fw-nav-phone-text {
  display: none; /* visible en desktop */
}

/* ── Foto del hero ────────────────────────────────────────────────────── */
.fw-photo {
  position: relative;
  width: 100%;
  height: var(--fw-photo-height-mobile);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 56px; /* altura del nav */
}

.fw-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fw-photo--generated {
  /* La foto generativa usa background de photo.js — ver index.html */
}

.fw-photo-overlay {
  position: absolute;
  inset: 0;
}

.fw-photo-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--fw-gradient-end) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Contenido: identity + trust ─────────────────────────────────────── */
.fw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--fw-space-lg) * var(--fw-density)) calc(var(--fw-space-md) * var(--fw-density));
  padding-bottom: calc(var(--fw-space-xl) * var(--fw-density));
  gap: calc(var(--fw-space-lg) * var(--fw-density));
  max-width: var(--fw-max-width);
  margin: 0 auto;
  width: 100%;
}

/* ── Identidad del negocio ────────────────────────────────────────────── */
.fw-identity {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fw-category {
  font-size: var(--fw-text-xs);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fw-text-muted);
  margin-bottom: calc(var(--fw-space-sm) * var(--fw-density));
}

.fw-rule {
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--fw-accent);
  margin-bottom: calc(var(--fw-space-sm) * var(--fw-density));
  flex-shrink: 0;
}

.fw-name {
  font-size: clamp(var(--fw-text-3xl), 9vw, var(--fw-text-5xl));
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 0.92;
  color: var(--fw-text);
  text-wrap: balance;
  margin-bottom: calc(var(--fw-space-sm) * var(--fw-density));
}

.fw-slogan {
  font-size: var(--fw-text-base);
  color: var(--fw-text-muted);
  line-height: 1.55;
  font-style: italic;
  margin-bottom: calc(var(--fw-space-lg) * var(--fw-density));
  text-wrap: balance;
  max-width: 38ch;
}

/* ── CTAs ─────────────────────────────────────────────────────────────── */
.fw-actions {
  display: flex;
  flex-direction: column;
  gap: calc(var(--fw-space-sm) * var(--fw-density));
}

.fw-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 calc(var(--fw-space-xl) * var(--fw-density));
  background: var(--fw-text);
  color: var(--fw-bg);
  font-size: var(--fw-text-sm);
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: var(--fw-radius-full);
  transition: opacity var(--fw-transition) ease, transform var(--fw-transition) ease;
  text-align: center;
}

.fw-cta-primary:hover,
.fw-cta-primary:focus-visible {
  opacity: 0.88;
  transform: translateY(-1px);
}

.fw-cta-primary:active {
  opacity: 1;
  transform: translateY(0);
}

.fw-cta-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 calc(var(--fw-space-xl) * var(--fw-density));
  background: transparent;
  color: var(--fw-text);
  font-size: var(--fw-text-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: var(--fw-radius-full);
  border: 1.5px solid var(--fw-border);
  transition: background var(--fw-transition) ease, border-color var(--fw-transition) ease;
  text-align: center;
}

.fw-cta-secondary:hover,
.fw-cta-secondary:focus-visible {
  background: var(--fw-surface);
  border-color: color-mix(in srgb, var(--fw-text) 30%, transparent);
}

/* ── Trust block ──────────────────────────────────────────────────────── */
.fw-trust {
  display: flex;
  flex-direction: column;
  gap: calc(var(--fw-space-sm) * var(--fw-density));
  padding-top: calc(var(--fw-space-md) * var(--fw-density));
  border-top: 1px solid var(--fw-border);
}

.fw-trust-rating {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fw-trust-stars {
  font-size: 14px;
  color: var(--fw-accent);
  letter-spacing: 1px;
}

.fw-trust-rating-val {
  font-size: var(--fw-text-sm);
  font-weight: 800;
  color: var(--fw-text);
  font-variant-numeric: tabular-nums;
}

.fw-trust-metrics {
  display: flex;
  gap: 0;
}

.fw-trust-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: calc(var(--fw-space-md) * var(--fw-density));
}

.fw-trust-metric + .fw-trust-metric {
  padding-left: calc(var(--fw-space-md) * var(--fw-density));
  padding-right: 0;
  border-left: 1px solid var(--fw-border);
}

.fw-trust-metric-val {
  font-size: var(--fw-text-xl);
  font-weight: 900;
  letter-spacing: -0.8px;
  color: var(--fw-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.fw-trust-metric-lbl {
  font-size: var(--fw-text-xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fw-text-muted);
}

/* ── Transición de entrada ────────────────────────────────────────────── */
#hero-root:not(.fw-ready) .fw-hero {
  opacity: 0;
}

#hero-root.fw-ready .fw-hero {
  opacity: 1;
  transition: opacity var(--fw-transition-slow) ease;
}

/* ══════════════════════════════════════════════════════════════════════
   DESKTOP — breakpoint 768px
══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  .fw-nav-phone-text { display: inline; }

  .fw-nav-inner {
    height: 64px;
    padding: 0 calc(var(--fw-space-xl) * var(--fw-density));
  }

  /* Hero: layout 2 columnas en desktop */
  .fw-hero-inner {
    flex-direction: row;
    min-height: calc(100dvh - 0px);
    min-height: calc(100vh - 0px);
  }

  /* Foto: columna derecha */
  .fw-photo {
    position: fixed;  /* se queda fija mientras el contenido scrollea */
    top: 0; right: 0;
    width: var(--fw-photo-width-desktop);
    height: 100dvh;
    height: 100vh;
    margin-top: 0;
  }

  .fw-photo-gradient {
    height: 100%;
    background: linear-gradient(
      to right,
      var(--fw-gradient-end) 0%,
      transparent 40%
    );
  }

  /* Contenido: columna izquierda */
  .fw-content {
    width: calc(100% - var(--fw-photo-width-desktop));
    min-height: 100dvh;
    min-height: 100vh;
    padding: calc(var(--fw-space-2xl) * var(--fw-density)) calc(var(--fw-space-xl) * var(--fw-density));
    padding-top: calc(120px * var(--fw-density));
    justify-content: center;
  }

  /* CTAs en fila en desktop */
  .fw-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .fw-cta-primary,
  .fw-cta-secondary {
    width: auto;
    min-width: 180px;
  }

  /* Trust en fila */
  .fw-trust {
    flex-direction: row;
    align-items: center;
    gap: calc(var(--fw-space-lg) * var(--fw-density));
    flex-wrap: wrap;
  }

  .fw-name {
    font-size: clamp(var(--fw-text-4xl), 5.5vw, var(--fw-text-5xl));
  }
}

/* ── Desktop grande: limitar ancho del texto ─────────────────────────── */
@media (min-width: 1100px) {
  .fw-identity {
    max-width: 560px;
  }
}
