/* =======================
   BARRE DE NAVIGATION
========================== */
#cs-navigation {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #ffffff !important;
    z-index: 10000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

.b2b-body, .pt-120 {
    padding-top: 130px !important;
    background-color: #f4f7f6;
    margin: 0;
    min-height: 80vh;
}

.b2b-tabs {
    display: flex; justify-content: center; gap: 20px;
    margin-bottom: 40px; flex-wrap: wrap;
}
.b2b-tab-btn {
    background-color: transparent; color: #1a1a1a;
    border: 2px solid #ddd; border-radius: 8px;
    padding: 12px 30px; font-size: 16px; font-weight: 700;
    cursor: pointer; font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}
.b2b-tab-btn:hover { border-color: #ff6a3e; color: #ff6a3e; }
.b2b-tab-btn.active { background-color: #ff6a3e; color: #fff; border-color: #ff6a3e; }

.form-group input[type="text"], .form-group input[type="email"],
.form-group input[type="tel"], .form-group input[type="password"],
.b2b-input {
    width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ddd; border-radius: 8px;
    background-color: #f9f9f9; transition: border-color 0.3s, background-color 0.3s;
    font-family: 'Montserrat', sans-serif; box-sizing: border-box;
}

.form-group input[type="text"]:focus, .form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus, .form-group input[type="password"]:focus,
.b2b-input:focus { border-color: #ffba43; outline: none; background-color: #fff; }

.pwd-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
.pwd-wrapper input[type="password"], .pwd-wrapper input[type="text"] { padding-right: 45px; }
.eye-icon { position: absolute; right: 15px; cursor: pointer; user-select: none; font-size: 1.2rem; color: #666; z-index: 10; }

.field-error { 
    color: #d9534f; 
    font-size: 0.85rem; 
    margin-top: 6px; 
    display: none; 
    font-family: 'Montserrat', sans-serif; 
    width: 100%; 
    text-align: left; 
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
}
.input-invalid { border-color: #d9534f !important; background-color: #fdf2f2 !important; }

.form-msg { text-align: center; margin-top: 15px; font-weight: 700; font-family: 'Montserrat', sans-serif; display: none; padding: 5px 0;line-height: 1.4; word-wrap: break-word; }
.form-msg.error { color: #d9534f; display: block; }
.form-msg.success { color: #4CAF50; display: block; }

input[type="radio"], input[type="checkbox"] { accent-color: #ff6a3e; transform: scale(1.2); margin-right: 8px; cursor: pointer; }
.checkbox-label { font-family: 'Montserrat', sans-serif; font-size: 0.85rem; cursor: pointer; line-height: 1.4; color: #1a1a1a; }

/* =====================================
   LAYOUT CATALOGUE + PANIER
======================================== */
.b2b-layout { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }

.b2b-products-section { flex: 1 1 60%; display: flex; flex-direction: column; }
.b2b-header-title { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 25px; }

.category-section { margin-bottom: 50px; }
.category-title {
    font-family: 'Montserrat', sans-serif; font-size: 1.4rem; color: #ff6a3e;
    border-bottom: 2px dashed #ffba43; padding-bottom: 10px; margin-bottom: 25px; margin-top: 0; font-weight: 900;
}

.b2b-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }

.b2b-cart {
    flex: 1 1 30%; background-color: #fff; border: 1px solid #ddd; border-radius: 12px;
    padding: 30px; position: sticky; top: 120px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.b2b-cart-title { margin-top: 0; font-family: 'Montserrat', sans-serif; border-bottom: 2px solid #ff6a3e; padding-bottom: 10px; font-size: 1.3rem; font-weight: 900; color: #1a1a1a;}
.b2b-cart-items-container { min-height: 80px; max-height: 350px; overflow-y: auto; padding-right: 10px; margin-bottom: 20px; }
.b2b-cart-items-container::-webkit-scrollbar { width: 6px; }
.b2b-cart-items-container::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }
.b2b-cart-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding: 15px 0; font-family: 'Montserrat', sans-serif; }
.b2b-cart-remove { color: #d9534f; cursor: pointer; font-weight: bold; margin-left: 10px; font-size: 20px; transition: transform 0.2s; }
.b2b-cart-remove:hover { transform: scale(1.3); }
.b2b-cart-total { font-size: 1.5rem; font-weight: 900; text-align: right; margin-top: 20px; border-top: 2px solid #eee; padding-top: 15px; color: #1a1a1a; font-family: 'Montserrat', sans-serif;}

.b2b-form-group { margin-bottom: 22px; }
.b2b-form-label { display: block; font-weight: 700; margin-bottom: 8px; font-family: 'Montserrat', sans-serif; font-size: 0.95rem; text-transform: uppercase; color: #1a1a1a; }
.b2b-order-form { margin-top: 25px; }

.cs-button-solid {
    background-color: #ffba43; color: #1a1a1a; border: none; border-radius: 8px; padding: 15px;
    font-size: 16px; font-weight: 700; cursor: pointer; font-family: 'Montserrat', sans-serif;
    transition: background-color 0.3s, transform 0.2s; width: 100%; display: block;
}
.cs-button-solid:hover { background-color: #ff6a3e; color: #fff; transform: translateY(-2px); }

/* =========================
   LES CARTES PRODUITS 
============================ */
.b2b-product-card { 
    background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; 
    padding: 20px; text-align: center; box-shadow: 0 4px 8px rgba(0,0,0,0.03); 
    transition: all 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; 
}
.b2b-product-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); border-color: #ffba43; }
.b2b-product-card img { width: 100%; height: 180px; object-fit: contain; margin-bottom: 15px; border-radius: 8px; transition: transform 0.3s ease;}
.b2b-product-card:hover img { transform: scale(1.05); }

.b2b-card-content { display: flex; flex-direction: column; flex-grow: 1; justify-content: flex-end; }
.b2b-card-title { font-size: 1.15rem; font-weight: 700; color: #1a1a1a; margin-bottom: 5px; font-family: 'Montserrat', sans-serif; }
.b2b-card-description { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 15px; font-family: 'Montserrat', sans-serif; }
.b2b-card-price { font-size: 1.4rem; font-weight: 900; color: #ff6a3e; margin-bottom: 15px; }

.b2b-card-actions { 
    display: flex; 
    gap: 10px; 
    align-items: stretch;
    justify-content: space-between; 
}
.b2b-qty-input { 
    width: 75px; 
    height: 48px;
    box-sizing: border-box;
    padding: 0; 
    border: 2px solid #eee; 
    border-radius: 8px; 
    text-align: center; 
    font-weight: 900; 
    font-family: 'Montserrat', sans-serif; 
    font-size: 16px; 
    transition: border-color 0.3s;
    margin: 0;
}
.b2b-qty-input:focus { border-color: #ffba43; outline: none; }
.b2b-card-actions .cs-button-solid {
    height: 48px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

.b2b-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); z-index: 1000; 
    display: flex; align-items: center; justify-content: center; 
    backdrop-filter: blur(4px); 
}
.b2b-modal-content { 
    background: #fff; padding: 30px; border-radius: 10px; 
    width: 90%; max-width: 400px; position: relative; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    font-family: 'Montserrat', sans-serif; text-align: center; 
}
.b2b-close-modal { 
    position: absolute; top: 15px; right: 20px; font-size: 28px; 
    cursor: pointer; color: #999; transition: color 0.3s; 
}
.b2b-close-modal:hover { color: #ff6a3e; }

@media (max-width: 900px) { 
    .b2b-layout { flex-direction: column; gap: 20px; padding: 0 15px 40px 15px; } 
    .b2b-cart { position: relative; top: 0; width: 100%; box-sizing: border-box; margin-top: 15px; padding: 20px; } 
    .b2b-products-section { width: 100%; }
    .b2b-header-title { flex-direction: column; align-items: flex-start; gap: 15px; }
    .b2b-tab-btn { width: 100%; text-align: center; }
}

/* ========================
   STYLE DE L'ESPACE PRO 
=========================== */
.TitreFormulaire .cs-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 900;
}

.b2b-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    padding: 0;
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.b2b-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
    text-align: left;
}

.b2b-table thead tr {
    background-color: #fdfaf5;
    border-bottom: 2px solid #ffba43;
}
.b2b-table th {
    padding: 18px 20px;
    color: #1a1a1a;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.b2b-table td {
    padding: 15px 20px;
    color: #444;
    font-size: 0.95rem;
    vertical-align: middle;
}
.b2b-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}
.b2b-table tbody tr:hover {
    background-color: #fafafa;
}
.b2b-table tbody tr:last-child {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-devis { background-color: #e3f2fd; color: #1976d2; }
.status-facture { background-color: #e8f5e9; color: #2e7d32; }
.status-attente { background-color: #fff3cd; color: #856404; }
.status-annule { background-color: #fce4e4; color: #c62828; }

.btn-download {
    background-color: #ff6a3e;
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    text-decoration: none;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    margin: 0 !important; 
    line-height: 1; 
    
    box-shadow: 0 4px 6px rgba(255, 106, 62, 0.2);
}
.btn-download:hover {
    background-color: #e55a2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 106, 62, 0.3);
    color: #fff;
}

.btn-accept {
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    text-decoration: none;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    margin: 0 !important;
    line-height: 1;
    
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.2);
}
.btn-accept:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

.action-buttons-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    height: 100%;
}

@media screen and (max-width: 850px) {
    .b2b-table-wrapper {
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .b2b-table thead {
        display: none;
    }
    .b2b-table, .b2b-table tbody, .b2b-table tr, .b2b-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .b2b-table tr {
        margin-bottom: 20px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.04);
        overflow: hidden;
    }
    .b2b-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 15px;
        border-bottom: 1px solid #f5f5f5;
        position: relative;
    }
    .b2b-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #ffba43;
        text-transform: uppercase;
        font-size: 0.8rem;
        text-align: left;
        margin-right: 15px;
    }
    .b2b-table td[data-label="Actions"], 
    .b2b-table td[data-label="Action"] {
        flex-direction: column !important;
        align-items: stretch !important;
        padding-top: 20px;
        background: #fafafa;
        border-bottom: none;
    }
    .action-buttons-wrapper {
        justify-content: space-between;
        width: 100%;
        margin-top: 10px;
    }
    .action-buttons-wrapper .btn-download,
    .action-buttons-wrapper .btn-accept {
        flex: 1;
        margin: 0 !important;
        padding: 12px;
    }
}

/* ==============================
   PAGINATION DES TABLEAUX
================================= */
.b2b-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.b2b-pagination-container button {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: all 0.2s;
    color: #333;
}

.b2b-pagination-container button:hover:not(:disabled) {
    background: #f4f7f6;
    border-color: #ffba43;
    color: #ff6a3e;
}

.b2b-pagination-container button.active {
    background: #ffba43;
    color: #111;
    border-color: #ffba43;
}

.b2b-pagination-container button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-refuse {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 40px; 
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    text-decoration: none;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    margin: 0 !important;
    line-height: 1;
    
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.2);
}

.btn-refuse:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
}

.action-buttons-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-wrap: wrap;
}

@media screen and (max-width: 850px) {
    .action-buttons-wrapper .btn-download,
    .action-buttons-wrapper .btn-accept,
    .action-buttons-wrapper .btn-refuse {
        flex: 1 1 calc(50% - 10px);
        margin: 0 !important;
        padding: 12px;
    }
}

/* ====================
   INFOS COMPTE 
======================= */
.b2b-info-card {
    background: #ffffff; 
    border-radius: 12px; 
    padding: 30px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border: 1px solid #eaeaea;
}

.b2b-contact-card {
    background: #fff8f6; 
    border-radius: 12px; 
    padding: 25px; 
    border-left: 6px solid #ff7e5f; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.b2b-info-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 25px;
}

.b2b-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.b2b-info-label {
    font-size: 0.85rem; 
    color: #6b7280; 
    font-weight: 700; 
    text-transform: uppercase;
    margin: 0;
}

.b2b-info-value {
    font-size: 1.05rem; 
    font-weight: 600; 
    color: #111; 
    margin: 0; 
    word-break: break-word;
}

.b2b-contact-btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    color: #111; 
    text-decoration: none; 
    font-weight: 700; 
    background: #ffffff; 
    padding: 12px 25px; 
    border-radius: 8px; 
    border: 1px solid #ffd4cc; 
    transition: all 0.2s; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.b2b-contact-btn:hover {
    background: #fff0ed;
    border-color: #ff7e5f;
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .b2b-info-card, .b2b-contact-card {
        padding: 20px 15px !important; 
    }
    .b2b-info-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .b2b-info-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid #f0f0f0;
        gap: 15px;
    }
    .b2b-info-item:last-child {
        border-bottom: none;
    }
    .b2b-info-label {
        font-size: 0.75rem;
        flex: 0 0 35%;
    }
    .b2b-info-value {
        font-size: 0.9rem;
        flex: 1;
        text-align: right;
    }
    .b2b-contact-btn {
        width: 100%; 
        padding: 15px;
    }
}