/* AI Category Carousel Styles */

.ai-category-carousel {
    padding: 2rem 0;
}

.category-carousel-section {
    margin-bottom: 3rem;
    background: transparent;
    border-radius: 15px;
    padding: 1.5rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    background: linear-gradient(135deg, #c2185b, #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-count {
    font-size: 0.9rem;
    color: #666;
    background: rgba(194, 24, 91, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.view-all-btn {
    background: linear-gradient(135deg, #c2185b, #e91e63);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(194, 24, 91, 0.3);
}

.category-carousel {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: 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;
    transition: all 0.3s ease;
    color: #c2185b;
}

.carousel-nav:hover {
    background: #c2185b;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: -20px;
}

.carousel-nav.next {
    right: -20px;
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
    margin: 0 30px;
}

.carousel-track {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-content: flex-start;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* Base carousel card - mobile first */
.carousel-card {
    min-width: 180px;
    max-width: 180px;
    flex-shrink: 0;
    height: auto;
    min-height: 280px; /* Removed !important to allow overrides */
}

/* Desktop-only carousel card styling - Override enhanced-product-cards.css */
@media (min-width: 769px) {
    .ai-category-carousel .carousel-card.product-page-card {
        min-width: 300px !important;
        max-width: 400px;
        height: 240px; /* Set the desired shorter height */
        min-height: 240px; /* Match the height to ensure it applies */
        overflow: hidden;
    }
    
    .ai-category-carousel .carousel-card .product-image-container {
        height: 160px; /* Adjusted image height for the shorter card */
    }
    
    .ai-category-carousel .carousel-card .product-content {
        height: 120px; /* Adjusted content height for the shorter card */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 0.75rem 1rem; /* Adjusted padding for a more compact feel */
    }
    
    .ai-category-carousel .carousel-card .product-title {
        font-size: 0.85rem; /* Adjusted font size for the new layout */
        line-height: 1.3;
        height: 2.2rem; /* Adjusted height for 2 lines of text */
        margin-bottom: 0.25rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .ai-category-carousel .carousel-card .product-price {
        font-size: 1rem; /* Adjusted price font size */
        margin: 0.25rem 0;
    }
    
    .ai-category-carousel .carousel-card .product-actions {
        display: flex;
        flex-direction: row;
        gap: 0.5rem; /* Adjusted gap for the new layout */
        margin-top: auto;
        padding: 0;
    }
    
    .ai-category-carousel .carousel-card .btn-add-cart,
    .ai-category-carousel .carousel-card .btn-buy-now {
        flex: 1;
        padding: 8px 10px; /* Adjusted button padding */
        font-size: 0.75rem; /* Adjusted button font size */
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .carousel-card {
        min-width: 180px;
        max-width: 180px;
        min-height: 280px;
    }
    
    .carousel-card .product-image-container {
        height: 120px !important;
    }
    
    .carousel-card .product-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .carousel-card .product-actions {
        padding: 0.5rem !important;
    }
    
    .carousel-card .add-to-cart,
    .carousel-card .buy-now {
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }
}

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

.product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-image-container {
    position: relative;
    height: 150px;
    overflow: hidden;
}

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

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

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 5;
}

.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    height: 2.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
}

.product-price-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.discounted-price {
    font-size: 1rem;
    font-weight: 700;
    color: #c2185b;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #c2185b;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.quick-add-btn,
.compare-btn {
    flex: 1;
    background: transparent;
    border: 1px solid #c2185b;
    color: #c2185b;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add-btn:hover {
    background: #c2185b;
    color: white;
}

.compare-btn:hover {
    background: #f8f9fa;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .category-meta {
        justify-content: space-between;
    }
    
    .carousel-track {
        flex-wrap: wrap;
    }
    
    .carousel-product-card {
        min-width: 160px;
        height: 240px;
    }
    
    .product-image-container {
        height: 120px;
    }
    
    .carousel-nav {
        width: 35px;
        height: 35px;
    }
    
    .carousel-nav.prev {
        left: -15px;
    }
    
    .carousel-nav.next {
        right: -15px;
    }
}

@media (max-width: 480px) {
    .carousel-track {
        gap: 0.75rem;
    }
    
    .carousel-product-card {
        min-width: 140px;
        height: 220px;
    }
    
    .product-image-container {
        height: 100px;
    }
    
    .carousel-track-container {
        margin: 0 20px;
    }
}