/* Amazon-style carousel components */
.amazon-carousel {
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.carousel-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.carousel-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

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

.carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0 1.5rem 1.5rem;
}

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

.carousel-item {
    flex: 0 0 auto;
    width: 220px;
    cursor: pointer;
}

.product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.carousel-item:hover .product-card {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

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

.discount-badge,
.new-badge {
    position: absolute;
    top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.discount-badge {
    left: 0.5rem;
    background: #dc3545;
}

.new-badge {
    right: 0.5rem;
    background: #28a745;
}

.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.stars {
    --percent: calc(var(--rating) / 5 * 100%);
    display: inline-block;
    font-size: 0.8rem;
    font-family: Times;
    line-height: 1;
}

.stars::before {
    content: '★★★★★';
    letter-spacing: 3px;
    background: linear-gradient(90deg, #ffc107 var(--percent), #ddd var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-count {
    font-size: 0.75rem;
    color: #666;
}

.product-price {
    margin-bottom: 0.5rem;
}

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

.current-price {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.delivery-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    margin-top: auto;
    padding: 0.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #5a67d8;
}

.add-to-cart-btn:disabled {
    background: #28a745;
    cursor: not-allowed;
}

/* Skeleton loading states */
.product-skeleton {
    width: 220px;
    flex: 0 0 auto;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px 8px 0 0;
}

.skeleton-title {
    height: 16px;
    background: #f0f0f0;
    margin: 1rem 1rem 0.5rem;
    border-radius: 4px;
}

.skeleton-price {
    height: 20px;
    background: #f0f0f0;
    margin: 0 1rem 0.5rem;
    border-radius: 4px;
    width: 60%;
}

.skeleton-button {
    height: 32px;
    background: #f0f0f0;
    margin: 0 1rem 1rem;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.empty-state p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .carousel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .carousel-title {
        font-size: 1.25rem;
    }

    .carousel-container {
        padding: 0 1rem 1rem;
    }

    .carousel-item {
        width: 180px;
    }

    .product-image {
        height: 160px;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .current-price {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .carousel-item {
        width: 160px;
    }

    .product-image {
        height: 140px;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Touch device enhancements */
@media (hover: none) {
    .carousel-item:hover .product-card {
        transform: none;
        box-shadow: none;
        border-color: #eee;
    }

    .carousel-item:active .product-card {
        transform: scale(0.98);
    }

    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .add-to-cart-btn {
        min-height: 44px;
    }
}