/*
 * M4RTIAL V130 · Cabecera invisible, movimiento editorial y móvil compacto
 * Capa final común para las plantillas pública actual y heredada.
 */

:root {
  --m4-v130-ease: cubic-bezier(.2, .72, .2, 1);
  --m4-v130-fast: 240ms;
  --m4-v130-slow: 760ms;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

/* La cabecera deja de ser una franja: solo permanecen sus controles. */
.site-header,
.site-header.scrolled,
.header,
body:not(.landing-light) .header,
.b2b-page .site-header,
.b2b-page .site-header.scrolled,
.b2b-page.menu-open .site-header,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .header {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Algunas páginas heredadas usaban selectores muy específicos. */
html body .header,
html body:not(.landing-light) .header,
html body.theme-white .header,
html body.landing-light .header,
html body.landing-light.hero-scrolled .header {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-theme="dark"] body .header,
html[data-theme="dark"] body.theme-white .header,
html[data-theme="dark"] body:not(.landing-light) .header,
html body.v115-home .site-header,
html body.v115-home .site-header.scrolled,
html[data-theme="dark"] body.v115-home .site-header,
html[data-theme="dark"] body.v115-home .site-header.scrolled {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.site-header,
.header {
  will-change: transform, opacity;
  transition:
    transform .42s var(--m4-v130-ease),
    opacity .3s ease,
    color var(--m4-v130-fast) ease !important;
}

.site-header.m4-header-hidden,
.header.m4-header-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -115%, 0);
}

.site-header:focus-within,
.header:focus-within,
body.menu-open .site-header,
body.menu-open .header {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

body:not(.menu-open) .m4-header-tone-light,
body:not(.menu-open) .m4-header-tone-light :where(.brand, .nav, .nav a, .header-tools, .language, .menu-toggle, .mobile-toggle, .menu, .menu a) {
  color: #fff !important;
}

body:not(.menu-open) .m4-header-tone-dark,
body:not(.menu-open) .m4-header-tone-dark :where(.brand, .nav, .nav a, .header-tools, .language, .menu-toggle, .mobile-toggle, .menu, .menu a) {
  color: #0b0b09 !important;
}

.site-header :where(.brand, .nav a, .language select, .menu-toggle),
.header :where(.header-center-logo, .menu a, .mobile-toggle) {
  text-shadow: 0 1px 18px rgba(0, 0, 0, .22);
}

.site-header .brand img,
.header .header-center-logo img {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .18)) !important;
}

.site-header .language select,
.site-header .menu-toggle,
.header .mobile-toggle {
  border-color: currentColor !important;
  background: rgba(255, 255, 255, .035) !important;
  box-shadow: 0 7px 24px rgba(0, 0, 0, .08);
}

body.menu-open .site-header,
body.menu-open .site-header.scrolled {
  color: #0a0a09 !important;
  background: transparent !important;
}

body.menu-open .site-header .menu-toggle {
  color: #fff !important;
  border-color: #0a0a09 !important;
  background: #0a0a09 !important;
}

/* Movimiento progresivo: el contenido sigue visible si JavaScript no carga. */
.m4-motion-ready .m4-reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition:
    opacity var(--m4-v130-slow) ease,
    transform var(--m4-v130-slow) var(--m4-v130-ease);
  transition-delay: var(--m4-delay, 0ms);
  will-change: opacity, transform;
}

.m4-motion-ready .m4-reveal[data-m4-motion="left"] {
  transform: translate3d(-34px, 0, 0);
}

.m4-motion-ready .m4-reveal[data-m4-motion="right"] {
  transform: translate3d(34px, 0, 0);
}

.m4-motion-ready .m4-reveal[data-m4-motion="scale"] {
  transform: scale(.965);
}

.m4-motion-ready .m4-reveal[data-m4-motion="clip"] {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(.99);
}

.m4-motion-ready .m4-reveal.m4-in-view {
  opacity: 1;
  transform: none;
}

