#header {
    max-width: var(--zg-standard-max-width);
    background-color: var(--zg-color-white);
    margin: auto;
}

#header .menu-icon-mobile {
    display: none;
}

#header .header a {
    color: var(--zg-color-white);
    text-decoration: none;
}

#header .header-top-contactinfo {
    width: 100%;
    height: 40px;
    border-bottom: 1px solid var(--zg-color-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    align-items: center;
    padding: 10px 20px;
}

#header .header-top-contactinfo .selector-wrapper {
    display: flex;
    gap: 30px;
}

#header .header-top-contactinfo .selector-wrapper .language-selector-wrapper,
#header .header-top-contactinfo .selector-wrapper .currency-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: var(--zg-font-size-body);
    color: var(--zg-color-text-primary);
}

#header .header-top-contactinfo .selector-wrapper .language-selector-wrapper select,
#header .header-top-contactinfo .selector-wrapper .currency-selector select {
    color: var(--zg-color-text-primary);
}

#header .header-top-contactinfo .contactinfo-tel a,
#header .header-top-contactinfo .contactinfo-email a {
    color: var(--zg-color-text-primary);
    font-size: var(--zg-font-size-body-large);
    text-decoration: none;
    cursor: pointer;
}

#header .header-top-contactinfo .contactinfo-tel a:hover,
#header .header-top-contactinfo .contactinfo-email a:hover {
    color: var(--zg-color-hover-primary);
}

#header .header-top {
    width: 100%;
    max-width: var(--zg-standard-max-width);
    height: auto;
    border-bottom: 1px solid var(--zg-color-secondary);
}

#header .header-top .container-f {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    gap: 100px;
}

#header .header-top .container-f .desktop_logo {
    width: 150px;
    min-width: 150px;
    height: 81px;
}

#header .header-top .container-f .header-top-center {
    width: 100%;
}

#header .header-top .container-f .header-top-center .search-container {
    width: 100%;
    border-radius: 10px;
    background-color: var(--zg-color-white);
    border: 1px solid var(--zg-color-secondary);
    font-size: var(--zg-font-size-body-large);
}

#header .header-top .container-f .header-top-center .search-container input {
    color: var(--zg-color-text-primary);
}

#header .header-top .container-f .header-top-center .search-container:focus-within {
    border: 1px solid var(--zg-color-primary);
}

#header .header-top .container-f .header-top-right {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#header .header-top .container-f .user-info,
#header .header-top .container-f #_desktop_cart {
    width: 50px;
    height: 50px;
    background-color: var(--zg-color-primary);
    border-radius: 50%;
    position: relative;
}

#header .header-top .container-f .user-info,
#header .header-top .container-f #_desktop_cart {
    width: 50px;
    height: 50px;
    background-color: var(--zg-color-primary);
    border-radius: 50%;
    color: var(--zg-color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#header .header-top .container-f .user-info:hover,
#header .header-top .container-f #_desktop_cart:hover {
    background-color: var(--zg-color-hover-primary);
}

#header .header-top .container-f #_desktop_cart .cart-products-count {
    position: absolute;
    bottom: 0px;
    right: -4px;
    background-color: var(--zg-color-hover-primary);
    color: var(--zg-color-white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: var(--zg-font-weight-bold);
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#header .header-top .container-f .user-info .logged-check {
    position: absolute;
    color: var(--zg-color-white);
    font-size: var(--zg-font-size-body);
    bottom: 0px;
    right: -4px;
    background-color: var(--zg-color-hover-primary);
    border-radius: 50%;
    padding: 3px;
}

#header .header-top .container-f .user-info a {
    color: var(--zg-color-white);
}

/* MENÚ PRINCIPAL */
#header #_desktop_top_menu {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 5px 20px;
    position: relative;
    border-bottom: 1px solid var(--zg-color-secondary);
}

#header ul.top-menu {
    display: flex;
    width: 100%;
    height: auto;
    margin: 0px;
    gap: 20px;
    padding: 0px;
    justify-content: space-between;
}


#header .top-menu>li>a {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease;
    text-align: center;
    color: var(--zg-color-text-primary);
    font-weight: var(--zg-font-weight-regular);
    font-size: var(--zg-font-size-body);
    height: 35px;
}

#header .top-menu>li {
    list-style: none;
    padding: 5px 0;
}

