/* =========================================================
   Materiales Terapéuticos de Yucatán — hoja de estilos
   ========================================================= */

:root{
  --teal: #1EADB6;
  --teal-dark: #128089;
  --teal-light: #5FD2D6;
  --navy: #103F5C;
  --navy-dark: #0A2D42;
  --ink: #16323F;
  --gray-600: #5B7079;
  --gray-300: #D9E4E6;
  --bg-tint: #F4F9FA;
  --white: #FFFFFF;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 4px 14px rgba(16, 63, 92, .08);
  --shadow-md: 0 14px 40px rgba(16, 63, 92, .14);
  --shadow-teal: 0 14px 32px rgba(30, 173, 182, .35);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 84px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, h4{
  font-family: "Poppins", sans-serif;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 .5em;
}

h1{ font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2{ font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3{ font-size: 1.25rem; font-weight: 700; }
p{ margin: 0 0 1em; }
ul{ list-style: none; margin: 0; padding: 0; }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }

.container{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Offset anchored scroll targets so the fixed header never covers the heading */
section[id]{ scroll-margin-top: 96px; }

.text-teal{ color: var(--teal); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .8em 1.6em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  border: 2px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn-primary{
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  box-shadow: var(--shadow-teal);
}
.btn-primary:hover{ transform: translateY(-3px); box-shadow: 0 18px 36px rgba(30,173,182,.42); }
.btn-ghost{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.55);
  color: var(--white);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover{ background: rgba(255,255,255,.92); color: var(--navy); transform: translateY(-3px); }
.btn-lg{ padding: 1em 2em; font-size: 1.02rem; }
.btn-block{ width: 100%; justify-content: center; }

/* ---------- Skip link ---------- */
.skip-link{
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: .8em 1.2em; border-radius: 0 0 8px 0;
}
.skip-link:focus{ left: 0; }

/* ---------- Preloader ---------- */
#preloader{
  position: fixed; inset: 0; z-index: 9999;
  background: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
#preloader.is-hidden{ opacity: 0; visibility: hidden; }
.preloader-logo{
  width: 120px; height: auto; filter: brightness(0) invert(1);
  animation: pulseLogo 1.4s ease-in-out infinite;
}
@keyframes pulseLogo{
  0%, 100%{ transform: scale(1); opacity: .85; }
  50%{ transform: scale(1.08); opacity: 1; }
}

/* ---------- Header ---------- */
.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: var(--header-h);
  display: flex; align-items: center;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .35s var(--ease), height .35s var(--ease);
}
.site-header.is-scrolled{
  box-shadow: var(--shadow-md);
  height: 72px;
}
.header-inner{
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.brand-logo{ height: 52px; width: auto; transition: height .35s var(--ease); }
.is-scrolled .brand-logo{ height: 44px; }

.main-nav{ display: flex; align-items: center; gap: 32px; }
.main-nav ul{ display: flex; gap: 28px; }
.nav-link{
  position: relative; font-weight: 600; font-size: .96rem;
  color: var(--teal); padding: 6px 0;
  transition: color .25s;
}
.nav-link::after{
  content:""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--teal-dark); transition: width .3s var(--ease);
}
.nav-link:hover, .nav-link.active{ color: var(--teal-dark); }
.nav-link:hover::after, .nav-link.active::after{ width: 100%; }
.nav-cta{ padding: .65em 1.4em; font-size: .92rem; }

.nav-toggle{
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 10px; z-index: 60;
}
.nav-toggle span{
  width: 26px; height: 3px; border-radius: 2px;
  background: var(--teal); transition: transform .3s var(--ease), opacity .3s var(--ease), background .3s;
}
.nav-toggle.is-active span:nth-child(1){ transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2){ opacity: 0; }
.nav-toggle.is-active span:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
  background: var(--navy-dark);
}
/* La foto vive en un panel anclado a la derecha de la página, no de fondo completo */
.hero-media{
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(58%, 920px);
  z-index: 0;
  overflow: hidden;
}
.hero-photo{
  width: 100%; height: 100%; object-fit: cover; object-position: left 22%;
  opacity: 1;
  filter: brightness(1.03) contrast(1.03) saturate(1.05);
}
.hero-overlay{
  position: absolute; inset: 0;
  /* Difuminado de izquierda (oscuro, se funde con el fondo) a derecha (foto nítida).
     Muchas paradas cercanas = transición suave, sin "escalón" visible sobre el cielo.
     Los porcentajes son relativos al ancho del panel de la foto (.hero-media), no de toda la página. */
  background: linear-gradient(
    90deg,
    var(--navy-dark) 0%,
    rgba(9,38,55,.97) 8%,
    rgba(9,38,55,.88) 16%,
    rgba(9,38,55,.74) 24%,
    rgba(9,38,55,.58) 32%,
    rgba(9,38,55,.42) 40%,
    rgba(9,38,55,.28) 48%,
    rgba(9,38,55,.16) 56%,
    rgba(9,38,55,.08) 64%,
    rgba(9,38,55,.03) 72%,
    rgba(9,38,55,0) 82%
  );
}
.hero-blob{
  position: absolute; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(30,173,182,.35), transparent 70%);
  top: -220px; right: -220px;
  animation: floatSlow 12s ease-in-out infinite;
  pointer-events: none;
}
@keyframes floatSlow{
  0%, 100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(-30px, 40px) scale(1.06); }
}
.hero-inner{ position: relative; z-index: 2; padding-top: var(--header-h); color: var(--white); max-width: 780px; }
.eyebrow{
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; font-size: .82rem; color: var(--teal-light);
  padding: .4em 1em; border: 1px solid rgba(95,210,214,.45); border-radius: 999px;
  margin-bottom: 1.2em;
}
.hero h1{ color: var(--white); }
.hero-lead{ font-size: 1.12rem; color: rgba(255,255,255,.86); max-width: 620px; }
.hero-tags{ display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0; }
.hero-tags a{
  display: flex; align-items: center; gap: .5em;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  padding: .55em 1.1em; border-radius: 999px; font-size: .9rem; font-weight: 600;
  color: var(--white);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.hero-tags a i{ color: var(--teal-light); transition: color .3s var(--ease), transform .3s var(--ease); }
.hero-tags a:hover, .hero-tags a:focus-visible{
  background: var(--teal); border-color: var(--teal);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 26px rgba(30,173,182,.4);
}
.hero-tags a:hover i, .hero-tags a:focus-visible i{ color: var(--white); transform: scale(1.15); }
.hero-actions{ display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 2em; }
.hero-meta{ font-size: .88rem; color: rgba(255,255,255,.72); }
.hero-meta p{ margin: .25em 0; display: flex; gap: .5em; align-items: flex-start; }
.hero-meta i{ color: var(--teal-light); margin-top: .2em; }
.razon-social{ opacity: .8; }

.scroll-cue{
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.55); border-radius: 20px;
  z-index: 2;
}
.scroll-cue span{
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--teal-light); border-radius: 2px;
  animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue{
  0%{ opacity: 1; transform: translateY(0); }
  70%{ opacity: 0; transform: translateY(14px); }
  100%{ opacity: 0; }
}

