/* =========================================================
   Bebé Crece — FIX DEFINITIVO MENÚ MÓVIL
   - Evita que subcategorías de Accesorios se monten sobre Promoción.
   - Alinea icono + texto juntos, no separados de extremo a extremo.
   - Mantiene el menú dentro del flujo normal y con scroll en celular.
   ========================================================= */
@media (max-width: 860px){
  body .header,
  body header.header{
    z-index: 9990 !important;
  }

  body .nav,
  body header .nav{
    overflow: visible !important;
  }

  body .nav .menu,
  body header .menu{
    box-sizing: border-box !important;
  }

  body .nav .menu.open,
  body header .menu.open{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-height: calc(100vh - 92px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px 12px calc(120px + env(safe-area-inset-bottom)) !important;
    border-radius: 22px !important;
  }

  body .nav .menu.open > a,
  body header .menu.open > a,
  body .nav .menu.open .nav-drop-trigger,
  body header .menu.open .nav-drop-trigger{
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 46px !important;
    padding: 13px 16px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    flex: 0 0 auto !important;
  }

  body .nav .menu.open .nav-drop-trigger,
  body header .menu.open .nav-drop-trigger{
    justify-content: space-between !important;
  }

  body .nav .menu.open .nav-item.dropdown,
  body header .menu.open .nav-item.dropdown{
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body .nav .menu.open .nav-item.dropdown.open .dropdown-menu,
  body header .menu.open .nav-item.dropdown.open .dropdown-menu,
  body .nav .menu.open .nav-item.dropdown:focus-within .dropdown-menu,
  body header .menu.open .nav-item.dropdown:focus-within .dropdown-menu{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 8px 0 0 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border: 1px solid #e8eef8 !important;
    border-radius: 18px !important;
    box-shadow: none !important;
  }

  body .nav .menu.open .dropdown-menu > a,
  body header .menu.open .dropdown-menu > a,
  body .nav .menu.open .dropdown-menu .dropdown-parent,
  body header .menu.open .dropdown-menu .dropdown-parent,
  body .nav .menu.open .dropdown-submenu-menu a,
  body header .menu.open .dropdown-submenu-menu a{
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: start !important;
    justify-content: start !important;
    column-gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 11px 12px !important;
    box-sizing: border-box !important;
    border-radius: 14px !important;
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    color: #102a63 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    flex: 0 0 auto !important;
  }

  body .nav .menu.open .dropdown-menu > a::before,
  body header .menu.open .dropdown-menu > a::before,
  body .nav .menu.open .dropdown-menu .dropdown-parent::before,
  body header .menu.open .dropdown-menu .dropdown-parent::before,
  body .nav .menu.open .dropdown-submenu-menu a::before,
  body header .menu.open .dropdown-submenu-menu a::before{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 17px !important;
    line-height: 1 !important;
  }

  body .nav .menu.open .dropdown-menu > a[href$="ninos.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="ninos.html"]::before{content:"👶" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="calzados.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="calzados.html"]::before{content:"👟" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="juguetes.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="juguetes.html"]::before{content:"🧸" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="coches.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="coches.html"]::before{content:"🛒" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="silla-de-carro.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="silla-de-carro.html"]::before{content:"🚗" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="cargadores.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="cargadores.html"]::before{content:"🤱" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="cunas.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="cunas.html"]::before{content:"🛏️" !important;}
  body .nav .menu.open .dropdown-menu > a[href$="hogar.html"]::before,
  body header .menu.open .dropdown-menu > a[href$="hogar.html"]::before{content:"🏠" !important;}

  body .nav .menu.open .dropdown-submenu,
  body header .menu.open .dropdown-submenu{
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    clear: both !important;
  }

  body .nav .menu.open .dropdown-menu .dropdown-parent,
  body header .menu.open .dropdown-menu .dropdown-parent{
    grid-template-columns: 28px minmax(0, 1fr) 20px !important;
  }

  body .nav .menu.open .dropdown-menu .dropdown-parent::before,
  body header .menu.open .dropdown-menu .dropdown-parent::before{content:"🎒" !important;}

  body .nav .menu.open .submenu-arrow,
  body header .menu.open .submenu-arrow{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
    transform: rotate(90deg) !important;
    color: #2048a0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
  }

  body .nav .menu.open .dropdown-submenu-menu,
  body header .menu.open .dropdown-submenu-menu{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 6px 0 8px 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: #f8fbff !important;
    border: 1px solid #e8eef8 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    clear: both !important;
  }

  body .nav .menu.open .dropdown-submenu-menu a[href*="cuidado-y-alimentacion"]::before,
  body header .menu.open .dropdown-submenu-menu a[href*="cuidado-y-alimentacion"]::before{content:"🍼" !important;}
  body .nav .menu.open .dropdown-submenu-menu a[href*="lactancia-y-panalera"]::before,
  body header .menu.open .dropdown-submenu-menu a[href*="lactancia-y-panalera"]::before{content:"👜" !important;}

  body .nav .menu.open .nav-item.dropdown.open + a,
  body header .menu.open .nav-item.dropdown.open + a{
    display: flex !important;
    position: relative !important;
    z-index: 1 !important;
    clear: both !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 420px){
  body .nav .menu.open,
  body header .menu.open{
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body .nav .menu.open .dropdown-menu > a,
  body header .menu.open .dropdown-menu > a,
  body .nav .menu.open .dropdown-menu .dropdown-parent,
  body header .menu.open .dropdown-menu .dropdown-parent,
  body .nav .menu.open .dropdown-submenu-menu a,
  body header .menu.open .dropdown-submenu-menu a{
    font-size: 13px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* =========================================================
   Bebé Crece — FIX SUBMENÚ ACCESORIOS TOGGLE
   Ahora en móvil Accesorios abre/cierra Cuidado y Lactancia.
   ========================================================= */
@media (max-width: 860px){
  body .nav .menu.open .dropdown-submenu:not(.open) > .dropdown-submenu-menu,
  body header .menu.open .dropdown-submenu:not(.open) > .dropdown-submenu-menu{
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body .nav .menu.open .dropdown-submenu > .dropdown-parent,
  body header .menu.open .dropdown-submenu > .dropdown-parent{
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
  }

  body .nav .menu.open .dropdown-submenu.open > .dropdown-parent,
  body header .menu.open .dropdown-submenu.open > .dropdown-parent{
    background: #eef4ff !important;
    color: #2048a0 !important;
  }

  body .nav .menu.open .dropdown-submenu > .dropdown-parent .submenu-arrow,
  body header .menu.open .dropdown-submenu > .dropdown-parent .submenu-arrow{
    transition: transform .18s ease !important;
    transform: rotate(90deg) !important;
  }

  body .nav .menu.open .dropdown-submenu.open > .dropdown-parent .submenu-arrow,
  body header .menu.open .dropdown-submenu.open > .dropdown-parent .submenu-arrow{
    transform: rotate(-90deg) !important;
  }

  body .nav .menu.open .dropdown-submenu.open > .dropdown-submenu-menu,
  body header .menu.open .dropdown-submenu.open > .dropdown-submenu-menu{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 6px 0 8px 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: #f8fbff !important;
    border: 1px solid #e8eef8 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
  }
}


/* =========================================================
   FIX DEFINITIVO: Accesorios es control de submenú en móvil
   ========================================================= */
@media (max-width: 860px){
  body .nav .menu.open .dropdown-submenu > .dropdown-parent,
  body header .menu.open .dropdown-submenu > .dropdown-parent{
    text-decoration: none !important;
    touch-action: manipulation !important;
  }

  body .nav .menu.open .dropdown-submenu:not(.open) > .dropdown-submenu-menu,
  body header .menu.open .dropdown-submenu:not(.open) > .dropdown-submenu-menu{
    display: none !important;
  }

  body .nav .menu.open .dropdown-submenu.open > .dropdown-submenu-menu,
  body header .menu.open .dropdown-submenu.open > .dropdown-submenu-menu{
    display: flex !important;
  }
}
