
#header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--zg-color-white);
  transition: box-shadow .45s ease, transform .45s ease;
}

/* SOMBRA CUANDO HACES SCROLL */

body.scrolled #header{
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}


#header.hide-header {
  /* transform: translateY(-100%); */
	top: -140px;
}

#header .menu-icon-mobile {
    display: none;
}

#header .header a {
    color: var(--zg-color-text-primary);
    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;
    background-color: var(--zg-color-primary);
}

#header .header-top-contactinfo .selector-wrapper {
    display: flex;
    gap: 30px;
    align-items: center;
    width: var(--zg-standard-width);
    max-width: var(--zg-standard-max-width);
    margin: auto;
    justify-content: flex-end;
}

#header .header-top-contactinfo .selector-wrapper #contact-link a, #header .header-top-contactinfo .selector-wrapper #contact-link a:visited {
    color: var(--zg-color-white);
    font-size: var(--zg-font-size-body-small);
}

/* Selector de idioma y selector de moneda */
#header .header-top-contactinfo .selector-wrapper .language-selector,
#header .header-top-contactinfo .selector-wrapper .currency-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--zg-font-size-body);
    color: var(--zg-color-white);
    cursor: pointer;
}

#header .header-top-contactinfo .selector-wrapper .language-selector>span,
#header .header-top-contactinfo .selector-wrapper .currency-selector>span {
    padding: 4px 8px;
    border-radius: 3px;
    background: var(--zg-color-primary);
}

#header .header-top-contactinfo .selector-wrapper .language-selector ul,
#header .header-top-contactinfo .selector-wrapper .currency-selector ul {
    position: absolute;
    top: 80%;
    left: 0;
    margin: 4px 0 0;
    padding: 5px 0;
    list-style: none;
    background: var(--zg-color-white);
    color: var(--zg-color-text-primary);
    min-width: 80px;
    border-radius: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 50;
}
.cart-info-container .resume-product-cart .product-name{
    font-size: 2rem;
}
#header .header-top-contactinfo .selector-wrapper .language-selector ul li a,
#header .header-top-contactinfo .selector-wrapper .currency-selector ul li a {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

#header .header-top-contactinfo .selector-wrapper .language-selector ul li.current a,
#header .header-top-contactinfo .selector-wrapper .currency-selector ul li.current a {
    font-weight: var(--zg-font-weight-semibold);
}

#header .header-top-contactinfo .selector-wrapper .language-selector ul li a:hover,
#header .header-top-contactinfo .selector-wrapper .currency-selector ul li a:hover {
    background: #f2f2f2;
}

#header .header-top-contactinfo .selector-wrapper .language-selector:hover ul,
#header .header-top-contactinfo .selector-wrapper .currency-selector:hover ul {
    display: block;
}

#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 .user-info {
    width: 43px;
    height: 43px;
    background-color: var(--zg-color-primary);
    border-radius: 10px;
    color: var(--zg-color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#header .user-info a {
    color: var(--zg-color-white);
    z-index: 1;
}

#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: -2px;
    border-radius: 50%;
    padding: 3px;
}

#header .user-info .login,
#header .user-info .account {
    color: var(--zg-color-white);
    font-size: var(--zg-font-size-body);
    cursor: pointer;
}

#header .user-info .login:hover,
#header .user-info .account:hover {
    color: var(--zg-color-hover-tertiary);
}

#header .user-info .logout {
    color: var(--zg-color-white);
    font-size: var(--zg-font-size-body-small);
    color: var(--zg-color-white);
    cursor: pointer;
}

#header .user-info .logout:hover {
    color: var(--zg-color-hover-tertiary);
}

#header .header-top {
    width: var(--zg-standard-width);
    max-width: var(--zg-standard-max-width);
    height: auto;
    margin: auto;
}

#header .header-top .container-f {
    display: flex;
    flex-direction: row;
    align-items: center;    
    gap: 100px;
    width: 100%;
}