/* Entrada de portada independiente del scroll. */
.m4-motion-ready body.v115-home .hero-overline,
.m4-motion-ready body.v115-home .hero-title > span,
.m4-motion-ready body.v115-home .hero-answer,
.m4-motion-ready body.v115-home .hero-intro {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  animation: m4-v130-hero-in .9s var(--m4-v130-ease) forwards;
}

.m4-motion-ready body.v115-home .hero-overline { animation-delay: .08s; }
.m4-motion-ready body.v115-home .hero-title > span:nth-child(1) { animation-delay: .14s; }
.m4-motion-ready body.v115-home .hero-title > span:nth-child(2) { animation-delay: .22s; }
.m4-motion-ready body.v115-home .hero-title > span:nth-child(3) { animation-delay: .3s; }
.m4-motion-ready body.v115-home .hero-answer { animation-delay: .4s; }
.m4-motion-ready body.v115-home .hero-intro { animation-delay: .48s; }

.m4-motion-ready body.v115-home .hero-image picture {
  animation: m4-v130-image-in 1.25s var(--m4-v130-ease) both;
}

@keyframes m4-v130-hero-in {
  to { opacity: 1; transform: none; }
}

@keyframes m4-v130-image-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

/* Microinteracciones compartidas. */
main :where(article, .card, .proof-card, .home-store-card, .data-grid a, .price-card, .plan-card, .store-card) {
  transition:
    transform .36s var(--m4-v130-ease),
    border-color .25s ease,
    box-shadow .36s ease,
    background-color .25s ease;
}

@media (hover: hover) and (pointer: fine) {
  main :where(article, .card, .proof-card, .home-store-card, .price-card, .plan-card, .store-card):hover {
    transform: translate3d(0, -5px, 0);
  }

  main :where(.card-img, .education-image, .home-store-image, .store-card-media, figure) img {
    transition: transform .8s var(--m4-v130-ease), filter .45s ease;
  }

  main :where(.card, .home-store-card, .store-card, figure):hover img {
    transform: scale(1.025);
  }
}

/* Ajustes comunes de densidad en tablet. */
@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .site-header .nav.open {
    background: #f8f7f2 !important;
    color: #0a0a09 !important;
  }

  .site-header .nav.open :where(a, small, b, .nav-kicker, .nav-bottom) {
    color: #0a0a09 !important;
  }
}