/* ---------- Stats strip ---------- */
.stats-strip{
  background: linear-gradient(120deg, var(--navy), var(--navy-dark));
  padding: 46px 0;
  position: relative; z-index: 3; margin-top: -2px;
}
.stats-grid{
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
}
.stat-number{
  display: block; font-family: "Poppins", sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--teal-light);
}
.stat-label{ font-size: .85rem; color: rgba(255,255,255,.78); font-weight: 600; }

/* ---------- Sections ---------- */
.section{ padding: 96px 0; position: relative; }
.section-tint{ background: var(--bg-tint); }
.section-head{ max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-kicker{
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .82rem;
  color: var(--teal-dark); margin-bottom: .6em;
}
.section-kicker-light{ color: var(--teal-light); }
.lead-text{ color: var(--gray-600); font-size: 1.05rem; }
.light-text{ color: rgba(255,255,255,.78); }
.light-heading{ color: var(--white); }

/* Quienes somos */
.section-split{
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.pill-badges{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6em; }
.pill-badges span{
  display: inline-flex; align-items: center; gap: .5em;
  background: var(--bg-tint); border: 1px solid var(--gray-300);
  padding: .55em 1.1em; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--navy);
}
.pill-badges i{ color: var(--teal); }

.mv-cards{ display: grid; gap: 20px; }
.mv-card{
  background: var(--white); border-radius: var(--radius-md);
  padding: 32px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-300);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.mv-card:hover{ transform: translateY(-6px); box-shadow: var(--shadow-md); }
.mv-card-alt{ background: linear-gradient(135deg, var(--teal), var(--teal-dark)); border: none; }
.mv-card-alt h3, .mv-card-alt p{ color: var(--white); }
.mv-icon{
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30,173,182,.12); color: var(--teal); font-size: 1.3rem; margin-bottom: 16px;
}
.mv-card-alt .mv-icon{ background: rgba(255,255,255,.2); color: var(--white); }

