/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   Nav · Buttons · Footer
   ═══════════════════════════════════════════════════════════ */


/* ── Web Components ──────────────────────────────────────── */

mtp-nav { display: contents; }


/* ── Skip link ───────────────────────────────────────────────
   Primer elemento enfocable del documento (lo inyecta <mtp-nav>).
   Fuera de pantalla hasta recibir foco por teclado. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: var(--space-8) var(--space-16);
  background: var(--color-accent);
  color: var(--color-primary);
  border-radius: var(--radius-8);
  font-size: var(--text-ui);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}


/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  border-radius: var(--radius-32);
  font-family: inherit;
  font-variation-settings: inherit;
  font-size: var(--text-ui);
  font-weight: 600;
  line-height: var(--lh-ui);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.18s ease;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.85;
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-primary);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-accent);
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}


/* ── Navigation ──────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav--scrolled {
  background: rgb(var(--color-bg-rgb) / 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav__container {
  max-width: 1280px;
  margin-inline: auto;
  padding: 20px clamp(var(--space-32), 5vw, var(--space-88));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-32);
}

.nav__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-32);
}

.nav__link {
  font-size: var(--text-ui);
  font-weight: 500;
  line-height: var(--lh-ui);
  color: var(--color-white);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  font-variation-settings: inherit;
  transition: opacity 0.15s ease;
}

.nav__link:hover {
  opacity: 0.75;
}

.nav__link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav__chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav__link[aria-expanded="true"] .nav__chevron {
  transform: rotate(180deg);
}

.nav__ctas {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-shrink: 0;
}

/* Dropdown */

.nav__item {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-16);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 320px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

/* Abierto únicamente vía aria-expanded (JS controla apertura) */
.nav__link[aria-expanded="true"] ~ .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Item simple (Soluciones, etc.) */
.nav-dropdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius-8);
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-dropdown__item:hover { background: var(--color-surface); }

.nav-dropdown__item span {
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  line-height: var(--lh-caption);
}

/* Variante con cards e imágenes (Profesionales) */
.nav-dropdown--pro {
  min-width: 380px;
  padding: 10px;
  gap: 8px;
}

.nav-dropdown__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-8);
  overflow: hidden;
  text-decoration: none;
  background: var(--color-white);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.nav-dropdown__card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.nav-dropdown__card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-8) var(--radius-8) 0 0;
}

.nav-dropdown__card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.nav-dropdown__card:hover .nav-dropdown__card-img img {
  transform: scale(1.04);
}

/* Dropdown Soluciones: 4 cards en una sola fila, no 2+2 */
#dropdown-soluciones {
  grid-template-columns: repeat(4, 1fr);
  min-width: 740px;
}

/* Dropdown Soluciones: mockups encajan completos sin recorte */
#dropdown-soluciones .nav-dropdown__card-img {
  background: var(--color-bg);
}
#dropdown-soluciones .nav-dropdown__card-img img {
  object-fit: scale-down;
  padding: 8px;
}
#dropdown-soluciones .nav-dropdown__card:hover .nav-dropdown__card-img img {
  transform: none;
}

.nav-dropdown__card span {
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  line-height: var(--lh-caption);
  padding: 4px 10px 12px;
}


/* ── Footer ──────────────────────────────────────────────── */

.footer {
  background-color: var(--color-footer);
  background-image: none;
  padding-bottom: var(--space-48);
}

/* Decorativo SVG top — full viewport width, sin padding */
.footer__top-deco {
  display: block;
  width: 100%;
  height: auto;
  /* Elimina el gap de inline que dejaría espacio bajo el svg */
  vertical-align: top;
}

.footer__container {
  width: min(1200px, 100% - var(--space-64));
  margin-inline: auto;
  padding-top: var(--space-48);
}

/* Zona 1 — logo + social */

.footer__brand {
  position: relative;
  margin-bottom: var(--space-40);
}

.footer__logo {
  height: 48px;
  width: auto;
}

.footer__social {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  position: absolute;
  right: 0;
  bottom: 4px;
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.footer__social a:hover {
  opacity: 1;
}

/* Zona 2 — links */

.footer__links {
  display: grid;
  grid-template-columns: 153px 283px 201px;
  gap: 44px;
  padding-block: var(--space-32);
  border-top: 1px solid rgba(214, 241, 245, 0.12);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__col a {
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--color-accent);
  line-height: var(--lh-body);
  transition: opacity 0.15s ease;
}

.footer__col a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Zona 3 — legal */

.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-24);
  padding-block: var(--space-24);
  border-top: 1px solid rgba(214, 241, 245, 0.08);
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--color-accent);
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE NAV — hamburger + mobile menu
   ═══════════════════════════════════════════════════════════ */

.nav__hamburger { display: none; }

/* ── Mobile nav overlay: oculto en desktop ───────────────── */
.nav__overlay { display: none; }

/* ── Nav overlay (≤1024px) ──────────────────────────────────
   El overlay reemplaza el panel de navegación en tablet y móvil.
   Se activa via JS añadiendo .nav__overlay--open.            */
