/* Category Carousel Styles */
.category-carousel {
    margin: 2rem 0 1rem 0;
    width: 100%;
    padding: 20px 60px 30px 60px;
    position: relative;
}

.category-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.category-carousel .swiper-slide {
    height: 200px;
    display: flex;
    flex-shrink: 0;
    min-width: 0;
    box-sizing: border-box;
}

/* Ensure cards fill available width when there are few categories */
.category-carousel .swiper-slide .category-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-carousel .category-card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    min-height: 180px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.category-carousel .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Remove margin from cards - space is handled by swiper spaceBetween */
.category-carousel .category-card {
    margin: 0;
}

.category-carousel .card-body {
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: center;
}

/* Background overlay for better text readability when using background images */
.category-carousel .category-card[style*="background-image"] .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
    border-radius: calc(0.375rem - 1px);
}

.category-carousel .category-card[style*="background-image"] .card-body > * {
    position: relative;
    z-index: 2;
}

.category-carousel .category-card[style*="background-image"] {
    color: white;
    border: none;
}

/* Navigation buttons */
.category-carousel .swiper-button-next,
.category-carousel .swiper-button-prev {
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-carousel .swiper-button-next {
    right: 10px;
}

.category-carousel .swiper-button-prev {
    left: 10px;
}

.category-carousel .swiper-button-next:hover,
.category-carousel .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1);
    color: #495057;
}

.category-carousel .swiper-button-next::after,
.category-carousel .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Pagination */
.category-carousel .swiper-pagination {
    position: relative;
    margin-top: 1.5rem;
    text-align: center;
}

.category-carousel .swiper-pagination-bullet {
    background: #6c757d;
    opacity: 0.5;
}

.category-carousel .swiper-pagination-bullet-active {
    background: #495057;
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-carousel {
        padding: 0 20px 20px 20px;
        margin: 1rem 0 1rem 0;
    }
    
    .category-carousel .swiper-button-next,
    .category-carousel .swiper-button-prev {
        display: none;
    }
    
    .category-carousel .swiper-slide {
        height: 180px;
        min-width: 0;
    }
    
    .category-carousel .category-card {
        min-height: 160px;
        margin: 0;
    }
    
    .category-carousel .card-body {
        padding: 0.8rem;
    }
}

@media (max-width: 576px) {
    .category-carousel {
        padding: 0 15px 15px 15px;
        margin: 0.5rem 0 1rem 0;
    }
    
    .category-carousel .swiper-slide {
        height: 160px;
        min-width: 0;
        flex-shrink: 0;
    }
    
    .category-carousel .category-card {
        min-height: 140px;
        margin: 0;
    }
    
    .category-carousel .card-body {
        padding: 0.6rem;
    }
    
    /* Make sure cards have enough space on very small screens */
    .category-carousel .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .category-carousel .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Extra small screens - single slide view */
@media (max-width: 480px) {
    .category-carousel {
        padding: 0 10px 10px 10px;
    }
    
    .category-carousel .swiper-slide {
        height: 150px;
    }
    
    .category-carousel .category-card {
        min-height: 130px;
    }
    
    .category-carousel .card-body {
        padding: 0.5rem;
    }
}

/* Static layout adjustments for mobile when swiper is disabled */
@media (max-width: 768px) {
    .category-carousel .swiper-wrapper[style*="gap: 30px"] {
        gap: 15px !important;
    }
}

@media (max-width: 576px) {
    .category-carousel .swiper-wrapper[style*="gap"] {
        gap: 10px !important;
        flex-wrap: wrap !important;
    }
    
    .category-carousel .swiper-slide[style*="flex: 1"] {
        flex: 1 1 calc(50% - 5px) !important;
        max-width: calc(50% - 5px);
    }
}

@media (max-width: 480px) {
    .category-carousel .swiper-slide[style*="flex: 1"] {
        flex: 1 1 100% !important;
        max-width: 100%;
    }
} 