/*
Theme Name: Astra Child
Theme URI: https://mobigo.tn
Description: A child theme for Astra, customized for Mobigo.
Author: Atef Kwiri
Author URI: https://atefkwiri.com
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/

/* Fixing FiboSearch Wrapper */
.dgwt-wcas-sf-wrapp {
    display: flex !important;
    width: 900px !important;
}

/* Responsive search bar styles */
@media (max-width: 1024px) {
    /* Tablet styles */
    .dgwt-wcas-sf-wrapp {
        width: 600px !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 767px) {
    /* Mobile styles */
    .dgwt-wcas-sf-wrapp {
        width: 350px !important;
        margin: 0 auto !important;
        justify-content: center !important;
    }
}

.dgwt-wcas-search-input {
    flex-grow: 1 !important;
    width: auto !important;
}

/* Ensure the footer stays below the sidebar */
footer.site-footer {
    clear: both !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Custom Text Selection Styles */
::selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

::-moz-selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

/* Header text selection */
.site-header ::selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

.site-header ::-moz-selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

/* Footer text selection */
.site-footer ::selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

.site-footer ::-moz-selection {
    color: #ffffff;
    background-color: #e5b260; /* Gold color */
}

/* Search input placeholder styles */
.dgwt-wcas-search-input::placeholder {
    color: #999999;
    opacity: 0.5;
    font-style: italic;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dgwt-wcas-search-input::-webkit-input-placeholder {
    user-select: none;
    -webkit-user-select: none;
}

.dgwt-wcas-search-input::-moz-placeholder {
    user-select: none;
    -moz-user-select: none;
}

.dgwt-wcas-search-input:-ms-input-placeholder {
    user-select: none;
    -ms-user-select: none;
}

.dgwt-wcas-search-input:-moz-placeholder {
    user-select: none;
    -moz-user-select: none;
}

/* Custom selection style for text typed in search field */
.dgwt-wcas-search-input::selection {
    color: #000000;
    background-color: rgba(0, 0, 0, 0.16); /* White with 16% opacity */
}

.dgwt-wcas-search-input::-moz-selection {
    color: #000000;
    background-color: rgba(0, 0, 0, 0.16); /* White with 16% opacity */
}

/* Remove the pink background */
body {
    background-color: #ffffff !important; /* Restore white background */
}

/* Remove unnecessary background overrides */
#page, 
.ast-container,
.ast-separate-container .ast-article-single,
.ast-separate-container .comment-respond,
.ast-separate-container .ast-comment-list li,
.ast-separate-container .ast-woocommerce-container {
    background-color: transparent !important; /* Reset to default */
}

/* Header Selection Styles */
.site-header ::selection {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.16); /* White with 16% opacity */
}

.site-header ::-moz-selection {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.16); /* White with 16% opacity */
}

/* Footer Selection Styles */
.site-footer ::selection {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.16); /* White with 16% opacity */
}

.site-footer ::-moz-selection {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.16); /* White with 16% opacity */
}

/* Disable text selection for search field placeholder */
.dgwt-wcas-search-input::placeholder {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* For older browsers and specific vendor implementations */
.dgwt-wcas-search-input::-webkit-input-placeholder {
    user-select: none;
    -webkit-user-select: none;
}

.dgwt-wcas-search-input::-moz-placeholder {
    user-select: none;
    -moz-user-select: none;
}

.dgwt-wcas-search-input:-ms-input-placeholder {
    user-select: none;
    -ms-user-select: none;
}

.dgwt-wcas-search-input:-moz-placeholder {
    user-select: none;
    -moz-user-select: none;
}

/* Custom selection style for text typed in search field */
.dgwt-wcas-search-input::selection {
    color: #000000;
    background-color: rgba(0, 0, 0, 0.16); /* White with 16% opacity */
}

.dgwt-wcas-search-input::-moz-selection {
    color: #000000;
    background-color: rgba(0, 0, 0, 0.16); /* White with 16% opacity */
}

/* Hide the "Effacer" reset variations text in product pages */
a.reset_variations,
.reset_variations {
    color: transparent !important; /* Hide the text */
    font-size: 0 !important; /* Reduce font size to 0 */
    text-indent: -9999px !important; /* Move text out of view */
    overflow: hidden !important; /* Hide any overflow */
    pointer-events: none !important; /* Prevents any interaction */
    /* Maintain the original dimensions and layout */
    display: inline-block !important; 
    visibility: visible !important;
    opacity: 1 !important;
}

/* Add empty content to preserve space if needed */
a.reset_variations::after,
.reset_variations::after {
    content: "";
    display: inline-block;
    width: 51.4453px; /* Same width as original */
    height: 14.5px; /* Same height as original */
}

/* If you need to target by content */
.single-product div.elementor-widget-container:has(span:contains("specific text inside the container")) {
    display: none !important;
}

/* Hide "Voir le panier" text that appears after adding to cart */
.single-product .single_add_to_cart_button + .added_to_cart.wc-forward,
.single-product form.cart .added_to_cart.wc-forward {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

/* Hide password visibility button completely */
button.show-password-input,
.show-password-input {
    display: none !important;
}

/* Change "Soldes !" tag to "Promo !" with red background and white text */
.ast-on-card-button.ast-onsale-card,
span.ast-onsale-card,
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
    background-color: #ff0000 !important; /* Red background */
    color: #ffffff !important; /* White text */
}

/* Hide the original text and replace with "Promo !" */
.ast-on-card-button.ast-onsale-card::before,
span.ast-onsale-card::before,
.woocommerce span.onsale::before,
.woocommerce ul.products li.product .onsale::before {
    content: "Promo !";  /* New text */
    font-weight: bold;
    font-size: inherit;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    background-color: #ff0000 !important;
    border-radius: inherit;
}

/* Adjust Scroll to Top Button Position */
#ast-scroll-top {
    bottom: 80px !important; /* Move up from default 30px */
}

