/* ACMP global nav — dropdown desktop + mobile overlay (rules/menu.json) */

/* ---- Barra desktop: fondo naranja + links blancos ---- */
.acmp-nav {
  background: var(--acmp-orange, #f74604);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.acmp-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 72px;
  padding: 0 clamp(16px, 2.5vw, 28px);
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.5vw, 20px);
}

.acmp-nav-left {
  flex: 0 0 auto;
  min-width: 0;
}

.acmp-nav-links {
  flex: 1 1 auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 22px);
  min-width: 0;
  transform: none !important;
  position: static !important;
}

.acmp-nav-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acmp-nav-logo-img {
  height: clamp(36px, 4vw, 46px);
  width: auto;
  display: block;
  margin-top: -4px;
}

.acmp-nav .acmp-logo img,
.acmp-nav-logo-img {
  filter: brightness(0) invert(1);
}

.acmp-nav-link,
.acmp-nav-dropdown-toggle {
  color: #fff;
  font-family: 'DM Sans', var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  font-size: clamp(12px, 1.05vw, 14px);
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.acmp-nav-link:hover,
.acmp-nav-dropdown-toggle:hover {
  color: rgba(255, 255, 255, 0.88);
}

.acmp-nav-link.is-active {
  color: #fff;
  opacity: 0.95;
}

.acmp-nav-burger {
  display: none;
  color: #fff;
}

.acmp-nav-burger:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* CTA del navbar: pastilla blanca con texto naranja.
   Va con !important a propósito. El css/<page>.css carga DESPUÉS de nav.css, y más de
   una entrega trae reglas sueltas del tipo `a.acmp-btn-primary { color:#fff !important }`
   pensadas para los botones de la página: sin blindaje le pisan el color al CTA y queda
   blanco sobre blanco (pasó en nosotros.html). El navbar es global — manda nav.css. */
.acmp-nav .acmp-nav-cta.acmp-btn-primary,
.acmp-nav a.acmp-nav-cta.acmp-btn-primary:link,
.acmp-nav a.acmp-nav-cta.acmp-btn-primary:visited {
  background: #fff !important;
  color: var(--acmp-orange, #f74604) !important;
  box-shadow: none;
  font-size: clamp(12px, 1vw, 14px);
  padding: clamp(10px, 1vw, 12px) clamp(14px, 1.4vw, 20px);
}

.acmp-nav .acmp-nav-cta.acmp-btn-primary:hover,
.acmp-nav a.acmp-nav-cta.acmp-btn-primary:hover,
.acmp-nav a.acmp-nav-cta.acmp-btn-primary:active,
.acmp-nav a.acmp-nav-cta.acmp-btn-primary:focus {
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--acmp-orange-700, #c93803) !important;
}

/* Desktop compacto antes del breakpoint mobile */
@media (min-width: 1201px) and (max-width: 1360px) {
  .acmp-nav-links {
    gap: 10px;
  }

  .acmp-nav-link,
  .acmp-nav-dropdown-toggle {
    font-size: 12px;
  }
}

/* Tablet: hamburguesa (evita solapamiento de links con logo) */
@media (max-width: 1200px) {
  .acmp-nav-links {
    display: none !important;
  }

  .acmp-nav-burger {
    display: inline-flex !important;
  }

  .acmp-nav-cta {
    display: none !important;
  }

  .acmp-nav-inner {
    height: 64px;
  }
}

@media (min-width: 1201px) {
  .acmp-nav-inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-content: unset;
  }

  .acmp-nav-left {
    position: relative;
    z-index: 2;
  }

  .acmp-nav-links {
    flex: unset;
    justify-self: center;
    max-width: 100%;
    pointer-events: none;
  }

  .acmp-nav-links > * {
    pointer-events: auto;
  }

  .acmp-nav-right {
    justify-self: end;
  }

  .acmp-nav-burger {
    display: none !important;
  }
}

/* ---- Desktop dropdown ---- */
.acmp-nav-dropdown {
  position: relative;
  /* Extiende el hit-area hacia el menú flotante (position:absolute no agranda el padre) */
  padding-bottom: 18px;
  margin-bottom: -18px;
}
.acmp-nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 0;
}
.acmp-nav-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.acmp-nav-dropdown.is-open .acmp-nav-dropdown-toggle .acmp-nav-chevron,
.acmp-nav-dropdown:hover .acmp-nav-dropdown-toggle .acmp-nav-chevron {
  transform: rotate(180deg);
}
.acmp-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--acmp-gray-200, #e6e6e6);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(34, 43, 73, 0.14);
  padding: 8px 0;
  z-index: 60;
}
/* Puente invisible toggle → menú (evita perder hover en el gap) */
.acmp-nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}
.acmp-nav-dropdown:hover .acmp-nav-dropdown-menu,
.acmp-nav-dropdown.is-open .acmp-nav-dropdown-menu {
  display: block;
}
.acmp-nav-dropdown.is-multi-col .acmp-nav-dropdown-menu {
  min-width: min(560px, calc(100vw - 48px));
  max-width: min(640px, calc(100vw - 48px));
  padding: 8px;
  column-count: 2;
  column-gap: 0;
}
.acmp-nav-dropdown-link {
  display: block;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--acmp-navy, #222b49);
  text-decoration: none;
  white-space: nowrap;
  break-inside: avoid;
}
.acmp-nav-dropdown.is-multi-col .acmp-nav-dropdown-link {
  white-space: normal;
  line-height: 1.35;
  padding: 9px 14px;
}
.acmp-nav-dropdown-link:hover {
  background: var(--acmp-gray, #f2f2f2);
  color: var(--acmp-orange, #f74604);
}

/* ---- Mobile: full-screen overlay ---- */
.acmp-nav-mobile {
  display: none;
}

@media (max-width: 1200px) {
  .acmp-nav-mobile {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--acmp-orange, #f74604);
    overflow: hidden;
    animation: acmp-mobile-in 0.2s ease-out;
  }
  @keyframes acmp-mobile-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .acmp-logo--inverted img {
    filter: brightness(0) invert(1);
  }

  .acmp-nav-mobile-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }

  .acmp-nav-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 10px;
  }
  .acmp-nav-mobile-close:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .acmp-nav-mobile-scroll {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
  }

  .acmp-nav-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    font-family: var(--font-section, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 17px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }

  .acmp-nav-mobile-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    background: #ffe066;
    color: var(--acmp-navy, #222b49);
  }

  .acmp-nav-mobile-accordion {
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }

  .acmp-nav-mobile-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    font-family: var(--font-section, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 17px;
    color: #fff;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
  }
  .acmp-nav-mobile-accordion-toggle .acmp-nav-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
  }
  .acmp-nav-mobile-accordion.is-open .acmp-nav-mobile-accordion-toggle .acmp-nav-chevron {
    transform: rotate(180deg);
  }

  .acmp-nav-mobile-accordion-body {
    padding-bottom: 8px;
  }

  .acmp-nav-mobile-sublink {
    display: block;
    padding: 11px 0 11px 4px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .acmp-nav-mobile-sublink:last-child {
    border-bottom: 0;
  }
  .acmp-nav-mobile-sublink:active {
    color: #fff;
    opacity: 0.85;
  }

  .acmp-nav-mobile-footer {
    flex-shrink: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.22);
  }

  .acmp-nav-mobile-cta {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 16px 22px;
    border-radius: 14px;
    background: #fff !important;
    color: var(--acmp-orange, #f74604) !important;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: none;
  }
  .acmp-nav-mobile-cta:hover {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--acmp-orange-700, #c93803) !important;
  }
}
