:root {
  --color-principal: #4dd21d;
  --color-fondo: #0a0a0a;
  --color-superficie: #1a1a1a;
  --color-texto: #f5f5f5;
  --color-texto-suave: #a3a3a3;
  --fuente-titulos: "Kanit", sans-serif;
  --fuente-texto: "Xmind", sans-serif;
}

@font-face {
  font-family: "Xmind";
  src: url("../fonts/Xmind-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Xmind";
  src: url("../fonts/Xmind-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Xmind";
  src: url("../fonts/Xmind-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Xmind";
  src: url("../fonts/Xmind-Bold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kanit";
  src: url("../fonts/Kanit-ExtraBoldItalic.ttf") format("truetype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  background-color: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--fuente-texto);
  font-size: 1.125rem;
  font-weight: 400;
}

main > section:not(.galeria) {
  max-width: 1200px; /* en pantallas grandes el contenido no se estira */
  margin-inline: auto;
  padding-bottom: 2rem;
}

h1 {
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(3rem, 12vw, 5rem);
  line-height: 1;
}

h1::after {
  content: "";
  display: block;
  width: 120px;
  height: 4px;
  margin: 1rem auto 0;
  background: var(--color-principal);
  border-radius: 2px;
  transform: skewX(-25deg);
}

h2 {
  font-family: var(--fuente-titulos);
  text-align: center;
  font-weight: 800;
  color: var(--color-texto);
  text-transform: uppercase;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-style: italic;
  text-wrap: balance;
  line-height: 1;
  padding: 20px 0;
}

h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  margin: 1rem auto 0;
  background: var(--color-principal);
  border-radius: 2px;
  transform: skewX(-25deg);
}

header {
  position: relative;
}

/**BARRA DE NAVEGACIÓN**/

.nav {
  background-color: var(--color-superficie);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1rem;
  margin: 0;
}

.nav__toggle {
  justify-self: start; /* pegado a la izquierda de su columna */
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.75rem; /* área táctil cómoda */
  background: none;
  border: none;
  cursor: pointer;
}

.nav__toggle[aria-expanded="true"] .nav__linea:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__linea:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__linea:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav__linea {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-principal);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav__logo {
  grid-column: 2; /* columna del medio */
}

.nav__logo img {
  display: block;
  height: 45px;
  width: auto;
  max-width: 100%;
}

.nav__menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--color-superficie);
  z-index: 10; /* para que quede por encima de las secciones */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px); /* arranca un poquito más arriba */
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0s linear 0.3s;
}

.nav__menu--abierto {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0s;
}

.nav__menu a {
  display: block;
  padding: 1rem;
  color: var(--color-texto);
  text-decoration: none;
  text-align: center;
  border-top: 1px solid black;
}

.nav__menu a:active {
  background-color: var(--color-principal);
  color: var(--color-superficie);
}

.nav__menu a:focus-visible {
  outline: 2px solid var(--color-principal);
  outline-offset: 2px;
}

/**GALERÍA**/

.galeria {
  position: relative;
}

.hero__contenido {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem 2rem;
  text-align: center;
  pointer-events: none;
}

.hero__contenido p {
  font-family: var(--fuente-texto);
  font-size: clamp(1.25rem, 6vw, 1.5rem);
}

.hero__contenido a {
  pointer-events: auto;
}

.boton {
  padding: 0.875rem 1.5rem;
  background: var(--color-principal);
  color: var(--color-fondo);
  font-family: var(--fuente-texto);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0.5rem;
}

.galeria__lista {
  position: relative;
  height: 75svh;
  min-height: 400px;
  list-style: none;
  padding: 0;
  overflow: hidden;
}

.galeria__item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.galeria__item--activa {
  opacity: 1;
}

.galeria__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.35));
}

.galeria__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/** NUESTRO GIMNASIO **/

#nuestro-gimnasio p {
  margin: 0 20px;
}

#nuestro-gimnasio p + p {
  margin-top: 1rem;
}

.nuestro-gimnasio__sergym {
  color: var(--color-principal);
  font-weight: 700;
}

/** CLASES Y HORARIOS - PRECIOS **/

