/* ===========================
   HERO — HN Contra Incendios
   Mobile-first. Foto fija real, sin slideshow.
   Tokens locales: no tocar :root global.
   =========================== */

#hero {
  --hero-ink: #0F1216;
  --hero-line: rgba(255, 255, 255, 0.12);
  --hero-text: #FFFFFF;
  --hero-text-soft: rgba(255, 255, 255, 0.82);
  --hero-text-mute: rgba(255, 255, 255, 0.58);
  --hero-red: #F65F01;
  --hero-red-dark: #D14E00;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-ink);
  color: var(--hero-text);
}

/* ---- Slideshow de fondo (10 capas + crossfade + Ken Burns en tablet+) ---- */
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--hero-ink);
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: bottom center;
  background-repeat: no-repeat;
  opacity: 0;
  will-change: opacity;
  animation: hero-slide-fade 30s linear infinite;
}

/* Solo fade en mobile (sin zoom para no esconder partes de la imagen) */
@keyframes hero-slide-fade {
  0%     { opacity: 1; }
  8.33%  { opacity: 1; }
  10%    { opacity: 0; }
  98.33% { opacity: 0; }
  100%   { opacity: 1; }
}

/* Zoom Ken Burns — se aplica solo en tablet+ */
@keyframes hero-slide-zoom {
  0%     { transform: scale(1.01); }
  8.33%  { transform: scale(1.08); }
  10%    { transform: scale(1.085); }
  98.33% { transform: scale(1); }
  100%   { transform: scale(1.01); }
}

/* Shift de -0.5s + cada slide siguiente arranca 3s antes en el ciclo */
.hero-slide-1  { background-image: url('../../images/hero/hero-01.jpeg'); animation-delay: -0.5s;  }
.hero-slide-2  { background-image: url('../../images/hero/hero-02.jpeg'); animation-delay: -27.5s; }
.hero-slide-3  { background-image: url('../../images/hero/hero-03.jpeg'); animation-delay: -24.5s; }
.hero-slide-4  { background-image: url('../../images/hero/hero-04.jpeg'); animation-delay: -21.5s; }
.hero-slide-5  { background-image: url('../../images/hero/hero-05.jpeg'); animation-delay: -18.5s; }
.hero-slide-6  { background-image: url('../../images/hero/hero-06.jpeg'); animation-delay: -15.5s; }
.hero-slide-7  { background-image: url('../../images/hero/hero-07.jpeg'); animation-delay: -12.5s; }
.hero-slide-8  { background-image: url('../../images/hero/hero-08.jpeg'); animation-delay: -9.5s;  }
.hero-slide-9  { background-image: url('../../images/hero/hero-09.jpeg'); animation-delay: -6.5s;  }
.hero-slide-10 { background-image: url('../../images/hero/hero-10.jpeg'); animation-delay: -3.5s;  }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 14, 0.62) 0%,
    rgba(8, 10, 14, 0.82) 55%,
    rgba(8, 10, 14, 0.96) 100%
  );
}

/* ---- Contenido ---- */
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 22px 44px;
  min-height: 100vh; /* fallback */
  min-height: 100svh;
  justify-content: center;
  animation: hero-fadein 0.5s ease-out both;
}

@keyframes hero-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- H1 ---- */
.hero-title {
  margin: 0;
  font-size: clamp(2rem, 9.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--hero-text);
  text-wrap: balance;
  max-width: 14ch;
}

/* ---- Sub ---- */
.hero-sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--hero-text-soft);
  max-width: 40ch;
  font-weight: 400;
}

/* ---- Acciones ---- */
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  background: var(--hero-red);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s ease, transform 0.12s ease;
}

.hero-cta-primary i {
  font-size: 1.25em;
  line-height: 1;
}

.hero-cta-primary:hover,
.hero-cta-primary:focus-visible {
  background: var(--hero-red-dark);
  color: #fff;
}

