/**
 * Marketplace Moderne - Design style Amazon
 * 
 * @package UMOA
 */

/* ============================================================================
   BOX-SIZING GLOBAL - Empêche les débordements
   ============================================================================ */

.marketplace-modern,
.marketplace-modern *,
.marketplace-modern *::before,
.marketplace-modern *::after {
    box-sizing: border-box !important;
}

/* S'assurer que le conteneur principal a box-sizing */
.marketplace-modern {
    box-sizing: border-box !important;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Images responsive - Empêche le défilement horizontal */
.marketplace-modern img,
.marketplace-modern svg {
    max-width: 100%;
    height: auto;
}

/* ============================================================================
   VARIABLES
   ============================================================================ */

:root {
    --marketplace-primary: #4A90E2;
    --marketplace-primary-hover: #1E3A8A;
    --marketplace-bg: #ffffff;
    --marketplace-border: #e0e0e0;
    --marketplace-text: #333333;
    --marketplace-text-light: #666666;
    --marketplace-text-lighter: #999999;
    --marketplace-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --marketplace-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --marketplace-radius: 8px;
    --marketplace-radius-lg: 12px;
    --marketplace-spacing: 1rem;
    --marketplace-spacing-lg: 1.5rem;
    --marketplace-spacing-xl: 2rem;
}

/* ============================================================================
   CONTAINER PRINCIPAL
   ============================================================================ */

.marketplace-modern {
    min-height: 100vh;
    background: #f5f5f5;
    width: 100%;
}

/* Override des styles du main-content pour le marketplace */
main.main-content .marketplace-modern {
    width: 100%;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: var(--marketplace-spacing-lg);
    padding-right: var(--marketplace-spacing-lg);
}

.marketplace-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--marketplace-spacing-lg);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .marketplace-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: var(--marketplace-spacing);
        box-sizing: border-box !important;
    }
    
    .container-fluid {
        padding-left: var(--marketplace-spacing);
        padding-right: var(--marketplace-spacing);
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .marketplace-modern {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .marketplace-modern * {
        box-sizing: border-box !important;
    }
}

/* ============================================================================
   HEADER AVEC RECHERCHE INTELLIGENTE
   ============================================================================ */

.marketplace-header-modern {
    background: linear-gradient(135deg, #232f3e 0%, #131921 100%) !important;
    padding: 5px 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    z-index: 998 !important;
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
    transition: transform 0.3s ease;
}

.marketplace-header-modern.hidden,
.marketplace-header-modern.visible {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    width: 100%;
}

.marketplace-header-modern.hidden {
    transform: translateY(-100%);
}

.marketplace-header-modern.visible {
    transform: translateY(0);
}

.marketplace-header-modern .container-fluid {
    padding-left: var(--marketplace-spacing-lg);
    padding-right: var(--marketplace-spacing-lg);
}

/* Historique de recherche - texte blanc sur fond sombre */
.marketplace-header-modern .search-history {
    color: white;
}

.marketplace-header-modern .history-title {
    color: rgba(255, 255, 255, 0.8) !important;
}

.marketplace-header-modern .history-item {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.marketplace-header-modern .history-item:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.search-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 10px;
}

/* Modern Floating Search Bar */
.modern-search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 48px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.3);
    background: #ffffff;
}

.icon-search {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 0 20px;
    color: #999;
    flex-shrink: 0;
    pointer-events: none;
}

.icon-search svg {
    width: 20px;
    height: 20px;
}

.search-input-modern {
    flex: 1;
    padding: 0;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--marketplace-text);
    background: transparent;
    height: 48px;
    box-sizing: border-box;
}

.search-input-modern::placeholder {
    color: #999;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 0 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 48px;
}

.filter-btn:hover {
    color: #4A90E2;
}

.filter-btn:active {
    transform: scale(0.95);
}

.icon-sliders {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sliders svg {
    width: 18px;
    height: 18px;
}

/* Suggestions Overlay - Modern Design */
.suggestions-overlay,
#searchSuggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.suggestions-overlay.active,
#searchSuggestions.active {
    display: block;
}

/* Compatibilité avec l'ancien sélecteur */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-icon {
    width: 20px;
    height: 20px;
    color: var(--marketplace-text-light);
    flex-shrink: 0;
}

/* Product suggestion with image */
.suggestion-item-product {
    display: flex;
    align-items: center;
    gap: 16px;
}

