:root {
  /* Colores principales */
  --color1: #41ba0d;
  --color2: #5dcb2a;
  --color3: #79dd46;
  --color4: #95ee63;
  --color5: #b1ff7f;
  --color6: #000000;
  
  /* Variables derivadas para el sistema de diseño */
  --primary-color: var(--color1);
  --primary-hover: var(--color2);
  --accent-color: var(--color3);
  --text-color: #1f2937;
  --text-light: #4b5563;
  --background: #ffffff;
  --background-alt: #f0f9ee;
  --border-color: #e5e7eb;
  --menu-bg: var(--color1);
  --menu-text: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.375rem;
  --header-height: 70px;
  --transition: all 0.2s ease-in-out;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-main);
  color: black;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header and Navigation */
#menu {
  background: white;
  position: fixed;
  width: 100%;
  height: var(--header-height);
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  transition: var(--transition);
  color: #79dd46;
}

#menu.scrolled {
  height: 60px;
  box-shadow: var(--shadow-md);
}

/* Logo */
#logo {
  display: flex;
  align-items: center;
  height: 100%;
}

#logo a {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

#logo img.logo {
  max-height: 70px;
  width: auto;
  transition: transform 0.3s ease;
}

#logo img.logo:hover {
  transform: scale(1.05);
}

/* Main navigation list */
#links {
  display: flex;
  align-items: center;
}

#links ul.main-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.75rem;
}

#links .nav-item {
  position: relative;
}

#links .nav-item a {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: black;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
  gap: 0.5rem;
}

#links .nav-item a:hover {
  color: white;
  background-color: var(--color2);
}

/* Guest menu (not logged in) */
#links.guest-menu .login-btn a {
  background-color: #74fd59;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
}

#links.guest-menu .login-btn a:hover {
  background-color: var(--primary-hover);
}

/* Profile dropdown */
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
}

.profile-trigger:hover {
  background-color: var(--color2);
}

.profile-arrow {
  font-size: 0.75rem;
  color: white;
  transition: var(--transition);
}

.profile-menu:hover .profile-arrow {
  transform: rotate(180deg);
}

.imagen-container2 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  background-color: white;
}

/* Dropdown menus */
.sub-menus {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--color1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  border: 1px solid var(--color4);
}

.profile-menu:hover .sub-menus {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.sub-menus li {
  display: block;
  width: 100%;
}

.sub-menus a {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  width: 100%;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
}

.sub-menus a:hover {
  background-color: var(--color2);
  color: white;
}

.sub-menus a i {
  margin-right: 0.75rem;
  font-size: 1rem;
  color: white;
  width: 1rem;
  text-align: center;
}

/* Badge for notifications */
.badge {
  position: absolute;
  top: 0;
  right: 8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}

.mobile-badge {
  position: relative;
  top: auto;
  right: auto;
  margin-left: 0.5rem;
}

/* Mobile styles */
.hamburger-icon {
  display: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  top:10px;
}

.hamburger-icon:hover {
  transform: scale(1.05);
}

.hamburger-profile-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  object-position: center;
  transition: var(--transition);
  background-color: white;
}

.mobile-only {
  display: none !important;
}

.mobile-profile-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  margin-right: 10px;
  background-color: white;
}

/* Header spacer */
.header-spacer {
  height: var(--header-height);
}

/* Mobile login button */
.mobile-login-btn {
  display: none;
}

.mobile-login-btn a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background-color: #239f0b;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-login-btn a:hover {
  background-color: var(--primary-hover);
}

/* Media queries for responsiveness */
@media (max-width: 992px) {
  #menu {
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  #menu {
    padding: 0 1rem;
    justify-content: space-between;
    align-items: center;
  }

  .hamburger-icon {
    display: flex;
  }

  .mobile-login-btn {
    display: block;
  }

  #links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color1);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
    transition: 
      max-height 0.3s ease, 
      opacity 0.3s ease, 
      transform 0.3s ease;
  }

  #links.menu-visible {
    max-height: calc(100vh - var(--header-height));
    opacity: 1;
    transform: translateY(0);
  }

  #links.guest-menu {
    display: none; /* Ocultar el menú desplegable para invitados en móviles */
  }

  #links ul.main-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 1rem;
  }

  #links .nav-item {
    width: 100%;
  }

  #links .nav-item a {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .profile-menu .profile-trigger {
    display: none;
  }
  
  .profile-menu .sub-menus {
    display: none;
  }

  .mobile-only {
    display: flex !important;
  }

  .profile-menu.active .sub-menus {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    display: block;
    background-color: var(--color2);
    border: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #95ee63;
    --primary-hover: #95ee63;
    --text-color: #f9fafb;
    --text-light: #9ca3af;
    --background: #111827;
    --background-alt: #1f2937;
    --border-color: #374151;
  }
  
  #menu {
    background: rgb(255 255 255 / 95%);
  }
}

.hamburger-image-wrapper .profile-img {
    width: 38px;
    height: 38px;
    top: 20px;
}
.nav-profile-image-wrapper .profile-img {
    width: 36px;
    height: 36px;
}

