/* =================================================================
   VARIABLES Y ESTILOS BASE
================================================================== */
:root {
  --color-primary-dark: #111827;
  --color-primary: #1F2937;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-text: #374151;
  --color-text-light: #4B5563;
  --color-background: #FFFFFF;
  --color-background-alt: #F9FAFB;
  --font-family-headings: 'Poppins', sans-serif;
  --font-family-base: 'Inter', sans-serif;
  --container-width: 1280px;
  --border-radius: 12px;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, .35);
}

*,
*::before,
*::after {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--font-family-base);
  line-height: 1.7;
  color: var(--color-text);
  background: #fff;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color .2s ease
}

a:hover {
  color: var(--color-accent-hover)
}

img {
  max-width: 100%;
  height: auto;
  display: block
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-headings);
  color: var(--color-primary-dark);
  font-weight: 700;
  line-height: 1.25
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: #fff;
  color: #000;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: var(--focus-ring)
}

/* Botones */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-headings);
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  border: 2px solid transparent;
  transition: transform .06s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring)
}

.button--small {
  padding: 8px 14px;
  font-size: .9rem
}

.button--large {
  padding: 16px 28px;
  font-size: 1.05rem
}

/* =================================================================
   CAMBIO: Colores de WhatsApp actualizados para cumplir con el ratio
   de contraste de accesibilidad (WCAG AA).
================================================================== */
.button--whatsapp {
  background: #075E54; /* Antes: #25D366 */
  color: #fff;
  padding-left: 16px;
  padding-right: 16px;
}

.button--whatsapp svg {
  margin-right: 6px;
}

.button--whatsapp:hover {
  background: #064C43; /* Antes: #1FB358 */
}

a.button:hover {
  color: #fff
}




/* =================================================================
   HEADER
================================================================== */
.site-header {
  background: rgba(255, 255, 255, .95);
  padding: 14px 0;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px)
}

.site-header__container {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.site-header__logo a {
  font-family: var(--font-family-headings);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  white-space: nowrap
}

.site-header__logo a span {
  color: var(--color-accent)
}

/* Nav desktop (oculta en móvil) */
.site-header__nav-desktop {
  display: none
}

.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-menu li {
  position: relative;
}

.main-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-headings);
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 0;
  position: relative;
  transition: color .2s ease;
}

.main-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width .25s ease
}

.main-menu a:hover,
.main-menu .current-menu-item>a {
  color: var(--color-accent);
}

.main-menu a:hover::after,
.main-menu .current-menu-item>a::after {
  width: 100%
}

.site-header__actions {
  display: flex;
  align-items: center;
}

/* Dropdown del Menú de Escritorio */
.sub-menu {
  list-style: none;
  margin: 0;
  padding: 12px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 220px;
  background: var(--color-background);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid #E5E7EB;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.menu-item-has-children:hover>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.sub-menu li {
  display: block;
}

.sub-menu a {
  display: block;
  color: var(--color-text);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}

.sub-menu a:hover {
  background-color: var(--color-background-alt);
  color: var(--color-accent);
}

.sub-menu a::after {
  display: none;
}

/* Botón de menú fijo (hamburguesa) */
.fixed-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background-color: var(--color-primary-dark);
  border: 1.5px solid #fff;
  border-radius: 50%;
  z-index: 220;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color .2s ease, transform .2s ease;
}

.fixed-hamburger:hover {
  background-color: var(--color-primary);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 3px 0;
  border-radius: 1px;
  transition: transform .2s ease, opacity .2s ease
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg)
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg)
}

/* Overlay móvil */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 210;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  pointer-events: none;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-overlay__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 72px 24px 24px
}

.menu-overlay__header {
  position: absolute;
  top: 16px;
  right: 16px
}

.menu-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  color: var(--color-primary-dark);
  background: var(--color-background-alt);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}

.menu-overlay__close:hover {
  background: #E5E7EB;
}

.menu-overlay__nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center
}

.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  width: 100%
}

