/* navbar.css */
/* === Reset básico === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Navbar container === */
.site-navbar {
  position: sticky;
  top: 0;
  margin: 1rem auto;
  width: 100%;
  max-width: var(--max-width);
  backdrop-filter: blur(var(--bg-blur));
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  z-index: 1000;
}

.site-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

/* === Nav menu === */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* === Branding === */
.brand img {
  max-height: 50px;
}

/* === Nav links === */
.nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-list li a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s, background-color 0.3s;
}

.nav-list li a:hover {
  color: var(--hover-color);
  background-color: rgba(155, 89, 182, 0.1);
  border-radius: 0.5rem;
}

/* === Dropdown === */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(255,255,255,0.8);
  backdrop-filter: blur(var(--bg-blur));
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  list-style: none;
  padding: 0.5rem 0;
  border-radius: 0.5rem;
  display: none;
  min-width: 200px;
  z-index: 1000;
}

.has-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--primary-color);
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.3s;
}

.dropdown-menu li a:hover {
  color: var(--hover-color);
  background-color: rgba(155, 89, 182, 0.1);
  border-radius: 0.5rem;
}

/* === Button 'Haz el test' === */
.btn-test {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
  white-space: nowrap;
  border: 2px solid var(--primary-color);
}

.btn-test:hover {
  background-color: var(--hover-color);
  border-color: var(--hover-color);
  color: white;
}

/* === Hamburger === */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  background-color: var(--primary-color);
  height: 3px;
  width: 25px;
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.hamburger.active {
  background: transparent;
}

.hamburger.active::before {
  transform: rotate(45deg);
  top: 0;
}

.hamburger.active::after {
  transform: rotate(-45deg);
  top: 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
    display: none;
    margin-top: 0.2rem;
    background-color: rgb(255, 255, 255);
    backdrop-filter: blur(var(--bg-blur));
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius);
  }

  .nav-menu.open {
    display: flex;
    padding: 1rem;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .nav-list li a {
    width: 100%;
    padding: 0.5rem 1rem;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    backdrop-filter: none;
    background: transparent;
    padding-left: 1rem;
  }

  .has-dropdown.open .dropdown-menu {
    display: block;
  }

  .btn-test {
    margin-top: 1rem;
    width: 100%;
    text-align: center;
  }
}
