@import "../../Styles/root.css";
@import "../../Styles/fonts.css";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Cambiar el color del highlight en móviles */
* {
  -webkit-tap-highlight-color: rgba(var(--color-primary-100-rgb), 0.1);
}

html {
  padding-bottom: env(safe-area-inset-bottom);
  cursor: var(--cursor);
}

html
  :is(
    a,
    button,
    summary,
    select,
    select option,
    ul li,
    label[for],
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    input[type="checkbox"],
    input[type="radio"],
    [role="button"],
    [role="link"],
    [onclick],
    [tabindex]
  ) {
  cursor: var(--cursor-pointer) !important;
}

html :is(input[type="search"], input[type="text"], input[type="email"]) {
  cursor: var(--cursor-select) !important;
}

html.selection-active {
  cursor: var(--cursor-select) !important;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--color-bg-light);
  display: flex;
  justify-content: center;
  flex-direction: column;
}

section {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-padding);
}

@media (max-width: 768px) {
  section {
    padding-inline: var(--layout-padding-mobile);
  }
}

html,
body {
  overscroll-behavior: none;
}

/* AJUSTES PARA EL MENÚ */
.menu {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;

  margin-inline: auto;

  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  max-width: var(--layout-max-width);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 var(--layout-padding);
  box-sizing: border-box;
  z-index: 10;
  background: transparent;
  height: max-content;
}

/* Oculto al hacer scroll hacia abajo */
.menu.is-hidden {
  transform: translateY(-140%);
}

.toggle-box {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary-300);
  border-radius: 6px;
  height: 40px;
  width: 40px;
  overflow: hidden;
}

.menu-toggle {
  position: relative;
  height: 18px;
  width: 18px;
}

/* Logo */
.menu .logo {
  z-index: 2;
  position: relative;
  top: -2px;
}

.Logo_BrandLabs {
  max-height: 48px;
  width: 100%;
  transition: transform 0.3s ease;
}

.Logo_BrandLabs path {
  fill: var(--color-neutral-1000);
}

.Logo_BrandLabs:hover {
  transform: scale(1.05);
}

/* Navegación */
.nav-space {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.nav {
  display: flex;
  list-style: none;
  height: fit-content;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
}

/* Cada elemento de la lista */
.nav-item {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-transform: uppercase;
  height: fit-content;
}

/* CTA item */
.nav-item:nth-child(5) {
  background-color: var(--color-primary-300);
  border-radius: 12px;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease;
}

.nav-item:nth-child(5) .nav-link {
  font-weight: bold;
  padding: 1.2rem 1.5rem;
}

.nav-item:nth-child(5):hover {
  transform: scale(1.05);
  transform: translateY(-3px);
  background-color: var(--color-primary-400);
}

/* Enlaces del menú */
.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  text-align: center;
  font-size: clamp(13px, 1vw, 16px);
  color: var(--color-neutral-1000);
  font-family: var(--font-inter-regular);
  position: relative;
  z-index: 2;
  transition: color 0.4s ease;
}

/* UNDERLINE PRO */
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition:
    width 0.3s ease,
    left 0.3s ease;
}

/* Hover */
.nav-item:hover .nav-link {
  font-weight: bold;
}

.nav-item:hover .nav-link::after {
  width: calc(100% - 2rem);
  left: 1rem;
}

/* Active */
.nav-item.active .nav-link {
  font-weight: bold;
}

.nav-item.active .nav-link::after {
  width: calc(100% - 2rem);
  left: 1rem;
}

/* EXCLUSIÓN CTA */
.nav-item:nth-child(5) .nav-link::after,
.nav-item:nth-child(5):hover .nav-link::after,
.nav-item:nth-child(5).active .nav-link::after {
  display: none;
}

.nav-idiom {
  position: relative;
  z-index: 2;
}

.logo svg {
  height: 70px;
  width: auto;
}

#logoopenmenu {
  display: none;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .menu .logo {
    z-index: 11;
    position: relative;
    top: 0;
  }

  .logo svg {
    height: 36px;
  }

  .logo svg path {
    fill: var(--color-neutral-100);
  }

  body:has(.nav-space.active) .menu #logoclosemenu {
    display: none;
  }
  #logoopenmenu {
    display: flex;
  }

  .nav-space #logoopenmenu {
    display: flex;
    transform: translateY(24px);
    opacity: 0;
    transition:
      transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
      opacity 0.4s ease;
  }

  .nav-space.active #logoopenmenu {
    transform: translateY(0);
    opacity: 1;
  }
  #logoopenmenu svg {
    height: 55px !important;
    max-height: none;
  }
  #logoopenmenu svg path {
    fill: var(--color-neutral-1000);
  }

  .menu {
    top: 5px;
    background-color: var(--color-neutral-1000);
    border-radius: 12px;
    padding: 8px;
    width: calc(100% - 16px);
  }

  .toggle-box {
    display: flex;
    z-index: 11;
    position: relative;
    cursor: pointer;
  }

  /* overlay cerrado */
  .nav-space {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100vw;
    height: 100vh;

    background-color: var(--color-neutral-100);
    z-index: 10;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    gap: 2rem;

    transition:
      opacity 0.4s ease,
      visibility 0.4s ease;
  }

  /* overlay abierto */
  .nav-space.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* lista */
  .nav-space .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;

    transform: translateY(24px);
    opacity: 0;

    transition:
      transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
      opacity 0.4s ease;
  }

  .nav-space.active .nav {
    transform: translateY(0);
    opacity: 1;
  }

  /* items */
  .nav-item {
    background: transparent;
    border: none;
    width: auto;

    transform: translateY(30px);
    opacity: 0;

    transition:
      transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
      opacity 0.4s ease;
  }

  .nav-space.active .nav-item {
    transform: translateY(0);
    opacity: 1;
  }

  /* links */
  .nav-link {
    font-size: 20px;
    padding: 0;
    text-align: center;
    letter-spacing: 0.04em;
  }

  .nav-link::after {
    bottom: -6px;
    height: 3px;
  }

  /* CTA */
  .nav-item:nth-child(5) {
    margin-top: 10px;
  }
}

/* ===== BLOQUEO BODY SOLO CUANDO EL MENU ESTA ABIERTO ===== */
body:has(.nav-space.active) {
  overflow: hidden;
}