.mobile-menu a {
  display: inline-block;
  color: var(--color-primary-dark);
  font-family: var(--font-family-headings);
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  padding: 10px 16px;
  border-radius: 8px;
  transition: color .2s ease, background-color .2s ease;
}

.mobile-menu a:hover {
  color: var(--color-accent);
  background-color: var(--color-background-alt);
}

/* ---- Menú Móvil con Desplegable (REDISEÑADO para empujar contenido) ---- */
.mobile-menu__toggle {
  color: var(--color-primary-dark);
  font-family: var(--font-family-headings);
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  background: none;
  border: none;
  padding: 10px 16px;
  width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.mobile-menu__toggle .arrow {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--color-text-light);
  border-bottom: 3px solid var(--color-text-light);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.mobile-menu__item--has-children.is-open .mobile-menu__toggle .arrow {
  transform: rotate(-135deg);
}

.mobile-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
  background-color: var(--color-background-alt);
  border-radius: 12px;
}

.mobile-menu__item--has-children.is-open .mobile-submenu {
  max-height: 300px;
  margin-top: 8px;
}

.mobile-submenu li {
  padding: 2px 0;
}

.mobile-submenu a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 10px 16px;
}

.mobile-submenu a:hover {
  color: var(--color-accent);
  background: none;
}

/* ---- Fin Menú Móvil ---- */
body.nav-open {
  overflow: hidden
}

/* Breakpoints (768px y superior) */
@media (min-width: 768px) {
  .site-header__logo a {
    font-size: 1.8rem;
  }

  .site-header__container {
    justify-content: initial;
  }

  .site-header__logo {
    flex-shrink: 0;
  }

  .site-header__nav-desktop {
    display: flex;
    flex: 1;
    justify-content: center;
    margin: 0 20px;
  }

  .main-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px
  }

  .site-header__actions {
    margin-left: auto;
    flex-shrink: 0;
  }

  .fixed-hamburger {
    display: none
  }
}

/* ---- Ajuste para un header más ancho en pantallas grandes ---- */
@media (min-width: 1400px) {
  .site-header>.container {
    max-width: 1360px;
  }
}

/* ================================================================
   Botón exclusivo del header: WhatsApp
   (Clase única, aislada de estilos globales)
   Verde más oscuro + icono y texto blancos
================================================================= */
.site-header .whatsapp-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: #128C7E; /* verde más oscuro */
  color: #fff;         /* texto blanco */
  font-family: var(--font-family-headings);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease;
  margin: 0;
}

.site-header .whatsapp-header-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  fill: currentColor; /* icono blanco */
}

