/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

/* Fix footer jumping on Shop page with infinite scroll */
.archive #main, 
.shop-container,
.archive.tax-product_cat #main, 
.archive.post-type-archive-product #main,
.page-id-7 #main {
    min-height: 80vh !important;
}

/* Fix checkout footer consistency - targeting CartFlows and WooCommerce */
.woocommerce-checkout .footer-wrapper,
.woocommerce-checkout .absolute-footer,
.cartflows-checkout .footer-wrapper,
.cartflows-checkout .absolute-footer,
.wcf-checkout-template .footer-wrapper,
.wcf-checkout-template .absolute-footer,
.wcf-custom-checkout-footer,
#colophon.footer-wrapper {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

.woocommerce-checkout .footer-wrapper a,
.woocommerce-checkout .absolute-footer a,
.cartflows-checkout .footer-wrapper a,
.cartflows-checkout .absolute-footer a,
.wcf-checkout-template .footer-wrapper a,
#colophon.footer-wrapper a {
    color: #ffffff !important;
}

/* Fix mobile overlapping of the help widget */
@media only screen and (max-width: 48em) {
    /*************** ADD MOBILE ONLY CSS HERE  ***************/
    .checkout-footer, 
    .footer-wrapper,
    .absolute-footer,
    #main.cart-main {
        padding-bottom: 120px !important;
    }
    
    /* Ensure checkout buttons are accessible */
    .checkout-button, #place_order, .wcf-order-button {
        margin-bottom: 30px !important;
    }
}

/* Custom Sticky Mobile Header Fix - by Antigravity AI */
@media (max-width: 849px) {
    .header-main {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        background-color: #ffffff !important;
        box-shadow: 0px 2px 10px rgba(0,0,0,0.1);
    }
    #main {
        padding-top: 70px !important;
    }
}

/* Ajuste Adicional: Forçar visibilidade imediata no carregamento (Scroll 0) */
@media (max-width: 849px) {
    .header-main {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    /* Remove transparência inicial se o tema estiver aplicando */
    .header-wrapper:not(.stuck) .header-main {
        background-color: #ffffff !important;
    }
}

/* Refinamento Final: Forçar visibilidade absoluta do conteúdo do header no topo */
@media (max-width: 849px) {
    .header-main, 
    .header-main .flex-row, 
    .header-main .header-nav,
    .header-main .logo {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    /* Ajuste para o botão flutuante de checkout não sobrepor o logo */
    .wcf-quick-checkout-button, .footer-button-wrap {
        z-index: 9998 !important;
    }
}
