header {
  position: fixed;
  width: 100%;
  background-color: transparent;
  top: 0;
  left: 0;
  z-index: 1100; /* Asegurar que esté por encima de filtros sticky */
}

.navbar {
  width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  height: 5rem;
}

.logo img {
  height: 4rem;
  cursor: pointer;
}

.navbar .menu {
  display: inline-flex;
  align-items: center;
  gap: 35px;
}

.navbar .menu a, .dropdown-toggle {
  color: #FFF;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar .menu a:hover, .dropdown-toggle:hover {
  color: #E8821A;
}

/* Dropdown logic */
.nav-item {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(24, 28, 37, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-width: 200px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  z-index: 1000;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  padding: 12px 20px !important;
  font-size: 0.9rem !important;
  color: rgba(255, 255, 255, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  transition: all 0.2s !important;
  width: 100%;
  box-sizing: border-box;
}

.dropdown-menu a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #E8821A;
}

.dropdown-menu a:hover {
  background: rgba(232, 130, 26, 0.15) !important;
  color: #FFF !important;
  padding-left: 25px !important;
}

.dropdown-toggle span {
  font-size: 18px !important;
  transition: transform 0.3s;
}

.nav-item:hover .dropdown-toggle span {
  transform: rotate(180deg);
}

.nav__close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
}

.nav__toggle,
.nav__close {
  display: flex;
  font-size: 1.25rem;
  color: #FFF;
  cursor: pointer;
}


.log-btn {
  background-color: #4B2D8A;
  border-color: #4B2D8A;

  border-radius: 0.6em;

  padding: 15px;
  cursor: pointer;

  color: #FFF;
  transition-duration: 0.4s;

  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;

  box-shadow: 0 0 40px 40px #4B2D8A inset, 0 0 0 0 #4B2D8A;
  transition: all 150ms ease-in-out;
}

.log-btn:hover {
  box-shadow: 0 0 10px 0 #4B2D8A inset, 0 0 10px 4px #4B2D8A;
}

/*LOGOUT*/
.logout-btn {
  background-color: #d1422c;
  border-color: #972918;
  border-radius: 0.6em;
  padding: 1rem;
  cursor: pointer;
  color: #FFF;
  transition-duration: 0.4s;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;

  box-shadow: 0 0 40px 40px #972918 inset, 0 0 0 0 #972918;
  transition: all 150ms ease-in-out;
}

.logout-btn:hover {
  box-shadow: 0 0 10px 0 #972918 inset, 0 0 10px 4px #972918;
}


/*Profile*/
.profile-btn {
  background-color: #4B2D8A;
  border-color: #4B2D8A;
  color: #FFF;
  cursor: pointer;
  transition-duration: 0.4s;
  border-radius: 0.6em;
  font-size: 14px;
  display: inline-flex !important;
  padding: 0.4rem 0.8rem !important;
  align-items: center !important;
  border: none !important;
  max-height: 40px !important;
  overflow: hidden !important;
}

.profile-btn-avatar {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  margin-left: 0.5rem !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Add blur to header */
.blur-header::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: hsla(0, 0%, 0%, .3);
  backdrop-filter: blur(12px);
  top: 0;
  left: 0;
  z-index: -1;
}

.material-symbols-outlined {
  margin-left: .5rem;
}

@media screen and (max-width:575px) {
  .navbar {
    padding: 1rem;
  }

  .logo img {
    height: 2.2rem;
  }
}

@media screen and (min-width: 576px) {
  .navbar {
    padding: 0;
  }

  .logo img {
    height: 3rem;
  }
}

/* Navigation for mobile devices */
@media screen and (max-width: 1023px) {
  .navbar .menu {
    position: fixed;
    top: -100%;
    left: 0;
    background-color: hsla(250, 60%, 15%, 0.98);
    width: 100%;
    height: 100vh;
    padding: 5rem 1.5rem;
    backdrop-filter: blur(12px);
    transition: top .4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    overflow-y: auto;
  }

  .navbar .menu a, .dropdown-toggle {
    font-size: 1.1rem !important;
    font-weight: 600;
    padding: 5px 0;
    width: 100%;
    text-align: center;
  }

  /* Sub-menús cerrados por defecto en móvil */
  .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 0;
    visibility: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: none; 
    flex-direction: column !important;
    width: 100% !important; /* Forzar ancho total */
    min-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px;
    margin: 10px 0 0 0 !important;
    padding: 10px 0 !important; /* Padding vertical solo */
    transition: all 0.3s ease;
  }

  /* Clase para abrir el menú desde JS */
  .nav-item.active-mobile .dropdown-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
  }

  .nav-item.active-mobile .dropdown-toggle span {
    transform: rotate(180deg);
  }

  .dropdown-menu a {
    font-size: 0.95rem !important;
    padding: 12px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    text-align: center !important;
  }

  .dropdown-menu i {
    font-size: 16px;
    width: 20px;
    text-align: center;
  }

  .nav-item {
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .nav-list {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    list-style: none !important;
  }

  .menu.show-menu {
    top: 0;
  }

  .nav-notifications {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }

  .profile-btn, .logout-btn {
    width: 100% !important;
    max-width: 250px;
    justify-content: center;
    margin-top: 5px;
  }
}