/* Móvil: más contenido por pantalla, sin reducir áreas táctiles críticas. */
@media (max-width: 700px) {
  :root {
    --page-pad: 14px;
    --header-h: 58px;
  }

  .site-header {
    min-height: calc(58px + env(safe-area-inset-top));
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 12px 6px;
  }

  .site-header .brand img { width: 31px; height: 31px; }
  .site-header .header-tools { gap: 6px; }
  .site-header .language select {
    width: 86px;
    height: 38px;
    padding: 0 24px 0 11px;
    font-size: .56rem;
  }
  .site-header .language::after { right: 10px; }
  .site-header .menu-toggle {
    width: 38px;
    height: 38px;
    padding: 9px;
  }

  .header .nav { min-height: 58px !important; }
  .header .header-center-logo img { width: 38px !important; height: 38px !important; }
  .header .mobile-toggle {
    min-height: 38px !important;
    padding-inline: 11px !important;
    font-size: 10px !important;
  }
  .header .menu { top: 58px !important; }

  /* Landing: portada más corta y jerarquía más nítida. */
  body.v115-home .hero,
  body.v115-home .hero-stage {
    min-height: max(570px, 76svh) !important;
  }
  body.v115-home .hero-stage {
    padding: calc(76px + env(safe-area-inset-top)) 14px 34px !important;
    gap: 10px;
  }
  body.v115-home .hero-overline {
    padding-left: 30px;
    font-size: .48rem;
  }
  body.v115-home .hero-title {
    font-size: clamp(3.45rem, 18.2vw, 5.2rem) !important;
    line-height: .72;
  }
  body.v115-home .hero-answer {
    right: 14px;
    bottom: 22%;
    max-width: 142px;
    font-size: .76rem;
  }
  body.v115-home .hero-intro {
    gap: 10px;
    align-items: end;
  }
  body.v115-home .hero-intro > p {
    max-width: 31ch;
    font-size: .79rem;
    line-height: 1.42;
  }
  body.v115-home .round-link {
    width: 78px;
    padding: 11px;
    font-size: .45rem;
  }
  body.v115-home .round-link b { font-size: 1rem; }

  /* Entrenar, formar y visitar quedan resueltos en una franja breve. */
  body.v115-home .entrances-content {
    grid-template-rows: repeat(3, minmax(92px, auto));
  }
  body.v115-home .entrance {
    min-height: 96px !important;
    padding: 12px 14px !important;
  }
  body.v115-home .entrance strong {
    font-size: clamp(2.25rem, 11vw, 3.05rem) !important;
  }

  /* Tienda en portada: cabecera y carrusel más compactos. */
  body.v115-home .home-store {
    padding: 44px 14px !important;
  }
  body.v115-home .home-store-heading {
    gap: 14px;
    margin-bottom: 24px;
  }
  body.v115-home .home-store h2 {
    margin-top: 9px;
    font-size: clamp(2.65rem, 12vw, 3.8rem);
  }
  body.v115-home .home-store-intro { gap: 14px; }
  body.v115-home .home-store-intro p {
    font-size: .84rem;
    line-height: 1.48;
  }
  body.v115-home .home-store-cta {
    min-height: 44px;
  }
  body.v115-home .home-store-grid {
    width: calc(100% + 14px);
    grid-template-columns: repeat(3, minmax(210px, 72vw));
  }
  body.v115-home .home-store-meta {
    min-height: 64px;
    padding: 11px 13px;
  }

  /* Confianza: conserva cuatro accesos con mucha menos altura. */
  body.v115-home .proof-strip {
    gap: 26px;
    padding: 46px 14px !important;
  }
  body.v115-home .proof-heading h2 {
    margin-top: 10px;
    font-size: clamp(2.35rem, 10.8vw, 3.45rem);
  }
  body.v115-home .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.v115-home .proof-card {
    min-height: 142px;
    gap: 5px;
    padding: 15px;
  }
  body.v115-home .proof-card span { font-size: .56rem; }
  body.v115-home .proof-card strong { font-size: 1rem; }
  body.v115-home .proof-card small { font-size: .72rem; line-height: 1.35; }

  /* Disciplinas, método y formación. */
  body.v115-home .discipline-intro {
    min-height: 238px !important;
    padding: 34px 14px !important;
  }
  body.v115-home .discipline-intro h2 {
    margin: 19px 0;
    font-size: clamp(2.75rem, 12.6vw, 3.75rem);
  }
  body.v115-home .discipline-stack {
    grid-template-rows: repeat(3, minmax(88px, auto));
  }
  body.v115-home .discipline-stack a,
  body.v115-home .discipline-stack a:first-child {
    min-height: 88px;
    padding: 11px 10px;
  }
  body.v115-home .discipline-stack strong {
    font-size: clamp(1.12rem, 5.6vw, 1.52rem);
  }
  body.v115-home .discipline-stack small { font-size: .43rem; }

  body.v115-home .manifesto {
    padding: 44px 14px !important;
  }
  body.v115-home .manifesto-main h2 {
    margin: 18px 0 25px;
    font-size: clamp(3rem, 13.6vw, 4.1rem);
  }
  body.v115-home .manifesto-copy {
    margin: 0 0 24px 8%;
    font-size: .87rem;
  }
  body.v115-home .manifesto-method article,
  body.v115-home .manifesto-method article + article {
    padding: 11px 0;
  }
  body.v115-home .manifesto-method h3 {
    font-size: 1.34rem;
  }
  body.v115-home .manifesto-method p { font-size: .78rem; }

  body.v115-home .education {
    padding-top: 172px !important;
  }
  body.v115-home .education-image {
    height: 184px !important;
  }
  body.v115-home .education-copy {
    padding: 34px 14px 72px !important;
  }
  body.v115-home .education-copy h2 {
    margin: 18px 0;
    font-size: clamp(2.65rem, 12.4vw, 3.75rem);
  }
  body.v115-home .education-copy > p:not(.eyebrow) {
    margin-bottom: 14px;
    font-size: .86rem;
  }
  body.v115-home .education-copy ul { margin-bottom: 17px; }
  body.v115-home .education-copy li { padding: 8px 0; }

  body.v115-home .information-content {
    padding: 42px 14px !important;
  }
  body.v115-home .information-content > h2 {
    margin-bottom: 25px;
    font-size: clamp(2.85rem, 13vw, 3.95rem);
  }
  body.v115-home .data-grid a,
  body.v115-home .data-grid a + a {
    min-height: 82px;
    padding: 10px 0;
  }
  body.v115-home .data-grid strong { font-size: 1.28rem; }

  /* Reserva: menos aire, mismos campos y mismas garantías. */
  body.v115-home .booking-section {
    gap: 24px;
    padding: 50px 14px 78px !important;
  }
  body.v115-home .booking-intro h2 {
    font-size: clamp(2.35rem, 10.8vw, 3.5rem);
  }
  body.v115-home .booking-intro > p:not(.eyebrow) {
    margin-top: 18px;
    font-size: .88rem;
    line-height: 1.5;
  }
  body.v115-home .booking-assurance { margin-top: 18px; }
  body.v115-home .booking-form { padding: 18px 14px; }
  body.v115-home .booking-slots { margin: 22px 0; }
  body.v115-home .booking-fields { gap: 11px; }
  body.v115-home .booking-form input,
  body.v115-home .booking-form select { min-height: 46px; }

  body.v115-home .site-footer {
    padding: 30px 14px 78px;
  }
  body.v115-home .site-footer > nav {
    margin: 22px 0;
    gap: 4px 12px;
  }
  body.v115-home .site-footer > nav a { min-height: 34px; }

  /* Plantillas internas y legales: misma reducción de scroll. */
  body:not(.v115-home) :where(.page-hero, .inner-hero, .b2b-hero, .store-hero) {
    min-height: auto !important;
    padding-top: calc(82px + env(safe-area-inset-top)) !important;
    padding-bottom: 34px !important;
  }
  body:not(.v115-home) :where(section, .section, .seo-content, .discipline-faq, .b2b-section) {
    padding-top: 42px !important;
    padding-bottom: 42px !important;
  }
  body:not(.v115-home) :where(.container, .nav-shell) {
    width: min(100% - 28px, 1200px);
  }
  body:not(.v115-home) :where(.section-head, .b2b-section-head) {
    margin-bottom: 20px;
  }
  body:not(.v115-home) :where(.card-body, .panel, .mini-card, .schedule-card, .contact-card, .feature-panel, .discipline-facts) {
    padding: 18px !important;
  }
  body:not(.v115-home) :where(.grid-2, .grid-3, .grid-4, .contact-grid, .discipline-seo-grid, .discipline-benefits) {
    gap: 12px;
  }

  .store-page .store-catalog,
  .store-page .store-principles,
  .store-page .store-separation {
    padding-block: 44px !important;
  }
}

@media (max-width: 380px) {
  body.v115-home .proof-grid { grid-template-columns: 1fr; }
  body.v115-home .proof-card { min-height: 120px; }
  body.v115-home .hero-title { font-size: clamp(3.15rem, 17.6vw, 4.5rem) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .site-header,
  .header,
  .m4-motion-ready .m4-reveal,
  .m4-motion-ready body.v115-home .hero-overline,
  .m4-motion-ready body.v115-home .hero-title > span,
  .m4-motion-ready body.v115-home .hero-answer,
  .m4-motion-ready body.v115-home .hero-intro,
  .m4-motion-ready body.v115-home .hero-image picture {
    animation: none !important;
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
    transition: none !important;
  }
}
