@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-bg-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-color: var(--color-bg);
}

html,
body {
  overscroll-behavior: none;
}

/* Estado inicial para secciones y footer */

section,
footer {
  opacity: 0;
  transition: opacity 1.5s ease;
  will-change: opacity;
}

section.is-visible,
footer.is-visible {
  opacity: 1;
}

/* ==========================================================
   MENÚ
========================================================== */

.menu {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  top: 5px;
  padding: 0 30px;
  padding-top: 25px;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: auto !important;
  transition: transform 0.3s ease;
}

.menu.is-hidden {
  transform: translateY(calc(-100% - 10px));
}

.toggle-box {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  border: 1px solid var(--color-text);
  height: 50px;
  width: 50px;
  overflow: hidden;
}

.menu-toggle {
  position: relative;
  width: 22px;
  height: 22px;
}

/* ==========================================================
   LOGO
========================================================== */

.menu .logo {
  position: relative;
  top: 2px;
  z-index: 2;
}

.menu .logo svg {
  height: 25px;
  width: auto;
}

.logo svg {
  height: 70px;
  width: auto;
}

#LogoMobile {
  display: none;
}

.LogoOzz path {
  fill: var(--color-text);
  transition: fill 0.4s ease;
}

.nav-item.home:hover .LogoOzz path {
  fill: var(--color-bg);
}

.FireOzz {
  width: 100%;
  height: 100%;
}

.FireOzz path {
  fill: var(--color-text);
}

/* ==========================================================
   NAVEGACIÓN
========================================================== */

.nav {
  display: flex;
  list-style: none;
}

.nav-space {
  display: flex;
  gap: 15px;
}

.nav-item {
  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
  overflow: visible;

  border: 1px solid var(--color-text);

  background-color: rgba(var(--color-bg-rgb), 0.7);

  z-index: 1;
}

.nav-item:nth-child(2) {
  border-left: none;
  border-right: none;
}

.nav-item:nth-child(3) {
  border-right: none;
}

.nav-item:nth-child(5) {
  border-left: none;
  border-right: none;
}

.nav-item::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;

  width: 100%;
  height: 0;

  background-color: var(--color-text);

  transition: height 0.4s ease;

  z-index: 1;
}

.nav-item:hover::before {
  height: 100%;
}

.nav-item.active::before {
  height: 100%;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;

  position: relative;
  z-index: 2;

  text-decoration: none;
  text-align: center;

  font-size: 1rem;
  font-family: var(--font-paragraph);
  font-weight: 100;

  color: var(--color-text);

  transition: color 0.4s;
}

.nav-item:hover .nav-link,
.nav-item.active .nav-link {
  color: var(--color-bg);
}

.nav-link-inner {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 4px;
}

.nav-chevron {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 15px;
  height: 15px;

  transition: transform 0.35s ease;
}

.nav-chevron svg {
  width: 100%;
  height: 100%;
}

.nav-chevron path {
  fill: var(--color-text);

  transition: fill 0.4s ease;
}

.nav-item:hover .nav-chevron path,
.nav-item.active .nav-chevron path {
  fill: var(--color-bg);
}

.nav-item.has-mega:hover .nav-chevron,
.nav-item.has-mega:focus-within .nav-chevron {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .nav-chevron {
    width: 20px;

    height: 20px;
  }
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 768px) {
  .menu {
    padding: 10px 15px;
  }

  .menu .logo {
    top: 0;
    z-index: 11;
  }

  .logo svg {
    width: 30px;
    height: 30px;
  }

  .toggle-box {
    display: flex;
    position: relative;
    z-index: 11;
    cursor: pointer;
  }

  #LogoPc {
    display: none;
  }

  #LogoMobile {
    display: block;
    position: relative;
    z-index: 11;
  }

  .nav-space {
    position: relative;

    display: flex;
    flex-direction: column;

    justify-content: left;
    align-items: self-start;

    top: 0;
    left: 0;

    width: 100vw;
    height: 100%;
    max-height: 100dvh;

    padding: 0 15px;
    padding-top: 110px;

    gap: 0;

    margin: 0;

    background-color: var(--color-placeholder);

    opacity: 0;
    visibility: hidden;

    transition:
      opacity 0.4s ease,
      visibility 0.4s ease;

    box-sizing: border-box;

    z-index: 10;
  }

  .nav-space.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-space .nav {
    flex-direction: column;
    align-items: flex-start;

    width: min-content;

    transform: translateY(20px);
    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;
  }

  .nav-link {
    width: min-content;

    padding: 0;

    text-align: left;

    font-size: clamp(42px, 18vw, 20vw);

    transition: color 0.3s ease;
  }

  .nav-item {
    justify-content: flex-start;

    width: min-content;

    margin: 0;
    padding: 0;

    border: none;

    background: transparent;

    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;
  }

  .nav-space.active .nav-item:nth-child(1) {
    transition-duration: 0.5s;
  }

  .nav-space.active .nav-item:nth-child(2) {
    transition-duration: 0.55s;
  }

  .nav-space.active .nav-item:nth-child(3) {
    transition-duration: 0.6s;
  }

  .nav-space.active .nav-item:nth-child(4) {
    transition-duration: 0.65s;
  }

  #nav-tools {
    position: absolute;

    bottom: 10px;
    left: -5px;

    display: flex;
    flex-direction: initial;

    width: 100%;

    padding: 5px 15px;

    margin-bottom: 0;

    opacity: 0;

    transition:
      opacity 0.4s ease,
      visibility 0.4s ease;
  }

  .nav-space.active #nav-tools {
    opacity: 1;
  }
}