.hero-cta-primary:active {
  transform: translateY(1px);
}

.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px 22px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hero-cta-secondary:hover,
.hero-cta-secondary:focus-visible {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.hero-cta-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.hero-cta-secondary:hover .hero-cta-arrow,
.hero-cta-secondary:focus-visible .hero-cta-arrow {
  transform: translateX(3px);
}

.hero-cta-primary:focus-visible,
.hero-cta-secondary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---- Stats strip (debajo del primer viewport, dentro del #hero) ---- */
.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  isolation: isolate;
  overflow: hidden;
}

.hero-stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../images/hero/hero-01.jpeg');
  background-size: cover;
  background-position: center center;
  z-index: -2;
}

.hero-stats::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    150deg,
    rgba(8, 18, 32, 0.88) 0%,
    rgba(15, 18, 22, 0.92) 100%
  );
  z-index: -1;
}

.hero-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 22px 26px;
}

.hero-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stat-value span {
  color: var(--hero-red);
  font-weight: 800;
}

.hero-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.1px;
  line-height: 1.4;
  margin-top: 0;
}

/* ---- Testimonio estilo Google card ---- */
.hero-testimonial {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px 36px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-testimonial-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-testimonial-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-testimonial-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hero-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-testimonial-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.hero-testimonial-info strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #202124;
}

.hero-testimonial-stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.hero-testimonial-stars i {
  color: #f5c518;
  font-size: 12px;
}

.hero-testimonial-time {
  font-size: 11px;
  color: #70757a;
  margin-left: 4px;
}

.hero-testimonial-quote {
  font-size: 13.5px;
  color: #3c4043;
  line-height: 1.58;
  margin: 0;
}

/* ---- Tablet (>= 640px) ---- */
@media (min-width: 640px) {
  /* En tablet/desktop sí suma el Ken Burns */
  .hero-slide {
    will-change: opacity, transform;
    animation-name: hero-slide-fade, hero-slide-zoom;
    animation-duration: 30s, 30s;
    animation-timing-function: linear, linear;
    animation-iteration-count: infinite, infinite;
  }

  .hero-content {
    padding: 132px 32px 56px;
    gap: 22px;
  }

  .hero-title {
    font-size: clamp(2.5rem, 6vw, 3.4rem);
    max-width: 18ch;
  }

  .hero-sub {
    font-size: 1.0625rem;
    max-width: 48ch;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-cta-primary,
  .hero-cta-secondary {
    width: auto;
    flex: 0 0 auto;
    min-width: 180px;
  }

  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-stat {
    padding: 38px 28px 30px;
  }

  .hero-stat-value {
    font-size: 2.5rem;
  }

  .hero-testimonial {
    padding: 28px 28px 40px;
  }
}

/* ---- Desktop (>= 1024px) ---- */
@media (min-width: 1024px) {
  .hero-content {
    padding: 160px 40px 80px;
    gap: 26px;
  }

  .hero-title {
    font-size: 3.75rem;
    max-width: 18ch;
  }

  .hero-sub {
    font-size: 1.125rem;
    max-width: 56ch;
  }

  .hero-stat {
    padding: 44px 32px 36px;
  }

  .hero-stat-value {
    font-size: 2.75rem;
  }

  .hero-stat-label {
    font-size: 13px;
  }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-content { animation: none; }
  .hero-cta-primary,
  .hero-cta-secondary,
  .hero-cta-arrow {
    transition: none;
  }
  .hero-slide { animation: none; opacity: 0; }
  .hero-slide-1 { opacity: 1; }
}

/* ===========================
   BOTONES GENÉRICOS (otras secciones del home)
   Se conservan tal cual del archivo previo para no romper
   estilos en proyectos, servicios, contacto, etc.
   =========================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--naranja);
  color: var(--blanco);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--naranja-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(242, 99, 34, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--gris-medio);
  color: var(--gris-texto);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--celeste);
  color: var(--celeste);
}
