/* Dashboard B2B Styles */

/* Variables CSS pour le dashboard */
:root {
    --brand: #2c5530;
    --brand-2: #ff6b35;
    --text: #333;
    --bg: #f8f9fa;
    --shadow: 0 2px 10px rgba(0,0,0,.1);
    --radius: 10px;
    --muted: #666;
}

/* ========== CONVERSATIONS MOBILE - FAB ET NAVIGATION ========== */
@media (max-width: 768px) {
    /* Cacher COMPLÈTEMENT le bouton du header sur mobile - FORCÉ */
    .conversations-header button,
    .conversations-header .b2bking_request_custom_quote_button,
    .conversations-header .b2bking_request_custom_quote_button.enhanced,
    .conversations-header #b2bking_request_custom_quote_button_conversations {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Simplifier le header sur mobile */
    .conversations-header {
        padding: 15px 20px;
        background: var(--brand);
        color: white;
        text-align: center;
    }
    
    .conversations-header h3 {
        margin: 0;
        font-size: 1.3rem;
        color: white;
    }
    
    /* FAB - Style violet comme les autres boutons de devis */
    .fab-new-quote {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 0 2px 4px rgba(0,0,0,0.2);
        z-index: 90;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .fab-new-quote:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5), 0 3px 6px rgba(0,0,0,0.25);
    }
    
    .fab-new-quote:active {
        transform: scale(0.95);
    }
    
    .fab-new-quote svg {
        width: 28px;
        height: 28px;
        stroke-width: 2.5;
        color: white;
        stroke: white;
    }
    
    /* PAS d'animation de vibration */
    
    /* Navigation 2 étapes pour les conversations */
    .conversations-list {
        position: relative;
        min-height: 600px;
    }
    
    .conversations-sidebar {
        transition: transform 0.3s ease;
    }
    
    .conversation-detail {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }
    
    /* État : conversation ouverte */
    .conversations-list.chat-open .conversations-sidebar {
        transform: translateX(-100%);
    }
    
    .conversations-list.chat-open .conversation-detail {
        transform: translateX(0);
    }
    
    /* Header du chat avec bouton retour */
    .mobile-chat-header {
        display: flex;
        align-items: center;
        padding: 15px;
        background: var(--brand);
        color: white;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .btn-back-to-list {
        background: transparent;
        border: none;
        color: white;
        display: flex;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        padding: 5px;
        margin-right: 10px;
    }
    
    .btn-back-to-list svg {
        width: 24px;
        height: 24px;
    }
    
    .mobile-chat-title {
        flex: 1;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    /* Zone de messages scrollable */
    .conversation-messages {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
    }
    
    /* Zone de saisie fixe en bas */
    .conversation-reply {
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 2px solid #e0e0e0;
        padding: 15px;
        display: flex;
        gap: 10px;
        align-items: flex-end;
    }
    
    .conversation-reply textarea {
        flex: 1;
        min-height: 50px;
        max-height: 120px;
        padding: 12px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        resize: none;
        font-size: 1rem;
    }
    
    .conversation-reply .btn-send {
        padding: 12px 20px;
        background: var(--brand);
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    /* Cacher le FAB quand le chat est ouvert */
    .conversations-list.chat-open .fab-new-quote {
        transform: scale(0);
        opacity: 0;
        pointer-events: none;
    }
}
    
    /* Adaptation du modal/formulaire B2BKing sur mobile */
    .b2bking_custom_quote_form,
    .b2bking_conversation_form,
    #b2bking_conversation_create_modal,
    .b2bking_modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
    }
    
    .b2bking_modal_content,
    .b2bking_conversation_create_modal_content {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 20px !important;
    }
    
    .b2bking_modal textarea,
    .b2bking_conversation_create_modal textarea {
        min-height: 150px !important;
        font-size: 16px !important; /* Empêche le zoom sur iOS */
    }
    
    .b2bking_modal input,
    .b2bking_conversation_create_modal input {
        font-size: 16px !important; /* Empêche le zoom sur iOS */
        padding: 12px !important;
    }
    
    /* Bouton fermer du modal B2BKing */
    .b2bking_modal_close,
    .b2bking_conversation_create_modal_close {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 10000 !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }
    
    /* IMPORTANT : Bouton Envoyer dans le formulaire B2BKing */
    .b2bking_send_custom_quote_button,
    .b2bking_modal button[type="submit"],
    .b2bking_modal .button,
    #b2bking_send_inquiry_button,
    #b2bking_send_offer_button {
        display: block !important;
        width: 100% !important;
        padding: 15px !important;
        background: var(--brand) !important;
        color: white !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        cursor: pointer !important;
        margin-top: 20px !important;
        transition: all 0.3s ease !important;
    }
    
    .b2bking_send_custom_quote_button:active,
    .b2bking_modal button[type="submit"]:active {
        transform: scale(0.98) !important;
        background: #1f3329 !important;
    }
    
    /* Zone du formulaire B2BKing */
    .b2bking_quote_form_container {
        padding: 20px !important;
        background: white !important;
        border-radius: 8px !important;
        margin-top: 15px !important;
    }
    
    /* Textarea du formulaire B2BKing */
    #b2bking_request_custom_quote_textarea,
    #b2bking_request_custom_quote_textarea_conversations {
        width: 100% !important;
        min-height: 200px !important;
        padding: 15px !important;
        border: 2px solid #e0e0e0 !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        resize: vertical !important;
    }
    
    #b2bking_request_custom_quote_textarea:focus,
    #b2bking_request_custom_quote_textarea_conversations:focus {
        outline: none !important;
        border-color: var(--brand) !important;
        box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1) !important;
    }
}

/* 🎨 STYLES UNIFIÉS - COPIE EXACTE DU BOUTON CONVERSATIONS */
.b2bking_request_custom_quote_button,
.b2bking_send_custom_quote_button,
#b2bking_request_custom_quote_button_dashboard,
#b2bking_request_custom_quote_button_conversations,
#b2bking_request_custom_quote_button_main,
#b2bking_request_custom_quote_button {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 8px 15px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* 🎯 ÉTAT HOVER - GARDE LA MÊME LOGIQUE */
.b2bking_request_custom_quote_button:hover,
.b2bking_send_custom_quote_button:hover,
#b2bking_request_custom_quote_button_dashboard:hover,
#b2bking_request_custom_quote_button_conversations:hover,
#b2bking_request_custom_quote_button_main:hover,
#b2bking_request_custom_quote_button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    transform: translateY(-2px) !important;
}

/* 🔥 ÉTAT ACTIF/FOCUS */
.b2bking_request_custom_quote_button:active,
.b2bking_request_custom_quote_button:focus,
.b2bking_send_custom_quote_button:active,
.b2bking_send_custom_quote_button:focus,
#b2bking_request_custom_quote_button_dashboard:active,
#b2bking_request_custom_quote_button_dashboard:focus,
#b2bking_request_custom_quote_button_conversations:active,
#b2bking_request_custom_quote_button_conversations:focus,
#b2bking_request_custom_quote_button_main:active,
#b2bking_request_custom_quote_button_main:focus,
#b2bking_request_custom_quote_button:active,
#b2bking_request_custom_quote_button:focus {
    outline: none !important;
    transform: translateY(-1px) !important;
}

/* ⏳ ÉTAT DISABLED */
.b2bking_request_custom_quote_button:disabled,
.b2bking_send_custom_quote_button:disabled,
#b2bking_request_custom_quote_button_dashboard:disabled,
#b2bking_request_custom_quote_button_conversations:disabled,
#b2bking_request_custom_quote_button_main:disabled,
#b2bking_request_custom_quote_button:disabled {
    background: #BDBDBD !important;
    color: #757575 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* 🎨 STYLE SPÉCIAL POUR LE MODE "ENVOI" - COULEUR VERTE */
.b2bking_send_custom_quote_button {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%) !important;
}

.b2bking_send_custom_quote_button:hover {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%) !important;
}

/* 🎨 ICÔNES SVG - COPIE EXACTE DU STYLE CONVERSATIONS */
.b2bking_request_custom_quote_button svg,
.b2bking_send_custom_quote_button svg,
#b2bking_request_custom_quote_button_dashboard svg,
#b2bking_request_custom_quote_button_conversations svg,
#b2bking_request_custom_quote_button_main svg,
#b2bking_request_custom_quote_button svg {
    width: 24px !important;
    height: 24px !important;
    viewBox: 0 0 24 24 !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    flex-shrink: 0 !important;
}