/* flex en vez de grid: así la última fila, si queda incompleta, se centra */
.clases__lista,
.precios__lista {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem;
  list-style: none;
}

.clase,
.plan {
  flex: 0 0 100%;
}

.clase,
.plan,
.ubicacion__caja,
.opinion {
  padding: 1.25rem;
  background: var(--color-superficie);
  border-top: 4px solid var(--color-principal);
  border-radius: 0.75rem;
}

.clase__titulo,
.plan__nombre {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1.1;
}

.clase__icono {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-principal);
}

.clase__icono--linea {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clase__icono--relleno {
  fill: currentColor;
}

.clase__descripcion {
  margin-bottom: 1rem;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-texto-suave);
}

.clase__horarios,
.plan__opciones {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.clase__horarios li,
.plan__opciones li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.clase__hora,
.plan__valor {
  color: var(--color-principal);
  font-family: var(--fuente-titulos);
  font-weight: 700;
  white-space: nowrap;
}

/** EQUIPO **/

.carrusel {
  position: relative;
  margin: 0 1rem 1rem;
}

.carrusel__lista {
  display: flex;
  gap: 1rem;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.carrusel__lista > li {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.profe {
  overflow: hidden;
  background: var(--color-superficie);
  border-top: 4px solid var(--color-principal);
  border-radius: 0.75rem;
  text-align: center;
}

.profe__foto {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.profe__info {
  padding: 1rem 3.5rem;
}

.profe__nombre {
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1.1;
}

.profe__clase {
  margin-top: 0.25rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--color-principal);
  font-weight: 700;
}

.carrusel__flecha {
  position: absolute;
  bottom: 0.5rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: none;
  color: var(--color-principal);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.carrusel__flecha--anterior {
  left: 0.5rem;
}

.carrusel__flecha--siguiente {
  right: 0.5rem;
}

.carrusel__flecha:disabled {
  opacity: 0.3;
  cursor: default;
}

.carrusel__flecha:focus-visible {
  outline: 2px solid var(--color-texto);
  outline-offset: 2px;
}

/* si todas las tarjetas entran en pantalla, las flechas no hacen falta */
.carrusel:has(.carrusel__flecha--anterior:disabled):has(
    .carrusel__flecha--siguiente:disabled
  )
  .carrusel__flecha {
  display: none;
}

/** OPINIONES **/

.opinion {
  height: 100%;
  padding-bottom: 4rem;
}

.opinion__texto::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  background: var(--color-principal);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M9 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z'/%3E%3Cpath d='M18 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

.opinion__texto p {
  line-height: 1.5;
}

.opinion__autor {
  margin-top: 1rem;
  font-weight: 700;
  color: var(--color-principal);
}

/** PRECIOS **/

.plan {
  display: flex;
  flex-direction: column;
}

.plan p {
  text-align: left;
}

.plan__opciones {
  margin-top: 0.5rem;
}

.plan--destacado {
  box-shadow: 0 0 0 2px var(--color-principal);
}

.plan__etiqueta {
  align-self: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--color-principal);
  color: var(--color-fondo);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan__precio {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.plan__precio .plan__periodo {
  font-size: 1.125rem;
}

.plan__monto {
  display: block;
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-style: italic;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-principal);
}

.plan__periodo,
.plan__detalle {
  color: var(--color-texto-suave);
}

.precios__nota {
  padding: 1rem 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-texto-suave);
}

/** PREGUNTAS FRECUENTES **/
.faq__lista {
  margin: 0 1rem;
  padding: 0 1.25rem;
  background: var(--color-superficie);
  border-top: 4px solid var(--color-principal);
  border-radius: 0.75rem;
}

.faq + .faq {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.faq__pregunta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq__pregunta::-webkit-details-marker {
  display: none;
}

.faq__pregunta::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-principal);
  transition: transform 0.2s ease;
}

.faq[open] .faq__pregunta::after {
  transform: rotate(45deg);
}

.faq__pregunta:focus-visible {
  outline: 2px solid var(--color-texto);
  outline-offset: 2px;
}

.faq__respuesta {
  padding-bottom: 1rem;
  line-height: 1.5;
  color: var(--color-texto-suave);
}

@media (prefers-reduced-motion: reduce) {
  .faq__pregunta::after {
    transition: none;
  }
}

/** UBICACIÓN **/

.ubicacion__caja {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 1rem;
}

.ubicacion__caja .boton {
  margin-top: 1rem;
  align-self: center;
}

.ubicacion__direccion {
  font-style: normal;
  text-align: left;
}

.ubicacion__direccion strong {
  display: block;
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  line-height: 1.1;
}

.ubicacion__mapa {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
  border-radius: 0.5rem;
}

/** FOOTER **/

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1rem 7rem;
  background: var(--color-superficie);
  border-top: 4px solid var(--color-principal);
  text-align: center;
}

.footer__logo {
  display: block;
  height: 40px;
  width: auto;
}

.footer__redes {
  display: flex;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.footer__redes a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--color-texto);
  text-decoration: none;
}

