/*
Theme Name: Salient Child Theme
Description: This is a custom child theme for Salient
Theme URI:   https://themeforest.net/item/salient-responsive-multipurpose-theme/4363266
Author: ThemeNectar
Author URI:  https://themeforest.net/user/themenectar
Template: salient
Version: 1.0
*/

add_action('woocommerce_after_add_to_cart_button', 'package_box');
function package_box() {
echo '<div style="color: red; font-size: 10px; font-weight: bold; text-transform: uppercase;">KUPUJESZ DWIE PARY!!!</div>';
}

.add-to-cart {
    background-color: #FF8C00;
}

.dostawa-cta {
display: block;
width: 100%;
margin-top: 10px;
text-align: center;
border: 1px solid #ededed;
padding: 5px 10px;
border-radius: 5px;
font-size: 13px;
text-transform: uppercase;
font-weight: 600;
}

.opinia-cta {
border: 1px dashed #24eb5c;
background: #f9f9f9;
padding: 20px;
border-radius: 10px;
font-style: italic;
font-size: 13px !important
 line-height: 2;
display: block;
margin-top: 30px;
}

.woocommerce-shipping-fields {
    display: none !important;
}
#billing_country_field {
    display: none !important;
}


document.addEventListener('DOMContentLoaded', function () {
    const postcode = document.querySelector('[name="billing_postcode"]');
    const city = document.querySelector('[name="billing_city"]');

    function openMapPopup() {
        const openBtn = document.querySelector('.apaczkaMapPopup .popupButtons a');
        if (openBtn) openBtn.click();
    }

    if (postcode) {
        postcode.addEventListener('blur', () => {
            setTimeout(openMapPopup, 500);
        });
    }
    if (city) {
        city.addEventListener('blur', () => {
            setTimeout(openMapPopup, 500);
        });
    }
});




