/* ═══════════════════════════════════════════════
   WEBLIFT Agency — navbar.css   
═══════════════════════════════════════════════ */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: 75px;  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5%;
  background: rgba(4, 9, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
  text-decoration: none;
}

.nav-logo-img {   
  height: 42px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
  display: block;
  transition: opacity 0.3s;
  filter: none !important;
}

.nav-logo-img:hover { opacity: 0.85; }

/* ── Links ── */
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3.5rem;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li { display: flex; }

/* Create space for the centered absolute logo between the 2nd and 3rd link */
.nav-links li:nth-child(2) {
  margin-right: 140px; 
}

.nav-links a {
  position: relative;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0;
  transition: color 0.3s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: white;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  color: white;
}

.nav-links a.active {
  color: var(--cyan);
  font-weight: 600;
}

.nav-links a.active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}

/* ── Auth buttons — columna derecha del grid ── */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-btn-login {
  color: rgba(200,212,232,0.8);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  transition: all 0.25s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-btn-login:hover {
  color: white;
  border-color: rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.06);
}

.nav-btn-cta {
  background: var(--cyan);
  color: white;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-btn-cta:hover {
  background: var(--cyan-glow);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cyan);
  color: white;
}

/* ── Usuario logueado ── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0.3rem 0.8rem 0.3rem 0.35rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-pill);
  transition: border-color 0.25s, background 0.25s;
}
.nav-user:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}

.nav-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem; font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-user-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Dropdown ── */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: rgba(7,15,32,0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: none;
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 200;
}
.nav-user-dropdown.open { display: block; }

.dropdown-user-info {
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 0.4rem;
}
.dropdown-user-info .d-name {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem; font-weight: 600;
  color: white;
}
.dropdown-user-info .d-email {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-user-dropdown a,
.nav-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-light);
  transition: background 0.2s, color 0.2s;
  text-align: left;
  background: none;
  cursor: pointer;
  text-decoration: none;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0.35rem 0;
}

.logout-btn { color: #f07070 !important; }
.logout-btn:hover { background: rgba(240,112,112,0.1) !important; }

/* ── Auth-nav (páginas login/register — solo logo) ── */
#navbar.auth-nav {
  background: rgba(7,15,32,0.98) !important;
  backdrop-filter: blur(24px);
  justify-content: center;
}
#navbar.auth-nav .nav-links     { display: none !important; }
#navbar.auth-nav .nav-auth      { display: none !important; }
#navbar.auth-nav .nav-hamburger { display: none !important; }

/* ── Hamburger móvil ── */
.nav-hamburger {
  display: none;
  position: absolute;
  right: 5%;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(200,212,232,0.8);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── RESPONSIVE MÓVIL ── */
@media (max-width: 900px) {
  #navbar {
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    padding: 0 5%;
  }

  .nav-logo { margin-right: 0; }

  .nav-logo-img { 
    height: 38px; 
  }

  #navbar > .nav-auth { display: none; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(6, 18, 38, 0.98); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.5rem 10% 2rem;
    gap: 1.2rem;
    z-index: 99;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    align-items: flex-start;
    justify-content: flex-start;
  }

  .nav-links.open {
    display: flex !important;
    animation: fadeInMenu 0.4s ease-out;
  }

  .nav-links li {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.8rem 0;
  }
  
  .nav-links li:nth-child(2) {
    margin-right: 0;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    color: rgba(200, 212, 232, 0.85);
    padding: 0.8rem;
  }
  
  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255,255,255,0.04);
    color: white;
    box-shadow: none;
  }

  .nav-hamburger {
    display: flex !important;
    position: relative;
    right: 0;
    z-index: 101;
  }

  .nav-hamburger span {
    background: rgba(240, 247, 255, 0.95);
  }
}

/* Ajustes extra para móviles muy pequeños */
@media (max-width: 480px) {
  #navbar { min-height: 70px; }
  .nav-links { top: 70px; height: calc(100vh - 70px); padding: 0.5rem 10% 2rem; gap: 1.2rem; align-items: flex-start; justify-content: flex-start; }
  .nav-logo-img { height: 32px; max-width: none; }
}

/* Animación de entrada suave para el menú móvil */
@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
