/**
 * Styles Frontend - Top Rachat MonBouquiniste
 * Version: 1.0.0
 */

/* ========================================
   CONTAINER PRINCIPAL
======================================== */
.mb-top-rachat-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'BenchNine', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   EN-TÊTE
======================================== */
.mb-top-rachat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.mb-top-rachat-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    position: relative;
}

.mb-top-rachat-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #ff6900, #ff9944);
    border-radius: 2px;
}

/* ========================================
   FILTRES
======================================== */
.mb-top-rachat-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mb-filter-btn {
    background: #f5f1e8;
    border: 2px solid transparent;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mb-filter-btn:hover {
    background: #fff;
    border-color: #ff6900;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 0, 0.2);
}

.mb-filter-btn.active {
    background: #ff6900;
    color: #fff;
    border-color: #ff6900;
}

/* ========================================
   SLIDER CONTAINER ET FLÈCHES
======================================== */
.mb-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.mb-slider-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.mb-slider-arrow {
    background: #ff6900;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 105, 0, 0.3);
    z-index: 10;
}

.mb-slider-arrow:hover {
    background: #e55d00;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 105, 0, 0.5);
}

.mb-slider-arrow:active {
    transform: scale(0.95);
}

.mb-slider-arrow svg {
    color: #fff;
}

.mb-slider-arrow:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.mb-slider-arrow:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   GRILLE DE PRODUITS (SLIDER)
======================================== */
.mb-top-rachat-grid {
    display: flex;
    gap: 24px;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* ========================================
   CARTE PRODUIT (SLIDER)
======================================== */
.mb-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

.mb-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Badge */
.mb-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff6900;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 10;
    text-transform: uppercase;
    display: none;
}

.mb-product-badge.show {
    display: block;
}

.mb-product-badge.badge-top {
    background: linear-gradient(135deg, #ff6900, #ff9944);
}

.mb-product-badge.badge-nouveau {
    background: linear-gradient(135deg, #00c9ff, #92fe9d);
}

/* Image */
.mb-product-image {
    height: 150px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

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

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

/* Infos produit */
.mb-product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mb-product-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.mb-product-author {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer carte */
.mb-product-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.mb-product-price {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.mb-price-label {
    font-size: 1.2rem;
    color: #000000;
    margin-bottom: 4px;
    font-weight: 600;
}

.mb-price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6900;
}

/* Bouton action */
.mb-product-action {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    min-width: 150px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 auto;
    display: block;
}

.mb-product-action:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* ========================================
   CHARGEMENT
======================================== */
.mb-top-rachat-loading {
    text-align: center;
    padding: 60px 20px;
}

.mb-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6900;
    border-radius: 50%;
    animation: mb-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.mb-top-rachat-loading p {
    color: #666;
    font-size: 1.1rem;
}

/* ========================================
   MESSAGE VIDE
======================================== */
.mb-top-rachat-empty {
    text-align: center;
    padding: 80px 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.mb-top-rachat-empty p {
    font-size: 1.3rem;
    color: #999;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .mb-top-rachat-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mb-top-rachat-title {
        font-size: 2rem;
    }
    
    .mb-top-rachat-filters {
        width: 100%;
        justify-content: center;
    }
    
    .mb-filter-btn {
        flex: 1;
        justify-content: center;
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    .mb-slider-container {
        gap: 10px;
    }
    
    .mb-slider-arrow {
        width: 40px;
        height: 40px;
    }
    
    .mb-slider-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .mb-product-card {
        min-width: 240px;
        max-width: 240px;
    }
    
    .mb-product-image {
        height: 150px;
    }
    
    .mb-product-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .mb-filter-btn {
        font-size: 0.95rem;
    }
    
    .mb-slider-container {
        gap: 5px;
    }
    
    .mb-slider-arrow {
        width: 35px;
        height: 35px;
    }
    
    .mb-product-card {
        min-width: 200px;
        max-width: 200px;
    }
}