/* Responsive adjustments for scroll to top button */
@media (max-width: 921px) {
    #ast-scroll-top {
        bottom: 80px !important;
    }
}

@media (max-width: 544px) {
    #ast-scroll-top {
        bottom: 80px !important;
    }
}

/* Hide the country/region field in checkout */
#billing_country_field,
#shipping_country_field,
.woocommerce-shipping-fields #shipping_country_field {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Hide any Select2 dropdown related to country selection */
.select2-container--default .select2-selection--single[aria-labelledby*="select2-billing_country-container"],
.select2-container--default .select2-selection--single[aria-labelledby*="select2-shipping_country-container"] {
    display: none !important;
}

/* Hide the country dropdown in the dropdown results */
.select2-results__option[id*="select2-billing_country"],
.select2-results__option[id*="select2-shipping_country"] {
    display: none !important;
}

/* Make Commander button full width on mobile */
@media (max-width: 767px) {
    /* Target the button wrapper */
    .elementor-button-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Target the Commander button - make it full width everywhere */
    a#commander-button,
    a#commander-button.elementor-button,
    .elementor-button.elementor-size-sm,
    .ast-sticky-add-to-cart .commander,
    .ast-sticky-add-to-cart button.commander,
    .ast-sticky-add-to-cart a.commander {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    /* Target the Add to Cart button */
    .single_add_to_cart_button,
    button.single_add_to_cart_button,
    .single_add_to_cart_button.button.alt {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Target the form container if needed */
    form.cart {
        display: flex;
        flex-direction: column;
    }
    
    /* Hide the sticky add to cart bar on mobile */
    .ast-sticky-add-to-cart,
    .ast-sticky-add-to-cart.bottom,
    .ast-sticky-add-to-cart.bottom.is-active,
    div.ast-sticky-add-to-cart.bottom.is-active {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        position: absolute !important;
        z-index: -1 !important;
        pointer-events: none !important;
    }
}

/* Hide the Checkout page title */
.woocommerce-checkout .entry-header .entry-title,
.woocommerce-checkout .ast-single-post-order .page-title,
.woocommerce-checkout h1.entry-title,
.woocommerce-checkout header h1.entry-title,
.woocommerce-checkout .woocommerce-checkout-review-order h3#order_review_heading {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Add additional spacing at the top of the checkout form if needed */
.woocommerce-checkout .woocommerce {
    padding-top: 20px;
}

/* Make billing postal code field optional */
#billing_postcode_field .optional {
    display: inline !important;
}

#billing_postcode_field .required {
    display: none !important;
}

/* Remove the red border and asterisk that indicates required fields */
#billing_postcode_field input.input-text {
    border-color: #ddd !important;
}

#billing_postcode_field label .ast-required-meta,
#billing_postcode_field label .required {
    display: none !important;
}

/* Ensure the field doesn't have the required validation styling */
#billing_postcode_field.validate-required {
    border-color: #ddd !important;
}

/* Hide any error messages specifically for this field */
.woocommerce-error li[data-id="billing_postcode"] {
    display: none !important;
}

/* In style.css hide mobile search bar overlay*/
@media (max-width: 992px) { /* Or your mobile breakpoint */
    .dgwt-wcas-overlay-mobile-wrapper { /* Use actual selector */
        display: none !important;
    }
}