/* ==========================================================
   MEGA MENU
========================================================== */

.nav-item.has-mega {
  position: relative;
  overflow: visible;
}

.nav-item.has-mega:hover {
  z-index: 100;
}

/* Área invisible para evitar que se cierre al mover el mouse */
.nav-item.has-mega::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 18px;
}

/* PANEL */

.mega-menu {
  position: absolute;

  top: calc(100% + 18px);
  left: 50%;

  transform: translateX(-50%) translateY(15px);

  width: min(1050px, 90vw);

  padding: 18px;

  background-color: rgba(var(--color-bg-rgb), 0.95);

  border: 1px solid var(--color-text);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    visibility 0.35s ease;

  z-index: 99;
}

/* Mostrar */

.nav-item.has-mega:hover .mega-menu,
.nav-item.has-mega:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* GRID */

.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* TARJETA */

.mega-card {
  position: relative;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 220px;

  padding: 22px;

  text-decoration: none;

  border: 1px solid rgba(var(--color-text-rgb), 0.3);

  background: rgba(var(--color-placeholder-rgb), 0.45);

  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    background 0.35s ease;
}

.mega-card:hover {
  transform: translateY(-4px);

  border-color: var(--color-text);

  background: rgba(var(--color-placeholder-rgb), 0.75);
}

.mega-content h3 {
  font-family: var(--font-paragraph);

  font-size: 1.45rem;

  font-weight: 600;

  color: var(--color-text);

  margin-bottom: 12px;
}

.mega-content p {
  font-family: var(--font-paragraph);

  font-size: 0.95rem;

  line-height: 1.55;

  color: var(--color-text);

  opacity: 0.8;

  max-width: 280px;
}

/* BOTÓN FLECHA */

.mega-arrow {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-top: auto;
  margin-left: auto;

  border: 1px solid rgba(var(--color-text-rgb), 0.3);
  background: transparent;

  overflow: hidden;

  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

.mega-card:hover .mega-arrow {
  background-color: var(--color-text);
  transform: translate(3px, -3px);
}

.mega-arrow svg {
  display: block;

  width: 20px;
  height: 20px;

  flex-shrink: 0;

  transform-origin: center;

  transition: transform 0.3s ease;
}

.mega-card:hover .mega-arrow svg {
  transform: scale(1.2) rotate(-45deg);
}

.mega-arrow svg path {
  fill: var(--color-text);
  transition: fill 0.3s ease;
}

.mega-card:hover .mega-arrow svg path {
  fill: var(--color-bg);
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 768px) {
  .nav-item.has-mega {
    flex-direction: column;

    align-items: flex-start;
  }

  .mega-menu {
    position: relative;

    top: auto;

    left: auto;

    width: 100%;

    transform: none;

    margin-top: 18px;

    padding: 0;

    border: none;

    background: transparent;

    opacity: 1;

    visibility: visible;

    display: none;
  }

  .nav-item.has-mega:hover .mega-menu,
  .nav-item.has-mega:focus-within .mega-menu {
    display: block;

    transform: none;
  }

  .mega-grid {
    display: flex;

    flex-direction: column;

    gap: 12px;
  }

  .mega-card {
    min-height: auto;

    padding: 16px;

    background: transparent;

    border: 1px solid rgba(var(--color-text-rgb), 0.15);
  }

  .mega-content h3 {
    font-size: 1.2rem;
  }

  .mega-content p {
    font-size: 0.9rem;

    max-width: none;
  }

  .mega-arrow {
    width: 34px;

    height: 34px;

    font-size: 1rem;

    margin-top: 16px;
  }
}
