[x-cloak] {
  display: none !important;
}

/* ── Scroll progress bar ── */
.scroll-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--color-bg-accent, #a30052);
  pointer-events: none;
}

@media (min-width: 768px) {
  .scroll-progress-bar {
    display: none;
  }
}

/* ── Base nav ── */
.nx-mega {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-bg-surface, #fff);
  font-family: "Open Sans", sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nx-mega__wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: var(--space-border-width-regular-1, 1px) solid var(--color-border-brand-primary, #a30052);
  padding-block: 1rem;
  justify-content: space-between;
  padding-inline: var(--space-padding-600-48, 48px);
}

/* ── Logo ── */
.nx-mega__logo-link {
  max-width: 232px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 16px;
  text-decoration: none;
}

.nx-mega__logo {
  width: 100%;
}

@media (max-width: 768px) {
  .nx-mega__logo-link {
    max-width: 100px;
  }
}

/* ── Testing mode ── */
.nx-mega__item--testing-open.nx-mega__item--cascade > div:first-of-type {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ── Lista L1 ── */
.nx-mega__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

@media (min-width: 769px) {
  .nx-mega__list .nx-mega__item {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Link L1 ── */
.nx-mega__link {
  color: var(--color-txt-primary, #212121);
  font-family: var(--body-400-font-family-400, "Open Sans");
  font-size: var(--body-400-font-size-400, 16px);
  font-weight: 400;
  line-height: var(--body-400-line-height-400, 26px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nx-mega__link:hover,
.nx-mega__link--active {
  color: var(--color-bg-accent, #a30052);
}

.nx-mega__link--mobile {
  display: none;
}

/* Chevron L1 */
.nx-mega__chevron {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nx-mega__item--cascade [aria-expanded="true"] .nx-mega__chevron,
.nx-mega__item--dropdown [aria-expanded="true"] .nx-mega__chevron,
.nx-mega__ctrl-dropdown [aria-expanded="true"] .nx-mega__chevron {
  transform: rotate(180deg);
}

/* ── Dropdown simple ── */
.nx-mega__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: var(--color-bg-surface, #fff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  z-index: 100;
}

@media (min-width: 769px) {
  .nx-mega__item--dropdown > .nx-mega__dropdown {
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }
}

.nx-mega__dropdown::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.nx-mega__dropdown-item a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  transition: background 0.15s ease;
}

.nx-mega__dropdown-item a:hover,
.nx-mega__dropdown-item--active a {
  background: #f5f5f5;
  color: var(--color-bg-accent, #a30052);
}

/* ── Cascading panel ── */
.nx-mega__item--cascade > div:first-of-type {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-bg-surface, #fff);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.24), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
  z-index: 100;
}

.nx-mega__item--cascade > div:first-of-type::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.nx-mega__panel {
  /* no extra padding; columns are self-contained */
}

/* Flex row of cascading columns */
.nx-mega__panel-cols {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 220px;
}

/* ── Individual column ── */
.nx-mega__col {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: 320px;
  border-right: 1px solid var(--neutral-200, #f0f0f0);
  overflow-y: auto;
  max-height: 60vh;
}

.nx-mega__col:last-child {
  border-right: none;
}

/* L2: slight background to visually separate from L3 */
.nx-mega__col--l2 {
  min-width: 240px;
}

.nx-mega__col--l3 {
  background: #fff;
}

.nx-mega__col--l4 {
  background: #fafafa;
}

/* ── Items within columns ── */
.nx-mega__col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 15px;
  font-family: "Open Sans", sans-serif;
  color: var(--color-txt-primary, #212121);
  text-decoration: none;
  border: none;
  border-bottom: 1px solid var(--neutral-200, #f0f0f0);
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
  gap: 8px;
}

.nx-mega__col-item:last-child {
  border-bottom: none;
}

.nx-mega__col-item:hover {
  background: var(--neutral-50, #f5f5f5);
  color: var(--color-bg-accent, #a30052);
}

/* Selected state (toggled by Alpine :class) */
.nx-mega__col-item.is-selected {
  color: var(--color-bg-accent, #a30052);
  font-weight: 600;
  background: #fff;
}

/* Active trail */
.nx-mega__col-item.is-active,
.nx-mega__col-item-label.is-active {
  color: var(--color-bg-accent, #a30052);
}

/* Label inside button (separates text from chevron) */
.nx-mega__col-item-label {
  flex: 1;
  min-width: 0;
}

/* Chevron icon inside col item */
.nx-mega__col-chevron {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--color-txt-secondary, #a0a0a0);
  transition: color 0.15s ease, transform 0.15s ease;
}

.nx-mega__col-item.is-selected .nx-mega__col-chevron {
  color: var(--color-bg-accent, #a30052);
  transform: translateX(2px);
}

/* ── Controls bar ── */
.nx-mega__controls {
  background: var(--color-bg-negative, #556372);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--color-bg-negative, #556372);
  font-size: 13px;
}

.nx-mega__controls:not(:has(.nx-mega__switcher)) span {
  display: none;
}

/* ── Switcher ── */
.nx-mega__switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nx-mega__switcher-option {
  color: var(--color-txt-negative, #fff);
  font-family: var(--body-200-font-family-200, "Open Sans");
  font-size: var(--body-200-font-size-200, 12px);
  font-weight: 400;
  line-height: var(--body-200-line-height-200, 16px);
  text-decoration: none;
}

.nx-mega__switcher-option.is-active {
  font-weight: 600;
}

.nx-mega__switcher-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--color-bg-surface, #fff);
  flex-shrink: 0;
  transition: background 0.2s ease;
  border: solid 1px var(--color-bg-brand-secondary-soft-press, #099bb0);
  text-decoration: none;
}

.nx-mega__switcher-knob {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-bg-brand-secondary-soft-press, #099bb0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}

.nx-mega__switcher-toggle[aria-checked="true"] .nx-mega__switcher-knob {
  left: calc(100% - 19px);
}

/* ── Ctrl dropdown (idioma) ── */
.nx-mega__ctrl-dropdown {
  position: relative;
}

.nx-mega__ctrl-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  color: var(--color-txt-negative, #fff);
  font-family: "Open Sans";
  font-size: 13px;
  font-weight: 400;
  line-height: 21px;
  text-decoration: none;
}

.nx-mega__ctrl-menu {
  position: absolute;
  top: 100%;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 140px;
  z-index: 300;
  border-radius: 4px;
}

.nx-mega__ctrl-menu::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.nx-mega__ctrl-menu-link {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.nx-mega__ctrl-menu-link:hover {
  background: #f5f5f5;
  color: var(--color-bg-accent, #a30052);
}

/* ── Hamburger ── */
.nx-mega__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
}

.nx-mega__hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  color: var(--color-bg-interactive) !important;
}

/* ── Overlay móvil ── */
.nx-mega__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* ── Switcher mobile ── */
.nx-mega__item--switcher-mobile {
  display: none !important;
}

.nx-mega__switcher-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-bg-surface, #fff);
}

.nx-mega__switcher-mobile .nx-mega__switcher-option {
  color: var(--color-txt-primary, #212121);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.nx-mega__switcher-mobile .nx-mega__switcher-option.is-active {
  color: var(--color-bg-accent, #a30052);
  font-weight: 600;
}

.nx-mega__switcher-mobile .nx-mega__switcher-toggle {
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nx-mega__hamburger {
    display: flex;
  }

  .nx-mega__item--switcher-mobile {
    display: block !important;
  }

  .nx-mega__switcher {
    display: none;
  }

  .nx-mega__link--desktop {
    display: none;
  }

  .nx-mega__link--mobile {
    display: flex;
    width: 100%;
  }

  .nx-mega__list {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100dvh;
    width: min(320px, 85vw);
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg-surface, #fff);
    overflow-y: auto;
    z-index: 100;
    transition: left 0.3s ease;
    padding-top: 60px;
  }

  .nx-mega__list--open {
    left: 0;
  }

  .nx-mega__dropdown,
  .nx-mega__item--cascade > div:first-of-type {
    position: static;
    box-shadow: none;
  }

  /* Columns stack vertically on mobile */
  .nx-mega__panel-cols {
    flex-direction: column;
    min-height: 0;
  }

  .nx-mega__col {
    min-width: 0;
    max-width: none;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--neutral-200, #f0f0f0);
  }

  .nx-mega__col--l3,
  .nx-mega__col--l4 {
    padding-left: 16px;
  }

  .nx-mega__col:last-child {
    border-bottom: none;
  }

  .nx-mega__overlay {
    display: block;
  }

  @media (max-width: 678px) {
    .nx-mega__item:has(.nx-mega__link[aria-expanded="true"]) {
      position: relative;
    }

    .nx-mega__item:has(.nx-mega__link[aria-expanded="true"])::before {
      content: '';
      background: var(--color-bg-accent);
      width: 2px;
      position: absolute;
      left: 2px;
      height: 100%;
    }
  }
}

.is-admin .nx-mega {
    top: 80px;
}
