/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* Styling the select2 container for Elementor widget */
.select2-container {
    width: 100% !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
}

/* Styling the dropdown field */
$18px 12px !important;
    outline: none !important;
    cursor: pointer !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.select2-selection:hover,
.select2-selection:focus {
    border-color: #cc0000 !important; /* Darker red on hover or focus */
    box-shadow: 0 0 5px rgba(230, 0, 0, 0.5) !important;
}

.select2-selection__rendered {
    color: #e60000 !important; /* Red text for placeholder and selected option */
    font-weight: 500 !important;
}

.select2-selection__placeholder {
/*     color: #cc0000 !important; /* Slightly lighter red for placeholder */ */
    font-style: italic !important;
}

.select2-selection__arrow b {
/*     border-color: #e60000 transparent transparent transparent !important; /* Red arrow */ */
}

/* Styling the dropdown menu */
.select2-dropdown {
    border: 1px solid #e60000 !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    margin-top: 5px !important;
}

.select2-results__option {
    padding: 10px 15px !important;
    color: #333 !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
    font-size: 14px !important;
}

.select2-results__option--highlighted {
    background-color: #e60000 !important; /* Red highlight for selected item */
    color: #fff !important; /* White text */
}

/* Customizing scrollbar for dropdown */
.select2-results__options {
    max-height: 180px !important; /* Set a max height for the dropdown */
    overflow-y: auto !important; /* Enable scrolling if needed */
}

.select2-results__options::-webkit-scrollbar {
    width: 8px !important;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background-color: #e60000 !important;
    border-radius: 4px !important;
}

/* Disabled styles */
.select2-selection[aria-disabled="true"] {
    background-color: #f9f9f9 !important;
    border-color: #dcdcdc !important;
    color: #aaa !important;
    cursor: not-allowed !important;
}

/* Elementor-specific tweaks */
.elementor-widget .select2-container {
    margin-top: 10px !important;
}

.select2-container--default .select2-selection--single{
	background-color: #f1f1f1 !important;
	border: 1px solid #aaa !important;
	border-radius: 10px !important;
	height: 60px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered{
	line-height: 60px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow{
	height: 60px !important;
}

 .select2-container--default .select2-selection--single .select2-selection__placeholder::before {
        content: '\f230'; /* Dashicons location icon code */
        font-family: 'Dashicons';
        margin-right: 5px;
        font-size: 1.2em; /* Increase the size of the icon */
    }

.select2-container--default .select2-selection--single .select2-selection__placeholder {
        display: flex;
        align-items: center;
    }

// Nav heder
.wd-nav{
	--nav-gap:15px !important;
}


.wc-pao-addon-image-swatch img {
    max-width: 100% !important;
    max-height: 65px;
    float: left;
}

.product-warranty {
    text-align: left;  /* Ensures left alignment */
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.product-warranty {
    display: block; 
    text-align: left !important;  /* Forces left alignment */
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.product-warranty {
    display: block;
    text-align: left !important; /* Force left alignment */
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

/* Ensure correct positioning if using flex/grid */
.woocommerce ul.products li.product .product-warranty {
    width: 100%;
    padding-left: 0;
}


.product-tags {
    display: block;
    text-align: left;
    font-size: 12px;
    font-weight: normal;
    color: #777;
    margin-top: 1px;
}
// Display discount percentage beside product price
function display_discount_percentage_on_price($price, $product) {
    if ($product->is_on_sale()) {
        // Get the regular price and sale price
        $regular_price = floatval($product->get_regular_price());
        $sale_price = floatval($product->get_sale_price());

        if ($regular_price > 0 && $sale_price > 0) {
            // Calculate the discount percentage
            $discount_percentage = round((($regular_price - $sale_price) / $regular_price) * 100);
            
            // Append the discount percentage to the price
            $price .= ' <span class="discount-badge">(' . $discount_percentage . '% Off)</span>';
        }
    }
    return $price;
}


.discount-percentage {
    font-size: 16px;
    color: #fff; /* White text color */
    font-weight: 700;
    background-color: #dc0e18; /* Background color */
    padding: 5px 10px; /* Padding to make it look nice */
    border-radius: 20%; /* 20% border radius */
    display: inline-block; /* Ensure it wraps around the text */
    margin-top: 5px; /* Optional, adjust the spacing */
}

/* Forcing all product columns to be 33.33% wide by default */
.three-col-mobile-col > .three-col-mobile-col {
    width: 50% !important;
    box-sizing: border-box; /* Ensures padding/border are inside the 33.33% */
}