.suggestion-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-size: 14px;
    color: var(--marketplace-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-name strong {
    font-weight: 600;
    color: #4A90E2;
}

.suggestion-price {
    font-size: 13px;
    color: #b12704;
    font-weight: 600;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-category {
    font-size: 12px;
    color: var(--marketplace-text-lighter);
    margin-top: 2px;
}

.suggestion-section {
    border-bottom: 1px solid var(--marketplace-border);
}

.suggestion-section:last-child {
    border-bottom: none;
}

.suggestion-header {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--marketplace-text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f5f5f5;
}

.suggestion-item.selected {
    background: #e8f4f8;
}

.history-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Historique de recherche */
.search-history {
    margin-top: 8px;
    display: none;
}

.search-history.active {
    display: block;
}

.history-item {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   LAYOUT PRINCIPAL
   ============================================================================ */

.marketplace-layout-modern {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--marketplace-spacing-lg);
    margin-top: var(--marketplace-spacing-lg);
}

/* ============================================================================
   SIDEBAR FILTRES
   ============================================================================ */

.marketplace-sidebar {
    background: white;
    border-radius: var(--marketplace-radius-lg);
    box-shadow: var(--marketplace-shadow);
    padding: var(--marketplace-spacing-lg);
    height: fit-content;
    position: sticky;
    top: 170px; /* Positionné après navbar + header recherche */
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overflow-x: hidden;
    width: 280px;
    max-width: 100%;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--marketplace-spacing-lg);
    padding-bottom: var(--marketplace-spacing);
    border-bottom: 2px solid var(--marketplace-border);
    width: 100%;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--marketplace-text);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--marketplace-text-light);
    padding: 4px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}

/* Sections de filtres */
.filter-section-modern {
    margin-bottom: var(--marketplace-spacing-lg);
    padding-bottom: var(--marketplace-spacing-lg);
    border-bottom: 1px solid var(--marketplace-border);
    width: 100%;
    overflow: hidden;
}

.filter-section-modern:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--marketplace-text);
    margin-bottom: var(--marketplace-spacing);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.filter-select-modern {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    font-size: 14px;
    color: var(--marketplace-text);
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select-modern:focus {
    outline: none;
    border-color: var(--marketplace-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Fourchette de prix */
.price-range-modern {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.price-input-modern {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    font-size: 13px;
    text-align: center;
    width: 0; /* Force flex à calculer correctement */
}

.price-input-modern:focus {
    outline: none;
    border-color: var(--marketplace-primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.price-separator-modern {
    color: var(--marketplace-text-light);
    font-weight: 600;
    flex-shrink: 0;
    padding: 0 2px;
}

/* Options de filtre (radio) */
.filter-options-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.filter-option-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--marketplace-radius);
    transition: background 0.2s;
    width: 100%;
    min-width: 0;
}

.filter-option-modern:hover {
    background: #f5f5f5;
}

.filter-option-modern input[type="radio"],
.filter-option-modern input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-option-modern span {
    font-size: 14px;
    color: var(--marketplace-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Actions des filtres */
.filter-actions-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: var(--marketplace-spacing-lg);
    padding-top: var(--marketplace-spacing-lg);
    border-top: 2px solid var(--marketplace-border);
}

.btn-apply-filters {
    width: 100%;
    padding: 12px;
    background: var(--marketplace-primary);
    color: white;
    border: none;
    border-radius: var(--marketplace-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply-filters:hover {
    background: var(--marketplace-primary-hover);
}

.btn-reset-filters {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--marketplace-text);
    border: 2px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.btn-reset-filters:hover {
    background: #f5f5f5;
    border-color: var(--marketplace-text-light);
}

/* Filtres actifs */
.active-filters-modern {
    margin-top: var(--marketplace-spacing-lg);
    padding-top: var(--marketplace-spacing-lg);
    border-top: 2px solid var(--marketplace-border);
}

.active-filters-modern h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--marketplace-text);
    margin-bottom: var(--marketplace-spacing);
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f4f8;
    color: #0066c0;
    border-radius: 16px;
    font-size: 13px;
}

.remove-filter-modern {
    color: #0066c0;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    margin-left: 4px;
}

.remove-filter-modern:hover {
    color: #c45500;
}

/* ============================================================================
   CONTENU PRINCIPAL
   ============================================================================ */

.marketplace-main-modern {
    background: white;
    border-radius: var(--marketplace-radius-lg);
    box-shadow: var(--marketplace-shadow);
    padding: var(--marketplace-spacing-lg);
}

/* Toolbar */
.marketplace-toolbar-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--marketplace-spacing-lg);
    padding-bottom: var(--marketplace-spacing);
    border-bottom: 1px solid var(--marketplace-border);
    flex-wrap: wrap;
    gap: var(--marketplace-spacing);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--marketplace-spacing);
    flex-wrap: wrap;
}

.btn-toggle-filters {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-filters:hover {
    background: #f5f5f5;
    border-color: var(--marketplace-primary);
}

.btn-promotions-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    color: white;
    border: none;
    border-radius: var(--marketplace-radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn-promotions-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #FF5252 0%, #26A69A 100%);
    color: white;
    text-decoration: none;
}

.btn-promotions-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.results-count-modern {
    font-size: 14px;
    color: var(--marketplace-text-light);
    display: block !important;
    visibility: visible !important;
}

.results-count-modern strong {
    color: var(--marketplace-text);
    font-weight: 600;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: var(--marketplace-text);
}

.sort-select-modern {
    padding: 8px 12px;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    font-size: 14px;
    cursor: pointer;
    background: white;
}

/* Grille de produits */
.products-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--marketplace-spacing-lg);
    margin-bottom: var(--marketplace-spacing-xl);
    width: 100%;
    max-width: 100%;
}

/* Carte produit - Desktop/Tablette (Grid Layout) */
.product-card-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden; /* Empêche tout débordement */
    box-shadow: var(--marketplace-shadow);
    transition: all 0.3s ease;
    position: relative;
    display: flex; /* Flex pour desktop/tablette (grid layout) */
    flex-direction: column;
    height: auto;
    min-height: auto;
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1;
    min-width: 0;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
}

