/* =========================================================
   XDORABLE / BOTBLE - HEADER RESET + SAFE STICKY BEHAVIOUR
   ========================================================= */

/* 1. Reset damaged/hidden header states */
header.tf-header.header-s6.has-by-category,
header.tf-header.header-s6.has-by-category * {
    animation: none !important;
}

/* 2. Keep the theme header visible without forcing wrong layout */
header.tf-header.header-s6.has-by-category {
    top: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    background: #ffffff !important;
    z-index: 1030 !important;
}

/* 3. Override inline top:-70px from theme scroll JS */
header.tf-header.header-s6.has-by-category[style] {
    top: 0 !important;
}

/* 4. Keep main header row normal */
header.tf-header.header-s6.has-by-category .header-inner_wrap {
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* 5. Restore the category/search bottom row if theme marks it as .hide */
@media (min-width: 1200px) {
    header.tf-header.header-s6.has-by-category .header-bottom_wrap,
    header.tf-header.header-s6.has-by-category .header-bottom_wrap.hide {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        height: auto !important;
        min-height: unset !important;
        max-height: none !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    header.tf-header.header-s6.has-by-category .header-bottom_wrap .container,
    header.tf-header.header-s6.has-by-category .header-bottom_wrap.hide .container {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* 6. Stop transition flicker, but do not touch layout columns */
header.tf-header.header-s6.has-by-category,
header.tf-header.header-s6.has-by-category .header-inner_wrap,
header.tf-header.header-s6.has-by-category .header-bottom_wrap {
    transition: none !important;
}

/* 7. Top bar stable */
.tf-topbar.topbar-s2.bg-dark {
    background: #010f1c !important;
    color: #ffffff !important;
}

/* 8. Modals and search above header */
.modal,
.modal.show,
#search.modal,
.modal#search,
.modal.modal-search {
    z-index: 1060 !important;
}

.modal-backdrop,
.modal-backdrop.show {
    z-index: 1055 !important;
}

/* 9. Mobile slide menu above header, using original close button */
@media (max-width: 1199px) {
    #mobileMenu,
    .offcanvas#mobileMenu,
    .offcanvas.offcanvas-start#mobileMenu {
        z-index: 1065 !important;
        background: #ffffff !important;
    }

    #mobileMenu.show,
    .offcanvas#mobileMenu.show {
        z-index: 1065 !important;
        visibility: visible !important;
    }

    .offcanvas-backdrop,
    .offcanvas-backdrop.show {
        z-index: 1060 !important;
    }

    #mobileMenu .btn-close,
    #mobileMenu [data-bs-dismiss="offcanvas"] {
        z-index: 1070 !important;
        position: relative !important;
    }
}

/* 10. Admin bar offset only while logged in */
body.show-admin-bar header.tf-header.header-s6.has-by-category {
    top: 32px !important;
}