body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #fff;
}

/* Base Carousel Styling */
.home-products-carousel {
    /* padding: 60px 20px; */
    text-align: center;
}

/* Alternating Background Colors */
.home-products-carousel.bg-light {
    background-color: #f8f9fa;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
}

.carousel-header h2 {
    font-size: 2.2rem;
    color: #333;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.carousel-container {
    display: flex;
    align-items: center;
    position: relative;
    /*width: 100%; /* CRITICAL: Forces it to stay inside your Tailwind parent */
    width: calc(75% - 30px); /* Exact math: 100% minus 3 gaps (60px) divided by 4 items */;
    max-width: 1400px;
    margin: 10px auto;

}

.carousel-track-wrapper {
    flex: 1; /* Tells the wrapper to fill only the space between the buttons */
    min-width: 0; /* CRITICAL MAGIC FIX: Stops inner cards from breaking the wrapper's width */
    overflow: hidden !important; /* Strictly cuts off the overlapping cards */
    position: relative;
    padding: 15px 0; /* Adds room so card drop-shadows don't get cut off */
}

.carousel-track {
    display: flex;
    flex-wrap: nowrap; /* Prevents cards from wrapping to the next line */
    transition: transform 0.5s ease-in-out;
    gap: 10px;
    /*width: 80%; /* Ensures percentage calculations are based on the wrapper */
}

/* Product Card Styling */
.carousel-card {
    /* Exact math: 100% minus 3 gaps (60px) divided by 4 items */
    /* flex: 0 0 calc((100% - 60px) / 4); 
    max-width: calc((100% - 60px) / 4); */
    
    box-sizing: border-box;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.carousel-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-bottom: 15px;
}

.carousel-card h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #333;
    min-height: 28px;
}

.carousel-card .category-badge {
    display: inline-block;
    background: #f0f8ff;
    color: #0066cc;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;     
    width: 150px;
    max-width: 160px;
    max-height: 40px;
    overflow: hidden;
}

/* Navigation Buttons */
.carousel-btn {
    background: #8bc647;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.5rem;
    position: absolute;
    z-index: 10;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: #8bc647cc;
    transform: scale(1.05);
}

.prev-btn { left: -20px; }
.next-btn { right: -20px; }

/* View More Button */
.view-more-btn {
    display: inline-block;
    background: #00acac;
    color: white;
    padding: 6px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.view-more-btn:hover {
    background: #00acaccc;
    transform: translateY(-2px);
}

/* Responsive Rules */
@media (max-width: 992px) {
    .carousel-card { 
        /* Exact math: 100% minus 1 gap (20px) divided by 2 items */
        flex: 0 0 calc((100% - 20px) / 2); 
        max-width: calc((100% - 20px) / 2);
    } 
    .prev-btn { left: -10px; }
    .next-btn { right: -10px; }
}

@media (max-width: 600px) {
    .carousel-card { 
        /* Exact math: 100% width for 1 item */
        flex: 0 0 100%; 
        max-width: 100%;
    } 
    .prev-btn { left: 0; }
    .next-btn { right: 0; }
    .carousel-container { padding: 0 25px; }
}