.product-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--marketplace-shadow-hover);
}

.product-link-modern {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Uniformisation des Images - Imposer un carré parfait */
.product-image-modern {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 240px;
    max-width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: none;
}

.product-image-modern img {
    width: 100%;
    height: 100%;
    max-height: 240px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s;
    display: block;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: none;
    max-width: 100% !important;
    max-height: 100% !important;
}

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

.product-badge-modern {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    display: inline-block;
    white-space: nowrap;
    line-height: 1.2;
}

.badge-new-modern {
    background: #10b981;
    color: white;
}

.badge-negotiable-modern {
    background: #3b82f6;
    color: white;
    padding: 2px 5px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
    animation: badge-glow 2s ease-in-out infinite alternate;
}

@keyframes badge-glow {
    0% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
    }
    100% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

.arrival-badge {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    color: white;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 8px rgba(123, 44, 191, 0.4);
}

.arrival-badge-card {
    top: 10px;
    left: 10px;
    right: auto;
}

.arrival-badge-detail {
    display: inline-block;
    position: relative;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(123, 44, 191, 0.4);
    }
    50% {
        box-shadow: 0 2px 16px rgba(123, 44, 191, 0.6);
    }
}

.product-info-modern {
    padding: 8px; /* Réduit de 12px à 8px pour économiser l'espace */
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: flex-start; /* Change de space-between à flex-start pour éviter les espaces vides */
    min-height: 80px; /* Hauteur minimale pour garantir la visibilité des informations */
    gap: 1px; /* Réduit à 1px pour réduire l'espace entre les lignes */
    overflow: visible; /* Assure que le contenu n'est pas coupé */
}

