/* Variables globales */
:root {
  --black: #161a1d;
  --bg-overlay: rgba(22, 26, 29, 0.7);
  --blue: #ba181b;
  --blue-light: #d3d3d3;
  --white: #f5f3f4;
  --font-size-xs: clamp(1.2rem, 1.8vw, 1.4rem);
  --font-size-sm: clamp(1.4rem, 2.3vw, 1.6rem);
  --font-size-md: clamp(1.6rem, 2.8vw, 1.8rem);
  --font-size-lg: clamp(1.8rem, 3.3vw, 2rem);
  --font-size-xl: clamp(2rem, 3.8vw, 2.4rem);
  --font-size-2xl: clamp(2.4rem, 4.3vw, 3rem);
  --font-size-3xl: clamp(2.8rem, 5.3vw, 3.8rem);
}

/* Reset de estilos */
*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

/* Estilos generales para encabezados */
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  text-wrap: balance;
  text-align: center;
}

/* Estilos generales para imágenes */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Estilos generales para enlaces */
a {
  text-decoration: none;
  color: inherit;
  text-align: center;
}

/* Estilos generales para listas */
ul {
  list-style: none;
  text-align: center;
}

/* Estilos generales del documento */
html {
  scroll-behavior: smooth;
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: "Poppins", sans-serif;
  font-size: var(--font-size-md);
  font-weight: 400;
  line-height: 1.5;
  min-height: 200vh;
  text-align: center;
}

/* Clase para elementos solo visibles para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Estilos comunes para secciones principales */
.hero,
.how,
.about,
.features {
  padding-left: 20px;
  padding-right: 20px;
}

/* Estilos para secciones con imagen de fondo */
.hero,
.about {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 1;
}

.hero {
  background-image: url("./hero.webp");
}

.about {
  background-image: url("./about.webp");
}

/* Overlay para las secciones hero y about */
.hero::before,
.about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  z-index: -1;
}

/* Estilos para el contenido de las secciones hero y about */
.hero__content,
.about__content {
  position: relative;
  z-index: 2;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.2rem;
}

/* Estilos para el logo en la sección hero */
.hero__logo {
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 2px;
}

.hero__logo img {
  height: 200px;
}

.hero__logo figcaption {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2rem;
  color: #fff;
}

.hero__logo figcaption span {
  display: block;
  margin-top: -8px;
  font-weight: 400;
  color: var(--blue-light);
}

/* Estilos para el título principal en la sección hero */
.hero__title {
  font-size: var(--font-size-3xl);
  max-width: 60rem;
  font-weight: 600;
  color: var(--white);
  z-index: 3;
}

/* Estilos para el subtítulo en la sección hero */
.hero__subtitle {
  font-size: var(--font-size-xl);
  font-weight: 500;
  color: var(--blue-light);
  z-index: 3;
}

/* Estilos para los botones de llamada a la acción */
.cta-button {
  font-size: var(--font-size-md);
  font-weight: 500;
  background-color: var(--blue);
  color: var(--white);
  padding: 1.2rem 6.4rem;
  border-radius: 10px;
  z-index: 3;
  transition: all 0.4s;
  text-decoration: none;
  display: inline-block;
}

.cta-button:hover,
.cta-button:focus {
  background-color: var(--blue-light);
  color: var(--black);
  transform: scale(1.05);
  outline: none;
}

.cta-button:focus {
  box-shadow: 0 0 0 3px rgba(186, 24, 27, 0.5);
}

/* Estilos para la sección de servicios */
.services {
  color: var(--black);
  background-color: var(--white);
  width: 100%;
  padding: 96px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.services__title {
  font-size: var(--font-size-3xl);
  max-width: 60rem;
  font-weight: 600;
  margin-bottom: 40px;
}

.services__container {
  margin-top: 3.2rem;
  width: 100%;
  max-width: 1140px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: auto;
  gap: 20px;
}

.services__cta {
  margin-top: 32px;
}

/* Estilos para las tarjetas de servicios */
.card {
  width: 100%;
  height: 300px;
  box-shadow: 0px 0px 25px 0px rgba(0, 0, 0, 0.09);
  font-size: var(--font-size-lg);
  line-height: 1.2;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background-color: var(--white);
  padding: 5%;
  border-radius: 10px;
}

.card__icon {
  font-size: 36px !important;
  font-weight: 500;
}

/* Estilos para la sección "Acerca de" */
.about__title {
  font-size: var(--font-size-3xl);
  max-width: 60rem;
  font-weight: 600;
  color: var(--white);
  z-index: 3;
}

.about__description {
  max-width: 88rem;
  font-weight: 300;
  color: var(--white);
  z-index: 3;
  font-size: var(--font-size-md);
}

.about__subtitle {
  font-size: var(--font-size-xl);
  font-weight: 600;
  z-index: 3;
  color: var(--white);
}

.about__subtitle span {
  color: var(--blue-light);
}

/* Estilos para las secciones "Cómo funciona" y "Características" */
.how,
.features {
  width: 100%;
  background-color: var(--blue-light);
  padding: 96px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--black);
}

