/* Product Carousel Styles */
.product-carousels-container {
    margin: 2rem 0;
}

.product-carousel-section {
    margin-bottom: 3rem;
}

.carousel-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.product-carousel {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 1200px;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.product-item {
    flex: 0 0 300px;
    margin: 0 10px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-item-info {
    padding: 0;
}

.product-item-photo {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.product-item-photo img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-item-photo img {
    transform: scale(1.05);
}

.product-item-details {
    padding: 1rem;
}

.product-item-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-item-name a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-item-name a:hover {
    color: #007bff;
}

.price-box {
    margin: 0.75rem 0;
    font-weight: 600;
}

.regular-price .price,
.special-price .price {
    font-size: 1.1rem;
    color: #007bff;
}

.old-price .price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.special-price .price {
    color: #e74c3c;
}

.product-item-actions {
    margin-top: 1rem;
}

.btn-cart {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.2s ease;
}

.btn-cart:hover {
    background: #0056b3;
}

.stock.unavailable {
    color: #e74c3c;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
}

/* Carousel Navigation */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
}

.carousel-prev {
    left: -25px;
}

.carousel-next {
    right: -25px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.carousel-dot.active {
    background: #007bff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-item {
        flex: 0 0 280px;
    }
    
    .carousel-prev {
        left: -20px;
    }
    
    .carousel-next {
        right: -20px;
    }
}

@media (max-width: 768px) {
    .product-item {
        flex: 0 0 260px;
        margin: 0 5px;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .carousel-prev {
        left: -15px;
    }
    
    .carousel-next {
        right: -15px;
    }
    
    .carousel-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-item {
        flex: 0 0 240px;
    }
    
    .product-carousel {
        margin: 0 20px;
    }
    
    .carousel-arrow {
        display: none;
    }
    
    .carousel-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
}

/* Touch Scrolling for Mobile */
@media (max-width: 768px) {
    .carousel-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .carousel-track::-webkit-scrollbar {
        display: none;
    }
    
    .product-item {
        scroll-snap-align: center;
    }
}

/* Loading States */
.product-carousel.loading .carousel-track {
    opacity: 0.5;
}

.product-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility */
.product-carousel:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.product-item:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .carousel-arrow,
    .carousel-dots {
        display: none;
    }
    
    .carousel-track {
        display: block;
    }
    
    .product-item {
        break-inside: avoid;
        margin-bottom: 1rem;
        width: 48%;
        display: inline-block;
        vertical-align: top;
    }
}