/* =========================
   NAV CONTENEDOR
========================= */

.nav {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

/* =========================
   COMBO NAV
========================= */

.nav-combo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  padding-right: 0;
  transition:
    width 0.45s cubic-bezier(0.77, 0, 0.18, 1),
    padding 0.45s cubic-bezier(0.77, 0, 0.18, 1);
}

/* compacto */

.nav.compact .nav-combo {
  width: 220px;
  background: rgba(25, 18, 8, 0.38);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(214, 162, 74, 0.12);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* expandido */

.nav.expanded .nav-combo,
.nav.menu-open .nav-combo {
  width: 300px;
}

/* =========================
   FONDO EXPANDIDO
========================= */

.nav-bg {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  z-index: -1;
  transition:
    width 0.45s cubic-bezier(0.77, 0, 0.18, 1),
    opacity 0.3s ease;
}

/* ocultar fuera compacto */
.nav:not(.compact) .nav-bg {
  width: 0 !important;
}

/* ancho compacto */
.nav.compact .nav-bg {
  width: 220px;
}

/* ancho expandido */
.nav.compact .nav-combo:hover .nav-bg,
.nav.menu-open .nav-bg {
  width: 300px !important;
}

/* =========================
   LOGO
========================= */

.logo {
  padding: 10px 14px;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

.logo:visited,
.logo:hover {
  color: white;
}

/* =========================
   MENÚ PRINCIPAL
========================= */

.nav-items {
  display: flex;
  gap: 24px;
  padding: 10px 20px;
  white-space: nowrap;
}

/* links */

.nav-items a {
  position: relative;
  color: white;
  text-decoration: none;
  opacity: 0.6;
  transition:
    transform 0.2s ease,
    color 0.25s ease,
    opacity 0.25s ease;
}

/* hover */

.nav-items a:hover {
  transform: translateY(-1px);
  opacity: 1;
}

/* activo */

.nav-items a.active {
  opacity: 1;
  letter-spacing: 0.02em;
}

/* línea hover */

.nav-items a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: white;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.77, 0, 0.18, 1);
}

.nav-items a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* =========================
   ACTIVE ITEM
========================= */