/* 🎨 LIGNES SVG DANS L'ICÔNE PLUS */
.b2bking_request_custom_quote_button svg line,
.b2bking_send_custom_quote_button svg line,
#b2bking_request_custom_quote_button_dashboard svg line,
#b2bking_request_custom_quote_button_conversations svg line,
#b2bking_request_custom_quote_button_main svg line,
#b2bking_request_custom_quote_button svg line {
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
}

/* 🎨 ICÔNES FEATHER (si utilisées) */
.b2bking_request_custom_quote_button .feather,
.b2bking_send_custom_quote_button .feather,
#b2bking_request_custom_quote_button_dashboard .feather,
#b2bking_request_custom_quote_button_conversations .feather,
#b2bking_request_custom_quote_button_main .feather,
#b2bking_request_custom_quote_button .feather {
    width: 24px !important;
    height: 24px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    fill: none !important;
}

/* 📱 RESPONSIVE - GARDE LES PROPORTIONS */
@media (max-width: 768px) {
    .b2bking_request_custom_quote_button,
    .b2bking_send_custom_quote_button,
    #b2bking_request_custom_quote_button_dashboard,
    #b2bking_request_custom_quote_button_conversations,
    #b2bking_request_custom_quote_button_main,
    #b2bking_request_custom_quote_button {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        gap: 4px !important;
    }
    
    /* Icônes légèrement plus petites sur mobile */
    .b2bking_request_custom_quote_button svg,
    .b2bking_send_custom_quote_button svg,
    #b2bking_request_custom_quote_button_conversations svg,
    .b2bking_request_custom_quote_button .feather,
    .b2bking_send_custom_quote_button .feather,
    #b2bking_request_custom_quote_button_conversations .feather {
        width: 20px !important;
        height: 20px !important;
    }
}

.b2b-dashboard{display:flex;min-height:100vh;background:var(--bg);font-family:'Georgia',serif;}

/* ✅ CACHER LE HEADER SITE SUR LA PAGE DASHBOARD */
.page-template-page-dashboard #site-header,
body.page-template-page-dashboard #site-header,
.b2b-dashboard #site-header,
#site-header.site-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ✅ AUSSI CACHER LE FOOTER SI BESOIN */
.page-template-page-dashboard #site-footer,
body.page-template-page-dashboard #site-footer {
    display: none !important;
}

/* ✅ S'ASSURER QUE LE DASHBOARD PREND TOUT L'ESPACE */
body.page-template-page-dashboard {
    margin: 0 !important;
    padding: 0 !important;
}

.page-template-page-dashboard .b2b-dashboard {
    min-height: 100vh !important;
    width: 100vw !important;
}

/* Sidebar */
.dashboard-sidebar{width:280px;background:#2c5530;color:#fff;position:fixed;height:100vh;overflow-y:auto;z-index:1000;padding-bottom:20px;}

/* Fix desktop sidebar visibility */
@media (min-width: 1025px) {
    .dashboard-sidebar {
        transform: translateX(0) !important;
        display: block !important;
        visibility: visible !important;
    }
}
.sidebar-header{padding:30px 25px;border-bottom:1px solid rgba(255,255,255,.1);}
.logo{display:flex;align-items:center;gap:10px;font-size:1.5rem;font-weight:700;}
.logo-icon{font-size:1.8rem;}
.sidebar-nav{padding:20px 0;}
.nav-item{display:flex;align-items:center;gap:15px;padding:15px 25px;color:rgba(255,255,255,.8);text-decoration:none;transition:.3s;border-left:3px solid transparent;}
.nav-item:hover,.nav-item.active{background:rgba(255,255,255,.1);color:#fff;border-left-color:var(--brand-2);}
.nav-icon{font-size:1.2rem;width:20px;}

/* User section */
.sidebar-footer{display:none;}
.user-section{padding:20px 25px;border-top:1px solid rgba(255,255,255,.1);margin-top:20px;}
.user-info{margin-bottom:15px;padding:15px;background:rgba(255,255,255,.05);border-radius:8px;text-align:center !important;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.user-info strong{display:block;margin-bottom:5px;color:#fff !important;font-size:1.1rem;text-align:center !important;width:100%;}
.user-info span{font-size:.9rem;opacity:.8;color:rgba(255,255,255,.8) !important;display:block;text-align:center !important;width:100%;}
.logout-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 20px;background:rgba(255,0,0,.1);color:#fff;text-align:center;text-decoration:none;border-radius:8px;transition:.3s;border:1px solid rgba(255,100,100,.3);}
.logout-btn:hover{background:rgba(255,0,0,.2);border-color:rgba(255,100,100,.5);transform:translateY(-2px);}
.logout-icon{font-size:1.1rem;}

/* Main */
.dashboard-main{margin-left:280px;flex:1;display:flex;flex-direction:column;}

/* ========== HEADER RESPONSIVE OPTIMISÉ ========== */
.dashboard-header {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 30px;
    min-height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--brand);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(45, 74, 62, 0.1);
}

#page-title {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text);
    font-weight: 400;
    white-space: nowrap;
}
.dashboard-content{padding:30px;flex:1;}
.content-section{display:none;}
.content-section.active{display:block;}

/* ========== HEADER RIGHT - ALIGNEMENT PARFAIT ========== */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 auto;
    justify-content: flex-end;
    max-width: 600px;
}

/* Cacher bouton recherche mobile sur desktop */
.mobile-search-btn {
    display: none !important;
}

/* Search bar */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 12px 48px 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fff;
    color: var(--text);
    font-family: 'Georgia', serif;
    height: 48px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.search-bar input::placeholder {
    color: #999;
    font-style: italic;
}

.search-bar button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background: #1f3329;
    transform: translateY(-50%) !important;
}