/* Beneficios */
.benefits-grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px;
}
.benefit-card{
  background: var(--white); border-radius: var(--radius-md); padding: 30px 26px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-300);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.benefit-card:hover{ transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--teal); }
.benefit-card i{
  font-size: 1.6rem; color: var(--teal); margin-bottom: 14px; display: block;
}
.benefit-card p{ margin: 0; font-weight: 600; color: var(--navy); font-size: .98rem; }

/* Productos y servicios - tabs */
.tabs{
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px;
}
.tab-btn{
  background: var(--white); border: 1.5px solid var(--gray-300); color: var(--gray-600);
  padding: .7em 1.3em; border-radius: 999px; font-weight: 700; font-size: .88rem;
  transition: all .3s var(--ease);
}
.tab-btn:hover{ border-color: var(--teal); color: var(--teal-dark); }
.tab-btn.active{
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); border-color: transparent;
  color: var(--white); box-shadow: var(--shadow-teal);
}

.tab-panels{ position: relative; }
.tab-panel{
  display: none;
  background: var(--bg-tint); border-radius: var(--radius-lg);
  padding: 44px clamp(20px, 5vw, 56px);
  border: 1px solid var(--gray-300);
}
.tab-panel.active{ display: block; animation: panelIn .5s var(--ease); }
@keyframes panelIn{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: translateY(0); }
}
.panel-icon{
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 28px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white); font-size: 1.6rem;
  box-shadow: var(--shadow-teal);
}
.item-grid{
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px;
  max-width: 640px; margin: 0 auto;
}
.item-grid-wide{ grid-template-columns: repeat(3, 1fr); max-width: 900px; }
.item-grid li{
  position: relative; padding-left: 26px; font-weight: 600; color: var(--ink); font-size: .96rem;
}
.item-grid li::before{
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 0; top: 2px; color: var(--teal); font-size: .8rem;
}

/* Photo strip */
.photo-strip{ overflow: hidden; height: 220px; position: relative; }
.photo-strip-track{
  display: flex; height: 100%; width: 200%;
  animation: scrollStrip 26s linear infinite;
}
.photo-strip-track img{
  width: 33.333%; height: 220px; object-fit: cover; flex-shrink: 0;
  filter: saturate(1.05);
}
@keyframes scrollStrip{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* Clientes */
.clients-grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px;
}
.client-card{
  text-align: center; background: var(--white); border-radius: var(--radius-md);
  padding: 40px 24px; border: 1px solid var(--gray-300); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.client-card:hover{ transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-md); }
.client-card i{
  font-size: 2.1rem; color: var(--teal); margin-bottom: 16px;
  display: inline-block; animation: none;
}
.client-card h3{ margin-bottom: .3em; }
.client-card p{ margin: 0; color: var(--gray-600); font-size: .92rem; }

/* Contacto */
.contact-section{
  background: linear-gradient(150deg, var(--navy-dark), var(--navy) 60%, var(--teal-dark));
  color: var(--white);
}
.contact-inner{
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: start;
}
.contact-list{ margin: 2em 0; display: flex; flex-direction: column; gap: 14px; }
.contact-list a, .contact-static{
  display: flex; align-items: center; gap: 14px;
  padding: .9em 1.1em; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  transition: background .3s, transform .3s var(--ease);
  font-weight: 600;
}
.contact-list a:hover{ background: rgba(255,255,255,.15); transform: translateX(6px); }
.contact-list i{
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30,173,182,.25); color: var(--teal-light); font-size: 1.05rem;
}
.social-row{ display: flex; gap: 12px; margin-top: 1.5em; }
.social-row a{
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  transition: transform .3s var(--ease), background .3s;
}
.social-row a:hover{ background: var(--teal); transform: translateY(-4px); }