.site-header .whatsapp-header-btn:hover {
  background: #0F7A6E; /* un tono más oscuro al hover */
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

.site-header .whatsapp-header-btn:active {
  transform: translateY(1px);
}

.site-header .whatsapp-header-btn:focus-visible {
  outline: 2px solid #0F7A6E;
  outline-offset: 2px;
}











/* =================================================================
   FOOTER (Diseño v5 - Grid, Navegación y Políticas)
================================================================== */
.site-footer {
  background-color: var(--color-background-alt);
  color: var(--color-text-light);
  padding: 80px 0 40px;
  border-top: 1px solid #E5E7EB;
  font-size: 0.95rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 60px;
  border-bottom: 1px solid #E5E7EB;
}

.site-footer__logo a {
  font-family: var(--font-family-headings);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.site-footer__logo a span {
  color: var(--color-accent);
}

.site-footer__tagline {
  margin: 15px 0 0;
  line-height: 1.7;
  max-width: 350px;
}

.site-footer__widget-title {
  font-family: var(--font-family-headings);
  color: var(--color-primary-dark);
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 18px;
  font-weight: 600;
}

.site-footer__widget p {
  margin: 0;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links-list li {
  margin-bottom: 12px;
}

.footer-links-list a,
.footer-email-link {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links-list a:hover,
.footer-email-link:hover {
  color: var(--color-accent);
}

.footer-email-link {
  font-weight: 500;
  color: var(--color-text);
}

.site-footer__bottom-bar {
  padding-top: 30px;
  text-align: center;
  font-size: 0.9rem;
}

/* ---- Footer Responsive ---- */
@media (max-width: 992px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer__tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer__bottom-bar {
    text-align: center;
  }
}

/* =================================================================
   WHATSAPP MODAL INTERACTIVO
================================================================== */
.whatsapp-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.whatsapp-modal-wrapper.is-open {
  opacity: 1;
  visibility: visible;
}

.whatsapp-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.whatsapp-modal__content {
  position: relative;
  width: 100%;
  max-width: 520px;
  background-color: var(--color-background);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #E5E7EB;
  overflow: hidden;
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.whatsapp-modal-wrapper.is-open .whatsapp-modal__content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.whatsapp-modal__form-view {
  padding: 32px 40px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.whatsapp-modal__header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.whatsapp-modal__title {
  font-size: 1.8rem;
  margin: 0 0 8px;
}

.whatsapp-modal__subtitle {
  margin: 0;
  color: var(--color-text-light);
  font-size: 1rem;
  line-height: 1.6;
}

.whatsapp-modal__close {
  position: absolute;
  top: -20px;
  right: -24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-background-alt);
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.whatsapp-modal__close:hover {
  background: #E5E7EB;
  color: var(--color-primary-dark);
  transform: rotate(90deg);
}

.whatsapp-modal__close svg {
  width: 20px;
  height: 20px;
}

.whatsapp-modal__form .form-group {
    margin-bottom: 24px;
}

.whatsapp-modal__form .form-group:last-of-type {
    margin-bottom: 32px;
}

.whatsapp-modal__form label {
  font-family: var(--font-family-headings);
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
  font-size: 1rem;
  display: block;
}

/* ---- Estilo para los desplegables (select) personalizados ---- */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234B5563'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  transition: transform .2s ease;
}

.whatsapp-modal__form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  background-color: var(--color-background-alt);
  border: 2px solid #E5E7EB;
  border-radius: var(--border-radius);
  padding: 12px 40px 12px 16px;
  font-family: var(--font-family-base);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.whatsapp-modal__form select:hover {
  border-color: #D1D5DB;
}

.whatsapp-modal__form select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.whatsapp-modal__form .button--whatsapp {
  width: 100%;
  gap: 12px;
}

.whatsapp-modal__form .button--whatsapp svg {
  margin-right: 0;
}

/* ---- ESTILOS DE LA MAGIA: PANTALLA DE ENVÍO Y ANIMACIÓN ---- */
.whatsapp-modal__success-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: #fff;
  font-family: var(--font-family-headings);
  font-size: 1.5rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
}

.whatsapp-modal__paper-plane {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  transform: translateY(30px) scale(0.5);
}

/* Estado de envío: "is-sending" */
.whatsapp-modal-wrapper.is-sending .whatsapp-modal__form-view {
  opacity: 0;
  transform: scale(0.95);
}

.whatsapp-modal-wrapper.is-sending .whatsapp-modal__success-view {
  opacity: 1;
  transition: opacity 0.4s ease 0.2s;
}

.whatsapp-modal-wrapper.is-sending .whatsapp-modal__paper-plane {
  animation: fly-and-away 1.5s cubic-bezier(0.5, -0.25, 0.5, 1.25) forwards;
}

@keyframes fly-and-away {
  0% {
    transform: translateY(50px) scale(0.5) rotate(0deg);
    opacity: 0;
  }
  30% {
    transform: translateY(0) scale(1) rotate(-15deg);
    opacity: 1;
  }
  70% {
    transform: translateY(-20px) scale(1) rotate(5deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-150px) translateX(100px) scale(0) rotate(45deg);
    opacity: 0;
  }
}

/* Responsive del Modal */
@media (max-width: 576px) {
  .whatsapp-modal__form-view {
    padding: 24px;
  }
  .whatsapp-modal__title {
    font-size: 1.5rem;
  }
  .whatsapp-modal__close {
    top: -12px;
    right: -8px;
  }
}