
/* Cabecera general */
.dibar-sticky-header {
    min-height: 90px !important;
    padding: 25px 0 0 !important;
    display: flex;
    align-items: center !important;
    box-sizing: border-box;
}

.dibar-sticky-header .elementor-widget-theme-site-logo {
    align-self: center !important;
}

/* Cabecera transparente en páginas corporativas */
body:not(.dibar-scrolled):not(:is(
    .single-product,
    .woocommerce-shop,
    .woocommerce-cart,
    .woocommerce-checkout,
    .woocommerce-account,
    .tax-product_cat,
    .tax-product_tag,
    .post-type-archive-product,
    .search,
    .dibar-pagina-legal
)) .dibar-sticky-header {
    position: absolute !important;
    top: 20px !important;
    left: 0;
    width: 100%;
    z-index: 999;
    background: transparent !important;
}

/* Cabecera fija al hacer scroll */
body.dibar-scrolled:not(:is(
    .single-product,
    .woocommerce-shop,
    .woocommerce-cart,
    .woocommerce-checkout,
    .woocommerce-account,
    .tax-product_cat,
    .tax-product_tag,
    .post-type-archive-product,
    .search,
    .dibar-pagina-legal
)) .dibar-sticky-header {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    width: 100%;
    z-index: 999;
    background: #532526 !important;
}

/* Cabecera marrón en WooCommerce y páginas legales */
body:is(
    .single-product,
    .woocommerce-shop,
    .woocommerce-cart,
    .woocommerce-checkout,
    .woocommerce-account,
    .tax-product_cat,
    .tax-product_tag,
    .post-type-archive-product,
    .search,
    .dibar-pagina-legal
) .dibar-sticky-header {
    position: relative !important;
    top: 0 !important;
    left: 0;
    width: 100%;
    z-index: 999;
    background: #532526 !important;
}

/* Menú crema */
.dibar-sticky-header .elementor-nav-menu--main .elementor-item,
.dibar-sticky-header .elementor-nav-menu--main .elementor-item:hover,
.dibar-sticky-header .elementor-nav-menu--main .elementor-item.elementor-item-active {
    color: #F9F3DF !important;
}

/* Idiomas e iconos crema */
.dibar-sticky-header
:is(.dibar-header-idiomas, .dibar-header-cuenta, .dibar-header-carrito),
.dibar-sticky-header
:is(.dibar-header-idiomas, .dibar-header-cuenta, .dibar-header-carrito)
:is(a, i, svg) {
    color: #F9F3DF !important;
}

/* Iconos */
.dibar-sticky-header
:is(.dibar-header-cuenta, .dibar-header-carrito) svg {
    fill: currentColor !important;
    stroke: currentColor;
}

