/* MarketDG - barre de compte compacte et homogène */

.dzm-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    max-width: 100%;
}

.dzm-header-actions .dzm-action-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    min-height: 36px;
    height: auto;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .18s ease, background-color .18s ease,
                box-shadow .18s ease, transform .18s ease;
}

.dzm-header-actions .dzm-action-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 9px rgba(37, 99, 235, .09);
}

.dzm-header-actions .dzm-ui-icon {
    display: block;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dzm-user-greeting {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    min-height: 36px;
    max-width: 100%;
    padding: 0 11px;
    border: 1px solid #dbeafe;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12.5px;
    line-height: 1.2;
    white-space: nowrap;
}

.dzm-user-greeting .dzm-ui-icon {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
}

.dzm-user-name {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    color: #1e3a8a;
    font-weight: 700;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.dzm-header-actions .dzm-post-action {
    font-weight: 700;
}

body.dark-theme .dzm-user-greeting {
    border-color: #31517b;
    background: #1b2d47;
    color: #bfdbfe;
}

body.dark-theme .dzm-user-name {
    color: #eff6ff;
}

body.dark-theme .dzm-header-actions .dzm-post-action {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

html[dir="rtl"] .dzm-header-actions {
    justify-content: flex-start;
}

@media (max-width: 700px) {
    .dzm-header-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
        margin-top: 8px;
    }

    .dzm-header-actions .dzm-action-link {
        min-height: 34px;
        padding: 0 9px;
        font-size: 12px;
    }

    .dzm-user-greeting {
        min-height: 34px;
        padding: 0 9px;
        font-size: 12px;
    }

    .dzm-user-name {
        max-width: 130px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dzm-header-actions .dzm-action-link {
        transition: none;
    }

    .dzm-header-actions .dzm-action-link:hover {
        transform: none;
    }
}


/* DZMARKET-HEADER-FINAL-ALIGNMENT-V1 */

/* Rangée supérieure : espaces équilibrés */
.header-container {
    column-gap: 10px;
}

.header-container > .logo {
    flex: 0 0 auto;
}

/* Garder la recherche fonctionnelle sans lui laisser trop d'espace */
.header-container > .header-search {
    flex: 0 1 220px;
    min-width: 130px;
    max-width: 240px;
}

/* Préférences accolées au logo, sans cadre carré */
.header-container > .dzmarket-settings-anchor.dzmarket-in-header {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    align-self: center;
    margin: 0;
    z-index: 6000;
}

.header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    box-shadow: none;
    color: #2563eb;
    font-size: 24px;
    line-height: 1;
}

.header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu-button:hover {
    background: #eff6ff;
}

.header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Le menu s'ouvre auprès du bouton, pas au bout de la page */
.header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: auto;
    bottom: auto;
    left: 0;
    width: 270px;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    z-index: 6000;
}

html[dir="rtl"] .header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu {
    right: 0;
    left: auto;
}

body.dark-theme .header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu-button {
    border: 0;
    background: transparent;
    color: #bfdbfe;
}

body.dark-theme .header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu-button:hover {
    background: #26364d;
}

/* Centrer ensemble les raccourcis */
.header-container > .dzm-header-actions {
    flex: 1 1 580px;
    min-width: 0;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-content: center;
}

html[dir="rtl"] .header-container > .dzm-header-actions {
    justify-content: center;
}

@media (max-width: 700px) {
    .header-container > .header-search {
        flex: 1 1 160px;
        min-width: 130px;
        max-width: none;
    }

    .header-container > .dzm-header-actions {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
        gap: 6px;
    }

    .header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu {
        left: 0;
        right: auto;
    }

    html[dir="rtl"] .header-container > .dzmarket-settings-anchor.dzmarket-in-header .theme-menu {
        right: 0;
        left: auto;
    }
}