.footer__icono {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--color-principal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__copy,
.footer__credito {
  font-size: 0.875rem;
  color: var(--color-texto-suave);
}

/** WHATSAPP FLOTANTE **/

.whatsapp-flotante {
  position: fixed;
  right: 1rem;
  bottom: 2rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.whatsapp-flotante svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whatsapp-flotante:focus-visible {
  outline: 2px solid var(--color-texto);
  outline-offset: 3px;
}

/** TABLET (768px o más) **/

@media (min-width: 768px) {
  /* clases y precios: 2 por fila (Pase libre queda centrado abajo) */
  .clase,
  .plan {
    flex-basis: calc((100% - 1rem) / 2);
  }

  /* carruseles: 2 tarjetas a la vez */
  .carrusel__lista > li {
    flex-basis: calc((100% - 1rem) / 2);
  }

  #nuestro-gimnasio p {
    max-width: 70ch;
    margin-inline: auto;
  }

  /* ubicación: mismo orden que en celular, con el mapa más alto */
  .ubicacion__mapa {
    height: 400px;
  }

  .footer {
    padding-bottom: 2rem;
  }
}

/** ESCRITORIO (1024px o más) **/

@media (min-width: 1024px) {
  main > section:not(.galeria) {
    padding-bottom: 4rem;
  }

  /* clases: 3 por fila */
  .clase {
    flex-basis: calc((100% - 2rem) / 3);
  }

  /* logo centrado arriba y menú en fila centrado abajo, sin hamburguesa */
  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .nav__logo img {
    height: 50px;
  }

  .nav__toggle {
    display: none;
  }

  .nav__menu {
    position: static;
    display: flex;
    gap: 1.5rem;
    width: auto;
    background: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav__menu a {
    padding: 0.5rem 0;
    border-top: none;
  }

  .hero__contenido {
    padding-bottom: 4rem;
  }

  .galeria h1 {
    font-size: clamp(5rem, 7vw, 7rem);
  }

  #equipo .carrusel {
    max-width: 760px;
    margin-inline: auto;
  }

  /* opiniones: 3 tarjetas a la vez */
  #opiniones .carrusel__lista > li {
    flex-basis: calc((100% - 2rem) / 3);
  }

  /* precios, preguntas y ubicación: más angostos y centrados */
  .precios__lista,
  .precios__nota,
  .faq__lista,
  .ubicacion__caja {
    max-width: 800px;
    margin-inline: auto;
  }
}

/** PANTALLAS GRANDES (1200px o más) **/

@media (min-width: 1200px) {
  /* clases: 4 por fila */
  .clase {
    flex-basis: calc((100% - 3rem) / 4);
  }
}

/** EFECTOS AL PASAR EL MOUSE (solo en dispositivos con mouse) **/

@media (hover: hover) {
  .nav__menu a,
  .footer__redes a {
    transition: color 0.2s ease;
  }

  .nav__menu a:hover,
  .footer__redes a:hover {
    color: var(--color-principal);
  }

  /* al hacer clic, el fondo verde de :active necesita el texto blanco */
  .nav__menu a:active {
    color: var(--color-texto);
  }

  .boton {
    transition: filter 0.2s ease;
  }

  .boton:hover {
    filter: brightness(1.15);
  }

  .carrusel__flecha:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .faq__pregunta:hover {
    color: var(--color-principal);
  }
}
