/* =========================================================
 * 1. RESET & STRUCTURE GLOBALE APP (Pleine largeur)
 * ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111;
    background: #f5f5f5;
    line-height: 1.6;
    overflow-x: hidden;
}

.b2b-app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* =========================================================
 * 2. SIDEBAR GAUCHE (MENU TOUJOURS PRÉSENT)
 * ========================================================= */
.b2b-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #2b2b2b;
    color: #fff;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.b2b-sidebar-logo {
    padding: 30px;
    background: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}
.b2b-sidebar-logo a { color: #fff; text-decoration: none; }

.b2b-sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0;
}
.b2b-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.b2b-sidebar-nav ul li a {
    display: block;
    padding: 15px 30px;
    color: #b0b0b0;
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: 0.2s;
}
.b2b-sidebar-nav ul li a:hover {
    background: #3a3a3a;
    color: #fff;
}

.b2b-sidebar-nav ul li.current a {
    background: #3a3a3a;
    color: #fff;
    border-left-color: #b23b2e;
}

.b2b-nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: .85;
}

.b2b-sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.b2b-nav-separator {
    height: 1px;
    background: rgba(255,255,255,.1);
    margin: 12px 24px;
}

.b2b-nav-info {
    padding: 10px 30px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
}

.b2b-sidebar-tagline {
    display: block;
    font-size: 11px;
    font-weight: normal;
    letter-spacing: 2px;
    color: #888;
    margin-top: 6px;
}

.topbar-search button {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
 * 3. CONTENU DROITE (TOPBAR + MAIN CONTENT)
 * ========================================================= */
.b2b-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f5f5f5;
}

.b2b-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #a9a9a9; /* Fond gris comme Eleonora */
    padding: 15px 40px;
    height: 70px;
}
.topbar-search form { display: flex; align-items: center; }
.topbar-search input[type="text"] {
    padding: 10px 15px;
    border: none;
    width: 300px;
    outline: none;
}
.topbar-search button {
    padding: 10px 15px;
    background: #fff;
    color: #111;
    border: none;
    cursor: pointer;
    font-weight: bold;
}
.topbar-user { font-weight: 600; color: #111; display:flex; align-items:center; gap:10px; }

.page-content {
    padding: 50px;
    background: #fff; /* Le contenu est sur fond blanc, entouré du fond gris global */
    margin: 40px;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
    min-height: 80vh;
}

/* =========================================================
 * 4. FIXES WOOCOMMERCE & MASQUAGE DU MENU INTERNE
 * ========================================================= */

/* MASQUER LE MENU WOOCOMMERCE NATIF (Puisqu'il est maintenant dans la vraie sidebar à gauche) */
body.woocommerce-account .woocommerce-MyAccount-navigation { 
    display: none !important; 
}
body.woocommerce-account .woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* GRILLE PRODUITS (4 Colonnes) */
body.woocommerce ul.products,
body.woocommerce-page ul.products,
body .woocommerce .related ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff;
    border: 1px solid #eaeaea;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
}
body.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
body.woocommerce ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 15px;
}
body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
    color: #111;
    margin-bottom: 10px;
}
body.woocommerce ul.products li.product .price {
    color: #6e0018 !important;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
}
body.woocommerce ul.products li.product .button {
    margin-top: auto !important;
    background: #111 !important;
    color: #fff !important;
    padding: 10px !important;
    text-transform: uppercase;
    font-size: 12px;
}

/* =========================================================
 * 5. RESPONSIVE
 * ========================================================= */
@media (max-width: 1024px) {
    .b2b-app-layout { flex-direction: column; }
    .b2b-sidebar { width: 100%; height: auto; position: relative; }
    .b2b-sidebar-nav ul { display: flex; flex-wrap: wrap; }
    .b2b-main-content { width: 100%; }
    .page-content { margin: 20px; padding: 20px; }
    body.woocommerce ul.products { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .b2b-topbar { flex-direction: column; height: auto; gap: 15px; }
    body.woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}

/* =========================================================
 * 6. PAGES DE CONTENU ET 404
 * ========================================================= */

.page-title {
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 26px;
}

.page-body {
    max-width: 780px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.dh-404-wrap {
    text-align: center;
    padding: 100px 0;
}

.dh-404-wrap h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.dh-404-wrap p {
    color: #666;
    margin-bottom: 24px;
}

.dh-404-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 26px;
    background: #111;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.dh-404-btn:hover {
    background: #000;
}

/* =========================================================
 * 7. ARTICLES, RECHERCHE, COMMENTAIRES
 * ========================================================= */

.dh-archive-list {
    display: grid;
    gap: 24px;
    max-width: 780px;
}

.dh-archive-item {
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.dh-archive-item h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.dh-archive-item h2 a {
    color: #111;
    text-decoration: none;
}

.dh-archive-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.nav-links {
    display: flex;
    gap: 8px;
    margin-top: 30px;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    color: #111;
    font-size: 13px;
    text-decoration: none;
}

.nav-links .page-numbers.current {
    background: #111;
    color: #fff;
    border-color: #111;
}

.dh-comments {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eaeaea;
    max-width: 780px;
}

.dh-comments-title {
    font-size: 18px;
    margin-bottom: 20px;
}

.dh-comment-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.dh-comment-list li {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.search-form {
    display: flex;
    gap: 8px;
    max-width: 500px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    font-size: 14px;
}

.search-form input[type="submit"] {
    background: #111;
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}