@media (max-width: 1024px) {

  /* Los links/CTAs de desktop se sustituyen por el overlay */
  .nav__links { display: none; }
  .nav__ctas  { display: none; }

  /* ── Hamburger icon ──────────────────────────────────────── */
  .nav__hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
  }

  .nav__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
  }

  /* Overlay: full-screen, oculto por defecto */
  .nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(2, 21, 23, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    flex-direction: column;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
  }
  .nav__overlay--open { display: flex; }

  /* Top bar del overlay: mismo padding que .nav__container para que
     logo y botón queden exactamente en la misma posición que el nav cerrado */
  .nav__overlay-top {
    padding: 20px clamp(var(--space-32), 5vw, var(--space-88));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  .nav__overlay-top img { height: 32px; width: auto; }

  /* Botón cerrar: mismo tamaño y padding que el hamburger (8px + 24px icon) */
  .nav__overlay-close {
    width: 40px;
    height: 40px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-accent);
    flex-shrink: 0;
  }

  /* Nav del overlay */
  .nav__overlay-nav {
    flex: 1;
    padding: 12px 20px 0;
    display: flex;
    flex-direction: column;
  }

  /* Links principales del overlay */
  .nav__overlay-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    font-size: 22px;
    font-weight: 500;
    color: var(--color-white);
    border-bottom: 1px solid rgba(214, 241, 245, 0.08);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
  }

  .nav__overlay-chevron { flex-shrink: 0; transition: transform 0.2s ease; }
  .nav__overlay-link[aria-expanded="true"] .nav__overlay-chevron { transform: rotate(180deg); }

  /* Sub-menú acordeón */
  .nav__overlay-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0 12px;
  }
  .nav__overlay-sub[hidden] { display: none; }
  .nav__overlay-sub a {
    display: block;
    padding: 10px 4px;
    font-size: 15px;
    color: var(--color-accent);
    opacity: 0.82;
    text-decoration: none;
  }

  /* Footer del overlay */
  .nav__overlay-footer {
    padding: 18px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-shrink: 0;
    border-top: 1px solid rgba(214, 241, 245, 0.08);
    text-align: center;
  }
  .nav__overlay-footer > p {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(214, 241, 245, 0.5);
  }

  .nav__overlay-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  .nav__overlay-badges img { height: 44px; width: auto; }

  .nav__overlay-footer .btn { text-align: center; }

  .nav__overlay-login {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-accent);
    opacity: 0.7;
    text-decoration: none;
  }
}

/* ── Footer responsive (≤768px) ──────────────────────────────
   Desktop usa grid-template-columns en px fijos (153/283/201) y
   .footer__social posicionado absoluto a la derecha de la marca —
   ambos rompen/desbordan en mobile. Aquí: social apilado debajo
   del logo, y los links pasan de 3 a 2 columnas con la 3ª
   ocupando el ancho completo debajo. */
@media (max-width: 768px) {
  .footer__container { padding-inline: var(--space-20); }

  .footer__brand {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }
  .footer__social {
    position: static;
    gap: var(--space-12);
  }

  .footer__links {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-24);
  }
  .footer__links .footer__col:last-child {
    grid-column: 1 / -1;
  }

  .footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
    text-align: left;
  }
}


/* ═══════════════════════════════════════════════════════════
   DEMO MODAL — popup global de "Solicitar demo"
   Incluido aquí (no en contacto.css) para que esté disponible
   en todas las páginas que usen demo-modal.js.
   ═══════════════════════════════════════════════════════════ */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-20);
}

.demo-modal[hidden] { display: none; }

.demo-modal [hidden] { display: none !important; }

.demo-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 21, 23, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: demoModalFade 0.2s ease;
}

.demo-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  background: #F4FAFB;
  border-radius: var(--radius-24);
  padding: clamp(var(--space-24), 3vw, var(--space-40));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: demoModalPop 0.22s ease;
}

@keyframes demoModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoModalPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-modal__overlay, .demo-modal__dialog { animation: none; }
}

.demo-modal__close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 81, 90, 0.08);
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.demo-modal__close:hover { background: rgba(10, 81, 90, 0.16); }

.demo-modal__head {
  margin-bottom: var(--space-24);
  padding-right: var(--space-40);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.demo-modal__title {
  font-size: clamp(22px, 3vw, var(--text-h2));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--color-primary);
}

.demo-modal__subtitle {
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: rgba(10, 81, 90, 0.7);
}

.demo-modal__steps {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.demo-modal__steps li {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--text-ui);
  font-weight: 600;
  color: rgba(10, 81, 90, 0.45);
}

.demo-modal__steps li::before {
  content: attr(data-num);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 81, 90, 0.12);
  color: var(--color-primary);
  font-size: var(--text-caption);
}

.demo-modal__steps li.is-active { color: var(--color-primary); }
.demo-modal__steps li.is-active::before {
  background: var(--color-primary);
  color: var(--color-accent);
}

.demo-modal__steps li:first-child::after {
  content: "";
  width: 24px;
  height: 1px;
  background: rgba(10, 81, 90, 0.2);
  margin-left: var(--space-8);
}

.demo-modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.demo-modal__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.demo-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
  margin-top: var(--space-8);
}

.demo-modal__actions .btn { min-width: 120px; }

.demo-modal .btn--outline {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.demo-modal__error {
  font-size: var(--text-ui);
  line-height: var(--lh-ui);
  color: #c0392b;
}

.demo-modal__success {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) 0;
}

.demo-modal__success-icon {
  width: 56px;
  height: 56px;
  padding: var(--space-12);
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-accent);
}

.demo-modal__success-title {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: var(--lh-h3);
  color: var(--color-primary);
}

.demo-modal__success-text {
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: rgba(10, 81, 90, 0.7);
  max-width: 420px;
}

body.demo-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .demo-modal { padding: 0; align-items: stretch; }
  .demo-modal__dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .demo-modal__actions { flex-direction: column-reverse; }
  .demo-modal__actions .btn { width: 100%; }
}
