/* OddPixel Factory 2.4.5 — navigation Astra, sans mutation des menus WordPress.
 * Desktop : alignement sur une ligne, espacements et accès client distinct.
 * Mobile : préserver le menu déroulant natif Astra et ses sous-menus.
 */

/* Un en-tête sobre et des états clavier visibles sur tout le site vitrine. */
body #masthead .ast-primary-header-bar {
    background-color: #f9faff;
    border-bottom: 1px solid #e7eaf5;
}
body #masthead .main-header-menu a.menu-link:focus-visible,
body #ast-mobile-header .main-header-menu a.menu-link:focus-visible {
    outline: 2px solid #6354e9;
    outline-offset: 2px;
}

/* Astra passe normalement en navigation mobile à 921 px. Les règles de
 * disposition ci-dessous ne concernent PAS l'en-tête mobile. */
@media (min-width: 922px) {
    body:not(.ast-header-break-point) #masthead .ast-primary-header-bar .ast-container {
        width: calc(100% - 48px) !important;
        max-width: 1200px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    body:not(.ast-header-break-point) #masthead .ast-primary-header-bar .ast-builder-grid-row-has-sides.ast-builder-grid-row-no-center {
        grid-template-columns: max-content minmax(0, 1fr) !important;
        align-items: center !important;
        column-gap: clamp(20px, 3vw, 52px);
    }
    body:not(.ast-header-break-point) #masthead .site-header-primary-section-left,
    body:not(.ast-header-break-point) #masthead .site-header-primary-section-right {
        min-width: 0;
        align-items: center;
    }
    body:not(.ast-header-break-point) #masthead .site-header-primary-section-right {
        justify-content: flex-end;
    }
    body:not(.ast-header-break-point) #masthead .ast-main-header-bar-alignment,
    body:not(.ast-header-break-point) #masthead .main-header-bar-navigation,
    body:not(.ast-header-break-point) #masthead .main-navigation {
        min-width: 0;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 2px;
        white-space: nowrap;
        margin: 0;
        padding: 0;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item {
        flex: 0 0 auto;
        width: auto;
        margin: 0 !important;
        white-space: nowrap;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item > a.menu-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 42px;
        height: auto;
        padding: 10px clamp(8px, 0.85vw, 13px) !important;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        letter-spacing: -0.01em;
        color: #202b49 !important;
        -webkit-text-fill-color: #202b49 !important;
        text-decoration: none;
        transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item > a.menu-link .menu-text {
        color: inherit !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item:not(.op-site-account-link) > a.menu-link:hover,
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item:not(.op-site-account-link) > a.menu-link:focus-visible,
    body:not(.ast-header-break-point) #masthead .main-header-menu > .current-menu-item:not(.op-site-account-link) > a.menu-link,
    body:not(.ast-header-break-point) #masthead .main-header-menu > .current-menu-ancestor:not(.op-site-account-link) > a.menu-link {
        background-color: #eeecff;
        color: #5234b9 !important;
        -webkit-text-fill-color: #5234b9 !important;
    }

    /* Repéré par son URL de tableau de bord client : pas de lien ajouté en double. */
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link {
        margin-left: 9px !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link,
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link.current-menu-item > a.menu-link {
        min-height: 43px;
        padding: 11px 18px !important;
        border: 1px solid #6850e7;
        border-radius: 999px;
        background-color: #6750e8 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        box-shadow: 0 6px 14px rgba(78, 53, 166, .16);
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link:hover,
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link:focus-visible {
        border-color: #4d39c8;
        background-color: #4d39c8 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        box-shadow: 0 8px 19px rgba(78, 53, 166, .25);
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link .menu-text {
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link::before {
        content: '';
        display: inline-block;
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/svg%3E");
    }
    /* Menus déroulants : largeur réelle adaptée aux intitulés WordPress.
     * Le parent utilise nowrap ; le rétablir explicitement ici évite que
     * « OddPixel PC Configurator Free » déborde sur l'en-tête clair. */
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu {
        box-sizing: border-box !important;
        width: 300px !important;
        min-width: 300px !important;
        max-width: calc(100vw - 32px) !important;
        padding: 7px !important;
        margin: 0 !important;
        white-space: normal !important;
        border: 1px solid #363b72 !important;
        border-radius: 13px !important;
        background: #151642 !important;
        box-shadow: 0 18px 40px rgba(8, 13, 46, .24) !important;
        overflow: visible !important; /* permettre un éventuel 3e niveau Astra */
        z-index: 9999;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu > .menu-item {
        display: block !important;
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: normal !important;
        background: transparent !important;
        border: 0 !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu > .menu-item + .menu-item {
        margin-top: 3px !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 44px;
        height: auto !important;
        padding: 12px 15px !important;
        border: 0 !important;
        border-radius: 8px !important;
        color: #f8f9ff !important;
        -webkit-text-fill-color: #f8f9ff !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1.45 !important;
        text-align: left !important;
        text-decoration: none !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        background: transparent !important;
        transition: background-color .16s ease;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link .menu-text {
        min-width: 0 !important;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        color: inherit !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link .dropdown-menu-toggle {
        flex: 0 0 auto;
        margin-left: 12px;
        color: #d6d2ff !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link:hover,
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item:hover > a.menu-link,
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link:focus-visible,
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .current-menu-item > a.menu-link {
        background: #383183 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu .menu-item > a.menu-link:focus-visible {
        outline: 2px solid #bcafff !important;
        outline-offset: -3px !important;
    }
}

/* Écran desktop réduit : on resserre les marges, sans couper les titres. */
@media (min-width: 922px) and (max-width: 1110px) {
    body:not(.ast-header-break-point) #masthead .ast-primary-header-bar .ast-container {
        width: calc(100% - 32px) !important;
    }
    body:not(.ast-header-break-point) #masthead .ast-primary-header-bar .ast-builder-grid-row-has-sides.ast-builder-grid-row-no-center {
        column-gap: 14px;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu { gap: 0; }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .menu-item > a.menu-link {
        font-size: 12.5px;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link { margin-left: 4px !important; }
    body:not(.ast-header-break-point) #masthead .main-header-menu > .op-site-account-link > a.menu-link { padding: 9px 11px !important; }
}

/* Mobile : conserver le menu Astra normal, mais mettre l'accès client en évidence. */
/* Le seuil de bascule Astra peut etre personnalise ; ne pas supposer 921px. */
@media screen {
    /* Mobile : ne jamais imposer les 300px du sous-menu de bureau. */
    body.ast-header-break-point #ast-mobile-header .main-header-menu .sub-menu,
    body.ast-header-break-point #ast-mobile-header .main-header-menu .sub-menu > .menu-item {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
    }
    body.ast-header-break-point #ast-mobile-header .main-header-menu .sub-menu a.menu-link,
    body.ast-header-break-point #ast-mobile-header .main-header-menu .sub-menu a.menu-link .menu-text {
        max-width: 100%;
        height: auto;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.5;
    }
    body.ast-header-break-point #ast-mobile-header .main-header-menu > .op-site-account-link > a.menu-link {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 8px 12px 12px;
        padding: 13px 16px !important;
        border-radius: 10px;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        background: #6750e8 !important;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.4;
    }
    body.ast-header-break-point #ast-mobile-header .main-header-menu > .op-site-account-link > a.menu-link:hover,
    body.ast-header-break-point #ast-mobile-header .main-header-menu > .op-site-account-link > a.menu-link:focus-visible {
        background: #4d39c8 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }
    body.ast-header-break-point #ast-mobile-header .main-header-menu > .op-site-account-link > a.menu-link::before {
        content: '';
        display: inline-block;
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/svg%3E");
    }
}

@media (prefers-reduced-motion: reduce) {
    body #masthead .main-header-menu > .menu-item > a.menu-link {
        transition: none !important;
    }
}
