/* Menú Cabecera Profic — pixel-perfect vs Figma Home
 * Desktop Menu (1:1137) + Header_Desktop_B (1:1138)
 * Tablet Menu (1:1502) · Mobile Menu (1:1867)
 */

:root {
  /* Figma Header_Desktop_B / kit secondary — muestreo ~rgb(9,6,17) */
  --profic-menu-bg: #090511;
  /* header.json box_shadow: 0 / 6 / 11.7 / rgba(0,0,0,0.2) */
  --profic-menu-shadow: 0 6px 11.7px rgba(0, 0, 0, 0.2);
  --profic-menu-shadow-open: 0 6px 6px rgba(0, 0, 0, 0.2);
  /* kit primary CTA Purple */
  --profic-menu-btn-bg: #4f10cd;
  --profic-menu-btn-hover: #090511;
  --profic-menu-btn-hover-border: #4f10cd;
  --profic-menu-btn-pressed: rgba(255, 255, 255, 0.08);
  --profic-menu-btn-pressed-border: rgba(255, 255, 255, 0.22);
  --profic-font-family: 'Amsi Pro', sans-serif;
}

/* Anular stacking context de Elementor */
.elementor-widget-profic_header_menu {
  position: static !important;
  z-index: 999999 !important;
}

/* Contenedor fijo — Figma Menu y=37 en Desktop/Tablet/Mobile */
.profic-menu-wrapper {
  font-family: var(--profic-font-family);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  padding: 37px 0 0;
  box-sizing: border-box;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999999 !important;
  pointer-events: none;
  transition: padding 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow-x: clip;
}

body.admin-bar .profic-menu-wrapper {
  top: 32px !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar .profic-menu-wrapper,
  body.admin-bar .profic-menu-wrapper.is-scrolled {
    top: 46px !important;
    /* La barra de WP ya empuja 46px; no sumar el inset Figma de 37px. */
    padding-top: 8px;
  }
}

.profic-menu-wrapper.is-scrolled {
  padding: 16px 0 0;
}

/* Gradiente superior Figma Rectangle 1165 (1:1136): 2770×187.
 * Suave: un scrim opaco apaga el glow del Hero y el pill se ve más negro. */
