/* ================================================================
   MEILLEUR BAR — Navigation principale v3.0
   Fichier CSS dédié (enqueué via wp_enqueue_style)
   ================================================================ */

/* ── Barre fixe ─────────────────────────────────────────────── */
#mb-nav {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 64px !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    background: #0E0C09 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 32px !important;
    box-shadow: 0 2px 24px rgba(0,0,0,.4) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
}

/* ── Logo ───────────────────────────────────────────────────── */
#mb-nav-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -.02em;
    white-space: nowrap;
    margin-right: 32px;
    flex-shrink: 0;
}
#mb-nav-logo span { color: #B8934A; }

/* ── Liste de navigation ────────────────────────────────────── */
#mb-nav-items {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Item nav ───────────────────────────────────────────────── */
.mb-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.mb-nav-item > a,
.mb-nav-item > button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    height: 100%;
    color: rgba(255,255,255,.82);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s;
    letter-spacing: .01em;
    line-height: 1;
}
.mb-nav-item > a:hover,
.mb-nav-item > button:hover,
.mb-nav-item.mb-active > a,
.mb-nav-item.mb-active > button { color: #B8934A; }

/* Chevron */
.mb-chevron {
    font-size: 8px;
    opacity: .5;
    transition: transform .2s;
    display: inline-block;
}
.mb-nav-item.open > button .mb-chevron { transform: rotate(180deg); }

/* ── Séparateur vertical ────────────────────────────────────── */
.mb-nav-sep {
    width: 1px; height: 18px;
    background: rgba(255,255,255,.1);
    margin: 0 4px;
    flex-shrink: 0;
    align-self: center;
}

/* ── Icône recherche ────────────────────────────────────────── */
.mb-search-icon {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.6);
    padding: 0 8px;
    transition: color .15s;
}
.mb-search-icon:hover { color: #B8934A; }

/* ================================================================
   DROPDOWN SIMPLE
   ================================================================ */
.mb-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1A1612;
    border: 1px solid rgba(255,255,255,.08);
    border-top: 2px solid #B8934A;
    border-radius: 0 0 12px 12px;
    min-width: 260px;
    padding: 8px 0 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .18s, visibility .18s, transform .18s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 16px 48px rgba(0,0,0,.45);
    z-index: 100;
}
.mb-nav-item.open > .mb-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.mb-dropdown a {
    display: block;
    padding: 8px 20px;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: color .12s, background .12s;
    white-space: nowrap;
}
.mb-dropdown a:hover {
    color: #fff;
    background: rgba(184,147,74,.12);
}
.mb-dropdown-section {
    padding: 10px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #B8934A;
}
.mb-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: 6px 0;
}

/* ================================================================
   MEGA MENU VILLES — position fixed, centré dans le viewport
   ================================================================ */
.mb-mega {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: min(820px, calc(100vw - 32px));
    background: #1A1612;
    border: 1px solid rgba(255,255,255,.08);
    border-top: 2px solid #B8934A;
    border-radius: 0 0 14px 14px;
    padding: 24px 28px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s, visibility .18s, transform .18s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    z-index: 100;
}
.mb-nav-item.open > .mb-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.mb-mega-col-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #B8934A;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.mb-mega-link {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    transition: color .12s, padding-left .12s;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.mb-mega-link:last-child { border-bottom: none; }
.mb-mega-link:hover { color: #fff; padding-left: 4px; }

/* ── Admin bar ──────────────────────────────────────────────── */
.admin-bar .mb-mega { top: 96px; }

/* ================================================================
   BURGER MOBILE
   ================================================================ */
#mb-nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    margin-left: auto;
    padding: 10px 6px;
    background: none;
    border: none;
    touch-action: manipulation;
}
#mb-nav-burger span {
    display: block;
    width: 22px; height: 2px;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: transform .22s ease, opacity .22s ease;
    pointer-events: none;
}
#mb-nav-burger.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#mb-nav-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#mb-nav-burger.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ================================================================
   RESPONSIVE — ≤ 900px
   ================================================================ */
@media (max-width: 900px) {

    /* Masquer items desktop */
    #mb-nav-items { display: none; }
    .mb-nav-sep { display: none !important; }
    #mb-nav-burger { display: flex; }

    /* Menu mobile plein écran */
    #mb-nav-items.mb-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 64px; left: 0; right: 0;
        height: calc(100dvh - 64px);
        background: #0E0C09;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 8px 0 32px;
        border-top: 1px solid rgba(255,255,255,.1);
        z-index: 99998;
    }

    /* Scroll lock */
    body.mb-menu-open { overflow: hidden; }

    /* Items en colonne */
    .mb-nav-item {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }
    .mb-nav-item > a,
    .mb-nav-item > button {
        padding: 13px 24px;
        width: 100%;
        height: auto;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,.05);
        justify-content: space-between;
    }

    /* Panneaux : statiques, cachés par défaut */
    .mb-mega,
    .mb-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid rgba(255,255,255,.06) !important;
        background: rgba(255,255,255,.03) !important;
        display: none;
        transition: none !important;
    }

    /* Mega : 1 colonne sur mobile */
    .mb-mega {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 12px 0 !important;
    }
    .mb-mega > div { padding: 0 24px 8px; }
    .mb-mega-col-title { margin-top: 8px; }

    /* Ouvrir au clic burger */
    .mb-nav-item.open > .mb-mega     { display: grid; }
    .mb-nav-item.open > .mb-dropdown { display: block; }

    /* Liens dans les panneaux mobiles */
    .mb-dropdown a,
    .mb-mega-link {
        padding: 10px 24px !important;
        font-size: 13.5px !important;
    }
    .mb-mega-link:hover { padding-left: 24px !important; }

    /* Icône recherche : pas de margin-left auto sur mobile */
    .mb-nav-item[style*="margin-left:auto"],
    .mb-nav-item[style*="margin-left: auto"] {
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    #mb-nav { padding: 0 16px; }
    #mb-nav-logo { font-size: 17px; margin-right: 0; }
}

/* ================================================================
   FIL D'ARIANE
   ================================================================ */
#mb-breadcrumb {
    background: #FAF5EB;
    padding: 10px 40px;
    font-size: 13px;
    color: #6B6560;
    border-bottom: 1px solid #E8E0D0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    line-height: 1.4;
}
#mb-breadcrumb a {
    color: #B8934A;
    text-decoration: none;
    transition: color .12s;
}
#mb-breadcrumb a:hover { color: #0E0C09; }
#mb-breadcrumb .mb-bc-sep   { color: #C8BFB0; font-size: 11px; margin: 0 2px; }
#mb-breadcrumb .mb-bc-current { color: #3D3530; font-weight: 600; }

@media (max-width: 600px) {
    #mb-breadcrumb { padding: 8px 16px; font-size: 12px; }
}
