/*--------------------------------------------------------------
# Menu Básico
--------------------------------------------------------------*/

/* Logo */
.header-logo {
  padding: 5px 0;
}

.header-logo img {
  max-height: 70px;
  height: auto;
  width: auto;
}

/* --- NAV WRAPPER --- */
.cmp-navigation,
.cmp-navigation * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cmp-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--default-font);
  font-size: 16px;
  line-height: 1.5;
  position: relative;
  z-index: 100;
}

.cmp-navigation__group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center; 
  gap: 20px;
}

/* --- ITEMS PRINCIPALES --- */
.cmp-navigation__item--level-0 {
  position: relative;
  display: inline-block;
  color: var(--nav-color);
}

.cmp-navigation__item--level-0 > .cmp-navigation__item-link {
  display: block;
  padding: 22px 18px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--nav-color-hover);
  transition: color .2s ease;
}

/* Hover sobre todo el header → todos los links */
.site-header:hover .cmp-navigation__item--level-0 > .cmp-navigation__item-link {
  color: var(--nav-color-active);
}

/* Hover sobre un link individual → override celeste */
.cmp-navigation__item--level-0 > .cmp-navigation__item-link:hover {
  color: var(--nav-color-active-hover) !important;
}

/* Link activo */
.cmp-navigation__item--level-0.is-active > .cmp-navigation__item-link {
  color: var(--nav-color-active-hover);
}

/* --- BOTONES MOBILE --- */
.open-menu,
.close-menu {
  display: none;
}

/*--------------------------------------------------------------
# Responsive ≤976px
--------------------------------------------------------------*/
@media screen and (max-width: 976px) {
  /* Botón abrir */
  .open-menu {
    display: block;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1100;
    color: var(--nav-color);
  }

  /* Menú oculto por defecto */
  #navigation {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background-color: #fff;
    padding: 2rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1099;
    transition: transform 0.3s ease;
    transform: translateX(100%);
  }

  /* Menú activo (se abre) */
  #navigation.active {
    display: flex;
    transform: translateX(0);
  }

  /* Botón cerrar */
  #navigation .close-menu {
    display: block;
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin-bottom: 1rem;
    color: var(--nav-color-active);
  }

  /* Estilo de las opciones en mobile */
  .cmp-navigation__group {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .cmp-navigation__group li a {
    font-size: 1.2rem;
    color: #131F6B;
    text-decoration: none;
    width: 100%;
    padding: 12px 0;
  }

  .cmp-navigation__group li a:hover {
    color: #00B3E3;
  }

  /* --- Dropdown en mobile --- */
  .nav-item.dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
  }

  /* Ocultar dropdown por defecto */
  .nav-item.dropdown .dropdown-menu {
    display: none;
    width: 100%;
    padding-left: 1rem;
    box-shadow: none;
    position: static;
    margin: 0;
  }

  /* Mostrar dropdown cuando está abierto */
  .nav-item.dropdown.open .dropdown-menu {
    display: block;
  }

  /* Icono del dropdown en mobile */
  .dropdown-icon {
    transition: transform 0.3s ease, color 0.3s ease;
  }

  .nav-item.dropdown.open > a .dropdown-icon {
    transform: rotate(90deg); /* apunta a la derecha cuando está abierto */
    color: var(--nav-color-active-hover);
  }
}

/*--------------------------------------------------------------
# Dropdown personalizado
--------------------------------------------------------------*/
.dropdown-menu {
  border: none !important;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);  /* sombra suave */
}

.dropdown-menu .dropdown-item {
  font-size: 15px;
  font-weight: 500;
  color: #131F6B;
  padding: 10px 20px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
  background-color: #f5f5f5;
  color: var(--nav-color-active-hover);
}

/* Dropdown por hover en desktop */
.nav-item.dropdown:hover > .dropdown-menu {
  display: block;
  top: calc(100% - 6px) !important;  /* se sube 6px */
  margin-top: 0 !important;
}

/* Icono del dropdown */
.dropdown-icon {
  font-size: 0.8rem;
  display: inline-block;
  color: inherit;
  transition: transform 0.3s ease, color 0.3s ease;
}

/* Hover en "Nuestras Marcas" → rota hacia la izquierda con efecto bounce */
.nav-item.dropdown:hover > a .dropdown-icon {
  animation: bounceRotateLeft 0.5s forwards;
  color: var(--nav-color-active-hover);
}

/* Al salir del hover → vuelve a apuntar hacia abajo */
.nav-item.dropdown:not(:hover) > a .dropdown-icon {
  transform: rotate(0deg);
}

/* Keyframes: rota de ↓ a ← con rebote */
@keyframes bounceRotateLeft {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-100deg); } 
  70%  { transform: rotate(-85deg); }
  100% { transform: rotate(-90deg); }
}
