/*
 * Header clean overrides (single global header for all pages).
 */

:root {
    --alua-topbar-height: 42px;
    --alua-topbar-height-admin: 74px;
    --alua-header-height: 74px;
    --alua-header-height-mobile: 62px;
}

@media (max-width: 900px) {
    :root {
        --alua-topbar-height: 38px;
        --alua-topbar-height-admin: 70px;
    }
}

/* Hide Avada native header container fully to avoid residual gray bars. */
html body .fusion-header-wrapper,
html body #wrapper > .fusion-header-wrapper,
html body .fusion-header-wrapper > header,
html body .fusion-header-wrapper > .fusion-clearfix,
html body .fusion-header,
html body .fusion-secondary-header {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

/* Fixed topbar and fixed white menu, always touching each other. */
html body .alua-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1400 !important;
    margin: 0 !important;
    border: 0 !important;
}

html body.admin-bar .alua-topbar {
    top: 32px !important;
}

html body .alua-producto-header {
    position: fixed !important;
    top: var(--alua-topbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1399 !important;
    height: var(--alua-header-height) !important;
    min-height: var(--alua-header-height) !important;
    max-height: var(--alua-header-height) !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    padding: 0 24px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border-top: 0 !important;
    border-bottom: 1px solid #ececec !important;
    box-shadow: none !important;
}

html body.admin-bar .alua-producto-header {
    top: var(--alua-topbar-height-admin) !important;
}

/* Reserve exactly the same space in page flow. */
html body {
    padding-top: calc(var(--alua-topbar-height) + var(--alua-header-height)) !important;
}

html body.admin-bar {
    padding-top: calc(var(--alua-topbar-height-admin) + var(--alua-header-height)) !important;
}

@media (max-width: 900px) {
    html body .alua-producto-header {
        height: var(--alua-header-height-mobile) !important;
        min-height: var(--alua-header-height-mobile) !important;
        max-height: var(--alua-header-height-mobile) !important;
        top: var(--alua-topbar-height) !important;
        padding: 0 12px !important;
    }

    html body.admin-bar .alua-producto-header {
        top: var(--alua-topbar-height-admin) !important;
    }

    html body {
        padding-top: calc(var(--alua-topbar-height) + var(--alua-header-height-mobile)) !important;
    }

    html body.admin-bar {
        padding-top: calc(var(--alua-topbar-height-admin) + var(--alua-header-height-mobile)) !important;
    }
}

/* Header internals. */
html body .alua-producto-header__hamburguesa,
html body .alua-producto-header__logo,
html body .alua-producto-header__iconos {
    align-self: center !important;
}

html body .alua-producto-header__hamburguesa {
    justify-content: flex-start !important;
}

html body .alua-producto-hamburguesa-btn {
    width: 36px !important;
    height: 24px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

html body .alua-producto-hamburguesa-btn span {
    display: block !important;
    width: 32px !important;
    height: 3px !important;
    border-radius: 2px !important;
    background: #2c1a00 !important;
}

html body .alua-producto-header__logo {
    justify-content: center !important;
}

html body .alua-producto-header__logo a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
}

html body .alua-producto-logo-img {
    width: auto !important;
    max-width: 320px !important;
    height: calc(100% - 8px) !important;
    max-height: calc(100% - 8px) !important;
    object-fit: contain !important;
    margin: 0 !important;
    transform: scale(1.45) !important;
    transform-origin: center center !important;
}

/* Unifica formato de cabecera en TODAS las páginas (incluida contacto). */
html body .alua-producto-header .alua-producto-logo-img {
    width: auto !important;
    max-width: 320px !important;
    height: calc(100% - 8px) !important;
    max-height: calc(100% - 8px) !important;
    transform: scale(1.45) !important;
}

html body.page-id-2663 .alua-producto-header,
html body.single-product .alua-producto-header,
html body.post-type-archive-product .alua-producto-header,
html body.home .alua-producto-header {
    height: var(--alua-header-height) !important;
    min-height: var(--alua-header-height) !important;
    max-height: var(--alua-header-height) !important;
    padding: 0 24px !important;
}

@media (max-width: 900px) {
    html body.page-id-2663 .alua-producto-header,
    html body.single-product .alua-producto-header,
    html body.post-type-archive-product .alua-producto-header,
    html body.home .alua-producto-header {
        height: var(--alua-header-height-mobile) !important;
        min-height: var(--alua-header-height-mobile) !important;
        max-height: var(--alua-header-height-mobile) !important;
        padding: 0 12px !important;
    }

    html body .alua-producto-header .alua-producto-logo-img {
        transform: scale(1.25) !important;
    }
}

/* Ajuste fino vertical: iconos y hamburguesa perfectamente centrados */
html body .alua-producto-header {
    overflow: visible !important;
}

html body .alua-producto-header__hamburguesa,
html body .alua-producto-header__iconos {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .alua-producto-header__iconos {
    justify-content: flex-end !important;
}

html body .alua-producto-hamburguesa-btn,
html body .alua-producto-header__icono,
html body .alua-producto-cart-toggle {
    position: relative !important;
    top: 0 !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
    line-height: 0 !important;
}

html body .alua-producto-header__icono svg,
html body .alua-producto-cart-toggle svg,
html body .alua-producto-hamburguesa-btn span {
    position: relative !important;
    top: 0 !important;
}

/* Canonico final: todo dentro de la franja blanca */
html body .alua-producto-header,
html body.page-id-2663 .alua-producto-header,
html body.single-product .alua-producto-header,
html body.home .alua-producto-header {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    height: var(--alua-header-height) !important;
    min-height: var(--alua-header-height) !important;
    max-height: var(--alua-header-height) !important;
    overflow: hidden !important;
}

html body .alua-producto-header__hamburguesa,
html body .alua-producto-header__logo,
html body .alua-producto-header__iconos {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
}

html body .alua-producto-header__hamburguesa { justify-content: flex-start !important; }
html body .alua-producto-header__logo { justify-content: center !important; }
html body .alua-producto-header__iconos { justify-content: flex-end !important; }

html body .alua-producto-header__logo a {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .alua-producto-logo-img {
    position: static !important;
    top: auto !important;
    transform: none !important;
    width: auto !important;
    height: 56px !important;
    max-height: 56px !important;
    max-width: 280px !important;
    margin: 0 !important;
}

html body .alua-producto-hamburguesa-btn,
html body .alua-producto-header__icono,
html body .alua-producto-cart-toggle {
    position: static !important;
    top: auto !important;
    transform: none !important;
    align-self: center !important;
}

@media (max-width: 900px) {
    html body .alua-producto-header,
    html body.page-id-2663 .alua-producto-header,
    html body.single-product .alua-producto-header,
    html body.home .alua-producto-header {
        height: var(--alua-header-height-mobile) !important;
        min-height: var(--alua-header-height-mobile) !important;
        max-height: var(--alua-header-height-mobile) !important;
    }

    html body .alua-producto-logo-img {
        height: 46px !important;
        max-height: 46px !important;
        max-width: 220px !important;
    }
}

html body .alua-producto-header__iconos {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
}

html body .alua-producto-header__icono,
html body .alua-producto-cart-toggle {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #2c1a00 !important;
    text-decoration: none !important;
}

html body .alua-producto-header__icono::before,
html body .alua-producto-header__icono::after,
html body .alua-producto-cart-toggle::before,
html body .alua-producto-cart-toggle::after {
    content: none !important;
    display: none !important;
}

html body .alua-producto-header__icono svg,
html body .alua-producto-cart-toggle svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    fill: none !important;
}

html body .alua-producto-header__icono:hover,
html body .alua-producto-header__icono:focus-visible,
html body .alua-producto-cart-toggle:hover,
html body .alua-producto-cart-toggle:focus-visible {
    color: #ceac6e !important;
}

/* Cart dropdown always closed by default. */
html body .alua-producto-cart-dropdown {
    display: none !important;
}

html body .alua-producto-cart.is-open .alua-producto-cart-dropdown {
    display: block !important;
}

/* Offcanvas overlay hidden must never occupy space. */
html body .alua-home-offcanvas-overlay[hidden],
html body .alua-home-offcanvas-overlay:not(.is-open) {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

html body .alua-home-offcanvas-overlay.is-open {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.38) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 1590 !important;
}

/* Offcanvas robusto: visible solo al abrir */
html body .alua-home-offcanvas {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(360px, 86vw) !important;
    height: 100vh !important;
    background: #ffffff !important;
    transform: translateX(-102%) !important;
    transition: transform 0.25s ease !important;
    z-index: 1600 !important;
    overflow-y: auto !important;
}

html body .alua-home-offcanvas.is-open {
    display: block !important;
    transform: translateX(0) !important;
}

/* Keep slider from hiding below fixed bars on home. */
html body.home #sliders-container,
html body.home #sliders-container .fusion-slider-container,
html body.home #sliders-container .tfs-slider,
html body.home #sliders-container .slides,
html body.home #sliders-container .slides li,
html body.home #sliders-container .slides li .background {
    height: calc(100vh - var(--alua-topbar-height) - var(--alua-header-height)) !important;
    min-height: calc(100vh - var(--alua-topbar-height) - var(--alua-header-height)) !important;
}

html body.home.admin-bar #sliders-container,
html body.home.admin-bar #sliders-container .fusion-slider-container,
html body.home.admin-bar #sliders-container .tfs-slider,
html body.home.admin-bar #sliders-container .slides,
html body.home.admin-bar #sliders-container .slides li,
html body.home.admin-bar #sliders-container .slides li .background {
    height: calc(100vh - var(--alua-topbar-height-admin) - var(--alua-header-height)) !important;
    min-height: calc(100vh - var(--alua-topbar-height-admin) - var(--alua-header-height)) !important;
}

@media (max-width: 900px) {
    html body.home #sliders-container,
    html body.home #sliders-container .fusion-slider-container,
    html body.home #sliders-container .tfs-slider,
    html body.home #sliders-container .slides,
    html body.home #sliders-container .slides li,
    html body.home #sliders-container .slides li .background {
        height: calc(100vh - var(--alua-topbar-height) - var(--alua-header-height-mobile)) !important;
        min-height: calc(100vh - var(--alua-topbar-height) - var(--alua-header-height-mobile)) !important;
    }

    html body.home.admin-bar #sliders-container,
    html body.home.admin-bar #sliders-container .fusion-slider-container,
    html body.home.admin-bar #sliders-container .tfs-slider,
    html body.home.admin-bar #sliders-container .slides,
    html body.home.admin-bar #sliders-container .slides li,
    html body.home.admin-bar #sliders-container .slides li .background {
        height: calc(100vh - var(--alua-topbar-height-admin) - var(--alua-header-height-mobile)) !important;
        min-height: calc(100vh - var(--alua-topbar-height-admin) - var(--alua-header-height-mobile)) !important;
    }

    html body .alua-producto-logo-img {
        transform: scale(1.25) !important;
    }
}