.profic-menu-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 187px;
  background: linear-gradient(
    180deg,
    rgba(5, 5, 8, 0.35) 0%,
    rgba(5, 5, 8, 0.12) 45%,
    rgba(5, 5, 8, 0) 100%
  );
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.profic-header-menu {
  pointer-events: auto;
  /* Fill sólido #090511 + Background Blur (sin stroke / sin inset) */
  background-color: var(--profic-menu-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
  border: none !important;
  outline: none;
  box-shadow: var(--profic-menu-shadow);
  isolation: isolate;
}

.profic-menu-wrapper.is-scrolled .profic-header-menu {
  background-color: var(--profic-menu-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none !important;
  box-shadow: var(--profic-menu-shadow);
}

/* Inner — Figma/header.json: padding 10 / 10 / 10 / 40 (derecha corta: el CTA ya trae pad) */
.profic-menu-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 10px 10px 10px 40px;
  box-sizing: border-box;
  justify-content: space-between;
}

/* Logotipo — Figma 127 × 25.084 */
.profic-menu-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.profic-menu-logo-container {
  height: 25.084px;
  width: 127px;
  position: relative;
}

.profic-menu-logo-container img {
  position: absolute;
  inset: 0;
  max-width: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Nav + CTA — Figma Acciones (I1:1138;2180:957): gap 16 entre links y CTA */
.profic-menu-desktop-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Links — Amsi Pro SemiBold 16/16, pad 15×20, radius 53 */
.profic-menu-link {
  background-color: transparent;
  color: #ffffff;
  text-decoration: none;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  border-radius: 53px;
  font-family: var(--profic-font-family);
  font-size: 16px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

.profic-menu-link:hover,
.profic-menu-link:focus-visible {
  background-color: rgba(255, 255, 255, 0.06);
}

/* Figma Header: link de la sección visible / página actual */
.profic-menu-link.is-active,
.profic-menu-link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* CTA Contactanos — estados en assets/css/profic-cta-btn.css (Figma Boton 1:7) */
.profic-menu-btn {
  flex-shrink: 0;
}

/* Hamburguesa — 31×22, barras #D9D9D9 */
.profic-menu-hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 31px;
  height: 22px;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0;
}

.profic-menu-hamburger span {
  display: block;
  background-color: #d9d9d9;
  height: 4px;
  width: 31px;
  border-radius: 8px;
  position: absolute;
  transition: all 0.3s ease;
}

.profic-menu-hamburger span:nth-child(1) {
  top: 0;
}

.profic-menu-hamburger span:nth-child(2) {
  top: 9px;
}

.profic-menu-hamburger span:nth-child(3) {
  top: 18px;
}

.profic-header-menu.is-open .profic-menu-hamburger span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}

.profic-header-menu.is-open .profic-menu-hamburger span:nth-child(2) {
  opacity: 0;
}

.profic-header-menu.is-open .profic-menu-hamburger span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

.profic-menu-mobile-expanded {
  display: none;
  width: 100%;
  background-color: var(--profic-menu-bg);
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
  box-sizing: border-box;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}

.profic-menu-mobile-expanded-inner {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.profic-menu-mobile-expanded-inner .profic-menu-link,
.profic-menu-mobile-expanded-inner .profic-menu-btn {
  width: 100%;
  justify-content: center;
  margin-left: 0;
}

/* ================= BREAKPOINTS ================= */

/* Desktop — Figma 1280: pill 1040×70, radius 50, centrado (márgenes 120)
 * Mismo corte 1280 que el resto del home: iPad Pro 1024 sigue siendo tablet. */
@media (min-width: 1280px) {
  .profic-header-menu {
    max-width: 1040px;
    height: 70px;
    border-radius: 50px;
    box-shadow: var(--profic-menu-shadow);
  }
}

/* Tablet — Figma 800 Menu (1:1502): 447×70 @ y=37, logo 127, pad 40/30 */
@media (max-width: 1279px) and (min-width: 480px) {
  .profic-menu-wrapper {
    padding: 37px 0 0;
  }

  .profic-menu-wrapper.is-scrolled {
    padding: 16px 0 0;
  }

  .profic-header-menu {
    width: 447px;
    max-width: calc(100% - 56px);
    border-radius: 50px;
    height: 70px;
    box-shadow: var(--profic-menu-shadow);
  }

  .profic-header-menu.is-open {
    border-radius: 30px;
    height: auto;
    width: min(447px, calc(100% - 56px));
  }

  .profic-header-menu.is-open::after {
    border-radius: 30px;
    box-shadow: var(--profic-menu-shadow-open);
  }

  .profic-menu-inner {
    padding: 10px 30px 10px 40px;
    height: 70px;
  }

  .profic-menu-logo-container {
    width: 127px;
    height: 25.084px;
  }

  .profic-menu-desktop-actions {
    display: none;
  }

  .profic-menu-hamburger {
    display: flex;
  }

  .profic-menu-mobile-expanded {
    display: block;
  }

  .profic-header-menu.is-open .profic-menu-mobile-expanded {
    max-height: 500px;
  }
}

/* Mobile — Figma 375 Menu (1:1867): 319×70 @ x=28 y=37
 * En 375 el inset 28px produce 319px. En iPhone 16 Pro Max (~440) el cap
 * 319px deja ~55px de aire por lado; el pill debe crecer con el viewport.
 * Al scrollear Figma pega el pill arriba: 8px + scrim opaco para que no
 * se lea contenido (p.ej. “Inteligencia artificial.”) por encima. */
@media (max-width: 479px) {
  .profic-menu-wrapper {
    padding: 37px 28px 0;
  }

  .profic-menu-wrapper.is-scrolled {
    padding: 8px 28px 0;
  }

  .profic-menu-wrapper.is-scrolled::before {
    height: 140px;
    background: linear-gradient(
      180deg,
      rgba(5, 5, 8, 0.92) 0%,
      rgba(5, 5, 8, 0.55) 42%,
      rgba(5, 5, 8, 0) 100%
    );
  }

  .profic-header-menu {
    max-width: none;
    width: 100%;
    border-radius: 50px;
    height: 70px;
    box-shadow: var(--profic-menu-shadow);
  }

  .profic-header-menu.is-open {
    border-radius: 30px;
    height: auto;
    width: 100%;
  }

  .profic-header-menu.is-open::after {
    border-radius: 30px;
    box-shadow: var(--profic-menu-shadow-open);
  }

  .profic-menu-inner {
    /* Header_Desktop_B Mobile: logo px 40 · hamburger pr 30 */
    padding: 10px 30px 10px 40px;
    height: 70px;
  }

  .profic-menu-logo-container {
    width: 127px;
    height: 25.084px;
  }

  .profic-menu-desktop-actions {
    display: none;
  }

  .profic-menu-hamburger {
    display: flex;
  }

  .profic-menu-mobile-expanded {
    display: block;
  }

  .profic-header-menu.is-open .profic-menu-mobile-expanded {
    max-height: 500px;
  }
}
