/* ==========================================================================
   Estructura: contenedor, encabezado, secciones y pie de página
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 7vw, 96px); }
.section-tight { padding-block: clamp(40px, 5vw, 64px); }
.section-soft { background: var(--gray-50); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.section-head h2 { margin-bottom: .2em; }
.section-head p { margin: 0; color: var(--muted); }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head.center p { max-width: 640px; }

/* ── Logotipo ───────────────────────────────────────────────────────── */
.brand { display: inline-flex; text-decoration: none; flex-shrink: 0; }
.logo-img { height: 66px; width: auto; }
@media (max-width: 1080px) { .logo-img { height: 54px; } }
.site-footer .logo-img { height: 78px; }
/* Sobre fondo oscuro el logo va en una tarjeta blanca para conservar sus colores */
.brand-light:has(.logo-img) { background: var(--white); padding: 10px 16px; border-radius: var(--radius); }
.logo-text { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -.03em;
}
.logo-a { color: var(--navy); }
.logo-b { color: var(--orange); }
.logo-o { position: relative; }
.logo-tag {
  font-family: var(--font-script);
  color: var(--orange);
  font-size: 1.05rem;
  margin-top: 2px;
}
.brand-light .logo-a { color: var(--white); }

/* ── Encabezado ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s var(--ease), border-color .3s;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); border-color: var(--gray-100); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.header-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.main-nav { margin-inline: auto; }
.main-nav ul { list-style: none; display: flex; gap: 4px; }
.main-nav a {
  position: relative;
  display: block;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .95rem;
  color: var(--navy);
  text-decoration: none;
  border-radius: 8px;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}
.main-nav a:hover::after, .main-nav a.is-active::after { transform: scaleX(1); }
.main-nav a.is-active { font-weight: 600; }

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
}
.header-search .icon {
  position: absolute; left: 14px;
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
  font-size: .9rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.header-search input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(22, 58, 140, .15);
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-login {
  display: flex; align-items: center; gap: 8px;
  color: var(--navy);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
}
.header-login .icon { width: 26px; height: 26px; }
.header-login:hover, .header-login.is-active { color: var(--orange-600); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: inline-flex; }

@media (max-width: 1240px) {
  .header-search { width: 170px; }
  .main-nav a { padding-inline: 10px; }
  .main-nav a::after { left: 10px; right: 10px; }
}

/* Menú móvil: panel desplegable */
@media (max-width: 1080px) {
  :root { --header-h: 68px; }
  .logo-word { font-size: 1.5rem; }
  .logo-tag { font-size: .95rem; }
  .nav-toggle { display: inline-flex; }

  .header-panel {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px var(--gutter) 28px;
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .header-panel.is-open { opacity: 1; visibility: visible; transform: none; }

  .main-nav { margin: 0; order: 2; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--gray-100); border-radius: 0; }
  .main-nav a::after { display: none; }
  .main-nav a.is-active { color: var(--orange-600); }

  .header-search { width: 100%; order: 1; }
  .header-search input { height: 48px; font-size: 1rem; }

  .header-actions { order: 3; flex-direction: column; align-items: stretch; gap: 12px; }
  .header-login { justify-content: center; font-size: .95rem; padding: 12px; border: 1px solid var(--gray-200); border-radius: 999px; }
  .header-login .br-desktop { display: none; }
  .header-actions .btn { width: 100%; }

  body.nav-open { overflow: hidden; }
}

/* ── Pie de página ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .78);
  font-size: .95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-block: 64px 48px;
}
.footer-brand p { margin-top: 18px; max-width: 320px; }
.footer-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--white);
  margin-bottom: 16px;
}
.footer-links { list-style: none; display: grid; gap: 10px; }
.site-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.footer-contact { list-style: none; display: grid; gap: 14px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { color: var(--orange); margin-top: 3px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}
.footer-social a:hover { background: var(--orange); color: var(--white); }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-block: 20px;
}
.footer-bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; }
}

/* ── Botón flotante de WhatsApp ─────────────────────────────────────── */
.wa-float {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(31, 175, 90, .4);
  transition: transform .2s var(--ease);
}
.wa-float .icon { width: 30px; height: 30px; }
.wa-float:hover { transform: scale(1.07); color: var(--white); }