/* In style.css - Mobile Link Fix + Sale Badge Visibility/Position Fix */
@media (max-width: 768px) { /* Adjust breakpoint if needed */

    /* --- 1. Hide buttons/elements appearing on tap, EXCLUDING the sale badge --- */
    .woocommerce ul.products li.product .ast-button-wrap:not(.ast-onsale-card),
    .woocommerce ul.products li.product .add_to_cart_button:not(.ast-onsale-card),
    .woocommerce ul.products li.product .ajax_add_to_cart:not(.ast-onsale-card),
    .woocommerce ul.products li.product .button:not(.ast-onsale-card),
    .woocommerce ul.products li.product .ast-shop-product-out-of-stock:not(.ast-onsale-card),
    .woocommerce ul.products li.product .ast-on-card-button:not(.ast-onsale-card)
    {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }

    /* --- 2. Ensure the main product link is clickable --- */
    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
        display: block;
        position: relative; /* Keeping this relative positioning on the link might be okay */
        z-index: 1;         /* Link above default elements */
        pointer-events: auto !important;
    }

    /* --- 3. Ensure image doesn't interfere with link click --- */
    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link img {
        pointer-events: none;
    }

    /* --- 4. Ensure the Sale Badge IS Visible WITHOUT breaking position --- */
    .woocommerce ul.products li.product .ast-onsale-card,
    .woocommerce ul.products li.product span.onsale /* Target default WC onsale too */
    {
        /* ** REMOVED ** display: inline-block !important; */
        /* ** REMOVED ** position: relative !important; */ /* Allow theme's default position (likely absolute) */

        /* Keep these rules to ensure it's visible and layered correctly */
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 5 !important;         /* Adjust if needed: should be above image, below modals etc. */
        pointer-events: none !important;
    }
}


/* FiboSearch - Disable Mobile Overlay + Fix Icon/Preloader Issues v2 */
@media (max-width: 992px) { /* FiboSearch default breakpoint, adjust if needed */

    /* 1. Hide the overlay container element (Keep this) */
    body > .dgwt-wcas-overlay-mobile-wrapper,
    .dgwt-wcas-overlay-mobile-wrapper {
        display: none !important;
        visibility: hidden !important;
    }

    /* 2. Hide the specific trigger link (Keep this) */
    .dgwt-wcas-search-wrapp a.dgwt-wcas-enable-mobile-form {
        display: none !important;
        visibility: hidden !important;
    }

    /* 3. Force the original search form wrapper visible & set positioning context */
    .ast-header-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important; /* CRITICAL: Parent for absolute positioning inside */
        width: 100%;
        max-width: 100%;
        height: auto !important;
        overflow: visible !important;
    }

     /* 4. Ensure the form tag itself is visible (Keep this) */
     .ast-header-search .dgwt-wcas-search-wrapp form.dgwt-wcas-search-form {
        display: flex !important; /* Keep flex here */
        width: 100%;
        visibility: visible !important;
     }

    /* 5. Ensure input field is visible & allow space for button */
    .ast-header-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important; /* Input stays in normal flow */
        height: auto !important;
        flex-grow: 1;
        width: auto;
        min-width: 50px;
        /* Add padding-right IF the submit button overlaps text. Adjust 40px as needed. */
        /* padding-right: 40px !important; */
    }

    /* 6. Ensure submit button is visible BUT let theme/plugin handle position */
     .ast-header-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp button[type="submit"] {
        /* REMOVED position: static !important; */ /* Allows default absolute positioning */
        /* REMOVED display, align-items, justify-content */
        /* REMOVED width: auto !important; */

        /* KEEP visibility */
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important; /* Allow default height */
        /* The plugin should handle top/right/transform positioning now */
        /* Add z-index if it appears behind input */
        z-index: 3 !important;
     }

     /* 7. Hide the preloader (gray circle) by default in this view */
     .ast-header-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-preloader {
         display: none !important;
         visibility: hidden !important;
         opacity: 0 !important;
     }


}

/* Hide TVA information on order received page */
.woocommerce-order-overview__total small.includes_tax,
.order_details tfoot small.includes_tax,
.woocommerce-table--order-details tfoot small.includes_tax,
.order-total small.includes_tax {
    display: none !important;
    visibility: hidden !important;
}

/* Price Filter - Increase Input Width */
input.wpc-filters-range-min,
input.wpc-filters-range-max {
    width: 100px !important; /* Increase width from default */
    min-width: 100px !important;
    box-sizing: border-box !important;
}