.product-title-modern {
    font-size: 0.875rem; /* 14px Desktop */
    font-weight: 500;
    color: var(--marketplace-text);
    margin: 0; /* Supprime les marges pour respecter la grille */
    line-height: 1.3em; /* Réduit à 1.3em pour économiser l'espace vertical */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes maximum */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em; /* Réduit la hauteur minimale */
    flex-shrink: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.product-category-modern {
    font-size: 12px;
    color: var(--marketplace-text-lighter);
    margin: 0; /* Supprime les marges pour respecter la grille */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2; /* Réduit l'interligne */
}

.product-price-modern {
    margin: 0; /* Supprime toutes les marges pour respecter la grille */
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 6px;
    line-height: 1.1; /* Réduit l'interligne */
    padding-top: 0; /* Supprime le padding-top de 10px */
}

.price-value-modern {
    font-size: 18px;
    font-weight: 700;
    color: #b12704;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Styles pour les prix avec promotion */
.price-with-discount {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
    width: 100%;
}

.price-original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-final {
    font-size: 18px;
    font-weight: 700;
    color: #b12704;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-savings {
    display: none; /* Masqué par défaut, sera masqué sur mobile */
    font-size: 11px;
    color: #666;
}

.product-meta-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px; /* Réduit à 2px pour respecter la grille */
    padding-top: 2px; /* Réduit à 2px */
    border-top: 1px solid var(--marketplace-border);
    font-size: 11px; /* Réduit légèrement la taille pour économiser l'espace */
    color: var(--marketplace-text-light);
    flex-shrink: 0;
    line-height: 1.2; /* Réduit l'interligne */
}

/* Alignement du bloc prix/bouton en bas de la carte */
.product-card-footer {
    margin-top: auto; /* Pousse le prix et le bouton tout en bas de la capsule */
    padding-top: 10px;
}

.product-location-modern {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-date-modern {
    color: var(--marketplace-text-lighter);
}

/* État vide */
.empty-state-modern {
    text-align: center;
    padding: var(--marketplace-spacing-xl) var(--marketplace-spacing-lg);
    color: var(--marketplace-text-light);
}

.empty-state-modern svg {
    margin: 0 auto var(--marketplace-spacing);
    color: var(--marketplace-text-lighter);
}

.empty-state-modern h3 {
    font-size: 1.25rem;
    margin: 0 0 8px 0;
    color: var(--marketplace-text);
}

.empty-state-modern p {
    margin: 0;
    color: var(--marketplace-text-light);
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: var(--marketplace-spacing-xl);
    padding-top: var(--marketplace-spacing-lg);
    border-top: 1px solid var(--marketplace-border);
    flex-wrap: wrap;
}

.page-btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    color: var(--marketplace-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
}

.page-btn-modern:hover {
    background: #f5f5f5;
    border-color: var(--marketplace-primary);
    color: var(--marketplace-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-btn-modern:active {
    transform: translateY(0);
}

.page-btn-modern svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.page-btn-modern .page-btn-text {
    display: inline;
}

.page-numbers-modern {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--marketplace-border);
    border-radius: var(--marketplace-radius);
    color: var(--marketplace-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
}

.page-number-modern:hover {
    background: #f5f5f5;
    border-color: var(--marketplace-primary);
    color: var(--marketplace-primary);
    transform: translateY(-1px);
}

.page-number-modern.active {
    background: var(--marketplace-primary);
    color: white;
    border-color: var(--marketplace-primary);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.page-dots-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: var(--marketplace-text-lighter);
    font-size: 14px;
    width: 36px;
    height: 36px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .marketplace-layout-modern {
        grid-template-columns: 1fr;
    }
    
    .marketplace-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px))); /* Tient compte de la navbar bottom */
        max-height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px))); /* Tient compte de la navbar bottom */
        z-index: 2000;
        transition: left 0.3s;
        overflow-y: auto;
    }
    
    .marketplace-sidebar.active {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .btn-toggle-filters {
        display: flex;
    }
    
    /* Sur tablette, garder le grid layout (pas Masonry) */
    .products-grid-modern {
        display: grid; /* Garde le grid sur tablette */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--marketplace-spacing);
    }
    
    /* Sur tablette, les cartes gardent leur style grid */
    .product-card-modern {
        display: flex; /* Garde flex sur tablette */
        break-inside: auto; /* Réinitialise pour grid */
        width: auto;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .marketplace-header-modern {
        padding: 3px 0 !important;
    }
    
    .marketplace-header-modern.hidden {
        top: 60px;
    }
    
    .search-section {
        padding: 3px 8px;
    }
    
    /* Mobile: Sticky search bar */
    .marketplace-header-modern {
        position: sticky;
        top: 0;
        z-index: 999;
    }
    
    .modern-search-container {
        max-width: 100%;
    }
    
    .search-box {
        height: 42px;
        border-radius: 42px;
    }
    
    .icon-search {
        padding: 0 12px 0 16px;
    }
    
    .icon-search svg {
        width: 18px;
        height: 18px;
    }
    
    .search-input-modern {
        font-size: 14px;
        height: 42px;
    }
    
    .filter-btn {
        padding: 0 16px 0 10px;
        height: 42px;
    }
    
    .icon-sliders svg {
        width: 16px;
        height: 16px;
    }
    
    .marketplace-content {
        padding: var(--marketplace-spacing);
        width: 100%;
        max-width: 100%;
    }
    
    /* ============================================================
       MASONRY LAYOUT - Grille en cascade style Pinterest/Alibaba
       ============================================================ */
    .products-grid-modern {
        column-count: 2; /* 2 colonnes sur mobile */
        column-gap: 10px;
        padding: 10px;
        /* Supprimer grid pour permettre le layout en cascade */
        display: block;
        width: 100%;
        max-width: 100%;
    }
    
    .marketplace-toolbar-modern {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-select-modern {
        flex: 1;
    }
    
    /* ============================================================
       MARKETPLACE PREMIUM - OPTIMISATIONS MOBILE
       ============================================================ */
    
    /* ============================================================
       MASONRY LAYOUT - Cartes produits adaptées
       ============================================================ */
    .product-card-modern {
        display: inline-block; /* Crucial pour le mode colonnes */
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
        break-inside: avoid; /* Empêche la carte de se diviser sur deux colonnes */
        page-break-inside: avoid; /* Support anciens navigateurs */
        -webkit-column-break-inside: avoid; /* Support Safari */
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: hidden; /* Empêche tout débordement */
        flex-direction: column;
        flex-shrink: 1;
        min-width: 0;
    }
    
    /* Articles sans image personnalisée - Capsule compacte style "Kilo d'avion" */
    .product-card-text-only .product-image-modern {
        display: none; /* Masque l'espace image pour les articles texte seul */
    }
    
    /* Stylisation pour articles texte seul (sans image personnalisée) */
    .product-card-text-only .product-info-modern {
        padding: 12px;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border: 1px solid #e9ecef;
        border-radius: 12px;
        margin-top: 0; /* Supprime l'espace en haut */
    }
    
    /* Capsule plus compacte pour articles texte seul */
    /* La capsule se compresse automatiquement grâce à l'absence d'image */
    
    /* Padding uniforme pour toutes les capsules */
    .product-info-modern {
        padding: 10px; /* Padding uniforme de 10px */
        gap: 1px; /* Réduit à 1px pour respecter la grille */
        display: flex;
        flex-direction: column;
        flex: 1;
        justify-content: space-between; /* Aligne le prix en bas */
        min-height: 90px; /* Hauteur pour titre + catégorie + prix + meta */
        overflow: visible;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        box-sizing: border-box !important;
    }
    
    .product-card-modern * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    /* Titre avec limitation de hauteur pour éviter le débordement */
    .product-title-modern {
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limite à 2 lignes maximum */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.6em; /* Réduit la hauteur minimale */
        font-size: 0.75rem; /* 12px Mobile */
        line-height: 1.3em; /* Réduit l'interligne */
        margin: 0;
        flex-shrink: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Hauteur auto pour cartes avec contenu complet (catégorie + meta) */
    .product-card-modern {
        max-height: none;
        overflow: visible;
    }
    
    /* Afficher catégorie et meta sur mobile comme sur desktop */
    .product-category-modern {
        display: block !important;
        font-size: 10px;
        color: var(--marketplace-text-lighter);
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
        flex-shrink: 0;
    }
    
    .product-description {
        display: none !important; /* Masque la description longue uniquement */
    }
    
    /* Garder product-meta-modern visible (localisation + date) */
    .product-meta-modern {
        display: flex !important;
        margin-top: 2px;
        padding-top: 2px;
        font-size: 10px;
        line-height: 1.2;
        border-top: 1px solid var(--marketplace-border);
    }
    .product-meta-modern svg {
        width: 10px;
        height: 10px;
        flex-shrink: 0;
    }
    .product-location-modern,
    .product-date-modern {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    
    /* Optimisation des prix - Une seule ligne */
    .product-price-modern {
        margin: 0; /* Supprime toutes les marges */
        display: flex;
        align-items: baseline;
        flex-wrap: nowrap;
        gap: 4px;
        line-height: 1.1; /* Réduit l'interligne */
        flex-shrink: 0;
        padding-top: 0; /* Supprime le padding-top */
    }
    
    .price-value-modern {
        font-size: 0.9375rem; /* 15px - Réduit de 18px */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 0;
    }
    
    /* Prix avec promotion - Affichage compact sur une ligne */
    .price-with-discount {
        display: flex;
        flex-direction: row; /* Sur une seule ligne */
        align-items: baseline;
        gap: 6px;
        flex-wrap: nowrap;
        width: 100%;
        line-height: 1.2;
    }
    
    .price-original {
        font-size: 0.75rem; /* 12px - Plus petit pour le prix barré */
        color: #999;
        text-decoration: line-through;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .price-final {
        font-size: 0.9375rem; /* 15px - Prix final en plus grand */
        font-weight: 700;
        color: #b12704;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }
    
    .price-savings {
        display: none !important; /* Masque le texte d'économie sur mobile */
    }
    
    /* Badges optimisés */
    .product-badge-modern {
        padding: 2px 5px;
        font-size: 10px; /* Réduit de 11px */
        top: 8px;
        right: 8px;
    }
    
    /* ============================================================
       PAGINATION MOBILE - Design optimisé sans superposition
       ============================================================ */
    .pagination-modern {
        gap: 12px;
        padding: 16px 12px;
        margin-top: var(--marketplace-spacing-lg);
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    /* Masquer le texte sur mobile - Afficher uniquement les flèches */
    .page-btn-modern .page-btn-text {
        display: none;
    }
    
    /* Boutons Précédent/Suivant - Design circulaire avec flèches uniquement */
    .page-btn-modern {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        padding: 0;
        border-radius: 50%;
        background: var(--marketplace-primary);
        border: 2px solid var(--marketplace-primary);
        color: white;
        box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
        font-size: 0;
        line-height: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        position: relative;
        margin: 0;
    }
    
    /* Positionnement spécifique pour éviter les chevauchements */
    .page-btn-prev {
        order: 1;
        margin-right: auto;
    }
    
    .page-btn-next {
        order: 3;
        margin-left: auto;
    }
    
    .page-btn-modern:hover {
        background: var(--marketplace-primary);
        border-color: var(--marketplace-primary);
        opacity: 0.85;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
    }
    
    .page-btn-modern:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(74, 144, 226, 0.25);
    }
    
    .page-btn-modern svg {
        width: 22px;
        height: 22px;
        stroke: white;
        stroke-width: 2.5;
        flex-shrink: 0;
        display: block;
    }
    
    /* Numéros de page - Plus compacts sur mobile */
    .page-numbers-modern {
        order: 2;
        gap: 6px;
        flex: 0 1 auto;
        justify-content: center;
        min-width: 0;
        margin: 0 8px;
    }
    
    .page-number-modern {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .page-number-modern.active {
        box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
    }
    
    /* Points de suspension */
    .page-dots-modern {
        width: 38px;
        height: 38px;
        font-size: 16px;
        padding: 0;
    }
    
}

@media (max-width: 480px) {
    /* Masonry Layout - Très petits écrans */
    .products-grid-modern {
        column-count: 2; /* 2 colonnes sur très petits écrans */
        column-gap: 10px;
        padding: 10px;
        display: block;
    }
    
    .product-card-modern {
        display: inline-block; /* Crucial pour le mode colonnes */
        width: 100%;
        margin-bottom: 10px;
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-column-break-inside: avoid;
        /* Hauteur auto pour afficher tout le contenu (titre + catégorie + prix + meta) */
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        flex-direction: column;
    }
    
    /* Padding uniforme réduit pour très petits écrans */
    .product-info-modern {
        padding: 6px; /* Réduit de 8px à 6px */
        gap: 1px; /* Réduit à 1px pour respecter la grille */
        min-height: 90px; /* Hauteur minimale pour afficher titre + catégorie + prix + meta */
        overflow: visible;
        justify-content: flex-start; /* Évite les espaces vides */
    }
    
    /* Limiter la hauteur de l'image sur mobile */
    .product-image-modern {
        max-height: 200px;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        border: none;
    }
    
    .product-image-modern img {
        max-height: 200px;
        object-fit: cover;
        object-position: center;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        border: none;
        max-width: 100% !important;
        max-height: 100% !important;
    }
    
    .product-title-modern {
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limite à 2 lignes maximum */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.6em; /* Réduit la hauteur minimale */
        margin: 0; /* Supprime toutes les marges */
        line-height: 1.3em; /* Réduit l'interligne */
        font-size: 0.75rem; /* 12px Mobile */
        flex-shrink: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    .product-price-modern {
        margin: 0; /* Supprime toutes les marges */
        padding-top: 0;
        line-height: 1.1; /* Réduit l'interligne */
    }
    
    .product-meta-modern {
        display: flex !important; /* Visible comme sur desktop */
        margin-top: 2px;
        padding-top: 2px;
        font-size: 9px; /* Compact pour très petits écrans */
        line-height: 1.2;
        border-top: 1px solid var(--marketplace-border);
    }
    .product-meta-modern svg {
        width: 8px;
        height: 8px;
        flex-shrink: 0;
    }
    .product-location-modern,
    .product-date-modern {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        font-size: inherit;
    }
    
    /* Catégorie visible sur très petits écrans */
    .product-category-modern {
        display: block !important;
        font-size: 9px;
        color: var(--marketplace-text-lighter);
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }
    
    .product-description {
        display: none !important;
    }
    
    .price-value-modern {
        font-size: 0.875rem; /* 14px - Encore plus petit */
    }
    
    .price-with-discount .price-original {
        font-size: 0.6875rem; /* 11px */
    }
    
    .price-with-discount .price-final {
        font-size: 0.875rem; /* 14px */
    }
    
    .product-badge-modern {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    /* Pagination - Très petits écrans - Encore plus compacte */
    .pagination-modern {
        gap: 8px;
        padding: 12px 8px;
        justify-content: space-between;
    }
    
    .page-btn-modern {
        width: 44px;
        height: 44px;
        min-width: 44px;
        max-width: 44px;
    }
    
    .page-btn-modern svg {
        width: 20px;
        height: 20px;
    }
    
    .page-numbers-modern {
        margin: 0 4px;
    }
    
    .page-numbers-modern {
        gap: 4px;
    }
    
    .page-number-modern {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 12px;
    }
    
    .page-dots-modern {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
}

/* ============================================================================
   PROTECTION CONTRE LA TRADUCTION AUTOMATIQUE
   ============================================================================ */

/* Empêcher la traduction des noms propres, marques et prix */
.notranslate {
    /* Classe standard pour empêcher la traduction automatique du navigateur */
    /* Utilisée par Google Chrome, Safari et autres navigateurs */
    translate: none;
}

/* S'assurer que les prix ne sont jamais traduits */
.price-value-modern.notranslate,
.kilo-price-value.notranslate,
.product-price-modern .notranslate {
    /* Les prix doivent rester intacts lors de la traduction automatique */
    /* Overflow et ellipsis déjà gérés dans les styles existants */
    translate: none;
}

/* ============================================================================
   STYLES DESKTOP - Assurer l'affichage correct des prix sur PC
   ============================================================================ */

@media (min-width: 1025px) {
    /* S'assurer que le prix est visible sur desktop */
    .product-price-modern {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0;
        margin-top: auto;
        flex-shrink: 0;
        align-items: baseline;
        flex-wrap: nowrap;
        gap: 6px;
        line-height: 1.2;
        padding-top: 10px;
    }
    
    .price-value-modern {
        font-size: 18px;
        font-weight: 700;
        color: #b12704;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* S'assurer que product-info-modern est visible et fonctionne correctement sur desktop */
    .product-info-modern {
        display: flex !important;
        visibility: visible !important;
        /* Les autres propriétés (padding, flex-direction, etc.) sont déjà définies dans la règle de base */
        min-height: 80px !important; /* Hauteur minimale pour garantir la visibilité */
        overflow: visible !important;
    }
    
    /* Badges positionnés correctement dans product-image-modern */
    /* Note: Les styles de base pour .product-image-modern sont déjà définis avec max-height: 240px */
    
    .product-badge-modern {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10;
        display: inline-block !important;
        visibility: visible !important;
        white-space: nowrap;
    }
    
    .badge-new-modern {
        background: #10b981;
        color: white;
        padding: 3px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
    }
    
    .badge-negotiable-modern {
        background: #3b82f6;
        color: white;
        padding: 2px 5px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
    }
    
    /* Prix avec promotion */
    .price-with-discount {
        display: flex !important;
        visibility: visible !important;
        flex-direction: column;
        gap: 2px;
        line-height: 1.2;
        width: 100%;
    }
    
    .price-original {
        display: block !important;
        visibility: visible !important;
        font-size: 14px;
        color: #999;
        text-decoration: line-through;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .price-final {
        display: inline-block !important;
        visibility: visible !important;
        font-size: 18px;
        font-weight: 700;
        color: #b12704;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