@media screen and (min-width: 1024px) {

  .nav__close,
  .nav__toggle {
    display: none;
  }
}

/* Notifications Styles */
.nav-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: -5px;
}

.notif-btn {
  background: transparent !important;
  border: none !important;
  color: #FFF !important;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px;
  box-shadow: none !important;
}

.notif-btn .material-symbols-outlined {
  margin-left: 0 !important;
  font-size: 26px;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #d1422c;
  color: white !important;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 50%;
  min-width: 14px;
  text-align: center;
  border: 1px solid white;
}

/* Container for absolute positioning */
.notif-dropdown-container {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 9999;
  pointer-events: none;
  /* Only the dropdown should catch events */
}

.notif-dropdown {
  width: 320px;
  background: #FFF !important;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column !important;
  /* Force vertical */
  margin-top: 15px;
  overflow: hidden;
  animation: fadeInDown 0.3s ease;
  pointer-events: auto;
}

.notif-dropdown.show {
  display: flex !important;
}

.notif-header {
  padding: 12px 15px;
  background: #f8f9fa !important;
  border-bottom: 1px solid #eee;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.notif-header span {
  font-weight: 700;
  color: #333 !important;
  font-size: 14px;
}

.notif-header a#mark-all-read {
  font-size: 12px !important;
  color: #666 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: color 0.2s;
}

.notif-header a#mark-all-read:hover {
  color: #4B2D8A !important;
}

.notif-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

a.clear-all-notifs {
  font-size: 12px !important;
  color: #d1422c !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: opacity 0.2s;
}

a.clear-all-notifs:hover {
  opacity: 0.7;
  text-decoration: none !important;
}

.notif-list {
  max-height: 350px;
  overflow-y: auto;
  background: white !important;
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.notif-item-wrapper {
  width: 100% !important;
  display: block !important;
  position: relative;
  border-bottom: 1px solid #f0f0f0;
  margin: 0 !important;
  padding: 0 !important;
}

.notif-item {
  position: relative;
  padding: 15px !important;
  padding-right: 45px !important;
  /* Space for X */
  display: block !important;
  text-decoration: none !important;
  color: #333 !important;
  background: white !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.notif-delete {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #bbb;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
}

.notif-delete:hover {
  color: #ff4d4d;
  background-color: rgba(255, 77, 77, 0.1);
  transform: translateY(-50%) scale(1.1);
}

.notif-item:hover {
  background: #f4f1ff !important;
}

.notif-item .n-msg {
  font-size: 13px !important;
  color: #333 !important;
  line-height: 1.4;
  white-space: normal;
  text-align: left; /* Corregido: Alineación a la izquierda */
  margin-bottom: 4px;
  display: block;
}

.notif-item .n-date {
  font-size: 11px !important;
  color: #888 !important;
  text-align: left; /* Corregido: Fecha también a la izquierda */
  display: block;
}

.notif-empty {
  padding: 30px;
  text-align: center;
  color: #888 !important;
  font-size: 13px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   Language Switcher Styles (RF-12) - Premium Glassmorphic Design
   ========================================== */
.lang-switcher-form {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  vertical-align: middle;
}

.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 2px;
}

.lang-switcher:hover {
  border-color: rgba(232, 130, 26, 0.4);
  box-shadow: 0 4px 20px rgba(232, 130, 26, 0.15);
  background: rgba(255, 255, 255, 0.1);
}

.lang-switcher .lang-btn {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  cursor: pointer;
  padding: 6px 12px !important;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: none !important;
  height: auto !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  text-transform: uppercase;
}

.lang-switcher .lang-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.lang-switcher .lang-btn.active {
  color: #fff !important;
  background: linear-gradient(135deg, #E8821A, #F39C12) !important;
  box-shadow: 0 2px 8px rgba(232, 130, 26, 0.4) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-switcher .lang-separator {
  display: none !important;
}

/* Responsive styles for language switcher */
@media screen and (max-width: 1023px) {
  .lang-switcher-form {
    margin-left: 0;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
  }
  
  .lang-switcher {
    padding: 4px;
    background: rgba(255, 255, 255, 0.08);
  }
  
  .lang-switcher .lang-btn {
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
  }
}