/* ========================================
   CATEGORIES CAROUSEL STYLES - INSPIRED BY FLASH SALES
   ======================================== */

/* Category Sections */
.category-section {
    background: rgb(255 255 255 / 50%);
    border-radius: 20px;
    padding: 20px;
    color: #333;
    margin-bottom: 30px;
    box-shadow: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-icon {
    font-size: 2rem;
    color: #4a7c59;
    text-shadow: none;
}

.category-main-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: none;
    color: #333;
}

.category-subtitle {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.subtitle-label {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
    color: #666;
}

.category-count {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.count-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    color: #4a7c59;
}

.count-label {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 2px;
    color: #666;
}

/* Categories Container */
.category-products-container {
    margin-bottom: 15px;
    position: relative;
    padding: 0 50px;
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e0e0e0;
    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;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.scroll-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.scroll-btn-left {
    left: 10px;
}

.scroll-btn-right {
    right: 10px;
}

.scroll-btn i {
    font-size: 14px;
    color: #666;
    transition: color 0.3s ease;
}

.scroll-btn:hover i {
    color: var(--primary-color);
}

/* Hide buttons on mobile */
@media (max-width: 768px) {
    .category-products-container {
        padding: 0 0;
    }
    
    .scroll-btn {
        width: 35px;
        height: 35px;
    }
    
    .scroll-btn-left {
        left: 5px;
    }
    
    .scroll-btn-right {
        right: 5px;
    }
}

.category-products-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-products-scroll::-webkit-scrollbar {
    display: none;
}

/* Category Card */
.category-product-card {
    background: white;
    border-radius: 15px;
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.category-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

.category-label {
    background: #4a7c59;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Category Image Container */
.category-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f8f9fa;
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.home-kitchen-category-card:hover .category-image {
    transform: scale(1.05);
}

/* Category Info */
.category-info {
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.category-title {
    height: auto;
    margin-bottom: 8px;
}

.category-link {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-link:hover {
    color: #4a7c59;
}

.category-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.category-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #888;
}

.products-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.popularity-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.star-rating {
    color: #ffc107;
}

/* Category Actions */
.category-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.explore-category-btn {
    background: #4a7c59;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(74, 124, 89, 0.3);
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.explore-category-btn:hover {
    background: #3d6b4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(74, 124, 89, 0.4);
    color: white;
    text-decoration: none;
}

.favorite-category-btn {
    background: #28a745;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.favorite-category-btn:hover {
    background: #218838;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

/* Footer */
.category-footer {
    text-align: center;
}

.view-all-categories-btn {
    background: #4a7c59;
    border: 2px solid #4a7c59;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3);
}

.view-all-categories-btn:hover {
    background: #3d6b4a;
    border-color: #3d6b4a;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .category-subtitle {
        align-self: stretch;
        justify-content: center;
    }
    
    .category-main-title {
        font-size: 1.5rem;
    }
    
    .category-product-card {
        width: 180px;
        min-width: 180px;
    }
    
    .category-count {
        padding: 6px 12px;
    }
    
    .count-value {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .category-section {
        padding: 2px;
        margin: 0 5px 20px;
    }
    
    .category-product-card {
        width: 160px;
        min-width: 160px;
    }
    
    .category-info {
        padding: 12px;
    }
    
    .category-link {
        font-size: 1rem;
    }
    
    .explore-category-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .favorite-category-btn {
        width: 30px;
        height: 30px;
    }
}

/* Animation Effects */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.home-kitchen-category-card {
    animation: slideInFromRight 0.5s ease-out forwards;
}

.home-kitchen-category-card:nth-child(1) { animation-delay: 0.1s; }
.home-kitchen-category-card:nth-child(2) { animation-delay: 0.2s; }
.home-kitchen-category-card:nth-child(3) { animation-delay: 0.3s; }
.home-kitchen-category-card:nth-child(4) { animation-delay: 0.4s; }
.home-kitchen-category-card:nth-child(5) { animation-delay: 0.5s; }

/* Hover Effects */
.home-kitchen-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(74, 124, 89, 0.1), rgba(45, 80, 22, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.home-kitchen-category-card:hover::before {
    opacity: 1;
}

/* Loading Animation */
.category-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: rgba(255,255,255,0.7);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #90ee90;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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