/* Carousel Styles */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    /* Ensure wrapper respects parent width */
}

.carousel-container {
    overflow: hidden;
    /* Hide overflow on both axes */
    width: 100%;
    position: relative;
    flex: 1;
    /* Take available space */
    min-width: 0;
    /* Critical: allows flex child to shrink below content size */
}

.carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.5s ease-in-out;
    /* Override grid styles */
    grid-template-columns: none !important;
    width: max-content;
    /* Allow track to be as wide as needed */
    padding: 15px 5px;
    /* Top/Bottom padding to contain badges and shadows */
}

.carousel-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    color: #333;
    flex-shrink: 0;
    /* Prevent button from shrinking */
}

.carousel-btn:hover {
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: #007185;
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Ensure product cards have a fixed width in the carousel */
.carousel-track .product-card {
    flex: 0 0 220px;
    width: 220px;
    max-width: 220px;
    margin-top: 0;
    /* Reset any margins */
}

/* Sale Badge */
.sale-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #CC0C39;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    .product-card {
        flex: 0 0 160px;
        width: 160px;
    }

    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .sale-badge {
        font-size: 10px;
        padding: 2px 6px;
        top: -5px;
        right: -5px;
    }
}