#header .top-menu>li>a:hover {
    color: var(--zg-color-hover-primary);
    opacity: 0.8;
}

/* Ícono de flecha para submenús */
#header .has-submenu>a::after {
    content: "keyboard_arrow_down";
    font-family: 'Material Icons';
    display: block;
    transition: transform 0.3s ease;
}

/* Contenedor del submenú */
.submenu-container {
    border-top: 2px solid var(--zg-color-primary);
    position: absolute;
    left: 0;
    width: 100%;
    max-width: var(--zg-standard-max-width);
    visibility: hidden;
    background: var(--zg-color-white);
    box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
    padding: 0px;
    z-index: 10;
}

/* Mostrar submenú al pasar el ratón o recibir focus */
.has-submenu:hover>.submenu-container,
.has-submenu:focus-within>.submenu-container {
    visibility: visible;
    opacity: 1;
    transform: translateY(5px);
}

/* Estilo básico del submenú */
#header .sub-menu {
    list-style: none;
    padding: 10px 0;
    position: relative;
    min-width: 200px;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 1.3rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: var(--zg-font-size-body);
    font-weight: var(--zg-font-weight-semibold);
}

/* Estilo de los enlaces dentro del submenú */
#header .sub-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--zg-color-text-primary);
    opacity: 0.7;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: var(--zg-font-size-body);
    font-weight: var(--zg-font-weight-regular);
}

/* Hover para los enlaces dentro del submenú */
#header .sub-menu a:hover {
    color: var(--zg-color-hover-primary);
}

/* Evitar que los submenús se muestren en el lugar equivocado */
#header .submenu .sub-menu .submenu {
    margin-left: 10px;
}

#header .sub-menu-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 10px 20px;
}

@media only screen and (max-width: 767px) {

    .collapse,
    .collapse.in,
    .collapsing {
        transition: none !important;
    }

    #header {
        width: var(--zg-tab-width);
    }

    #header .header-top-contactinfo {
        padding: 10px 10px;
    }

    #header .menu-icon-mobile {
        display: block;
        color: var(--zg-color-text-primary);
    }

    #header .sub-menu {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 80vh;
        border: none;
        overflow: auto;
    }

    #header .header-top .container-f {
        display: grid;
        grid-template-columns: 1fr 3fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "menu logo right"
            "center center center";
        align-items: center;
        justify-items: center;
        column-gap: 10px;
        row-gap: 0px;
        padding: 20px 10px;
    }

    .menu-icon-mobile {
        grid-area: menu;
    }

    .mobile_logo {
        grid-area: logo;
        padding: 0 30px 0 10px;
    }

    .header-top-right {
        grid-area: right;
    }

    .header-top-center {
        grid-area: center;
        margin-top: 10px;
    }

    #header .header-top .container-f .user-info,
    #header .header-top .container-f #_desktop_cart {
        width: 40px;
        height: 40px;
    }

    #header #_desktop_top_menu {
        display: none;
        padding: 20px;
    }

    ul.top-menu {
        display: flex;
        flex-direction: column;
    }

    #header .sub-menu {
        min-width: 200px;
        z-index: 1000;
        display: flex;
        width: 100%;
        max-height: 80vh;
        display: none;
    }

    .js-sub-menu.popover {
        top: auto !important;
    }

    #header .top-menu>li>a {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        height: 20px;
    }

    #header .sub-menu a {
        padding: 0 0 0 15px;
    }

    #header .top-menu [data-depth="2"] {
        padding-top: 15px;
        padding-left: 20px;
    }

    #header .top-menu [data-depth="2"] a {
        padding: 0 0 0 30px;
        justify-content: flex-end;
    }

#header .top-menu>li>a:hover {
    color: var(--zg-color-text-primary);
    opacity: 1;
}
}

@media only screen and (max-width: 375px) {

    #header .header-top .container-f .user-info,
    #header .header-top .container-f #_desktop_cart {
        width: 35px;
        height: 35px;
    }

    #header .header-top-contactinfo .contactinfo-tel a,
    #header .header-top-contactinfo .contactinfo-email a {
        font-size: var(--zg-font-size-body);
    }

    #header .header-top .container-f .user-info .material-icons,
    #header .header-top .container-f #_desktop_cart .material-icons {
        font-size: 20px;
    }

    .mobile_logo {
        padding: 0px;
    }
}