#header .header-top .container-f .desktop_logo {
   width: 10%;
  min-width: 180px;
  height: 110px;
  padding: 5px;
}

#header .header-top .container-f .desktop_logo img {
    object-fit: contain;
    height: 100%;
}
/*
#header .header-top .container-f .header-top-center {
    width: 90%;
    display: flex;
    align-items: center;
    gap: 25px;
}
*/
#header .header-top .container-f .header-top-right {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    width: 10%;
}

#header #search_widget {
    flex: 1;
}

/* Carrito */
#header #blockcart-wrapper {
    background-color: var(--zg-color-primary);
    height: 43px;
    border-radius: 10px;
    width: 160px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

}

#header #blockcart-wrapper .blockcart.cart-preview {
    line-height: 1.3;
    width: 100%;
    height: 100%;
}

/* Overlay */
#header #blockcart-wrapper::after,
#header .user-info::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--zg-color-secondary);
    opacity: .8;
    transition: left .4s ease;
    z-index: 0;
}

/* Hover hacia la derecha */
#header #blockcart-wrapper:hover::after,
#header .user-info:hover::after {
    left: 0;
}

#header #blockcart-wrapper.is-open::after {
    left: -100%;
    transition: none;
}

#header #blockcart-wrapper .blockcart .header {
    position: relative;
    z-index: 1;
    height: 100%;
}

#header #blockcart-wrapper .blockcart .header a,
#header #blockcart-wrapper .blockcart .header .material-symbols-outlined {
    color: var(--zg-color-white);
}

#header #blockcart-wrapper .blockcart .header a {
    font-size: var(--zg-font-size-body);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
    height: 100%;
}

#header #blockcart-wrapper .blockcart .header .material-symbols-outlined {
    font-size: var(--zg-font-size-h3);
}

/* Encabezado del carrito */
.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px 0 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.cart-panel-title {
    font-size: var(--zg-font-size-h3);
    font-weight: var(--zg-font-weight-bold);
    margin: 0;
    color: var(--zg-color-text-primary);
}

/* X */
.close-cart-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.close-cart-btn span.material-symbols-outlined {
    font-size: var(--zg-font-size-h2);
    color: var(--zg-color-text-primary);
    transition: color 0.2s ease;
}

.close-cart-btn:hover span.material-symbols-outlined {
    color: var(--zg-color-black);
}

#blockcart-wrapper .blockcart .body {
    position: fixed;
    top: 2%;
    right: 10px;
    width: 20%;
    height: 95vh;
    background: var(--zg-color-white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow-y: auto;
    padding: 20px;
    transform: translateX(110%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
    z-index: 9001;
}

#blockcart-wrapper .blockcart.open .body {
    transform: translateX(0);
}

#blockcart-wrapper .blockcart .body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    overflow-y: auto;
}

/* Lista de productos dentro del panel */
/* Cada <li> del carrito */
#blockcart-wrapper .blockcart .body ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

/* Imagen + info */
.cart-info-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Bloque de imagen */
.cart-info-container .img-product {
    flex: 0 0 98px;
}

.cart-info-container .img-product img {
    width: 98px;
    height: 98px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* Bloque de info a la derecha, en columna */
.cart-info-container .resume-product-cart {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Nombre del producto */
#blockcart-wrapper .cart-info-container .product-name {
    display: block;
    font-size: var(--zg-font-size-body);
    font-weight: var(--zg-font-weight-semibold);
    color: var(--zg-color-text-primary);
    line-height: 1.2;
}

/* Atributos debajo del nombre */
.cart-info-container .product-attribute {
    display: block;
    font-size: var(--zg-font-size-body-small);
    color: var(--zg-color-text-primary);
    opacity: .7;
}

/* Cantidad y precio */
.cart-info-container .product-quantity,
.cart-info-container .product-price {
    font-size: var(--zg-font-size-body);
    font-weight: var(--zg-font-weight-regular);
    color: var(--zg-color-text-primary);
}

/* Botón eliminar */
.cart-info-container .remove-from-cart {
    margin-top: 4px;
    font-size: var(--zg-font-size-body-small);
    color: var(--zg-color-secondary);
    text-decoration: none;
    align-self: flex-end;
    cursor: pointer;
}

.cart-info-container .remove-from-cart:hover {
    color: var(--zg-color-hover-primary);
}

/* subtotales carrito lateral */
#blockcart-wrapper .blockcart .cart-subtotals {
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#blockcart-wrapper .blockcart .cart-subtotals>div {
    display: flex;
    justify-content: space-between;
    font-size: var(--zg-font-size-body-small);
    color: var(--zg-color-text-primary);
}

