/*
 Theme Name: Rally Child Theme
 Theme URI: https://rally.axiomthemes.com/
 Description: Rally Child Theme
 Author: AxiomThemes
 Author URI: https://axiomthemes.com/
 Template: rally
 Version: 1.0.0
 Tested up to: 6.7
 Requires at least: 5.5
 Requires PHP: 7.4
 Tags: flexible-header, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, full-width-template, microformats, post-formats, theme-options, threaded-comments, translation-ready
 Text Domain:  rally
*/


/* =Theme customization starts here
------------------------------------------------------------ */

/* Atriumetal green – used for WhatsApp icon (override in customizer if needed) */
:root {
	--atriumetal-green: #25D366;
}

/* Hide WhatsApp button in main product area (post_data_inner); keep it only in hover overlay */
.woocommerce .post_data .post_data_inner .add_to_cart_wrap,
.woocommerce .post_data .post_data_inner a.whatsapp-inquiry,
.woocommerce .post_data .post_data_inner a.button.whatsapp-inquiry {
	display: none !important;
}

/* Font Awesome 6 WhatsApp icon (brands solid) – https://fontawesome.com/icons/whatsapp?f=brands&s=solid */
.add_to_cart_wrap a.whatsapp-inquiry::before {
	font-family: "Font Awesome 6 Brands";
	font-weight: 400;
	content: "\f232";
	display: inline-block;
	margin-right: 0.35em;
	vertical-align: middle;
	color: var(--atriumetal-green);
	font-style: normal;
	font-variant: normal;
	line-height: 1;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
}

/* Ensure hover overlay WhatsApp button is visible and usable on all screen sizes */
.post_featured.hover_shop .bottom-info .add_to_cart_wrap a.whatsapp-inquiry,
.woocommerce ul.products .post_featured .add_to_cart_wrap a.whatsapp-inquiry {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

add_action( 'admin_head', function () {
    $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
    if ( empty( $screen ) || $screen->post_type !== TRX_ADDONS_CPT_CARS_PT ) {
        return;
    }
    ?>
    <style>
        #trx_addons_meta_box .trx_addons_options_item[data-param="maker"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="model"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="type_drive"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="engine_type"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="engine_size_prefix"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="engine_power_horses"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="engine_power_wt"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="before_price"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="price"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="price2"],
        #trx_addons_meta_box .trx_addons_options_item[data-param="after_price"] {
            display: none !important;
        }
    </style>
    <?php
} );