/* ============================================================
   Málaga Centro de Entrenamiento
   ============================================================ */

:root {
  --turquesa: #1FB6CE;
  --turquesa-dark: #178DA0;
  --carbon: #15191C;
  --gris: #5A6469;
  --hueso: #F7F9FA;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radio: 14px;

  --header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--carbon);
  background: var(--hueso);
  -webkit-font-smoothing: antialiased;
}

/* Lenis lock while preloading */
html.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--carbon);
}

p { margin: 0; }

a { color: inherit; }

::selection { background: var(--turquesa); color: var(--hueso); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 5vw, 5rem);
}

section { padding-block: clamp(5rem, 10vw, 8rem); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--turquesa);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radio);
  transition: transform 0.25s ease, background-color 0.25s ease;
  will-change: transform;
}

.btn--primary {
  background: var(--turquesa);
  color: var(--hueso);
}

.btn--lg {
  font-size: 1.1rem;
  padding: 1.05rem 2rem;
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--turquesa-dark);
    transform: scale(1.03);
  }
}

:focus-visible {
  outline: 3px solid var(--turquesa);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--hueso);
}
.preloader__logo {
  width: clamp(120px, 22vw, 180px);
  height: auto;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
  background: var(--hueso);
  transition: box-shadow 0.3s ease;
}
.header.is-scrolled {
  box-shadow: 0 4px 24px rgba(21, 25, 28, 0.08);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.header__logo { display: flex; align-items: center; }
.header__logo img { height: 44px; width: auto; }
.header__cta { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(1.5rem, 4vw, 3rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.hero__grid {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  width: 100%;
}
.hero__title {
  font-weight: 800;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 1.4rem;
}
/* SplitType word mask */
.hero__title .word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
}
.hero__sub {
  max-width: 38ch;
  color: var(--gris);
  margin-bottom: 2rem;
}
.hero__media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radio);
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- El diferencial (carbón, bento 2+1) ---------- */
.diff { background: var(--carbon); }
.diff__bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2vw, 2rem);
}
.diff__card {
  background: rgba(247, 249, 250, 0.04);
  border: 1px solid rgba(247, 249, 250, 0.08);
  border-radius: var(--radio);
  padding: clamp(1.6rem, 3vw, 2.6rem);
}
.diff__card--lead {
  grid-column: 1 / -1;
  background: var(--turquesa);
  border-color: transparent;
}
.diff__card h3 {
  font-weight: 700;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--hueso);
  margin-bottom: 0.6rem;
}
.diff__card p { color: rgba(247, 249, 250, 0.78); }
.diff__card--lead h3 { color: var(--carbon); }
.diff__card--lead p { color: rgba(21, 25, 28, 0.82); }

/* ---------- Cómo entrenamos (zigzag) ---------- */
.how__grid {
  display: grid;
  grid-template-columns: 42fr 58fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.how__media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radio);
  overflow: hidden;
}
.how__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.how__text h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 1.2rem;
}
.how__text p { color: var(--gris); max-width: 46ch; }

/* ---------- El equipo ---------- */
.team__title {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.team__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 920px;
}
.team__member {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.team__member--offset { transform: translateY(2.5rem); }
.team__avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--turquesa);
}
.team__avatar span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--hueso);
}
.team__info h3 {
  font-weight: 700;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 0.2rem;
}
.team__info p { color: var(--gris); }

/* ---------- El espacio (galería desfasada) ---------- */
.space__gallery {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
}
.space__item {
  margin: 0;
  border-radius: var(--radio);
  overflow: hidden;
}
.space__item img { width: 100%; height: 100%; object-fit: cover; }
.space__item--tall {
  aspect-ratio: 3 / 4;
  margin-top: clamp(2rem, 6vw, 4.5rem);
}
.space__item--wide { aspect-ratio: 4 / 5; }

/* ---------- Ubicación + CTA final (carbón, split) ---------- */
.cta { background: var(--carbon); }
.cta__grid {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.cta__media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radio);
  overflow: hidden;
}
.cta__media img { width: 100%; height: 100%; object-fit: cover; }
.cta__text h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  color: var(--hueso);
  margin-bottom: 1.4rem;
}
.cta__address {
  color: rgba(247, 249, 250, 0.7);
  margin-bottom: 1.4rem;
}
.cta__map {
  aspect-ratio: 16 / 10;
  border-radius: var(--radio);
  overflow: hidden;
  margin-bottom: 2rem;
}
.cta__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--carbon);
  border-top: 1px solid rgba(247, 249, 250, 0.08);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(6rem, 9vw, 7rem);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
}
.footer__logo { height: 52px; width: auto; }
.footer__bottom {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.footer__credit {
  color: rgba(247, 249, 250, 0.55);
  font-size: 0.9rem;
  margin: 0;
}
.footer__credit a { color: var(--hueso); text-decoration: none; }
.footer__credit strong { font-weight: 700; }
.footer__social {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer__social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--hueso);
  text-decoration: none;
  font-weight: 500;
}
.footer__social-link svg {
  width: 20px;
  height: 20px;
  fill: var(--hueso);
  flex: 0 0 auto;
}
@media (hover: hover) {
  .footer__social-link:hover { color: var(--turquesa); }
}

/* ---------- Botón flotante WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 950;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(21, 25, 28, 0.25);
  transition: transform 0.25s ease;
}
.wa-float svg {
  width: 34px;
  height: 34px;
  fill: var(--hueso);
}
@media (hover: hover) {
  .wa-float:hover { transform: scale(1.06); }
}

/* ---------- Reveal base ---------- */
.reveal { opacity: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 50fr 50fr; }
}

@media (max-width: 768px) {
  .header__logo img { height: 38px; }
  .header__cta { font-size: 0.9rem; padding: 0.7rem 1.1rem; }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 1.5rem);
  }
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__media { aspect-ratio: 16 / 11; }
  .hero__title br { display: none; }

  .diff__bento { grid-template-columns: 1fr; }
  .diff__card--lead { grid-column: auto; }

  .how__grid { grid-template-columns: 1fr; gap: 2rem; }

  .team__list { grid-template-columns: 1fr; gap: 2rem; }
  .team__member--offset { transform: none; }

  .space__gallery { grid-template-columns: 1fr; }
  .space__item--tall { margin-top: 0; }

  .cta__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; }
  .preloader { display: none !important; }
}
