/* =============================================
   HEADER
   ============================================= */

.site-header {
  background: white;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0;
}

.site-header__content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header__logo-left,
.site-header__logo-right {
  display: flex;
  align-items: center;
  flex: 1;
}

.site-header__logo-right {
  justify-content: flex-end;
  gap: 1rem;
}

.site-header__logo-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header__logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

/* --- Nav Center (link al catálogo) --- */
.site-header__nav-center {
  font-size: 1.125rem;
  font-weight: 500;
  color: #374151;
}

.site-header__catalogo-link {
  color: #4B5563;
  transition: 0.3s linear;
  text-decoration: none;
  font-weight: 600;
}

.site-header__catalogo-link:hover {
  color: #015B9B;
}

/* --- User Menu (autenticado) --- */
.site-header__user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__user-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: color 0.2s;
}

.site-header__user-link:hover {
  color: #005B9B;
}

.site-header__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #005B9B, #0088cc);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.site-header__user-name {
  font-size: 0.9rem;
}

.site-header__logout-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s;
}

.site-header__logout-link:hover {
  color: #dc3545;
}

/* --- Extra nav links (Ver Cursos, etc.) --- */
.site-header__extra-link {
  color: #005B9B;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border: 2px solid #005B9B;
  border-radius: 8px;
  transition: all 0.3s;
}

.site-header__extra-link:hover {
  background: #005B9B;
  color: white;
}

/* --- Home icon link --- */
.site-header__home-link {
  color: #4B5563;
  text-decoration: none;
  font-size: 1.25rem;
  transition: color 0.3s;
  display: flex;
  align-items: center;
}

.site-header__home-link:hover {
  color: #005B9B;
}

/* --- Auth Buttons (no autenticado) --- */
.site-header__auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-header__login-btn {
  background: transparent;
  border: 2px solid #005B9B;
  color: #005B9B;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.site-header__login-btn:hover {
  background: #005B9B;
  color: white;
}

.site-header__register-btn {
  background: #005B9B;
  border: 2px solid #005B9B;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.site-header__register-btn:hover {
  background: #004475;
  border-color: #004475;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-header__logo-img {
    height: 60px;
  }

  .site-header__logo-left,
  .site-header__logo-right {
    display: none;
  }

  .site-header__logo-center {
    flex: none;
  }

  .site-header__content {
    justify-content: center;
  }

  .site-header__user-menu {
    gap: 0.5rem;
  }

  .site-header__user-name {
    display: none;
  }

  .site-header__auth-buttons {
    gap: 0.5rem;
  }

  .site-header__login-btn,
  .site-header__register-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
  }

  .site-header__extra-link {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .site-header__logo-img {
    height: 60px;
  }
}

/* --- Mobile Sidebar Overlay --- */
.mobileBackdrop,
.mobileSidebar {
  display: none;
}

@media (max-width: 768px) {
  .mobileBackdrop {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    backdrop-filter: blur(2px);
  }

  .mobileBackdrop.visible {
    opacity: 1;
    visibility: visible;
  }

  .mobileSidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background-color: white;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  }

  .mobileSidebar.open {
    transform: translateX(0);
  }

  .mobileSidebarHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
  }

  .mobileSidebarTitle {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: #4b5563;
  }

  .closeBtn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobileMenuContent {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mobileMenuContent .site-header__user-menu,
  .mobileMenuContent .site-header__auth-buttons {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 1rem;
    display: flex;
  }

  .mobileMenuContent .site-header__user-name {
    display: inline-block;
  }

  .mobileMenuContent .site-header__login-btn,
  .mobileMenuContent .site-header__register-btn, 
  .mobileMenuContent .site-header__logout-link {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    font-size: 1rem;
  }

  .mobileNavHome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4B5563;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
  }
}