#blockcart-wrapper .blockcart .cart-subtotals .label {
    font-weight: var(--zg-font-weight-regular);
}

#blockcart-wrapper .blockcart .cart-subtotals .value {
    font-weight: var(--zg-font-weight-semibold);
    color: var(--zg-color-text-primary);
}

#blockcart-wrapper .blockcart .cart-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: var(--zg-font-size-body-large);
    font-weight: var(--zg-font-weight-bold);
    color: var(--zg-color-text-primary);
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

#blockcart-wrapper .blockcart .cart-total .label {
    font-weight: var(--zg-font-weight-bold);
}

#blockcart-wrapper .blockcart .cart-total .value {
    font-weight: var(--zg-font-weight-bold);
}

#blockcart-wrapper .button-cart-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#blockcart-wrapper .blockcart .button-go-cart a {
    background: var(--zg-color-primary);
    color: var(--zg-color-white);
}

#blockcart-wrapper .blockcart .button-go-cart a,
#blockcart-wrapper .blockcart .button-continue-shopping .js-close-panel {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    border-radius: 6px;
    font-size: var(--zg-font-size-body-large);
    font-weight: var(--zg-font-weight-semibold);
    text-decoration: none;
    transition: background 0.25s ease, transform 0.15s ease;
}

#blockcart-wrapper .blockcart .button-go-cart a:hover {
    background: var(--zg-color-hover-secondary);
}

#blockcart-wrapper .blockcart .button-continue-shopping .js-close-panel {
    background: var(--zg-color-white);
    color: var(--zg-color-primary);
    border: 1px solid var(--zg-color-primary);
    cursor: pointer;
}

#blockcart-wrapper .blockcart .button-continue-shopping .js-close-panel:hover {
    border: 1px solid var(--zg-color-secondary);
    color: var(--zg-color-secondary);
}

/* Overlay del fondo */
#cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#cart-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* MENÚ PRINCIPAL */
#header #_desktop_top_menu {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0px 20px;
    margin: auto;
    position: relative;
    background-color: var(--zg-color-primary);
}

#header ul.top-menu {
    display: flex;
    width: var(--zg-standard-width);
    max-width: var(--zg-standard-max-width);
    height: auto;
    margin: auto;
    gap: 20px;
    padding: 0px;
    justify-content: space-between;
    position: relative;
}


#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);
    color: var(--zg-color-white);
    font-weight: var(--zg-font-weight-semibold);
    font-size: var(--zg-font-size-body);
    height: 35px;
}

#header .top-menu>li {
    list-style: none;
    padding: 5px 0;
    box-sizing: border-box;
    /* Borde transparente para que no haya efecto raro */
    border-bottom: 5px solid transparent;
}

#header .top-menu>li:hover {
    border-bottom-color: var(--zg-color-tertiary);
    color: var(--zg-color-tertiary);
}

/* Í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-tertiary);
    position: absolute;
    top: 45px;
    width: 100%;
    left: 0;
    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;
    margin: auto;
    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);
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: var(--zg-font-size-body);
    font-weight: var(--zg-font-weight-semibold);
}

/* Hover para los enlaces dentro del submenú */
#header .sub-menu a:hover {
    color: var(--zg-color-tertiary);
}