.nav-active {
  position: absolute;
  top: 50%;
  right: 17px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav.compact .nav-active,
.nav.expanded .nav-active,
.nav.menu-open .nav-active {
  opacity: 1;
}

/* punto */

.dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

/* ocultar desktop links en compacto */

.nav.compact .nav-items,
.nav.menu-open .nav-items {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* =========================
   INDICADOR ⭕ → ❌
========================= */

.nav-indicator {
  position: relative;
  width: 10px;
  height: 10px;
  border: 1.5px solid white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.nav-indicator::before,
.nav-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  background: white;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: all 0.3s ease;
}

/* abierto */

.nav.menu-open .nav-indicator {
  border-color: transparent;
}

.nav.menu-open .nav-indicator::before {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav.menu-open .nav-indicator::after {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: fixed;
  top: 0 !important;
  left: 20px;
  width: 270px !important;
  display: flex;
  flex-direction: column;
  padding: 0 15px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.98);
  transform-origin: top left;
  transition:
    transform 0.45s cubic-bezier(0.77, 0, 0.18, 1),
    opacity 0.3s ease;
  z-index: 999;
}

/* abierto */

.sidebar.open {
  margin-top: 60px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* =========================
   SIDEBAR INNER
========================= */

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 20px;
  padding: 0 7px;
}

/* links */

.sidebar-inner a {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  color: #aaa;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  transition:
    0.3s,
    transform 0.25s ease;
}

/* entrada stagger */

.sidebar.open .sidebar-inner a {
  opacity: 1;
  transform: translateY(0);
}

/* delays */

.sidebar.open .sidebar-inner a:nth-child(1) {
  transition-delay: 0.05s;
}

.sidebar.open .sidebar-inner a:nth-child(2) {
  transition-delay: 0.1s;
}

.sidebar.open .sidebar-inner a:nth-child(3) {
  transition-delay: 0.15s;
}

.sidebar.open .sidebar-inner a:nth-child(4) {
  transition-delay: 0.2s;
}

.sidebar.open .sidebar-inner a:nth-child(5) {
  transition-delay: 0.25s;
}

.sidebar.open .sidebar-inner a:nth-child(6) {
  transition-delay: 0.3s;
}

/* hover */

.sidebar-inner a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* activo */

.sidebar-inner a.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* texto hover */

.sidebar-inner a span {
  transition: transform 0.25s ease;
}

.sidebar-inner a:hover span {
  transform: translateX(3px);
}

/* =========================
   HOVER AVANZADO DESKTOP
========================= */

@media (min-width: 901px) {
  .sidebar-inner .hover-item {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 25px;
  }

  .hover-item .main,
  .hover-item .sub {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    transform: translateY(-50%);
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  .hover-item .main {
    opacity: 1;
  }

  .hover-item .sub {
    opacity: 0;
    transform: translateY(calc(-50% + 100%));
  }

  .hover-item:hover .main {
    opacity: 0;
    transform: translateY(calc(-50% - 100%));
  }

  .hover-item:hover .sub {
    opacity: 1;
    transform: translateY(-50%);
  }
}

/* =========================
   OVERLAY
========================= */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    backdrop-filter 0.4s ease;
  z-index: 998;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
  backdrop-filter: blur(12px) saturate(120%);
}

/* =========================
   MOBILE / TABLET
========================= */

@media (max-width: 900px) {
  /* =========================
     NAV CONTENEDOR
  ========================= */

  .nav {
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
  }

  /* =========================
     NAV COMBO
  ========================= */

  .nav-combo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    height: 50px;
    padding: 0 !important;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    position: relative;
  }

  /* =========================
     FONDO LIQUID GLASS
  ========================= */

  .nav-bg {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(214, 162, 74, 0.1);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* =========================
     OCULTAR DESKTOP
  ========================= */

  .nav-items,
  .nav-active {
    display: none !important;
  }

  /* =========================
     LOGO
  ========================= */

  .logo {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 30px;
  color: white !important;
  font-weight: 700;
  line-height: 50px;
  transform: none;
}

  /* =========================
     BOTÓN MENU
  ========================= */

  .menu-btn {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 50px;
    margin-left: auto;
    margin-right: 0;
    padding: 0 26px !important;
    cursor: pointer;
    background: rgba(20, 15, 8, 0.32);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-left: 1px solid rgba(214, 162, 74, 0.12);
    transition:
      background 0.3s ease,
      transform 0.25s ease;
  }

  .menu-btn:hover {
    background: rgba(35, 24, 12, 0.45);
  }

  /* =========================
     SIDEBAR MOBILE
  ========================= */

  .sidebar {
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100vh;
    top: 0 !important;
    left: 0 !important;
    padding: 130px 40px 60px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: none;
    box-shadow: none;
    overflow-y: auto;
    z-index: 9999;
  }

  .sidebar.open {
    margin-top: 0;
  }

  /* =========================
     LINKS SIDEBAR
  ========================= */

  .sidebar-inner {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .sidebar-inner a {
    font-size: 32px;
    line-height: 1.15;
  }

  .sidebar-inner .sub {
    display: none !important;
  }
}

/* =========================
   HAMBURGER
========================= */

.hamburger {
  position: relative;
  width: 16px;
  height: 2px;
  background: white;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: white;
}

.hamburger::before {
  top: -5px;
}

.hamburger::after {
  top: 5px;
}

/* active */

.menu-btn.active .hamburger {
  background: transparent;
}

.menu-btn.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-btn.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

.hamburger,
.hamburger::before,
.hamburger::after {
  transition: all 0.3s ease;
}

/* =========================
   CURSOR DESKTOP
========================= */

@media (min-width: 901px) {
  .logo,
  .nav.compact .nav-combo,
  .nav-items a {
    cursor: pointer;
  }
}

/* =========================
   FIX DESKTOP
========================= */

@media (min-width: 901px) {
  .menu-btn {
    display: none !important;
  }

  .nav-items {
    display: flex !important;
  }

  .nav-active {
    display: flex !important;
  }
}

/* =========================
   FIX MOBILE / TABLET
========================= */

@media (max-width: 900px) {
  .logo {
    display: block !important;
  }

  .menu-btn {
    display: flex !important;
  }

  .nav-combo {
    align-items: center;
  }

  .menu-btn {
    height: 50px;
  }

  .nav-active,
  .nav-items {
    display: none !important;
  }

  .nav.menu-open .menu-btn {
    display: flex !important;
  }

  .nav.menu-open .logo {
    display: block !important;
  }
}

@media (max-width: 900px) {

  .nav.menu-open {
    background: transparent !important;
  }

  .nav.menu-open .nav-combo {
    background: rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(214,162,74,0.1) !important;
    box-shadow:
      0 8px 32px rgba(0,0,0,0.28),
      inset 0 1px 0 rgba(255,255,255,0.03) !important;
  }
}