.contact-form{
  background: var(--white); color: var(--ink);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: var(--shadow-md);
}
.contact-form h3{ margin-bottom: 1em; }
.form-row{ margin-bottom: 18px; }
.form-row label{ display: block; font-weight: 700; font-size: .88rem; margin-bottom: .4em; color: var(--navy); }
.form-row input, .form-row textarea{
  width: 100%; padding: .8em 1em; border-radius: 10px; border: 1.5px solid var(--gray-300);
  font-family: inherit; font-size: .96rem; resize: vertical;
  transition: border-color .25s, box-shadow .25s;
  background: var(--bg-tint);
}
.form-row input:focus, .form-row textarea:focus{
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(30,173,182,.14);
}
.form-note{ font-size: .82rem; color: var(--gray-600); margin: .8em 0 0; min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer{ background: var(--navy-dark); color: rgba(255,255,255,.75); padding: 48px 0 28px; }
.footer-inner{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand{ display: flex; align-items: center; gap: 14px; }
.footer-brand img{ height: 40px; filter: brightness(0) invert(1); opacity: .9; }
.footer-brand p{ margin: 0; font-size: .85rem; }
.footer-nav{ display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a{ font-size: .88rem; font-weight: 600; transition: color .25s; }
.footer-nav a:hover{ color: var(--teal-light); }
.copyright{ width: 100%; text-align: center; font-size: .8rem; margin: 24px 0 0; opacity: .65; }

/* ---------- Floating buttons ---------- */
.whatsapp-float{
  position: fixed; bottom: 26px; right: 26px; z-index: 400;
  width: 60px; height: 60px; border-radius: 50%;
  background: #25D366; color: #fff; font-size: 1.7rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(37,211,102,.45);
  animation: pulseWA 2.6s ease-in-out infinite;
  transition: transform .3s var(--ease);
}
.whatsapp-float:hover{ transform: scale(1.08); }
@keyframes pulseWA{
  0%, 100%{ box-shadow: 0 10px 26px rgba(37,211,102,.45); }
  50%{ box-shadow: 0 10px 26px rgba(37,211,102,.45), 0 0 0 12px rgba(37,211,102,.12); }
}
.back-to-top{
  position: fixed; bottom: 26px; right: 96px; z-index: 400;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--white); color: var(--navy); border: 1px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  box-shadow: var(--shadow-sm);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .3s, visibility .3s, transform .3s var(--ease), background .3s;
}
.back-to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ background: var(--teal); color: var(--white); }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity: 0; transition: opacity .7s var(--ease), transform .7s var(--ease); will-change: transform, opacity; }
.reveal[data-reveal="fade-up"]{ transform: translateY(36px); }
.reveal[data-reveal="fade-right"]{ transform: translateX(-36px); }
.reveal[data-reveal="fade-left"]{ transform: translateX(36px); }
.reveal.is-visible{ opacity: 1; transform: translate(0,0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .section-split, .contact-inner{ grid-template-columns: 1fr; gap: 40px; }
  .stats-grid{ grid-template-columns: repeat(2, 1fr); }
  .item-grid-wide{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px){
  .main-nav{
    position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 82vw);
    background: var(--white); flex-direction: column; align-items: flex-start;
    padding: 110px 32px 40px; gap: 32px;
    transform: translateX(100%); transition: transform .4s var(--ease);
    box-shadow: -18px 0 40px rgba(16,63,92,.18);
  }
  .main-nav.is-open{ transform: translateX(0); }
  .main-nav ul{ flex-direction: column; gap: 22px; }
  .nav-link{ color: var(--navy); font-size: 1.05rem; }
  .nav-cta{ width: 100%; justify-content: center; }
  .nav-toggle{ display: flex; }
}

@media (max-width: 640px){
  .container{ padding: 0 18px; }
  .section{ padding: 72px 0; }
  .hero{ min-height: auto; padding-bottom: 60px; }
  .hero-inner{ padding-top: calc(var(--header-h) + 26px); }
  .stats-grid{ grid-template-columns: 1fr 1fr; gap: 32px 16px; }
  .item-grid, .item-grid-wide{ grid-template-columns: 1fr; }
  .tab-panel{ padding: 32px 20px; }
  .whatsapp-float{ width: 54px; height: 54px; font-size: 1.5rem; bottom: 18px; right: 18px; }
  .back-to-top{ width: 42px; height: 42px; right: 82px; bottom: 18px; }
  .contact-form{ padding: 28px; }
  .hero-actions{ flex-direction: column; align-items: stretch; }
  .hero-actions .btn{ justify-content: center; }
}