/* 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;
}
/* Menú cerrado */
.js-top-menu.position-static{
  display: none;
}

/* Menú abierto */
.js-top-menu.position-static.menu-open{
  display: block !important;
}
.close-menu-btn{
  display: none;
}
@media only screen and (max-width: 769px) {


    .close-menu-btn{
        display: block;
        color: white;
        background-color: transparent;
        border: none;
    }
    .collapse,
    .collapse.in,
    .collapsing {
        transition: none !important;
    }

    #header {
        width: var(--zg-mobile-width-large);
    }

    #header .header-top {
        width: var(--zg-mobile-width-large);
    }

    #header .header-top-contactinfo {
        padding: 10px 10px;
    }

    #header #blockcart-wrapper .cart-label {
        display: none;
    }

    #header .header-top .container-f .desktop_logo {
        width: 150px;
        height: 90px;
        min-width: 100px;
    }

    #header .desktop_logo h1 img,
    #header .desktop_logo img {
        width: 150px;
        height: 52px;
    }

    #header .menu-icon-mobile {
        display: block;
        color: var(--zg-color-text-primary);
    }

    #header .menu-icon-mobile span.material-symbols-outlined {
        font-size: var(--zg-font-size-h1);
    }

    #header .sub-menu {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 80vh;
        border: none;
        overflow: auto;
        background-color: var(--zg-color-primary);
    }

    #header .header-top .container-f .header-top-center {
        width: 100%;
    }

    #header .header-top .container-f {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "menu logo right"
        "search search search";
    align-items: center;
    justify-items: center;
    column-gap: 10px;
    row-gap: 0px;
    padding: 0px 10px;
}

.menu-icon-mobile { grid-area: menu; }

.desktop_logo { grid-area: logo; }

.header-top-center { grid-area: right; }   /* usuario + carrito */

#search_widget { grid-area: search; }      /* buscador abajo */

    #header .header-top .container-f .header-top-right {
        width: 100%;
        justify-content: center;
    }

    #header #blockcart-wrapper {
        width: 120px;
    }

   

    .mobile_logo {
        grid-area: logo;
        padding: 0 30px 0 10px;
    }

    .header-top-right {
        grid-area: right;
    }

 

    #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;
    }

    #header .header-top .container-f #_desktop_cart .material-icons {
        font-size: 20px;
    }

    .js-sub-menu.popover {
        top: auto !important;
    }

    #header .top-menu>li {
        border-bottom: none;
    }

    #header .top-menu>li>a {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        height: 20px;
    }

    #header .top-menu .category .dropdown-item .hidden-md-up {
        display: block !important;

    }

    #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;
    }

    /* Carrito lateral */
    #blockcart-wrapper .blockcart .body {
        top: 0;
        right: 0;
        width: 60%;
        height: 100vh;
    }

    .cart-panel-header {
        padding: 5px 0 5px 0;
        margin-bottom: 0px;
    }

    .cart-panel-title {
        font-size: var(--zg-font-size-body-large);
    }

    #blockcart-wrapper .button-cart-container {
        flex-direction: row;
    }

    #blockcart-wrapper .button-cart-container .button-go-cart {
        flex: 1;
    }

    #blockcart-wrapper .button-cart-container .button-continue-shopping {
        flex: 1;
    }
}

@media only screen and (max-width: 425px) {
    #blockcart-wrapper .button-cart-container {
        flex-direction: column;
    }

    .mobile_logo {
        padding: 0px;
    }

    /* Carrito lateral */
    #blockcart-wrapper .blockcart .body {
        width: 100%;
    }

    #blockcart-wrapper .blockcart .button-go-cart a,
    #blockcart-wrapper .blockcart .button-continue-shopping a {
        font-size: var(--zg-font-size-body-small);
    }

    #header .sub-menu {
        background-color: var(--zg-color-primary);
    }
}