.search-bar button:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.search-bar button [data-feather] {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Filters */
.filters-bar{display:flex;align-items:center;gap:20px;margin-bottom:30px;padding:20px;background:#fff;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.1);}
.filter-group{flex:1;}
.filter-group:first-child{display:flex;align-items:center;gap:15px;}
.filter-group:first-child label{margin:0;font-weight:500;color:var(--text);white-space:nowrap;}
.filter-group select{width:100%;padding:10px 12px;border:2px solid #e0e0e0;border-radius:5px;font-size:1rem;height:42px;}
.filter-label{font-weight:500;color:var(--text);white-space:nowrap;margin-right:10px;}

/* Products Grid (scopé pour le dashboard) */
.b2b-dashboard .products-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:25px;margin-bottom:40px;}
.b2b-dashboard .product-card{background:#fff;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:.3s;}
.b2b-dashboard .product-card:hover{transform:translateY(-5px);}
.b2b-dashboard .product-image{height:200px;background:#f5f5f5;background-size:cover;background-position:center;}
.b2b-dashboard .product-info{padding:20px;}
.b2b-dashboard .product-info h3{margin-bottom:10px;color:var(--text);}
.b2b-dashboard .product-price{font-size:1.2rem;font-weight:700;color:var(--brand);margin-bottom:15px;}
.b2b-dashboard .add-to-cart{width:100%;padding:12px;background:var(--brand);color:#fff;border:none;border-radius:8px;cursor:pointer;transition:.3s;}
.b2b-dashboard .add-to-cart:hover{background:#1f3329;}

/* Brands Grid */
.brands-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:30px;}
.brand-card{background:#fff;padding:30px;border-radius:var(--radius);box-shadow:var(--shadow);display:flex;gap:20px;align-items:center;}
.brand-logo{width:80px;height:80px;display:flex;align-items:center;justify-content:center;background:#f5f5f5;border-radius:10px;}
.brand-logo img{max-width:60px;max-height:60px;object-fit:contain;}
.brand-info h3{margin-bottom:10px;color:var(--text);}
.brand-link{color:var(--brand);text-decoration:none;font-weight:500;}

/* Tabs */
.dashboard-tabs{display:flex;gap:5px;margin-bottom:30px;border-bottom:2px solid #e0e0e0;}
.tab-btn{padding:15px 25px;background:none;border:none;color:#666;cursor:pointer;border-bottom:3px solid transparent;transition:.3s;}
.tab-btn.active,.tab-btn:hover{color:var(--brand);border-bottom-color:var(--brand);}

/* ========== TABLES RESPONSIVE - SOLUTION HYBRIDE ========== */

/* Conteneurs des tables */
.orders-table, .quotes-table, .invoices-table {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: visible;
    position: relative;
}

/* Wrapper pour scroll horizontal si nécessaire */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Indicateur de scroll */
.table-wrapper.has-scroll::after {
    content: '→';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateY(-50%) scale(1.1); }
}

/* Table de base */
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Largeur minimum pour éviter compression excessive */
}

/* Headers */
th {
    background: var(--brand);
    color: #fff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

th:hover {
    background: #1f3329;
}

/* Icône de tri dans les headers */
th.sortable::after {
    content: '⇅';
    margin-left: 8px;
    opacity: 0.5;
    font-size: 0.9rem;
}

th.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

th.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

/* Cellules */
td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

/* Lignes avec hover */
tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

/* ========== STATUTS COLORÉS ========== */
.status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Devis statuts */
.status.pending, .status.en-attente {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    color: #856404;
    border: 1px solid #ffc107;
}

.status.accepted, .status.accepte {
    background: linear-gradient(135deg, #d4edda 0%, #a8e6b5 100%);
    color: #155724;
    border: 1px solid #28a745;
}

.status.rejected, .status.refuse {
    background: linear-gradient(135deg, #f8d7da 0%, #f5a3a9 100%);
    color: #721c24;
    border: 1px solid #dc3545;
}

.status.expired, .status.expire {
    background: linear-gradient(135deg, #e2e3e5 0%, #c5c7ca 100%);
    color: #383d41;
    border: 1px solid #6c757d;
}

/* Commandes statuts */
.status.processing, .status.en-cours {
    background: linear-gradient(135deg, #cce5ff 0%, #99ccff 100%);
    color: #004085;
    border: 1px solid #007bff;
}

.status.completed, .status.complete {
    background: linear-gradient(135deg, #d4edda 0%, #a8e6b5 100%);
    color: #155724;
    border: 1px solid #28a745;
}

.status.shipped, .status.expedie {
    background: linear-gradient(135deg, #d1ecf1 0%, #9dd9e7 100%);
    color: #0c5460;
    border: 1px solid #17a2b8;
}

.status.cancelled, .status.annule {
    background: linear-gradient(135deg, #f8d7da 0%, #f5a3a9 100%);
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Factures statuts */
.status.paid, .status.paye {
    background: linear-gradient(135deg, #d4edda 0%, #a8e6b5 100%);
    color: #155724;
    border: 1px solid #28a745;
}

.status.unpaid, .status.impaye {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    color: #856404;
    border: 1px solid #ffc107;
}

.status.overdue, .status.en-retard {
    background: linear-gradient(135deg, #f8d7da 0%, #f5a3a9 100%);
    color: #721c24;
    border: 1px solid #dc3545;
}

.status.partial, .status.partiel {
    background: linear-gradient(135deg, #d1ecf1 0%, #9dd9e7 100%);
    color: #0c5460;
    border: 1px solid #17a2b8;
}

/* ========== ACTIONS GROUPÉES ========== */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.action-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    transform: translateY(-2px);
}

.action-btn.view {
    color: #2196F3;
    border-color: #2196F3;
}

.action-btn.view:hover {
    background: #2196F3;
    color: white;
}

.action-btn.download {
    color: #4CAF50;
    border-color: #4CAF50;
}

.action-btn.download:hover {
    background: #4CAF50;
    color: white;
}

.action-btn.delete {
    color: #f44336;
    border-color: #f44336;
}

.action-btn.delete:hover {
    background: #f44336;
    color: white;
}

/* Dropdown pour actions multiples */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

.actions-dropdown-toggle {
    background: var(--brand);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.actions-dropdown-toggle:hover {
    background: #1f3329;
}

.actions-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 100;
    display: none;
    margin-top: 5px;
}

.actions-dropdown.open .actions-dropdown-menu {
    display: block;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--brand);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* ========== BARRE DE RECHERCHE DANS TABLE ========== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 15px;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.table-search input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.table-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.table-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ========== PAGINATION ========== */
.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
}

.pagination-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.pagination-btn.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

/* News */
.news-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));gap:30px;}
.news-card{background:#fff;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);}
.news-image{height:200px;background:#f5f5f5;}
.news-image img{width:100%;height:100%;object-fit:cover;}
.news-content{padding:25px;}
.news-content h3{margin-bottom:15px;color:var(--text);}
.news-date{color:#666;font-size:.9rem;}
.read-more{color:var(--brand);text-decoration:none;font-weight:500;display:inline-block;margin-top:10px;}
.read-more:hover{text-decoration:underline;}

/* FAQ */
.faq-list{max-width:800px;}
.faq-item{background:#fff;margin-bottom:15px;border-radius:10px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.1);}
.faq-question{width:100%;padding:20px 25px;background:none;border:none;text-align:left;font-size:1.1rem;font-weight:500;cursor:pointer;display:flex;justify-content:space-between;align-items:center;}
.faq-answer{padding:0 25px 25px;display:none;color:#666;line-height:1.6;}
.faq-item.active .faq-answer{display:block;}
.faq-item.active .faq-toggle{transform:rotate(45deg);}

/* Load more */
.load-more-container{text-align:center;}
.load-more-btn{padding:15px 30px;background:var(--brand);color:#fff;border:none;border-radius:25px;cursor:pointer;font-size:1rem;transition:.3s;}
.load-more-btn:hover{background:#1f3329;}
.cart-count{background:var(--brand-2);color:#fff;padding:2px 8px;border-radius:12px;font-size:.8rem;margin-left:8px;}

/* Modals used by dashboard (moved from JS) */
@keyframes slideIn{from{transform:translateX(100%);opacity:0;}to{transform:translateX(0);opacity:1;}}
@keyframes slideOut{from{transform:translateX(0);opacity:1;}to{transform:translateX(100%);opacity:0;}}
.order-modal-overlay,.quote-modal-overlay{
  position:fixed;top:0;left:0;width:100%;height:100%;
  background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:10000;
}
.order-modal,.quote-modal{background:#fff;border-radius:15px;max-width:800px;width:90%;max-height:90vh;overflow-y:auto;}
.order-modal-header,.quote-modal-header{padding:20px 30px;border-bottom:1px solid #eee;display:flex;justify-content:space-between;align-items:center;}
.order-modal-body,.quote-modal-body{padding:30px;}
.close-order-modal,.close-quote-modal{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:5px;}
.order-items-table{width:100%;border-collapse:collapse;margin:20px 0;}
.order-items-table th,.order-items-table td{padding:10px;border:1px solid #ddd;text-align:left;}
.order-items-table th{background:#f5f5f5;}
.order-addresses{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:20px;}
.quote-btn{width:100%;padding:15px;background:var(--brand);color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:1rem;}
.quote-btn:hover{background:#1f3329;}
.request-quote-btn{display:inline-block;padding:12px 25px;background:#ff6b35;color:#fff;text-decoration:none;border-radius:25px;margin-top:20px;transition:.3s;}
.request-quote-btn:hover{background:#e55a2b;}

/* Conversations Section */
.conversations-list {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 600px;
}

.conversations-sidebar {
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversations-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

.btn-new-conversation {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-new-conversation:hover {
    background: #1f3329;
    transform: translateY(-2px);
}

.btn-new-conversation [data-feather] {
    width: 16px;
    height: 16px;
}

.conversations-items {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item:hover {
    background: #f8f8f8;
}

.conversation-item.active {
    background: #f0f7f4;
    border-left: 3px solid var(--brand);
}

/* Conversation active sur mobile avec bordure visible */
@media (max-width: 768px) {
    .conversation-item.active {
        border: 2px solid var(--brand);
        background: #f0f7f4;
        box-shadow: 0 3px 10px rgba(44, 85, 48, 0.2);
    }
    
    /* Masquer le header desktop du détail sur mobile */
    .conversation-detail > .conversations-header {
        display: none;
    }
}

.conversation-item .conv-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.conversation-item .conv-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 5px;
}

.conversation-item .conv-preview {
    font-size: 0.85rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item .conv-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.conv-status.new {
    background: #fff3cd;
    color: #856404;
}

.conv-status.replied {
    background: #d1ecf1;
    color: #0c5460;
}

.conv-status.resolved {
    background: #d4edda;
    color: #155724;
}

/* Conversation Detail */
.conversation-detail {
    display: flex;
    flex-direction: column;
}

.conversation-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.no-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.no-conversation [data-feather] {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.message-item {
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.message-item.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 15px;
    position: relative;
}

.message-item.admin .message-bubble {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px 15px 15px 0;
}

.message-item.user .message-bubble {
    background: var(--brand);
    color: #fff;
    border-radius: 15px 15px 0 15px;
}

.message-author {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 5px;
    font-weight: 600;
}

.message-text {
    line-height: 1.5;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
}

.message-item.user .message-time {
    color: rgba(255,255,255,0.8);
}

/* Reply Box */
/* ✅ VARIANTE ALIGNEMENT PARFAIT */
.conversation-reply {
    flex-shrink: 0;
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    margin-top: auto;
    display: flex;
    gap: 15px;
    align-items: stretch; /* Même hauteur pour les deux */
}

#reply-message {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    resize: none;
    font-family: 'Georgia', serif;
    min-height: 60px;
    max-height: 120px;
}

#reply-message:focus {
    outline: none;
    border-color: var(--brand);
}

.btn-send {
    padding: 12px 25px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-send:hover {
    background: #1f3329;
}

/* ========== RESPONSIVE ZONE DE SAISIE ET MESSAGES ========== */

/* Mobile - Zone de saisie adaptée */
@media (max-width: 768px) {
    .conversation-reply {
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 2px solid #e0e0e0;
        padding: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 10;
    }
    
    #reply-message {
        min-height: 80px;
        font-size: 1rem;
        padding: 15px;
        font-family: inherit; /* Utiliser la police du site */
    }
    
    .btn-send {
        padding: 15px 20px;
        font-size: 1rem;
        min-height: 50px;
        white-space: nowrap;
    }
    
    /* Messages adaptés mobile */
    .conversation-messages {
        padding: 15px;
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 15px 20px;
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .message-author {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .message-time {
        font-size: 0.8rem;
        margin-top: 8px;
    }
    
    .no-conversation {
        padding: 40px 20px;
    }
    
    .no-conversation [data-feather] {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }
    
    .no-conversation p {
        font-size: 1.1rem;
        text-align: center;
        line-height: 1.5;
    }
}

/* Très petit écran - Optimisations supplémentaires */
@media (max-width: 480px) {
    .conversation-reply {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
    }
    
    #reply-message {
        min-height: 70px;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .btn-send {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .conversation-messages {
        padding: 12px;
    }
    
    .no-conversation {
        padding: 30px 15px;
    }
    
    .no-conversation [data-feather] {
        width: 48px;
        height: 48px;
    }
    
    .no-conversation p {
        font-size: 1rem;
    }
}
    transform: translateX(3px);
}

.btn-send [data-feather] {
    width: 18px;
    height: 18px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .conversations-list {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .conversations-sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 200px;
    }
    
    .conversation-detail {
        min-height: 400px;
    }
}

/* ========== SECTION PANIER RESPONSIVE ========== */

/* Container principal du panier */
#panier .cart-content {
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Table normale sur desktop */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

/* Header de table - Masqué sur tous les appareils */
.cart-table thead {
    display: none !important;
}

.cart-table th {
    display: none !important;
}

.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

/* Ligne de total */
.cart-total-row {
    background: #f8f9fa;
    font-weight: bold;
}

.cart-total-row td {
    padding: 20px 15px;
    font-size: 1.1rem;
}

/* Input quantité */
.cart-quantity {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
}

/* Bouton supprimer */
.remove-from-cart {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-from-cart:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Actions du panier */
.cart-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cart-actions button {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-actions .secondary-btn {
    background: #6c757d;
    color: white;
}

.cart-actions .secondary-btn:hover {
    background: #5a6268;
}

.cart-actions .primary-btn {
    background: var(--brand);
    color: white;
}

.cart-actions .primary-btn:hover {
    background: #1f3329;
}

/* ========== RESPONSIVE MOBILE - TRANSFORMATION EN CARDS ========== */
@media (max-width: 768px) {
    
    /* Masquer le header de table sur mobile */
    .cart-table thead {
        display: none;
    }
    
    /* Transformer les lignes en cards */
    .cart-table tbody tr:not(.cart-total-row) {
        display: block;
        margin-bottom: 20px;
        background: #fff;
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        padding: 15px;
        position: relative;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .cart-table tbody tr:not(.cart-total-row) td {
        display: block;
        border: none;
        padding: 8px 0;
        position: relative;
        padding-left: 35%;
    }
    
    /* Labels pour mobile */
    .cart-table tbody tr:not(.cart-total-row) td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 30%;
        font-weight: 600;
        color: #666;
        font-size: 0.9rem;
        display: block;
        line-height: 1.2;
    }
    
    /* Styles spécifiques pour chaque cellule */
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(1) {
        padding-left: 0;
        font-weight: 600;
        font-size: 1.05rem;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(1):before {
        display: none;
    }
    
    /* Produit details */
    .product-details {
        display: block;
    }
    
    .product-details .product-brand {
        display: inline-block;
        margin-top: 5px;
        padding: 3px 8px;
        background: #f0f0f0;
        border-radius: 12px;
        font-size: 0.8rem;
    }
    
    /* Quantité sur mobile */
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(3) {
        display: flex;
        align-items: center;
        padding-left: 0;
    }
    
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(3):before {
        content: "Quantité:";
        position: relative;
        width: auto;
        margin-right: 10px;
    }
    
    .cart-quantity {
        width: 80px;
        padding: 10px;
        font-size: 1.1rem;
        border-radius: 8px;
    }
    
    /* Total ligne */
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(4) {
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--brand);
        display: block;
        padding-left: 35%;
        min-height: 30px;
        line-height: 1.4;
    }
    
    /* Fix pour le prix unitaire */
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(2) {
        display: block;
        padding-left: 35%;
        min-height: 30px;
        line-height: 1.4;
    }
    
    /* Bouton supprimer */
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(5) {
        padding-left: 0;
        text-align: center;
        margin-top: 15px;
    }
    
    .cart-table tbody tr:not(.cart-total-row) td:nth-child(5):before {
        display: none;
    }
    
    .remove-from-cart {
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    /* Ligne total sur mobile */
    .cart-total-row {
        display: block;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 10px;
        padding: 20px;
        margin-top: 20px;
        border: 2px solid var(--brand);
    }
    
    .cart-total-row td {
        display: block;
        padding: 5px 0;
        border: none;
    }
    
    .cart-total-row td:first-child {
        font-size: 1.2rem;
        margin-bottom: 10px;
        color: var(--text);
    }
    
    .cart-total-row td:nth-child(2) {
        font-size: 1.5rem;
        color: var(--brand);
    }
    
    .cart-total-row td:nth-child(3),
    .cart-total-row td:nth-child(4),
    .cart-total-row td:nth-child(5) {
        display: none;
    }
    
    /* Actions sur mobile */
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-actions button {
        width: 100%;
        min-width: auto;
        padding: 18px;
        font-size: 1.05rem;
    }
    
    /* Ordre des boutons sur mobile */
    .cart-actions .primary-btn {
        order: 1;
    }
    
    .cart-actions .b2bking_request_custom_quote_button {
        order: 2;
    }
    
    .cart-actions .secondary-btn {
        order: 3;
        background: #f8f9fa;
        color: #dc3545;
        border: 2px solid #dc3545;
    }
    
    /* Message panier vide */
    .cart-table tbody tr td[colspan="5"] {
        display: block;
        text-align: center;
        padding: 40px 20px;
        font-size: 1.1rem;
        color: #666;
        background: #f8f9fa;
        border-radius: 10px;
        border: 2px dashed #e0e0e0;
    }
}

/* ========== TRÈS PETIT ÉCRAN ========== */
@media (max-width: 480px) {
    
    #panier h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .cart-content {
        padding: 15px;
    }
    
    .cart-table tbody tr:not(.cart-total-row) {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .cart-table tbody tr:not(.cart-total-row) td {
        padding: 6px 0;
    }
    
    .cart-quantity {
        width: 70px;
        padding: 8px;
    }
    
    .cart-actions button {
        padding: 16px;
        font-size: 1rem;
    }
    
    /* Sticky cart total sur très petit écran */
    .cart-total-row {
        position: sticky;
        bottom: 0;
        z-index: 10;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
}

/* Fix pour les boutons quantité mobile */
@media (max-width: 768px) {
    .qty-control {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
        font-weight: bold;
        vertical-align: middle;
    }
    
    .qty-control.qty-minus-inline,
    .qty-control.qty-plus-inline {
        min-width: 35px;
        min-height: 35px;
    }
    
    /* Fix supplémentaire pour l'alignement des prix */
    .cart-table tbody tr:not(.cart-total-row) td[data-label]:not(:first-child):not(:last-child) {
        position: relative;
        padding-top: 5px;
        padding-bottom: 5px;
    }
    
    .cart-table tbody tr:not(.cart-total-row) td[data-label="Prix unitaire"],
    .cart-table tbody tr:not(.cart-total-row) td[data-label="Total"] {
        white-space: nowrap;
        overflow: visible;
    }
    
    /* S'assurer que les montants sont bien visibles */
    .cart-table tbody tr:not(.cart-total-row) td .woocommerce-Price-amount {
        display: inline-block;
        margin-top: 2px;
    }
}

/* ========== INDICATEUR DE PANIER VIDE ========== */
.empty-cart-message {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-icon {
    font-size: 4rem;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.empty-cart-title {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 10px;
}

.empty-cart-text {
    color: #666;
    margin-bottom: 30px;
}

.empty-cart-action {
    display: inline-block;
    padding: 15px 30px;
    background: var(--brand);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.empty-cart-action:hover {
    background: #1f3329;
    transform: translateY(-2px);
}

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

/* Tablette (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Masquer colonnes non essentielles */
    .quotes-table th:nth-child(3),
    .quotes-table td:nth-child(3),
    .orders-table th:nth-child(3),
    .orders-table td:nth-child(3),
    .invoices-table th:nth-child(3),
    .invoices-table td:nth-child(3) {
        display: none;
    }
    
    /* Réduire padding */
    th, td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    /* Actions en icônes uniquement */
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 8px;
        min-width: 36px;
        justify-content: center;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .table-search {
        max-width: 100%;
    }
}

/* Mobile (<768px) - Transformation en cards */
@media (max-width: 768px) {
    /* Masquer la table normale */
    .table-wrapper {
        overflow: visible;
    }
    
    .table-wrapper table {
        display: none;
    }
    
    /* Container pour les cards */
    .table-cards {
        display: block;
    }
    
    /* Card individuelle */
    .table-card {
        background: white;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        transition: all 0.3s ease;
    }
    
    .table-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-color: var(--brand);
    }
    
    /* Header de card */
    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .card-id {
        font-weight: 700;
        color: var(--brand);
        font-size: 1rem;
    }
    
    .card-status {
        margin-left: auto;
    }
    
    /* Corps de card */
    .card-body {
        display: grid;
        gap: 10px;
    }
    
    .card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
    }
    
    .card-label {
        font-weight: 600;
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .card-value {
        font-weight: 500;
        color: var(--text);
        text-align: right;
    }
    
    .card-value.total {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--brand);
    }
    
    /* Actions dans la card */
    .card-actions {
        display: flex;
        gap: 8px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #e0e0e0;
        justify-content: space-between;
    }
    
    .card-actions .action-btn {
        flex: 1;
        justify-content: center;
        padding: 10px;
    }
    
    /* Contrôles de table en mobile */
    .table-controls {
        padding: 10px;
    }
    
    .table-search {
        max-width: 100%;
    }
    
    /* Pagination mobile */
    .table-pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 10px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* Très petit écran (<480px) */
@media (max-width: 480px) {
    .table-card {
        padding: 12px;
    }
    
    .card-id {
        font-size: 0.9rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .action-btn {
        width: 100%;
    }
}

/* Message table vide */
.empty-table-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-table-icon {
    font-size: 3rem;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.empty-table-title {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 10px;
}

.empty-table-text {
    color: #999;
    margin-bottom: 20px;
}

.empty-table-action {
    display: inline-block;
    padding: 12px 24px;
    background: var(--brand);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.empty-table-action:hover {
    background: #1f3329;
    transform: translateY(-2px);
}

/* Responsive général */
@media (max-width:1024px){
  .dashboard-sidebar{transform:translateX(-100%);transition:transform .3s;}
  .dashboard-sidebar.open{transform:translateX(0);}
  .dashboard-main{margin-left:0;}
  .mobile-menu-toggle{display:block;}
  .search-bar input{width:200px;}
}

/* FIX: Sidebar visible sur desktop */
@media (min-width: 1025px) {
    .dashboard-sidebar {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .dashboard-main {
        margin-left: 280px !important;
    }
    .mobile-menu-toggle {
        display: none !important;
    }
}
@media (max-width:768px){
  .dashboard-content{padding:20px;}
  .filters-bar{flex-direction:column;gap:15px;}
  .b2b-dashboard .products-grid{grid-template-columns:1fr;}
  .brands-grid{grid-template-columns:1fr;}
  .brand-card{flex-direction:column;text-align:center;}
  .news-grid{grid-template-columns:1fr;}
  .search-bar{flex-direction:column;}
  .search-bar input{width:100%;}
  .order-addresses{grid-template-columns:1fr;gap:20px;}
  .orders-table,.quotes-table,.invoices-table{font-size:.8rem;}
  .orders-table th,.quotes-table th,.invoices-table th,
  .orders-table td,.quotes-table td,.invoices-table td{padding:8px;}
}

/* Tab panels visibility */
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Ajuster les animations de notification */
@keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}

/* Header cart icon - Harmonisé avec la search bar */
.header-cart {
    position: relative;
    flex: 0 0 auto;
}

/* DESKTOP & TABLET - Fond vert, icône blanche */
@media (min-width: 769px) {
    .cart-icon-btn {
        background: var(--brand) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        font-size: 1.1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .cart-icon-btn:hover {
        background: #1f3329 !important;
        color: #fff !important;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,.2);
    }
}

/* MOBILE - Garder style existant */
@media (max-width: 768px) {
    .cart-icon-btn {
        background: #fff;
        color: var(--brand);
        border: 2px solid var(--brand);
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        font-size: 1.1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }
    
    .cart-icon-btn:hover {
        background: var(--brand);
        color: #fff;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,.2);
    }
}

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

.cart-icon-btn .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    min-width: 22px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Icône dans le bouton panier */
.cart-icon-btn [data-feather] {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

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

/* Tablette */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 15px 20px;
        gap: 20px;
    }
    
    #page-title {
        font-size: 1.5rem;
    }
    
    .header-right {
        max-width: 450px;
    }
    
    .search-bar {
        max-width: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 15px;
        gap: 15px;
        min-height: 70px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    #page-title {
        font-size: 1.3rem;
    }
    
    .header-right {
        gap: 10px;
        max-width: none;
        flex: 1 1 auto;
    }
    
    .search-bar {
        max-width: none;
        flex: 1 1 auto;
    }
    
    .search-bar input {
        height: 44px;
        padding: 10px 44px 10px 16px;
        font-size: 0.9rem;
    }
    
    .search-bar button {
        width: 34px;
        height: 34px;
        right: 5px;
    }
    
    .cart-icon-btn {
        width: 44px;
        height: 44px;
    }
    
    .cart-icon-btn [data-feather] {
        width: 20px;
        height: 20px;
    }
    
    .cart-icon-btn .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        top: -4px;
        right: -4px;
    }
    
    .b2b-dashboard .product-brand {
        font-size: 0.75rem;
        padding-left: 16px;
    }
    
    .b2b-dashboard .product-brand::before {
        font-size: 10px;
    }
}

/* Très petit écran */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 10px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    #page-title {
        font-size: 1.2rem;
    }
    
    .header-right {
        width: 100%;
        gap: 8px;
    }
    
    .search-bar {
        flex: 1 1 calc(100% - 52px);
    }
    
    .search-bar input {
        height: 40px;
        padding: 8px 40px 8px 14px;
        font-size: 0.85rem;
    }
    
    .search-bar button {
        width: 32px;
        height: 32px;
        right: 4px;
    }
    
    .search-bar button [data-feather] {
        width: 16px;
        height: 16px;
    }
    
    .cart-icon-btn {
        width: 40px;
        height: 40px;
    }
    
    .cart-icon-btn [data-feather] {
        width: 18px;
        height: 18px;
    }
    
    .cart-icon-btn .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
        top: -3px;
        right: -3px;
    }
}

/* Ultra petit écran (< 360px) */
@media (max-width: 360px) {
    .dashboard-header {
        padding: 8px;
    }
    
    #page-title {
        font-size: 1.1rem;
    }
    
    .mobile-menu-toggle {
        padding: 6px;
        font-size: 1.3rem;
    }
}

/* ========== FEATHER ICONS STYLES ========== */
/* Configuration globale Feather */
[data-feather] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* Ajustements navigation */
.nav-icon [data-feather] {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-icon [data-feather] {
    stroke-width: 2.5;
    transform: translateX(3px);
}

/* Logo sidebar */
.logo-icon [data-feather] {
    width: 28px;
    height: 28px;
    stroke-width: 2;
    transform: rotate(-15deg);
}

/* Bouton déconnexion */
.logout-icon [data-feather] {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* Menu mobile */
.mobile-menu-toggle [data-feather] {
    width: 24px;
    height: 24px;
}

/* Bouton recherche */
.search-bar button [data-feather] {
    width: 16px;
    height: 16px;
}

/* Icône panier header */
.cart-icon-btn [data-feather] {
    width: 22px;
    height: 22px;
}

/* Bouton fermer modal */
.close-modal [data-feather],
.close-order-modal [data-feather],
.close-quote-modal [data-feather] {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Animation au chargement */
@keyframes fadeInIcon {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

[data-feather] {
    animation: fadeInIcon 0.3s ease;
}

/* Fix alignement mobile */
@media (max-width: 768px) {
    [data-feather] {
        width: 20px;
        height: 20px;
    }
}

/* Search bar animations */
@keyframes pulseSearch {
  0% { box-shadow: 0 0 0 0 rgba(45, 74, 62, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(45, 74, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 74, 62, 0); }
}

.search-bar input:focus + button {
  animation: pulseSearch 1.5s ease-out;
}

/* Effet de brillance sur le bouton */
.search-bar button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.search-bar button:hover::before {
  left: 100%;
}

/* Styles pour la marque dans le panier */
.product-details {
    line-height: 1.4;
}

.product-brand {
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Sélecteur de quantité dans le catalogue */
.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 35px;
    height: 35px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--brand);
    color: #fff;
}

.qty-input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.b2b-dashboard .add-to-cart {
    flex: 1;
}

/* État de recherche active */
.search-bar button.searching {
  animation: rotate 0.5s ease-in-out;
}

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

/* Product brand styling dans les cartes */
.b2b-dashboard .product-brand {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.b2b-dashboard .product-brand::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--brand);
    font-size: 12px;
    top: 2px;
}

.b2b-dashboard .product-info h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 500;
}

.b2b-dashboard .product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 15px;
    margin-top: 12px;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.b2b-dashboard .price-ht {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium, #4a4a4a);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-left: 4px;
}

/* Hover effect sur la carte complète */
.b2b-dashboard .product-card:hover .product-brand {
    color: var(--brand);
}

.b2b-dashboard .product-card:hover .product-brand::before {
    animation: sparkle 0.5s ease;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
}

/* Style pour le bouton B2BKing natif */
#b2bking_request_custom_quote_button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

#b2bking_request_custom_quote_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Masquer le formulaire B2BKing s'il apparaît */
.b2bking_request_custom_quote_container {
    display: none !important;
}

/* Formulaire de demande de devis */
.b2bking_quote_form_container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#b2bking_request_custom_quote_textarea {
    transition: border-color 0.3s ease;
}

#b2bking_request_custom_quote_textarea:focus {
    border-color: #9b7c4c !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(155, 124, 76, 0.1);
}

.b2bking_send_custom_quote_button {
    background: #9b7c4c !important;
    color: white !important;
    font-weight: bold;
}

.b2bking_send_custom_quote_button:hover {
    background: #7a6239 !important;
}

.b2bking_send_custom_quote_button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Style pour le bouton conversations */
#b2bking_request_custom_quote_button_conversations {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#b2bking_request_custom_quote_button_conversations:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
}

#b2bking_request_custom_quote_button_conversations [data-feather] {
    width: 16px;
    height: 16px;
}

/* ✅ CORRECTION CHAMP MESSAGE CONVERSATION */
.conversation-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 600px; /* Hauteur fixe pour la conversation */
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: 450px; /* Limite la zone des messages */
    margin-bottom: 15px;
}

.conversation-reply {
    flex-shrink: 0; /* Empêche la compression */
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    margin-top: auto; /* Pousse vers le bas */
}

.conversation-reply textarea {
    flex: 1;
    min-height: 80px;
    max-height: 120px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.conversation-reply button {
    background: #2c5530;
    color: white;
    border: none;
    padding: 0 20px; /* Padding vertical retiré */
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    min-height: 80px; /* Même hauteur que le textarea */
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

conversation-reply button:hover {
    background: #1e3a21;
    transform: translateY(-1px);
}

.conversation-reply button [data-feather] {
    width: 16px;
    height: 16px;
}

/* ✅ MESSAGES STYLING */
.message-item {
    margin-bottom: 15px;
    clear: both;
}

.message-item.user {
    text-align: right;
}

.message-item.admin {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.message-item.user .message-bubble {
    background: #2c5530;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-item.admin .message-bubble {
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-author {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

/* 🎨 FIX SCROLL CONVERSATIONS - SOLUTION COMPLÈTE */
.conversations-sidebar {
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%; /* ✅ IMPORTANT : Hauteur définie */
    max-height: 600px; /* ✅ IMPORTANT : Limite la hauteur */
}

.conversations-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* ✅ EMPÊCHE LA COMPRESSION */
}

.conversations-items {
    flex: 1; /* ✅ PREND TOUT L'ESPACE RESTANT */
    overflow-y: auto; /* ✅ SCROLL VERTICAL */
    overflow-x: hidden; /* ✅ PAS DE SCROLL HORIZONTAL */
    max-height: calc(600px - 80px); /* ✅ HAUTEUR - HEADER */
    padding-bottom: 10px; /* ✅ PETIT ESPACE EN BAS */
}

/* 🎨 STYLE DE LA SCROLLBAR */
.conversations-items::-webkit-scrollbar {
    width: 6px;
}

.conversations-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversations-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.conversations-items::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 🎨 AMÉLIORATION RESPONSIVE */
@media (max-width: 768px) {
    .conversations-sidebar {
        max-height: 300px; /* ✅ PLUS PETIT SUR MOBILE */
    }
    
    .conversations-items {
        max-height: calc(300px - 70px); /* ✅ AJUSTÉ POUR MOBILE */
    }
}

/* 🎯 SMOOTH SCROLL POUR UNE MEILLEURE EXPÉRIENCE */
.conversations-items {
    scroll-behavior: smooth;
}

/* ✅ S'ASSURER QUE LE CONTENEUR PARENT A UNE HAUTEUR DÉFINIE */
.conversations-list {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 600px; /* ✅ HAUTEUR FIXE OBLIGATOIRE */
    max-height: 600px; /* ✅ LIMITE MAXIMALE */
}

/* ========== RESPONSIVE CONVERSATIONS - OPTION A (LAYOUT VERTICAL) ========== */

/* Tablette (769px - 1024px) - Sidebar plus petite */
@media (max-width: 1024px) and (min-width: 769px) {
    .conversations-list {
        grid-template-columns: 280px 1fr;
        gap: 15px;
        height: 500px;
    }
    
    .conversations-sidebar {
        border-right: 1px solid #e0e0e0;
    }
}

/* Mobile (≤768px) - Style basique pour mobile */
@media (max-width: 768px) {
    .conversations-list {
        display: grid;
        grid-template-columns: 1fr;
        height: auto;
        min-height: 500px;
    }
    
    .conversations-sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .conversation-detail {
        min-height: 400px;
    }
    
    /* Amélioration lisibilité mobile */
    .conversations-header {
        padding: 15px 20px;
        background: var(--brand);
        color: white;
        text-align: center;
    }
    
    .conversations-header h3 {
        font-size: 1.3rem;
        color: white;
        margin: 0;
    }
    
    .conversation-item {
        padding: 30px 20px;
        min-height: 130px;
        margin: 0 15px 10px 15px;
        border-radius: 12px;
        border: 1px solid #e8e8e8;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        background: #fff;
        transition: all 0.2s ease;
        box-shadow: 0 2px 5px rgba(0,0,0,0.08);
        cursor: pointer;
    }
    
    .conversation-item:last-child {
        margin-bottom: 20px;
    }
    
    /* Effet au touch sur mobile */
    .conversation-item:active {
        background: #f0f7f4;
        transform: scale(0.98);
        box-shadow: 0 0 0 2px var(--brand);
    }
    
    .conversation-item:hover {
        box-shadow: 0 4px 10px rgba(0,0,0,0.12);
        transform: translateY(-1px);
    }
    
    .conversation-item .conv-title {
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 10px;
        font-weight: 600;
        color: var(--text);
    }
    
    .conversation-item .conv-preview {
        font-size: 0.95rem;
        line-height: 1.5;
        white-space: normal; /* Permettre retour à la ligne */
        max-height: 3em; /* 2 lignes max */
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        color: #666;
        margin-bottom: 6px;
    }
    
    .conversation-item .conv-date {
        font-size: 0.85rem;
        margin-bottom: 0;
        color: #999;
        font-weight: 500;
    }
    
    .conversation-item .conv-status {
        font-size: 0.75rem;
        padding: 5px 12px;
        border-radius: 12px;
        font-weight: 600;
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

/* Très petit écran (≤480px) */
@media (max-width: 480px) {
    .conversations-list {
        min-height: 450px;
    }
    
    .conversations-sidebar {
        max-height: 350px;
        min-height: 220px;
    }
    
    .conversation-detail {
        min-height: 350px;
    }
    
    .conversations-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .conversations-header h3 {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .conversations-header button {
        width: 100%;
        justify-content: center;
    }
    
    .conversation-item {
        padding: 22px 18px;
        min-height: 100px;
    }
    
    .conversation-item .conv-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .conversation-item .conv-preview {
        font-size: 0.9rem;
        max-height: 2.7em;
        margin-bottom: 6px;
    }
    
    .conversation-item .conv-date {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .conversation-item .conv-status {
        font-size: 0.7rem;
        padding: 3px 8px;
        top: 12px;
        right: 12px;
    }
}

/* ========== AMÉLIORATIONS UX MOBILE ========== */

/* Indicateurs visuels pour mobile */
@media (max-width: 768px) {
    /* Indicateur de conversation active */
    .conversation-item.active {
        background: #f0f7f4;
        border-left: 4px solid var(--brand);
        position: relative;
    }
    
    .conversation-item.active::after {
        content: '→';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--brand);
        font-weight: bold;
        font-size: 1.2rem;
    }
    
    /* Animation d'apparition des conversations */
    .conversation-item {
        animation: slideInLeft 0.3s ease;
    }
    
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Effet de pression sur les boutons */
    .conversations-header button:active,
    .btn-send:active {
        transform: scale(0.95);
    }
    
    /* Scroll smooth pour la sidebar */
    .conversations-items {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Indicateur de scroll */
    .conversations-items::-webkit-scrollbar {
        width: 4px;
    }
    
    .conversations-items::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .conversations-items::-webkit-scrollbar-thumb {
        background: var(--brand);
        border-radius: 2px;
    }
    
    .conversations-items::-webkit-scrollbar-thumb:hover {
        background: #1f3329;
    }
}

/* Améliorations pour très petit écran */
@media (max-width: 480px) {
    /* Réduire les animations sur très petit écran pour la performance */
    .conversation-item {
        animation: none;
    }
    
    /* Optimiser les touch targets */
    .conversation-item {
        min-height: 80px;
        transition: all 0.2s ease;
    }
    
    .conversation-item:hover {
        background: #f8f9fa;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .conversation-item.active {
        background: #f0f7f4;
        border-left: 4px solid var(--brand);
        box-shadow: 0 2px 10px rgba(44, 85, 48, 0.15);
    }
    
    .conversations-header button,
    .btn-send {
        min-height: 44px; /* Touch target minimum recommandé */
    }
    
    /* Améliorer la lisibilité des statuts */
    .conversation-item .conv-status {
        font-size: 0.7rem;
        padding: 4px 10px;
        border-radius: 12px;
    }
}

/* ========== NOTIFICATIONS MOBILE ========== */
.mobile-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--brand);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    opacity: 0;
}

.mobile-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mobile-notification.success {
    background: #28a745;
}

.mobile-notification.error {
    background: #dc3545;
}

.mobile-notification.info {
    background: var(--brand);
}

/* ========== ÉTATS DE CHARGEMENT ========== */
.conversation-item.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.conversation-item.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* ========== FOCUS TEXTAREA MOBILE ========== */
#reply-message.focused {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1);
}

/* ========== SCROLL INDICATORS ========== */
.conversations-items.scrolling {
    scroll-behavior: smooth;
}

/* ========== AMÉLIORATIONS PERFORMANCE ========== */
@media (max-width: 480px) {
    /* Réduire les animations pour la performance */
    * {
        animation-duration: 0.2s !important;
    }
    
    /* Optimiser les transitions */
    .conversation-item,
    .message-bubble,
    .btn-send {
        transition: all 0.2s ease;
    }
}

/* ========== SECTION MON COMPTE ========== */
.account-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.account-tabs .tab-btn {
    padding: 15px 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.95rem;
}

.account-tabs .tab-btn.active,
.account-tabs .tab-btn:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.account-content {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.account-form-container {
    padding: 30px;
}

.account-form-container h3 {
    margin-bottom: 25px;
    color: var(--text);
    font-size: 1.3rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.account-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.form-group input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.btn-save {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: #1f3329;
    transform: translateY(-2px);
}

/* Adresses de livraison */
.addresses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 30px 25px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.addresses-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.3rem;
}

.btn-add-address {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-add-address:hover {
    background: #1f3329;
    transform: translateY(-2px);
}

.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 0 30px 30px 30px;
}

.address-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
}

.address-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.address-card.default {
    border-color: var(--brand);
    background: #f0f7f4;
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.address-title {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-title.default::after {
    content: "Par défaut";
    background: var(--brand);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.address-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-address,
.btn-delete-address,
.btn-set-default {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-edit-address {
    color: #2196F3;
}

.btn-delete-address {
    color: #f44336;
}

.btn-set-default {
    color: var(--brand);
}

.btn-edit-address:hover,
.btn-delete-address:hover,
.btn-set-default:hover {
    background: rgba(0,0,0,0.1);
}

.address-details {
    color: #666;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .addresses-grid {
        grid-template-columns: 1fr;
    }
    
    .addresses-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
    
    .account-tabs {
        flex-wrap: wrap;
    }
    
    .account-form-container {
        padding: 20px;
    }
}

/* Modal d'adresse - Styles corrigés */

.address-modal {
    background: white !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-width: 580px !important;
    width: 100% !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 10001 !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    animation: slideUpModal 0.2s ease !important;
    /* ✅ FIX LAG - GPU ACCELERATION */
    will-change: transform, opacity !important;
    transform: translateZ(0) !important;
}

.address-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 25px !important;
    border-bottom: 1px solid #e8e8e8 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%) !important;
    border-radius: 16px 16px 0 0 !important;
}

.address-modal-header h3 {
    margin: 0 !important;
    font-size: 1.3rem !important;
    color: #2c5530 !important;
    font-weight: 600 !important;
}

/* Bouton fermer du modal */
.close-address-modal {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.close-address-modal:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.close-address-modal svg {
    width: 18px;
    height: 18px;
    stroke: white;
}


.address-modal-body {
    padding: 25px !important;
    max-height: 65vh !important;
    overflow-y: auto !important;
    background: white !important;
}

.address-modal-body {
    padding: 30px;
}

.address-modal .form-group {
    margin-bottom: 15px !important;
}

.address-modal .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
}

.address-modal .form-group label {
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    font-size: 0.9rem !important;
    display: block !important;
}

.address-modal .form-group input,
.address-modal .form-group select {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 2px solid #e0e6ed !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.address-modal .form-group input:focus,
.address-modal .form-group select:focus {
    outline: none !important;
    border-color: #2c5530 !important;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1) !important;
}

.address-modal label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.address-modal input,
.address-modal select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.address-modal input:focus,
.address-modal select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.address-modal .btn-save {
    width: 100% !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, #2c5530 0%, #1e3a21 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    margin-top: 20px !important;
}

.address-modal .btn-save:hover {
    background: linear-gradient(135deg, #1e3a21 0%, #0f1d10 100%) !important;
    transform: translateY(-1px) !important;
}

/* ✅ ANIMATIONS */
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ✅ RESPONSIVE */
@media (max-width: 768px) {
    .address-modal-overlay {
        padding: 15px !important;
    }
    
    .address-modal {
        max-width: 100% !important;
        border-radius: 12px !important;
    }
    
    .address-modal-body {
        padding: 20px !important;
    }
    
    .address-modal .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* Sélecteur d'adresse checkout */
.shipping-address-selector-wrapper {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.shipping-address-selector-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.2rem;
}

.shipping-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.shipping-address-option {
    position: relative;
}

.shipping-address-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.address-card-checkout {
    display: block;
    padding: 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shipping-address-option input[type="radio"]:checked + .address-card-checkout {
    border-color: var(--brand);
    background: #f0f7f4;
    box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.address-card-checkout:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.address-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.default-badge {
    background: var(--brand);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.address-details {
    color: #666;
    line-height: 1.4;
    font-size: 0.9rem;
}

.shipping-address-option.default .address-card-checkout {
    border-color: var(--brand);
}

/* Responsive */
@media (max-width: 768px) {
    .shipping-addresses-grid {
        grid-template-columns: 1fr;
    }
    
    .shipping-address-selector-wrapper {
        padding: 15px;
    }
}

/* ✅ MODAL ADRESSE - VERSION OPTIMISÉE COMPLÈTE */

.modal-content {
    background: white !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-width: 580px !important; /* ✅ PLUS COMPACT */
    width: 100% !important;
    max-height: 85vh !important; /* ✅ RÉDUIT */
    overflow: hidden !important;
    position: relative !important;
    z-index: 10001 !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    animation: slideUpModal 0.2s ease !important;
    /* ✅ FIX LAG - GPU ACCELERATION */
    will-change: transform, opacity !important;
    transform: translateZ(0) !important;
}

.modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 25px !important; /* ✅ RÉDUIT */
    border-bottom: 1px solid #e8e8e8 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%) !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal-header h2 {
    margin: 0 !important;
    font-size: 1.3rem !important; /* ✅ RÉDUIT */
    color: #2c5530 !important;
    font-weight: 600 !important;
}

.modal-close {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important; /* ✅ RÉDUIT */
    height: 32px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
    /* ✅ FIX FERMETURE AUTOMATIQUE */
    pointer-events: auto !important;
}

.modal-close:hover {
    background: #c82333 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

.modal-close:focus {
    outline: 2px solid #dc3545 !important;
    outline-offset: 2px !important;
}

/* ✅ FORMULAIRE CONDENSÉ PREMIUM */
.address-form {
    padding: 25px !important; /* ✅ RÉDUIT */
    max-height: 65vh !important; /* ✅ RÉDUIT */
    overflow-y: auto !important;
    background: white !important;
}

/* ✅ GRILLE COMPACTE - 3 COLONNES */
.form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important; /* ✅ 3 COLONNES */
    gap: 15px !important; /* ✅ RÉDUIT */
    margin-bottom: 15px !important; /* ✅ RÉDUIT */
}

/* ✅ LIGNE SPÉCIALE POUR ADRESSE (2 COLONNES) */
.form-row.address-row {
    grid-template-columns: 2fr 1fr !important;
}

/* ✅ LIGNE PLEINE LARGEUR */
.form-row.full-width {
    grid-template-columns: 1fr !important;
}

.form-group {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
}

.form-group label {
    margin-bottom: 6px !important; /* ✅ RÉDUIT */
    font-weight: 600 !important;
    color: #2c3e50 !important;
    font-size: 0.9rem !important; /* ✅ RÉDUIT */
}

.form-group input,
.form-group select {
    padding: 12px 14px !important; /* ✅ RÉDUIT */
    border: 2px solid #e0e6ed !important;
    border-radius: 8px !important;
    font-size: 14px !important; /* ✅ RÉDUIT */
    transition: all 0.2s ease !important; /* ✅ ACCÉLÉRÉ */
    background: #fff !important;
    font-family: inherit !important;
    height: 42px !important; /* ✅ HAUTEUR FIXE */
    box-sizing: border-box !important;
}

.form-group input:focus,
.form-group select:focus {
    outline: none !important;
    border-color: #2c5530 !important;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1) !important;
    transform: translateY(-1px) !important;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e0 !important;
}

/* ✅ ACTIONS COMPACTES */
.form-actions {
    margin-top: 20px !important; /* ✅ RÉDUIT */
    padding-top: 20px !important;
    border-top: 1px solid #e8e8e8 !important;
    display: flex !important;
    gap: 12px !important; /* ✅ RÉDUIT */
    justify-content: flex-end !important;
    background: #f8f9fa !important;
    margin-left: -25px !important;
    margin-right: -25px !important;
    margin-bottom: -25px !important;
    padding-left: 25px !important;
    padding-right: 25px !important;
    padding-bottom: 20px !important;
}

.btn-cancel {
    padding: 12px 20px !important; /* ✅ RÉDUIT */
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important; /* ✅ RÉDUIT */
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    min-width: 100px !important; /* ✅ RÉDUIT */
}

.btn-cancel:hover {
    background: #5a6268 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3) !important;
}

.btn-save {
    padding: 12px 24px !important; /* ✅ RÉDUIT */
    background: linear-gradient(135deg, #2c5530 0%, #1e3a21 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important; /* ✅ RÉDUIT */
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    min-width: 140px !important; /* ✅ RÉDUIT */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.btn-save:hover {
    background: linear-gradient(135deg, #1e3a21 0%, #0f1d10 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.4) !important;
}

.btn-save:active {
    transform: translateY(0) !important;
}

/* ✅ SCROLLBAR FINE */
.address-form::-webkit-scrollbar {
    width: 6px !important; /* ✅ PLUS FINE */
}

.address-form::-webkit-scrollbar-track {
    background: #f1f3f4 !important;
    border-radius: 3px !important;
}

.address-form::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%) !important;
    border-radius: 3px !important;
    transition: background 0.2s ease !important;
}

.address-form::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%) !important;
}

/* ✅ MODAL ADRESSE - CENTRAGE PARFAIT */
.address-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    animation: fadeInModal 0.2s ease !important;
    will-change: opacity !important;
    transform: translateZ(0) !important;
}

/* ✅ ANIMATIONS ACCÉLÉRÉES */
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ✅ RESPONSIVE OPTIMISÉ */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 15px !important;
    }
    
    .modal-content {
        max-width: 100% !important;
        max-height: 95vh !important;
        border-radius: 12px !important;
    }
    
    .modal-header {
        padding: 18px 20px !important;
    }
    
    .modal-header h2 {
        font-size: 1.2rem !important;
    }
    
    .address-form {
        padding: 20px !important;
        max-height: 70vh !important;
    }
    
    /* ✅ 2 COLONNES SUR MOBILE */
    .form-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    /* ✅ 1 COLONNE POUR ADRESSE SUR MOBILE */
    .form-row.address-row,
    .form-row.full-width {
        grid-template-columns: 1fr !important;
    }
    
    .form-actions {
        flex-direction: column !important;
        gap: 10px !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
        margin-bottom: -20px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .btn-cancel,
    .btn-save {
        width: 100% !important;
        min-width: auto !important;
    }
    
    .address-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    animation: fadeInModal 0.2s ease !important;
    will-change: opacity !important;
    transform: translateZ(0) !important;
}
    
    .address-modal {
    background: white !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-width: 580px !important;
    width: 100% !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 10001 !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    animation: slideUpModal 0.2s ease !important;
    will-change: transform, opacity !important;
    transform: translateZ(0) !important;
}
    
    .address-modal-body {
        padding: 20px !important;
    }
    
    
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px !important;
    }
    
    .modal-header h2 {
        font-size: 1.1rem !important;
    }
    
    .address-form {
        padding: 15px !important;
    }
    
    /* ✅ 1 COLONNE SUR TRÈS PETIT ÉCRAN */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px !important;
        font-size: 14px !important;
        height: 40px !important;
    }
}

/* ✅ STATES VISUELS AMÉLIORÉS */
.form-group input:invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.form-group input:valid {
    border-color: #28a745 !important;
}

/* ✅ FOCUS GLOBAL */
.modal-overlay:focus-within .modal-content {
    box-shadow: 0 30px 60px rgba(0,0,0,0.35) !important;
}

/* ✅ ANTI-DUPLICATION */
.modal-overlay ~ .modal-overlay {
    display: none !important;
}

/* ✅ FIX PERFORMANCE - DÉSACTIVE CERTAINS EFFETS SUR MOBILE */
@media (max-width: 768px) {
    .modal-content {
        animation: none !important;
        transform: none !important;
    }
    
    .modal-overlay {
        animation: none !important;
    }
}

/* 🚨 FORCER L'AFFICHAGE DU TÉLÉPHONE */
#shipping_phone,
.form-group:has(#shipping_phone),
[name="shipping_phone"],
input[type="tel"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100% !important;
}

/* Spécifiquement pour votre modal */
.address-modal #shipping_phone,
.address-modal-body #shipping_phone {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 42px !important;
}

/* Le conteneur du téléphone avec fond jaune */
.form-group[style*="background: #fffbcc"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}