.how__title,
.features__title {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  margin-bottom: 32px;
}

.how__description,
.features__description {
  max-width: 740px;
}

.step__number,
.feature__icon {
  font-size: var(--font-size-lg);
  font-weight: 600;
  border-radius: 50%;
  border: 2px solid var(--black);
  height: 50px;
  width: 50px;
  display: grid;
  place-items: center;
  padding-top: 2px;
  background-color: var(--white);
}

.feature__icon {
  padding-top: 1rem;
}

.step__title,
.feature__title {
  font-size: var(--font-size-lg);
  font-weight: 500;
}

.steps,
.features__container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 32px;
  flex-wrap: wrap;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  margin-top: 32px;
}

.features__container {
  max-width: 960px;
}

.step,
.feature {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  font-size: var(--font-size-md);
  text-align: center;
}

.feature__description {
  max-width: 220px;
}

/* Estilos para la sección de crédito */
.credit {
  width: 100%;
  background-color: var(--white);
  padding: 96px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--black);
}

.credit__title {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  margin-bottom: 32px;
}

.credit__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

.credit__logo {
  width: 100px;
  height: auto;
}

/* Estilos para el pie de página */
.footer {
  width: 100%;
  background-color: var(--black);
  padding: 96px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--white);
}

.footer__title {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  margin-bottom: 32px;
}

.footer__locations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  width: 100%;
  max-width: 1140px;
}

.location {
  text-align: center;
  flex: 1;
  min-width: 480px;
}

.location__title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--blue-light);
}

.location__map {
  width: 100%;
  height: 0;
  padding-bottom: 75%;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.location__map iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Estilos para el botón flotante de WhatsApp */
.whatsapp-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
}

.whatsapp-button:hover,
.whatsapp-button:focus {
  background-color: #128c7e;
  transform: scale(1.1);
  outline: none;
}

.whatsapp-button:focus {
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.5);
}

.whatsapp-button__icon {
  width: 30px;
  height: 30px;
}

/* Estilos responsivos */
@media (max-width: 1200px) {
  .services__container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 992px) {
  .hero__title,
  .about__title,
  .services__title,
  .how__title,
  .features__title,
  .credit__title,
  .footer__title {
    font-size: var(--font-size-2xl);
    max-width: 100%;
  }

  .hero__subtitle,
  .about__subtitle {
    font-size: var(--font-size-xl);
  }

  .services__container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .card {
    height: 250px;
  }

  .card__title {
    font-size: var(--font-size-sm);
  }

  .steps,
  .features__container {
    flex-direction: column;
    align-items: center;
  }

  .step,
  .feature {
    max-width: 100%;
  }

  .step__description {
    max-width: 480px;
  }

  .footer__locations {
    flex-direction: column;
  }

  .location {
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero,
  .about {
    min-height: auto;
    padding: 64px 20px;
  }

  .services__container {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .about__description {
    padding: 0 20px;
  }

  .cta-button {
    padding: 1rem 4rem;
  }
}

@media (max-width: 576px) {
  .hero__title,
  .about__title,
  .services__title,
  .how__title,
  .features__title,
  .credit__title,
  .footer__title {
    font-size: var(--font-size-xl);
  }

  .feature__description {
    max-width: 160px;
  }

  .hero__subtitle,
  .about__subtitle {
    font-size: var(--font-size-lg);
  }

  .services__container {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    height: 220px;
  }

  .card__icon {
    font-size: 32px !important;
  }

  .card__title {
    font-size: var(--font-size-xs);
    line-height: 1.3;
  }

  .cta-button {
    font-size: var(--font-size-sm);
    padding: 1rem 3rem;
  }

  .step,
  .feature {
    font-size: var(--font-size-sm);
  }

  .location__title {
    font-size: var(--font-size-md);
  }

  .credit__logos {
    flex-direction: column;
  }

  .location__map {
    max-width: 100%;
    height: 300px;
  }
}

@media (max-width: 360px) {
  .services__container {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    height: 200px;
  }

  .card__icon {
    font-size: 28px;
  }

  .card__title {
    font-size: var(--font-size-xs);
  }

  .hero .cta-button,
  .about .cta-button,
  .services .cta-button {
    padding: 1rem 4rem;
  }
}

/* Ajustes para preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ajuste para iOS */
@supports (-webkit-touch-callout: none) {
  .hero,
  .about {
    background-attachment: scroll;
  }
}
