/* --- Layout base --- */
.am-header {
  background: #fff;
  border-bottom: 1px solid #EDE7DE;
  position: relative;
  z-index: 1000;
}

.am-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.am-logo {
  font-weight: 600;
  color: #0334B2;
  text-decoration: none;
}

/* --- Nav desktop --- */
.am-nav ul#am-nav-main-menu {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.am-nav a {
  color: #292929;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.am-nav a:hover {
  color: #FF6C3F;
}

.am-best-sellers-list {
  gap: 10px;
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;

  li {
    padding-bottom: 0;

    a {
      font-size: 0.875rem;
      color: black;

      &:hover {
        color: #0334B2;
      }
    }
  }
}

#am-nav-main-menu>li>a {
  color: black;
  font-family: "Inter", Sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;

  &:hover {
    color: #0334B2;
    font-weight: 700;
  }
}

/* El dropdown en mobile no debe ser fixed; que fluya y tenga scroll propio */
.am-menu-dropdown {
  display: none;
  position: absolute;
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  top: 55px;
  background: white;
  width: 100dvw;
  left: 0;
  border-bottom: 1px solid #cecece;
}

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

/* Cuando el menú está abierto, bloqueá el fondo */
body.menu-open {
  overflow: hidden;
}

/* --- Botón hamburguesa --- */
.am-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 16px !important;
  height: 16px !important;
  border: none !important;

  &:hover,
  &:focus {
    background-color: transparent;
  }
}

.am-toggle .bar {
  width: 100%;
  height: 3px;
  background: #292929;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.am-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.am-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.am-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .am-toggle {
    display: flex;
  }

  .am-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    display: none;
    flex-direction: column;
    border-top: 1px solid #EDE7DE;
  }

  .am-nav.open {
    display: flex;
    animation: slideDown 0.25s ease forwards;
  }

  .am-nav ul {
    flex-direction: column;
  }

  #am-nav-main-menu>li {
    border-bottom: 1px solid #EDE7DE;
  }

  #am-nav-main-menu>li>a {
    display: block;
    padding: 1rem 1.5rem;
  }

  /* Dropdown dentro del mobile */
  .am-menu-dropdown {
    display: none;
    border-top: none;
    box-shadow: none;
    padding: 0;
  }

  .has-dropdown:hover .am-menu-dropdown {
    display: none;
  }

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

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

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