/* ============================================
   STYLES FINAUX POUR PRODUITS ET CATÉGORIES
   Design exact selon les maquettes
   ============================================ */

/* ========================================
   CATÉGORIES POPULAIRES - CAROUSEL
   ======================================== */

/* ========================================
   CAROUSEL CATÉGORIES - FLÈCHES DISCRÈTES
   ======================================== */

.category-carousel-wrapper {
    position: relative;
    padding: 0 30px;
}

/* Flèches discrètes - visibles seulement au hover */
.category-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
}

.category-carousel-wrapper:hover .category-nav-btn {
    opacity: 1;
    pointer-events: auto;
}

.category-nav-prev {
    left: 0;
}

.category-nav-next {
    right: 0;
}

.category-nav-btn:hover {
    background: #F27A1A;
    border-color: #F27A1A;
    color: white;
    box-shadow: 0 6px 20px rgba(242, 122, 26, 0.3);
}

.category-nav-btn i {
    font-size: 1.25rem;
    color: #333;
    transition: color 0.3s ease;
}

.category-nav-btn:hover i {
    color: white;
}

/* ========================================
   CATÉGORIES GRID - Carousel scrollable avec flèches
   ======================================== */

.category-grid-horizontal {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-grid-horizontal::-webkit-scrollbar {
    display: none;
}

.category-grid-horizontal::-webkit-scrollbar-track {
    background: transparent;
}

.category-grid-horizontal::-webkit-scrollbar-thumb {
    background: transparent;
}

.category-grid-horizontal::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

.category-card-modern {
    flex: 0 0 calc(25% - 1.2rem);
    min-width: 180px;
    background: white;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

/* Responsive pour catégories sur mobile */
@media (max-width: 576px) {
    .category-card-modern {
        flex: 0 0 120px;
        min-width: 120px;
    }
    
    .category-image-wrapper {
        height: 100px !important;
    }
    
    .category-name {
        font-size: 0.75rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .category-count {
        font-size: 0.65rem !important;
    }
    
    .category-info {
        padding: 0.4rem 0.3rem !important;
    }
    
    .category-grid-horizontal {
        gap: 0.75rem;
    }
}

.category-card-modern:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

.category-icon-wrapper {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.category-card-modern:hover .category-icon-wrapper {
    transform: scale(1.02);
}

.category-icon-wrapper i {
    font-size: 4rem;
    color: white;
}

.category-image-wrapper {
    width: 100%;
    height: 160px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.category-card-modern:hover .category-image-wrapper {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card-modern:hover .category-image {
    transform: scale(1.08);
}

.category-info {
    width: 100%;
    padding: 0.75rem 0.5rem;
    background: white;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.category-count {
    font-size: 0.85rem;
    color: #F27A1A;
    margin: 0;
    font-weight: 500;
}

/* Cartes de produits modernes */
.product-card-modern {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: none;
}

.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card-modern:hover .product-image {
    transform: scale(1.1);
}

/* Badges produits */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge-discount {
    background: #ff4757;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.badge-new-modern {
    background: #2ed573;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(46, 213, 115, 0.3);
}

.badge-stock-out {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    z-index: 10;
}

.badge-stock-in {
    background: #26de81;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* Wishlist flottant */
.wishlist-floating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

/* Contenu de la carte */
.product-card-body {
    padding: 1.25rem;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a:hover {
    color: #667eea !important;
}

.rating-stars {
    color: #ffa502;
}

.stock-indicator {
    min-height: 24px;
}

/* Prix */
.product-pricing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: #F27A1A;
}

.price-old {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}

/* Actions */
.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-add-cart {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-stock-out {
    flex: 1;
    background: #dfe6e9;
    color: #636e72;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: not-allowed;
}

/* Section spacing - Contenu compact comme la maquette */
.categories-section {
    background: #fafbfc;
    padding: 1.25rem 0 1.5rem 0;
    margin: 0;
}

.products-section {
    padding: 1.25rem 0;
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    .category-card-modern {
        width: 160px;
        padding: 0;
    }

    .category-icon-wrapper,
    .category-image-wrapper {
        width: 100%;
        height: 120px;
        margin-bottom: 0;
        border-radius: 0;
    }

    .category-icon-wrapper i {
        font-size: 2.5rem;
    }

    .category-info {
        padding: 0.75rem 0.5rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .category-count {
        font-size: 0.75rem;
    }

    .product-image {
        height: 160px;
    }

    .product-card-body {
        padding: 1rem;
    }

    .product-title {
        font-size: 0.85rem;
    }

    .price-current {
        font-size: 1.1rem;
    }

    .btn-add-cart,
    .btn-stock-out {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .category-grid-horizontal {
        gap: 0.75rem;
    }

    .category-card-modern {
        width: 140px;
        padding: 0;
    }

    .category-icon-wrapper,
    .category-image-wrapper {
        width: 100%;
        height: 100px;
        border-radius: 0;
    }

    .category-info {
        padding: 0.5rem;
    }

    .product-badges {
        top: 8px;
        left: 8px;
        gap: 6px;
    }

    .badge-discount,
    .badge-new-modern {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-modern {
    animation: fadeInUp 0.5s ease;
}

.category-card-modern {
    animation: fadeInUp 0.4s ease;
}

/* État de chargement */
.product-card-modern.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
