/* Main Categories Cards Styles */
.categories-scroll-container {
    width: 100%;
    padding: 0 15px;
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Pour un défilement fluide sur iOS */
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.categories-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.categories-scroll-wrapper {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    cursor: grab;
    touch-action: pan-x; /* Permet le défilement horizontal tactile */
}

.categories-scroll-wrapper:active {
    cursor: grabbing;
}

.category-card-wrapper {
    flex: 0 0 auto;
    width: 280px; /* Légèrement réduit pour plus de cartes visibles */
    scroll-snap-align: start;
}

.category-card {
    border-radius: 8px;
    height: 180px;
    background: #e31837;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: scale(1.02);
}

.category-card img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    z-index: 2;
}

.category-title {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffd700;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
}

/* Styles spécifiques pour mobile */
@media (max-width: 768px) {
    .categories-scroll-container {
        padding: 0 10px;
    }

    .categories-scroll-wrapper {
        gap: 10px;
        padding: 5px 0;
    }

    .category-card-wrapper {
        width: 220px;
    }

    .category-card {
        height: 150px;
    }

    .category-title {
        font-size: 14px;
    }

    .discount-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* Desktop view */
@media (min-width: 769px) {
    .categories-scroll-wrapper {
        margin: 0 auto;
        max-width: 100%;
        overflow-x: auto;
    }
}
