/* ==========================================================================
   layout.css — contenedores, header, secciones, footer y elementos flotantes
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

/* --- Secciones ---------------------------------------------------------- */
.section {
  padding: clamp(56px, 7vw, 104px) var(--gutter);
  scroll-margin-top: 84px;
}

.section--hero {
  padding: clamp(40px, 6vw, 84px) var(--gutter) clamp(48px, 6vw, 96px);
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg) 100%);
}
.section--white  { background: var(--surface); border-top: 1px solid var(--line); }
.section--framed { background: var(--surface); border-block: 1px solid var(--line); }
.section--navy   { background: var(--navy); padding-block: clamp(40px, 5vw, 68px); }
.section--contact {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: clamp(80px, 8vw, 120px);
}

.section__head { max-width: 820px; margin-bottom: 44px; }
.section__head .h2 { margin: 12px 0 16px; }
.section__head--tight .h2 { margin-bottom: 0; }

/* --- Grillas reutilizables ---------------------------------------------- */
.grid { display: grid; }

/* auto-fit con min(): se acomoda solo y nunca desborda en pantalla chica */
.grid--auto    { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.grid--auto-sm { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.grid--two-col { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(28px, 4vw, 56px); }
.grid--hero    { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: clamp(32px, 4vw, 64px); align-items: center; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 60;
  background: rgba(245, 247, 250, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.4px;
  color: var(--navy);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.nav-desktop a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 13px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.nav-desktop a:hover {
  background: #EAF4F5;
  color: var(--navy);
  text-decoration: none;
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Botón hamburguesa: 3 líneas reales, target de 46px */
.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-pill);
  place-items: center;
  box-shadow: 0 12px 28px -18px rgba(11, 31, 51, .55);
}
.nav-toggle__box {
  display: grid;
  gap: 4px;
  width: 18px;
}
.nav-toggle__box span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Menú móvil desplegable */
.nav-mobile {
  display: none;
  margin: 0 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-menu);
  padding: 8px 14px 14px;
  animation: islandIn .3s cubic-bezier(.2, .8, .2, 1) both;
}
.nav-mobile.is-open { display: grid; }
.nav-mobile a {
  padding: 15px 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.nav-mobile a:hover { text-decoration: none; color: var(--teal-deep); }
.nav-mobile a:last-of-type { border-bottom: 0; }
.nav-mobile__cta {
  display: block;
  margin-top: 12px;
  text-align: center;
  background: var(--teal-dark);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
  padding: 14px;
  border-radius: var(--r-md);
  border-bottom: 0 !important;
}
.nav-mobile__cta:hover { background: var(--navy); color: #FFFFFF; text-decoration: none; }

/* ==========================================================================
   Elementos flotantes
   ========================================================================== */
.nav-island {
  position: fixed;
  top: 16px;
  left: 0; right: 0;
  margin-inline: auto;
  width: fit-content;
  max-width: calc(100vw - 32px);
  z-index: 65;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, .28);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(227, 233, 240, .45);
  border-radius: var(--r-pill);
  padding: 7px 10px;
  box-shadow: 0 14px 34px -22px rgba(11, 31, 51, .4);
  animation: islandIn .38s cubic-bezier(.2, .8, .2, 1) both;
}
.nav-island a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 13px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background .18s ease;
}
.nav-island a:hover { background: #EAF4F5; color: var(--navy); text-decoration: none; }

.back-to-top {
  position: fixed;
  left: 0; right: 0;
  margin-inline: auto;
  bottom: 28px;
  z-index: 71;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, .18);
  background: var(--teal-dark);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-float);
  animation: popIn .3s cubic-bezier(.2, .8, .2, 1) both;
  transition: background .2s ease, transform .2s ease;
}
.back-to-top:hover { background: var(--navy); transform: translateY(-2px); }

/* Solo aparece en móvil (ver responsive.css) */
.sticky-cta {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.sticky-cta a {
  display: block;
  text-align: center;
  background: var(--teal-dark);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
  padding: 14px;
  border-radius: var(--r-lg);
}
.sticky-cta a:hover { background: var(--navy); color: #FFFFFF; text-decoration: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy);
  padding: clamp(44px, 5vw, 68px) var(--gutter) 32px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(28px, 4vw, 32px);
  padding-bottom: 32px;
  border-bottom: 1px solid var(--navy-line);
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.site-footer__brand span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: #FFFFFF;
}
.site-footer__desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--on-dark);
  max-width: 34ch;
}
.site-footer h3 {
  font-size: 14px;
  color: #FFFFFF;
  margin-bottom: 12px;
}
.site-footer__links { display: grid; gap: 8px; }
.site-footer__links a,
.site-footer__links span {
  font-size: 14.5px;
  color: var(--on-dark);
}
.site-footer__links a:hover { color: #FFFFFF; }
.site-footer__legal {
  font-size: 13px;
  color: var(--muted-3);
  margin-top: 22px;
  text-align: center;
}
