/* === VARIABLES CSS === */
:root {
  --primary-color: #3C8C58;
  --primary-hover: #2e6c44;
  --accent-color: #00f320;
  --bg-light: #E8F5E9;
  --bg-white: #ffffff;
  --text-dark: #333;
  --text-light: #555;
  --text-grey: #666;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* === NAVEGACIÓN === */
#header-container {
  display: block !important;
  width: 100%;
}

#barra {
  background-color: var(--bg-light) !important;
  padding: 15px 30px !important;
  box-shadow: var(--shadow-sm) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  display: block !important;
}

#nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  gap: 20px !important;
}

.nav-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  gap: 30px !important;
}

#logo img {
  max-width: 120px;
  height: auto;
  transition: transform 0.3s ease;
}

#logo img:hover {
  transform: scale(1.05);
}

#contenido-dinamico {
  flex: 1 !important;
  display: flex !important;
  justify-content: center !important;
}

#contenido-dinamico ul {
  list-style: none !important;
  display: flex !important;
  gap: 25px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
}

#contenido-dinamico li {
  position: relative !important;
  display: list-item !important;
}

#contenido-dinamico li a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
}

#contenido-dinamico li a:hover {
  color: var(--accent-color);
  background-color: rgba(0, 243, 32, 0.05);
}

.nav-social {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 15px !important;
  width: 100% !important;
  padding-bottom: 10px !important;
}

.social-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 6px;
  border-radius: 8px;
}

.social-icon-link:hover {
  background-color: rgba(0, 243, 32, 0.08);
}

.social-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.social-icon-link:hover .social-icon {
  transform: scale(1.15);
}

#busqueda {
  padding: 10px 16px;
  border-radius: 20px;
  border: 2px solid #ddd;
  font-family: inherit;
  font-size: 0.95em;
  outline: none;
  transition: all 0.3s ease;
  min-width: 200px;
}

#busqueda:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(60, 140, 88, 0.1);
}

/* === MENÚ HAMBURGUESA === */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover span {
  background-color: var(--accent-color);
}

/* Animación del menú hamburguesa cuando está abierto */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* === RESPONSIVE === */
@media (max-width: 968px) {
  .mobile-menu-toggle {
    display: flex !important;
    order: 3;
  }

  #logo {
    order: 1;
  }

  #busqueda {
    display: none !important;
  }

  .nav-top {
    flex-wrap: wrap;
    position: relative;
  }

  #contenido-dinamico {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100% !important;
    background-color: var(--bg-light);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 0 0 12px 12px;
    margin-top: 15px;
    z-index: 999;
  }

  #contenido-dinamico.mobile-active {
    display: block !important;
    animation: slideDown 0.3s ease-out;
  }

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

  #contenido-dinamico ul {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    align-items: stretch !important;
    padding: 10px 0 !important;
  }

  #contenido-dinamico li {
    width: 100%;
    border-bottom: 1px solid rgba(60, 140, 88, 0.1);
  }

  #contenido-dinamico li:last-child {
    border-bottom: none;
  }

  #contenido-dinamico li a {
    display: block !important;
    text-align: left !important;
    padding: 15px 20px !important;
    width: 100%;
    transition: all 0.2s ease;
  }

  #contenido-dinamico li a:hover {
    background-color: rgba(60, 140, 88, 0.1) !important;
    padding-left: 30px !important;
  }

  .nav-social {
    width: 100% !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 15px !important;
    padding: 15px 0 10px !important;
    order: 4;
  }

  #nav {
    gap: 10px !important;
  }
}