/* Contenedor de idiomas */
.dibar-header-idiomas {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Selector WPML */
.dibar-header-idiomas .wpml-ls,
.dibar-header-idiomas .wpml-ls ul {
    margin: 0 !important;
    padding: 0 !important;
}

.dibar-header-idiomas .wpml-ls ul {
    display: flex !important;
    align-items: center;
    gap: 12px !important;
}

.dibar-header-idiomas .wpml-ls li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Enlaces de idiomas */
.dibar-header-idiomas .wpml-ls a {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none !important;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.dibar-sticky-header .dibar-header-idiomas .wpml-ls a,
.dibar-sticky-header .dibar-header-idiomas .wpml-ls a span {
    color: #F9F3DF !important;
}

/* Idioma inactivo */
.dibar-header-idiomas .wpml-ls li:not(.wpml-ls-current-language) {
    opacity: 0.5;
}

/* Idioma activo */
.dibar-header-idiomas .wpml-ls-current-language {
    opacity: 1 !important;
}

.dibar-header-idiomas .wpml-ls-current-language a,
.dibar-header-idiomas .wpml-ls-current-language a span {
    font-weight: 700 !important;
}

/* Iconos de cuenta y carrito */
.dibar-header-cuenta,
.dibar-header-carrito {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dibar-header-cuenta svg,
.dibar-header-carrito svg {
    width: 19px;
    height: 19px;
}

/* Transiciones */
.dibar-header-cuenta a,
.dibar-header-carrito a {
    transition: color 0.25s ease;
}

/* Contador de la cesta */
.dibar-header-carrito .elementor-button-icon-qty {
    font-size: 9px !important;
    font-weight: 500 !important;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    line-height: 15px !important;
    padding: 0 !important;
    text-align: center !important;
    border-radius: 50% !important;
    border: none !important;
    box-shadow: none !important;
    background: #F9F3DF !important;
    color: #532526 !important;
}

/* Ocultar el logo original */
.dibar-sticky-header .elementor-widget-theme-site-logo img {
    opacity: 0 !important;
}

/* Mostrar el logo crema */
.dibar-sticky-header .elementor-widget-theme-site-logo a {
    display: block;
    width: 125px;
    height: 45px;
    background: url('https://maensystems.net/dibarcafe/wp-content/uploads/2026/05/dibar_crema.png') center / contain no-repeat !important;
}

/* Alineación vertical de idiomas */
.dibar-sticky-header .dibar-header-idiomas {
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dibar-sticky-header .dibar-header-idiomas .wpml-ls,
.dibar-sticky-header .dibar-header-idiomas .wpml-ls ul,
.dibar-sticky-header .dibar-header-idiomas .wpml-ls li,
.dibar-sticky-header .dibar-header-idiomas .wpml-ls a {
    line-height: 1 !important;
}

.dibar-sticky-header .dibar-header-idiomas .wpml-ls a {
    display: flex !important;
    align-items: center !important;
}

/* Ajustar únicamente el icono del carrito */
.dibar-sticky-header .dibar-header-carrito .elementor-menu-cart__toggle {
    transform: translateY(-1px);
}

/* Nombre del producto en el carrito lateral */
.dibar-sticky-header .elementor-menu-cart__container
.elementor-menu-cart__product-name a,
.dibar-sticky-header .elementor-menu-cart__container
.elementor-menu-cart__product-name a:link,
.dibar-sticky-header .elementor-menu-cart__container
.elementor-menu-cart__product-name a:visited {
    color: #532526 !important;
}

/* Color al pasar el ratón */
.dibar-sticky-header .elementor-menu-cart__container
.elementor-menu-cart__product-name a:hover {
    color: #5A1215 !important;
}


/* Cabecera fija en tienda y productos */
body:is(
    .woocommerce-shop,
    .post-type-archive-product,
    .tax-product_cat,
    .tax-product_tag,
    .single-product
) .elementor-location-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
}

/* Menú móvil por encima de la cabecera */
@media (max-width: 767px) {
    .elementor-location-header .elementor-nav-menu--dropdown {
        position: relative;
        z-index: 10001 !important;
    }
}

/* Evitar fijar dos veces la cabecera */
body:is(
    .woocommerce-shop,
    .post-type-archive-product,
    .tax-product_cat,
    .tax-product_tag,
    .single-product
) .dibar-sticky-header {
    position: relative !important;
    top: auto !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Barra de envío integrada en la cabecera */
.dibar-envio-gratis {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    background: #F9F3DF;
    color: #532526;
    text-align: center;
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 13px;
    padding: 9px 15px;
    line-height: 1.5;
}

/* Importe destacado */
.dibar-envio-gratis strong {
    font-weight: 700;
}

/* Ajuste móvil */
@media (max-width: 767px) {
    .dibar-envio-gratis {
        font-size: 12px;
        padding: 9px 12px;
    }
}


/* Colores corporativos WooCommerce */
:root {
    --dibar-granate: #5A1215;
    --dibar-crema: #F9F3DF;
}

/* Enlaces de WooCommerce */
.woocommerce a:not(.button),
.woocommerce-account .woocommerce-MyAccount-content a:not(.button) {
    color: var(--dibar-granate);
}

/* Botones generales */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .button,
.woocommerce-page a.button,
.woocommerce-page button.button {
    color: var(--dibar-granate);
    border-color: var(--dibar-granate);
}

/* Botones de Mi cuenta */
.woocommerce-account .woocommerce-MyAccount-content a.button,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-button {
    color: var(--dibar-granate) !important;
    border: 2px solid var(--dibar-granate) !important;
    background: transparent !important;
    border-radius: 4px;
}

/* Hover de botones */
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce-account .woocommerce-MyAccount-content a.button:hover {
    color: var(--dibar-crema) !important;
    background: var(--dibar-granate) !important;
    border-color: var(--dibar-granate) !important;
}

/* Botones principales */
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
    background: var(--dibar-granate) !important;
    color: var(--dibar-crema) !important;
    border-color: var(--dibar-granate) !important;
}

/* Campos activos y enlaces */
.woocommerce input:focus,
.woocommerce select:focus,
.woocommerce textarea:focus {
    border-color: var(--dibar-granate) !important;
    outline-color: var(--dibar-granate);
}

.woocommerce a:focus-visible,
.woocommerce button:focus-visible {
    outline: 2px solid var(--dibar-granate);
    outline-offset: 2px;
}

/* Mensajes de WooCommerce */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    border-top-color: var(--dibar-granate) !important;
}

.woocommerce-info::before,
.woocommerce-message::before {
    color: var(--dibar-granate) !important;
}

/* Paginación */
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    color: var(--dibar-granate);
}

.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: var(--dibar-granate);
    color: var(--dibar-crema);
}


/* Cabecera en página 404 */
body.error404 .elementor-location-header {
    position: relative !important;
    top: 0 !important;
    z-index: 999 !important;
    background: #532526 !important;
}

body.error404 .dibar-sticky-header,
body.error404:not(.dibar-scrolled) .dibar-sticky-header,
body.error404.dibar-scrolled .dibar-sticky-header {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #532526 !important;
}


