/**
 * Apanika Featured Product Carousel 
 *
 * A custom Gutenberg block to create a product carousel for showing featured products.
 *
 * @package Apanika_Featured_Product_Carousel
 * @version 1.0
 * @author Apanika.com
 * @license GPLv2 or later
 * @license URI: https://www.gnu.org/licenses/gpl-2.0.html
 */

 .apanfepr-woocommerce-product-slider {
    position: relative;
    width: 100%;
    /*height: 100vh;*/ /* Full screen height */
    overflow: hidden; /* Hide overflow */
    display: flex;
    align-items: center;
    justify-content: center;
  /*  background-color: #f9f9f9; */
}

/* Styles for the product list */
.apanfepr-product-list {
    display: flex;
   /* gap: 16px;*/
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive grid */
}

/* Styles for each gallery item */
.apanfepr-product-item-container {
    border: 1px solid #ddd;
    padding: 16px;
    text-align: center;
    position: relative;
   overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px; /* Slightly circular corners */
    display: block; /* Ensure the link behaves as a block element */
    text-decoration: none; /* Remove underline from links */
    color: inherit; /* Inherit text color */
    border-radius: 10px; /* Slightly circular corners for the image container */
    background-color: #f5f5f5; /* Fallback background color */
    flex: 0 0 auto; /* Prevent items from shrinking */
    /*width: calc(100% / 3); /* Default to 3 products per row */
    margin: 10px 5px;  /* Spacing between products */
    text-align: center;
    display: none; /* Hide by default */
}

.apanfepr-product-item .apanfepr-woocommerce-loop-product__title:hover {
    color: var(--apanfepr-product-name-hover) !important;
}

/* Hover effect for gallery items */
.apanfepr-product-item-container:hover {
    transform: translateY(-5px); /* Slight lift on hover */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); /* Add shadow on hover */
}

/* Container for product image to ensure square shape */
.apanfepr-product-item .apanfepr-image-container {
    width: 100%;
    aspect-ratio: 1 / 1; /* Make the container square */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
   
}

/* Image styles */
.apanfepr-product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the container without distortion */
    transition: transform 0.3s ease;
    border-radius: 10px; /* Slightly circular corners for the image */
}

/* Hover effect for images */
.apanfepr-product-item:hover img {
    transform: scale(1.05); /* Slight zoom on hover */
}

.apanfepr-product-item .apanfepr_add_to_cart_button:hover {
    background-color: var(--apanfepr-add-to-cart-hover) !important;
    border-color: var(--apanfepr-add-to-cart-hover) !important;
}

/* Styles for navigation buttons */
.apanfepr-prev-button, .apanfepr-next-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    z-index: 10; /* Ensure buttons are above other elements */
    border-radius: 5px; /* Rounded corners */
}

.apanfepr-prev-button {
    left: 10px; /* Position on the left */
}

.apanfepr-next-button {
    right: 10px; /* Position on the right */
}

.apanfepr-product-item-container:hover {

    transform: scale(1.05); /* Slightly enlarge on hover */

    transition: transform 0.3s ease; /* Smooth transition */

}

/* Responsive styles */
@media (max-width: 768px) {
    .apanfepr-product-item-container {
        width: calc(100% / 2) !important; /* 2 products per row on smaller screens */
    }
}

@media (max-width: 480px) {
    .apanfepr-product-item-container {
        width: 100% !important; /* 1 product per row on mobile */
    }
}

/* Base styles for the Add to Cart button */
.apanfepr-woocommerce-product-slider .apanfepr-product-item .apanfepr_add_to_cart_button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-size: 14px; /* Base font size */
    transition: background-color 0.3s ease;
}

.apanfepr-woocommerce-product-slider .apanfepr-product-item .apanfepr_add_to_cart_button:hover {
    background-color: #005177;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .apanfepr-woocommerce-product-slider .apanfepr-product-item .apanfepr_add_to_cart_button {
        padding: 8px 16px; /* Smaller padding for smaller screens */
        font-size: 12px; /* Smaller font size for smaller screens */
    }
}

@media (max-width: 480px) {
    .apanfepr-woocommerce-product-slider .apanfepr-product-item .apanfepr_add_to_cart_button {
        padding: 6px 12px; /* Even smaller padding for mobile screens */
        font-size: 11px; /* Smaller font size for mobile screens */
    }
}
/**star rating*/
.apanfepr-star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 5.4em;
    font-family: star;
    margin: 0.5em 0;
    display: inline-block
}

.apanfepr-star-rating::before {
    content: "\73\73\73\73\73";
    color: #d3ced2;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.apanfepr-star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.apanfepr-star-rating span::before {
    content: "\53\53\53\53\53";
    color: #ffb100;
    top: 0;
    position: absolute;
    left: 0;
}

.apanfepr-rating {
    display: none;
}
/*price discount*/


.apanfepr-price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0;
}

.apanfepr-discount-badge {
    display: inline-block;
    font-weight: bold;
    line-height: 1;
}

.apanfepr-price-container del {
    opacity: 0.7;
}

.apanfepr-price-container ins {
    font-weight: bold;
}
