/* Mag back-office — thème AUTO-PIECE ecom */
:root {
    --mag-primary: #f97316;
    --mag-primary-light: #fb923c;
    --mag-primary-dark: #dc2626;
    --mag-accent-bg: #fff7ed;
    --mag-border: #fed7aa;
    --mag-heading: #1a1a1a;
    --mag-muted: #6b7280;
    --mag-gradient: linear-gradient(90deg, #f97316 0%, #dc2626 100%);
    --dash-primary: #f97316;
    --dash-filter-bg: linear-gradient(135deg, #f97316 0%, #ea580c 55%, #dc2626 100%);
}

html:has(body.mag-ecom-body) {
    height: 100%;
}

body.mag-ecom-body {
    min-height: 100%;
    margin: 0;
    background: #fffaf5;
    display: flex;
    flex-direction: column;
}

/* Coque page : header + contenu + footer collés sur toute la hauteur */
body.mag-ecom-body > #wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

#main-content.mag-ecom-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
    background: linear-gradient(180deg, #fffaf5 0%, #f8fafc 45%, #f1f5f9 100%) !important;
    padding-top: 0.65rem;
    padding-bottom: 2rem;
}

#main-content.mag-ecom-main > .container-fluid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding-top: 0.15rem;
}

#main-content.mag-ecom-main .app-page-header {
    flex: 0 0 auto;
}

#main-content.mag-ecom-main > .container-fluid > .row {
    flex: 1 1 auto;
    min-height: 0;
}

/* Cards */
.mag-ecom-body .card {
    border: 1px solid var(--mag-border);
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.08) !important;
    overflow: hidden;
    background: #fff;
}

/* Sidebar mail (catégories, pièces, historique) : visible hors mobile */
@media (min-width: 768px) {
    .mag-ecom-body .mail-inbox .mail-left.collapse,
    .mag-ecom-body .mail-inbox .mail-left.collapse:not(.show) {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    .mag-ecom-body .mobile-left {
        display: none !important;
    }

    .mag-ecom-body .card:has(.mail-inbox) {
        overflow: visible;
    }
}

.mag-ecom-body .card .header {
    background: #fff;
    border-bottom: 1px solid #ffe4cc;
    padding: 1rem 1.25rem;
}

.mag-ecom-body .card .header h2 {
    color: var(--mag-heading);
    font-weight: 700;
    margin: 0;
}

.mag-ecom-body .card .header h2 small {
    color: var(--mag-muted);
    font-weight: 500;
}

.mag-ecom-body .card .body {
    padding: 1rem 1.25rem 1.25rem;
}

/* Buttons */
.mag-ecom-body .btn-primary,
.mag-ecom-body .btn.btn-primary {
    background: var(--mag-primary) !important;
    background-image: none !important;
    border-color: var(--mag-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.mag-ecom-body .btn-primary:hover,
.mag-ecom-body .btn.btn-primary:hover,
.mag-ecom-body .btn-primary:focus,
.mag-ecom-body .btn.btn-primary:focus {
    background: var(--mag-primary-dark) !important;
    border-color: var(--mag-primary-dark) !important;
    color: #fff !important;
}

.mag-ecom-body .btn-warning,
.mag-ecom-body .btn.btn-warning {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #fff !important;
    background-image: none !important;
}

.mag-ecom-body .btn-warning:hover,
.mag-ecom-body .btn.btn-warning:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff !important;
}

.mag-ecom-body .btn-outline-success,
.mag-ecom-body .btn-outline-primary {
    color: #c2410c !important;
    border-color: var(--mag-primary-light) !important;
    background: transparent !important;
}

.mag-ecom-body .btn-outline-success:hover,
.mag-ecom-body .btn-outline-primary:hover {
    background: var(--mag-accent-bg) !important;
    border-color: var(--mag-primary) !important;
    color: #9a3412 !important;
}

.mag-ecom-body .btn-outline-secondary {
    border-color: #fdba74 !important;
    color: #9a3412 !important;
}

.mag-ecom-body .btn-outline-secondary:hover {
    background: var(--mag-accent-bg) !important;
}

/* Alpine data table shell */
.mag-table-shell {
    width: 100%;
}

.mag-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mag-table-search-wrap {
    position: relative;
    flex: 1 1 240px;
    max-width: 420px;
}

.mag-table-search-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.mag-table-search {
    width: 100%;
    height: 42px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--mag-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mag-heading);
    font-size: 0.92rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mag-table-search:focus {
    outline: none;
    border-color: var(--mag-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.mag-table-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mag-muted);
    white-space: nowrap;
}

.mag-table-count strong {
    color: var(--mag-primary-dark);
}

.mag-data-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.mag-data-table thead th {
    background: var(--mag-primary) !important;
    color: #fff !important;
    font-weight: 700;
    border: none !important;
    padding: 0.75rem 0.85rem;
    white-space: nowrap;
    vertical-align: middle;
}

.mag-data-table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

.mag-data-table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

.mag-data-table tbody td,
.mag-data-table tbody th {
    padding: 0.7rem 0.85rem;
    border-color: #ffe4cc !important;
    vertical-align: middle;
    color: #374151;
    background: #fff;
}

.mag-data-table tbody tr:nth-child(even) td,
.mag-data-table tbody tr:nth-child(even) th {
    background: var(--mag-accent-bg);
}

.mag-data-table tbody tr:hover td,
.mag-data-table tbody tr:hover th {
    background: #ffedd5 !important;
}

.mag-data-table tbody tr.is-filtered-out {
    display: none !important;
}

.mag-data-table tfoot td,
.mag-data-table tfoot th {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    font-weight: 700;
    color: var(--mag-primary-dark);
}

.mag-table-empty {
    text-align: center;
    color: var(--mag-muted);
    padding: 1.5rem;
    display: none;
}

.mag-table-empty.is-visible {
    display: block;
}

.mag-data-table a {
    color: var(--mag-primary-dark);
    font-weight: 600;
}

.mag-data-table a:hover {
    color: var(--mag-primary);
}

/* Periode filter modal — ecom colors */
.btn-periode-filter {
    background: var(--dash-filter-bg) !important;
    border: none !important;
    color: #fff !important;
}

body.mag-ecom-body [id$="FilterModal"] .modal-header {
    background: #fff !important;
    color: #1f2937 !important;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

body.mag-ecom-body [id$="FilterModal"] .modal-header .close {
    color: #6b7280 !important;
    text-shadow: none;
}

body.mag-ecom-body [id$="FilterModal"] .modal-title {
    color: #1f2937 !important;
}

.mag-ecom-body .text-primary {
    color: var(--mag-primary) !important;
}

.mag-ecom-body .text-danger {
    color: var(--mag-primary-dark) !important;
}

.mag-ecom-body .text-info {
    color: #ea580c !important;
}

.mag-ecom-body .text-success {
    color: #16a34a !important;
}

.mag-ecom-body .badge-info {
    background: var(--mag-primary) !important;
}

.mag-ecom-body .badge-outline-info {
    background: transparent !important;
    color: var(--mag-primary, #ea580c) !important;
    border: 1px solid var(--mag-primary, #ea580c);
    font-weight: 600;
}

.mag-ecom-body .badge-outline-secondary {
    background: transparent !important;
    color: #6b7280 !important;
    border: 1px solid #9ca3af;
    font-weight: 600;
}

.mag-ecom-body .badge-outline-attente {
    background: transparent !important;
    color: #c45c26 !important;
    border: 1px solid #c45c26;
    font-weight: 600;
}

.mag-ecom-body .badge-outline-livrer {
    background: transparent !important;
    color: #2980b9 !important;
    border: 1px solid #2980b9;
    font-weight: 600;
}

.mag-ecom-body .badge-outline-proforma {
    background: transparent !important;
    color: #b7950b !important;
    border: 1px solid #b7950b;
    font-weight: 600;
}

/* Footer global — toujours en bas, même largeur que le header */
.mag-copyright-area {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    margin-top: auto;
    padding: 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.mag-copyright-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--mag-primary);
}

.mag-copyright-area > .container-fluid {
    max-width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.mag-copyright-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: nowrap;
    min-height: 3.5rem;
    padding: 0.85rem 0;
}

.mag-copyright-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
}

.mag-copyright-mark {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--mag-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.mag-copyright-text {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-copyright-text a {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mag-copyright-text a:hover {
    color: var(--mag-primary);
}

.mag-copyright-rest {
    color: #94a3b8;
}

.mag-copyright-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
    flex-shrink: 0;
}

.mag-copyright-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569 !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mag-copyright-link i {
    color: var(--mag-primary);
    font-size: 0.8rem;
}

.mag-copyright-link:hover {
    background: #fff7ed;
    border-color: #fdba74;
    color: #ea580c !important;
}

.mag-copyright-app {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: #f97316;
    border: 1px solid #f97316;
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mag-copyright-app i {
    font-size: 0.95rem;
}

.mag-copyright-app:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 991px) {
    .mag-copyright-inner {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem 0;
    }

    .mag-copyright-brand {
        flex: 1 1 100%;
        justify-content: center;
    }

    .mag-copyright-text {
        white-space: normal;
    }

    .mag-copyright-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .mag-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .mag-table-search-wrap {
        max-width: none;
    }

    .mag-copyright-area > .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .mag-copyright-link span,
    .mag-copyright-app span {
        display: none;
    }

    .mag-copyright-link,
    .mag-copyright-app {
        padding: 0.5rem 0.7rem;
    }
}

/* Modal Download App (aligné base_ecom / ecom-piece-card) */
.ecom-app-download-modal .modal-dialog {
    max-width: 860px;
    margin: 1.25rem auto;
}

.ecom-app-download-content {
    position: relative;
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.ecom-app-download-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #c2410c;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ecom-app-download-close:hover {
    background: #fff7ed;
    color: #9a3412;
    transform: scale(1.04);
}

.ecom-app-download-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    padding: 0;
    overflow: hidden;
    background-color: #dcdcdc;
}

.ecom-app-download-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 480px;
    max-height: 520px;
    object-fit: cover;
    object-position: 35% center;
}

.ecom-app-download-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 34px 36px;
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 55%);
}

.ecom-app-download-eyebrow {
    margin: 0 0 10px;
    color: #ea580c;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ecom-app-download-title {
    margin: 0 0 14px;
    color: #111827;
    font-size: 2.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.ecom-app-download-text {
    margin: 0 0 24px;
    color: #374151;
    font-size: 1.18rem;
    line-height: 1.6;
}

.ecom-app-download-stores {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
}

.ecom-app-store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ecom-app-store-link:hover {
    border-color: #fdba74;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.15);
    transform: translateY(-1px);
}

.ecom-app-store-link img {
    display: block;
    width: auto;
    height: 48px;
    max-width: 100%;
    object-fit: contain;
}

.ecom-app-download-note {
    margin: 18px 0 0;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.45;
}

@media only screen and (max-width: 991px) {
    .ecom-app-download-modal .modal-dialog {
        max-width: 720px;
    }

    .ecom-app-download-content {
        grid-template-columns: 1.25fr 1fr;
    }

    .ecom-app-download-visual {
        min-height: 400px;
    }

    .ecom-app-download-img {
        min-height: 400px;
    }

    .ecom-app-download-title {
        font-size: 1.75rem;
    }

    .ecom-app-download-text {
        font-size: 1.08rem;
    }
}

@media only screen and (max-width: 767px) {
    .ecom-app-download-content {
        grid-template-columns: 1fr;
    }

    .ecom-app-download-visual {
        min-height: 280px;
    }

    .ecom-app-download-img {
        min-height: 280px;
        object-fit: cover;
        object-position: center top;
    }

    .ecom-app-download-body {
        padding: 26px 20px 24px;
    }

    .ecom-app-download-eyebrow {
        font-size: 0.92rem;
    }

    .ecom-app-download-title {
        font-size: 1.55rem;
    }

    .ecom-app-download-text {
        font-size: 1.08rem;
    }

    .ecom-app-download-stores {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .ecom-app-store-link {
        flex: 1 1 0;
        padding: 6px 8px;
    }

    .ecom-app-store-link img {
        height: 42px;
    }

    .ecom-app-download-note {
        font-size: 0.95rem;
    }
}

/* Panneau Paramètres (setting_div) */
body.mag-ecom-body.h_menu .setting_div.mag-settings-panel {
    width: 300px;
    right: -320px;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #fed7aa;
    box-shadow: -12px 0 32px rgba(15, 23, 42, 0.12);
    overflow-y: auto;
}

body.mag-ecom-body.h_menu .setting_div.mag-settings-panel.open {
    right: 0;
}

.mag-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem 0.95rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fff 70%);
    border-bottom: 1px solid #fed7aa;
}

.mag-settings-header-text h6 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
}

.mag-settings-header-text p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--mag-muted);
}

.mag-settings-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #9a3412;
    background: #fff;
    border: 1px solid #fdba74;
    text-decoration: none !important;
    flex-shrink: 0;
}

.mag-settings-close:hover {
    background: var(--mag-primary);
    border-color: var(--mag-primary);
    color: #fff;
}

.mag-settings-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}

.mag-settings-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--mag-primary), var(--mag-primary-dark));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mag-settings-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mag-settings-user-initials {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.mag-settings-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.mag-settings-user-meta strong {
    font-size: 0.92rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-settings-user-meta > span {
    font-size: 0.75rem;
    color: var(--mag-muted);
}

.mag-settings-local {
    color: var(--mag-primary-dark) !important;
}

.mag-settings-local i {
    margin-right: 0.2rem;
}

.mag-settings-section {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}

.mag-settings-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a3412;
}

.mag-settings-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mag-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: #fffaf5;
    border: 1px solid #ffedd5;
}

.mag-settings-row-label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 0;
}

.mag-settings-row-label > i {
    margin-top: 0.15rem;
    color: var(--mag-primary);
    width: 1rem;
    text-align: center;
}

.mag-settings-row-label strong {
    display: block;
    font-size: 0.84rem;
    color: #1a1a1a;
}

.mag-settings-row-label small {
    display: block;
    font-size: 0.7rem;
    color: var(--mag-muted);
    line-height: 1.3;
}

.mag-settings-panel .toggle-switch {
    flex-shrink: 0;
    margin: 0;
}

.mag-settings-panel .theme-switch input:checked + .toggle-switch-slider,
.mag-settings-panel .theme-high-contrast input:checked + .toggle-switch-slider {
    background: var(--mag-primary);
}

.mag-settings-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mag-settings-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 0.86rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.mag-settings-link i {
    width: 1.1rem;
    text-align: center;
    color: var(--mag-primary);
}

.mag-settings-link:hover {
    background: #fff7ed;
    color: #9a3412 !important;
}

.mag-settings-footer {
    margin-top: auto;
    padding: 1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mag-settings-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c !important;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
}

.mag-settings-logout:hover {
    background: #fee2e2;
}

.mag-settings-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #fdba74;
    background: #fff;
    color: #9a3412 !important;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
}

.mag-settings-close-btn:hover {
    background: #fff7ed;
}

/* ── Sidebar mobile (même langage que panneau Paramètres) ── */
body.mag-ecom-body.h_menu .mag-mobile-menu-user,
body.mag-ecom-body.h_menu .mag-mobile-menu-section-title,
body.mag-ecom-body.h_menu .mag-mobile-menu-header-text,
body.mag-ecom-body.h_menu .mag-mobile-menu-close,
body.mag-ecom-body.h_menu .mag-mobile-menu-logout,
body.mag-ecom-body.h_menu .mag-mobile-menu-close-btn,
body.mag-ecom-body.h_menu .mag-drawer-shortcuts,
body.mag-ecom-body.h_menu .mag-drawer-cathead,
body.mag-ecom-body.h_menu .mag-mobile-menu-brand,
body.mag-ecom-body.h_menu .mag-mobile-menu-header-spacer {
    display: none;
}

@media (max-width: 991px) {
    /* —— Navbar mobile : Logo | cloche | avatar | menu —— */
    body.mag-ecom-body.h_menu header.header {
        padding: 0 !important;
        background: #fff !important;
        border-bottom: 1px solid #fed7aa;
        box-shadow: 0 1px 0 rgba(234, 88, 12, 0.06);
    }

    body.mag-ecom-body.h_menu header .container-fluid {
        padding-left: 0.85rem !important;
        padding-right: 0.75rem !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        float: none !important;
        width: 100% !important;
        min-height: 56px;
        gap: 0.5rem;
        padding: 0.4rem 0;
        position: relative;
    }

    body.mag-ecom-body.h_menu header .desk-menu .logo {
        float: none !important;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        margin: 0 !important;
        order: 1;
    }

    body.mag-ecom-body.h_menu header .desk-menu .logo .logo-ad {
        margin: 0;
        line-height: 1;
        display: flex;
        align-items: center;
    }

    body.mag-ecom-body.h_menu header .desk-menu .logo .ecom-logo-img,
    body.mag-ecom-body.h_menu header .desk-menu .logo .app-logo-img {
        display: block;
        max-height: 34px;
        width: auto;
        max-width: min(150px, 42vw);
        object-fit: contain;
    }

    /* Rôle déjà dans le menu utilisateur / sidebar */
    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions > li.nav-user-role {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions {
        float: none !important;
        order: 2;
        flex: 0 0 auto;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.45rem;
        background: transparent;
        border: 0;
        border-radius: 0;
        list-style: none !important;
        z-index: 3;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions > li {
        float: none !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        position: relative;
        list-style: none !important;
    }

    /* Pas de caret Bootstrap à côté de la cloche / avatar */
    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .dropdown-toggle::after {
        display: none !important;
        content: none !important;
        margin: 0 !important;
        border: 0 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions > li.header-notifications-center > a {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50%;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: #c2410c !important;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        box-sizing: border-box;
        position: relative;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions > li.header-notifications-center > a .fa-bell {
        font-size: 1rem !important;
        color: #ea580c !important;
        line-height: 1;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .notification-count-badge {
        top: -2px !important;
        right: -2px !important;
        min-width: 16px;
        height: 16px;
        font-size: 0.62rem;
        line-height: 16px;
        padding: 0 4px;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions > li.nav-user-profile {
        margin: 0 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-trigger {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50%;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        box-sizing: border-box;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-chevron {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-avatar-wrap {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 32px;
        height: 32px;
        margin: 0;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-avatar,
    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-avatar--initials {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.72rem;
        margin: 0;
    }

    body.mag-ecom-body.h_menu header .desk-menu .header-nav-actions .nav-user-status-dot {
        width: 8px;
        height: 8px;
        right: -1px;
        bottom: -1px;
    }

    body.mag-ecom-body.h_menu header .desk-menu .box-menu {
        float: none !important;
        order: 3;
        flex: 0 0 auto;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        align-self: center !important;
        height: 40px;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu {
        float: none !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 50%;
        border: 1px solid #fed7aa;
        background: #fff7ed;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 0 0 0.45rem !important;
        padding: 0 !important;
        box-shadow: none;
        flex: 0 0 auto;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        box-sizing: border-box;
        cursor: pointer;
        line-height: 0;
        overflow: hidden;
    }

    /* Recentrer les 3 barres (annule translateY(25px) de h-menu.css) */
    body.mag-ecom-body.h_menu header .hamburger-menu .bar,
    body.mag-ecom-body.h_menu header .hamburger-menu .bar::before,
    body.mag-ecom-body.h_menu header .hamburger-menu .bar::after {
        width: 18px !important;
        height: 2px !important;
        background: #ea580c !important;
        border-radius: 2px;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar {
        position: relative !important;
        display: block !important;
        margin: 0 auto !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        -webkit-transform: none !important;
        transition: background 0.15s ease;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar::before,
    body.mag-ecom-body.h_menu header .hamburger-menu .bar::after {
        position: absolute !important;
        left: 0 !important;
        content: '' !important;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar::before {
        bottom: 6px !important;
        top: auto !important;
        transform: none !important;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar::after {
        top: 6px !important;
        bottom: auto !important;
        transform: none !important;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar.animate {
        background: transparent !important;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar.animate::before {
        bottom: 0 !important;
        transform: rotate(-45deg) !important;
    }

    body.mag-ecom-body.h_menu header .hamburger-menu .bar.animate::after {
        top: 0 !important;
        transform: rotate(45deg) !important;
    }

    body.mag-ecom-body.h_menu .nav-user-menu {
        position: fixed !important;
        top: 60px !important;
        right: 12px !important;
        left: auto !important;
        width: min(300px, calc(100vw - 24px)) !important;
        max-width: none !important;
        transform: none !important;
        margin: 0;
        z-index: 1080;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu {
        width: min(320px, 88vw) !important;
        left: -340px !important;
        right: auto !important;
        top: 0 !important;
        padding: 0 !important;
        padding-top: env(safe-area-inset-top, 0px);
        background: #fff !important;
        border-right: 1px solid #e5e7eb;
        border-left: 0 !important;
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.12);
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column;
        overflow: hidden !important;
        z-index: 1100 !important;
        isolation: isolate;
        transition: left 0.28s ease;
    }

    body.mag-ecom-body.h_menu.open-menu header .desk-menu .menu-container.mag-mobile-menu,
    body.mag-ecom-body.h_menu.open-menu header .desk-menu .menu-container.mag-mobile-menu {
        left: 0 !important;
        right: auto !important;
    }

    /* Navbar ne doit plus se superposer au panneau (comme Paramètres) */
    body.mag-ecom-body.h_menu.open-menu header,
    body.mag-ecom-body.h_menu.open-menu header {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        z-index: 1095 !important;
        pointer-events: none !important;
    }

    body.mag-ecom-body.h_menu.open-menu header .desk-menu .menu-container.mag-mobile-menu,
    body.mag-ecom-body.h_menu.open-menu header .desk-menu .menu-container.mag-mobile-menu {
        pointer-events: auto !important;
    }

    body.mag-ecom-body.h_menu.open-menu header .logo,
    body.mag-ecom-body.h_menu.open-menu header .header-nav-actions,
    body.mag-ecom-body.h_menu.open-menu header .hamburger-menu,
    body.mag-ecom-body.h_menu.open-menu header .logo,
    body.mag-ecom-body.h_menu.open-menu header .header-nav-actions,
    body.mag-ecom-body.h_menu.open-menu header .hamburger-menu {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    body.mag-ecom-body.h_menu.open-menu .over-menu,
    body.mag-ecom-body.h_menu.open-menu .over-menu {
        z-index: 1090 !important;
        pointer-events: auto;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-head.mag-mobile-menu-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.85rem 1rem !important;
        background: #fff !important;
        border-bottom: 1px solid #e5e7eb;
        color: inherit !important;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-header-text {
        display: none !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-brand {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-logo {
        display: block;
        height: 36px;
        width: auto;
        max-width: 160px;
        object-fit: contain;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-header-spacer {
        display: block !important;
        width: 36px;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-close {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 0;
        color: #111827 !important;
        background: transparent;
        border: 0;
        font-size: 1.15rem;
        text-decoration: none !important;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-close:hover {
        background: transparent;
        color: #f97316 !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user {
        display: none !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: linear-gradient(135deg, var(--mag-primary, #ea580c), var(--mag-primary-dark, #c2410c));
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-initials {
        color: #fff;
        font-size: 0.85rem;
        font-weight: 700;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-meta {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 0.1rem;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-meta strong {
        font-size: 0.92rem;
        color: #1a1a1a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-user-meta > span {
        font-size: 0.75rem;
        color: var(--mag-muted, #6b7280);
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-local {
        color: var(--mag-primary-dark, #c2410c) !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-local i {
        margin-right: 0.2rem;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-header-container {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.9rem 1.15rem 0.5rem;
        float: none !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #fdba74 transparent;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-header-container::-webkit-scrollbar {
        width: 6px;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-header-container::-webkit-scrollbar-thumb {
        background: #fdba74;
        border-radius: 999px;
    }

    body.mag-ecom-body.h_menu .mag-drawer-shortcuts {
        display: flex !important;
        flex-direction: column;
        margin: 0 -1.15rem 0.25rem;
        padding: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    body.mag-ecom-body.h_menu .mag-drawer-toplink {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.95rem 1.15rem;
        color: #9ca3af !important;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-decoration: none !important;
        border-bottom: 1px solid #f3f4f6;
    }

    body.mag-ecom-body.h_menu .mag-drawer-toplink i {
        color: #d1d5db;
        font-size: 1rem;
    }

    body.mag-ecom-body.h_menu .mag-drawer-iconrow {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.85rem 1.15rem;
        color: #111827 !important;
        font-size: 0.95rem;
        font-weight: 500;
        text-decoration: none !important;
    }

    body.mag-ecom-body.h_menu .mag-drawer-iconrow i {
        width: 22px;
        text-align: center;
        color: #6b7280;
        font-size: 1.05rem;
    }

    body.mag-ecom-body.h_menu .mag-drawer-cathead {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 0 0.35rem;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-section-title {
        display: block !important;
        margin: 0;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #9ca3af;
    }

    body.mag-ecom-body.h_menu .mag-nav-dashboard-item {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-header-container ul {
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        gap: 0;
        list-style: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu ul,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu li {
        list-style: none !important;
        list-style-type: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu ul::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu ul::after,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu li::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container.mag-mobile-menu li::marker {
        content: none !important;
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li {
        width: 100%;
        float: none !important;
        margin: 0 !important;
        border: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li > a {
        display: flex !important;
        align-items: center;
        gap: 0.7rem;
        padding: 0.85rem 0.15rem !important;
        border-radius: 0 !important;
        border: 0 !important;
        border-bottom: 0 !important;
        color: #111827 !important;
        text-decoration: none !important;
        font-size: 0.95rem;
        font-weight: 500;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li > a > i:not(.mag-nav-parent-chevron) {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: auto;
        margin-right: 0 !important;
        border-radius: 0;
        background: transparent;
        color: #6b7280 !important;
        border: 0;
        font-size: 1.05rem;
        flex-shrink: 0;
        text-align: center;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li > a:hover,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li:hover > a,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.active > a {
        background: transparent !important;
        color: #111827 !important;
        border-color: transparent !important;
        box-shadow: none;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li > a:hover > i:not(.mag-nav-parent-chevron),
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.active > a > i:not(.mag-nav-parent-chevron) {
        background: transparent;
        border-color: transparent;
        color: #f97316 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children > a::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children > a::after {
        display: none !important;
        content: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children > a .mag-nav-parent-chevron {
        margin-left: auto;
        font-size: 0.72rem;
        color: #9ca3af;
        transition: transform 0.2s ease;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children.is-expanded > a .mag-nav-parent-chevron {
        transform: rotate(180deg);
        color: #f97316;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu {
        display: none !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 0 0.35rem 2rem !important;
        z-index: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        float: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children.is-expanded > .sub-menu {
        display: block !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu .mag-nav-dropdown-header,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu li.back {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu::-webkit-scrollbar {
        width: 6px;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu::-webkit-scrollbar-thumb {
        background: #fdba74;
        border-radius: 999px;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu .mag-nav-dropdown-list {
        list-style: none !important;
        margin: 0 !important;
        padding-left: 0 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu .mag-nav-dropdown-list {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li.mag-nav-dropdown-item,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li.back {
        list-style: none !important;
    }

    /* Liens sous-menu mobile = même carte que le dropdown navbar desktop */
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link {
        display: flex !important;
        align-items: center;
        gap: 0.7rem;
        padding: 0.55rem 0.25rem !important;
        border-radius: 0 !important;
        border: 0 !important;
        color: #4b5563 !important;
        font-size: 0.9rem;
        font-weight: 500;
        line-height: 1.35;
        text-decoration: none !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        position: relative;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a::after {
        display: none !important;
        content: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link .mag-nav-dropdown-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
        border-radius: 9px;
        background: #fff;
        color: var(--mag-primary, #ea580c);
        border: 1px solid #ffedd5;
        flex-shrink: 0;
        position: relative;
        overflow: visible;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown li > a.mag-nav-dropdown-link .mag-nav-dropdown-icon i,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a i {
        position: static !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        float: none !important;
        line-height: 1 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link:hover,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link.is-active,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li.active > a.mag-nav-dropdown-link,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a:hover,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li.active > a {
        background: #fff7ed !important;
        color: #9a3412 !important;
        border-color: #fdba74 !important;
        box-shadow: 0 6px 16px rgba(249, 115, 22, 0.12);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link.is-active {
        box-shadow: inset 3px 0 0 var(--mag-primary, #ea580c), 0 4px 12px rgba(249, 115, 22, 0.1);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link:hover .mag-nav-dropdown-icon,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li > a.mag-nav-dropdown-link.is-active .mag-nav-dropdown-icon {
        background: var(--mag-primary, #ea580c);
        border-color: var(--mag-primary, #ea580c);
        color: #fff;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu li.back > a {
        background: #fff7ed !important;
        border-color: #fed7aa !important;
        color: #9a3412 !important;
        font-weight: 600;
        margin-bottom: 0.35rem;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu li.back a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        margin-bottom: 0.5rem;
        padding: 0.55rem 0.75rem !important;
        border-radius: 8px;
        border: 1px solid #fdba74 !important;
        background: #fff !important;
        color: #9a3412 !important;
        font-size: 0.86rem;
        font-weight: 600;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu li.back a::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu li.back a::after {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu-foot.mag-mobile-menu-footer {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: auto;
        padding: 1rem 1.15rem 1.25rem !important;
        background: #fff !important;
        border-top: 1px solid #f1f5f9;
        position: relative !important;
        bottom: auto !important;
        width: 100%;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-logout {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        padding: 0.55rem 0.75rem;
        border-radius: 8px;
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #b91c1c !important;
        font-size: 0.86rem;
        font-weight: 600;
        text-decoration: none !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-logout:hover {
        background: #fee2e2;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.55rem 0.75rem;
        border-radius: 8px;
        border: 1px solid #fdba74;
        background: #fff;
        color: #9a3412 !important;
        font-size: 0.86rem;
        font-weight: 600;
        text-decoration: none !important;
    }

    body.mag-ecom-body.h_menu .mag-mobile-menu-close-btn:hover {
        background: #fff7ed;
    }
}

/* Zones de livraison — aperçu */
.zones-page {
    display: block !important; /* annule row-deck flex qui réduit la largeur */
    flex: 0 0 100%;
    width: 100% !important;
    max-width: 100% !important;
}

.zones-layout {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    align-items: start;
}

.zones-overview {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

.zones-card {
    width: 100%;
    min-width: 0;
}

.zones-stat-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.zones-stat {
    width: 100%;
    appearance: none;
    text-align: left;
    background: #fff;
    border: 1px solid var(--mag-border);
    border-radius: 14px;
    padding: 1rem 1.05rem;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.06);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.zones-stat:hover {
    border-color: #fdba74;
    background: #fffaf5;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.12);
    transform: translateY(-1px);
}

.zones-stat.is-active {
    border-color: var(--mag-primary);
    background: linear-gradient(135deg, #fff7ed 0%, #fff 70%);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16), 0 8px 20px rgba(249, 115, 22, 0.12);
}

.zones-stat-icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffedd5;
    color: #c2410c;
    font-size: 1.05rem;
}

.zones-stat.is-active .zones-stat-icon {
    background: var(--mag-primary);
    color: #fff;
}

.zones-stat-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.zones-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mag-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.zones-stat-label em {
    font-style: normal;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #ea580c;
    opacity: 0.9;
}

.zones-stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--mag-heading);
    line-height: 1.1;
}

.zones-stat.is-active .zones-stat-value {
    color: #9a3412;
}

.zones-stat-connector {
    align-self: center;
    color: #fdba74;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1;
}

.zones-stat-hint {
    margin-top: 0;
    font-size: 0.86rem;
    color: var(--mag-muted);
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--mag-border);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.06);
    line-height: 1.45;
}

.zones-stat-hint-link {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: #c2410c;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.zones-stat-hint-link:hover {
    color: #9a3412;
}

.zones-card-header {
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.zones-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
}

.zones-tab {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mag-muted);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.65rem 1rem;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.zones-tab:hover {
    color: var(--mag-primary-dark);
    background: var(--mag-accent-bg);
}

.zones-tab.is-active {
    color: var(--mag-primary-dark);
    background: #fff;
    border-color: #ffe4cc;
    border-bottom-color: #fff;
    box-shadow: 0 -2px 0 var(--mag-primary) inset;
}

.zones-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 0.75rem;
    font-weight: 700;
}

.zones-tab.is-active .zones-tab-count {
    background: var(--mag-primary);
    color: #fff;
}

.zones-add-form {
    background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
    border: 1px solid #ffe4cc;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}

.zones-add-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mag-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.zones-add-grid {
    display: grid;
    gap: 0.75rem 1rem;
    align-items: end;
}

.zones-add-grid--pays {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
}

.zones-add-grid--ville {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto;
}

.zones-add-grid--commune {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) auto;
}

.zones-add-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.3rem;
}

.zones-add-actions .btn {
    white-space: nowrap;
    min-height: 38px;
}

.zones-edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.zones-edit-form--ville {
    min-width: 280px;
}

.zones-code-input {
    max-width: 90px;
}

.zones-frais-input {
    max-width: 110px;
}

.zones-code {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 700;
    font-size: 0.82rem;
}

.zones-frais {
    font-weight: 700;
    color: var(--mag-heading);
    white-space: nowrap;
}

.zones-ville-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.25;
}

.zones-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

@media (max-width: 991.98px) {
    .zones-overview {
        position: static;
    }

    .zones-stat-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 0.5rem;
    }

    .zones-stat {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 140px;
    }

    .zones-stat-connector {
        display: none;
    }

    .zones-add-grid--pays,
    .zones-add-grid--ville,
    .zones-add-grid--commune {
        grid-template-columns: 1fr;
    }

    .zones-add-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .zones-stat {
        flex: 1 1 100%;
    }

    .zones-tab {
        flex: 1 1 auto;
        justify-content: center;
        border-radius: 10px;
    }

    .zones-tab.is-active {
        border-bottom-color: #ffe4cc;
        box-shadow: none;
        border-color: var(--mag-primary);
        background: var(--mag-accent-bg);
    }
}

/* Toggle actif/inactif : fond semi-transparent (comptes, stock, etc.) */
.toggle-switch .toggle-switch-slider.bg-success {
    background-color: rgba(40, 167, 69, 0.4) !important;
    border-color: rgba(40, 167, 69, 0.55) !important;
}

.toggle-switch .toggle-switch-slider.bg-danger {
    background-color: rgba(220, 53, 69, 0.4) !important;
    border-color: rgba(220, 53, 69, 0.55) !important;
}

/* Icônes du dropdown : rester dans le carré (annule h-menu.css absolute right) */
body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown li > a.mag-nav-dropdown-link .mag-nav-dropdown-icon > i,
body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link .mag-nav-dropdown-icon > i,
body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-header-icon > i {
    position: static !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    float: none !important;
    line-height: 1 !important;
}

/* ── Navbar : menus déroulants (Stocks, Interfaces, Listes…) ── */
@media (min-width: 992px) {
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.mag-nav-item {
        position: relative;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li > a.mag-nav-single-link,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link {
        display: inline-flex !important;
        align-items: center;
        gap: 0.45rem;
        padding: 0.65rem 0.9rem !important;
        font-weight: 600;
        font-size: 0.88rem;
        letter-spacing: 0.01em;
        color: #475569 !important;
        border-radius: 999px;
        border: 1px solid transparent;
        text-decoration: none !important;
        transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li > a.mag-nav-single-link > i,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link > i:first-child {
        color: var(--mag-primary, #ea580c);
        font-size: 0.95rem;
        margin-right: 0;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link .mag-nav-parent-chevron {
        font-size: 0.58rem;
        color: #94a3b8;
        margin-left: 0.1rem;
        transition: transform 0.22s ease, color 0.18s ease;
    }

    /* Badge compteur commandes en ligne (Interfaces + sous-menu) */
    body.mag-ecom-body.h_menu .mag-nav-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.1rem;
        height: 1.1rem;
        padding: 0 0.28rem;
        border-radius: 999px;
        background: #dc2626;
        color: #fff;
        font-size: 0.62rem;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0;
        box-shadow: 0 0 0 2px #fff;
        vertical-align: middle;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-nav-badge[hidden] {
        display: none !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link .mag-nav-badge {
        position: absolute;
        top: 0.15rem;
        right: 0.35rem;
        min-width: 1rem;
        height: 1rem;
        font-size: 0.58rem;
        padding: 0 0.22rem;
        box-shadow: 0 0 0 1.5px #fff;
        pointer-events: none;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link {
        position: relative;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-icon--badge {
        position: relative;
    }

    body.mag-ecom-body.h_menu .mag-nav-badge--sm {
        position: absolute;
        top: -0.35rem;
        right: -0.4rem;
        min-width: 0.95rem;
        height: 0.95rem;
        font-size: 0.55rem;
        padding: 0 0.2rem;
        box-shadow: 0 0 0 1.5px #fff;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li > a.mag-nav-single-link:hover,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children:hover > a.mag-nav-parent-link,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link:hover {
        color: #9a3412 !important;
        background: #fff7ed !important;
        border-color: #fed7aa !important;
        box-shadow: 0 4px 14px rgba(249, 115, 22, 0.12);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children:hover > a.mag-nav-parent-link .mag-nav-parent-chevron {
        color: var(--mag-primary, #ea580c);
        transform: rotate(180deg);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link::before,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children > a.mag-nav-parent-link::after {
        display: none !important;
    }

    /* Pont invisible pour garder le hover entre parent et panneau */
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.mag-nav-item::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 14px;
        z-index: 1054;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown {
        display: flex !important;
        flex-direction: column;
        width: min(320px, 92vw) !important;
        min-width: 280px !important;
        max-height: min(70vh, 520px);
        left: 50% !important;
        right: auto !important;
        float: none !important;
        margin-top: 10px;
        padding: 0 !important;
        border: 1px solid #fed7aa !important;
        border-radius: 16px !important;
        background: #fff !important;
        box-shadow:
            0 22px 50px rgba(15, 23, 42, 0.16),
            0 8px 20px rgba(249, 115, 22, 0.08) !important;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-50%) translateY(10px) scale(0.98);
        transform-origin: top center;
        transition:
            opacity 0.22s ease,
            transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
            visibility 0.22s ease;
        z-index: 1055;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown--wide {
        width: min(520px, 94vw) !important;
        min-width: 420px !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown::before {
        content: '';
        position: absolute;
        top: -7px;
        left: 50%;
        width: 14px;
        height: 14px;
        background: #fffaf5;
        border-top: 1px solid #fed7aa;
        border-left: 1px solid #fed7aa;
        transform: translateX(-50%) rotate(45deg);
        z-index: 1;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children:hover .sub-menu.mag-nav-dropdown,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown:hover {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header,
    body.mag-ecom-body.h_menu .mag-nav-dropdown-body {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header {
        pointer-events: none;
        position: relative;
        z-index: 2;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header-inner {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        padding: 0.95rem 1rem 0.85rem;
        background: linear-gradient(180deg, #fffaf5 0%, #fff 100%);
        border-bottom: 1px solid #ffedd5;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
        color: #fff;
        flex-shrink: 0;
        font-size: 1rem;
        box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header-text {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        min-width: 0;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header-text strong {
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.25;
        color: #1e293b;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-header-text span {
        font-size: 0.72rem;
        font-weight: 500;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.65rem;
        background: #fff;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #fdba74 transparent;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-body::-webkit-scrollbar {
        width: 6px;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-body::-webkit-scrollbar-thumb {
        background: #fdba74;
        border-radius: 999px;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown--wide .mag-nav-dropdown-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-item {
        width: 100%;
        margin: 0;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link {
        display: flex !important;
        align-items: center;
        gap: 0.7rem;
        padding: 0.7rem 0.75rem !important;
        color: #334155 !important;
        font-size: 0.84rem;
        font-weight: 500;
        line-height: 1.35;
        text-decoration: none !important;
        background: #f8fafc !important;
        border: 1px solid #f1f5f9 !important;
        border-radius: 12px !important;
        transition:
            background 0.15s ease,
            color 0.15s ease,
            border-color 0.15s ease,
            transform 0.15s ease,
            box-shadow 0.15s ease;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 9px;
        background: #fff;
        color: var(--mag-primary, #ea580c);
        border: 1px solid #ffedd5;
        flex-shrink: 0;
        font-size: 0.82rem;
        position: relative;
        overflow: visible;
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    /* Annule h-menu.css qui place les <i> du sous-menu à droite */
    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown li > a.mag-nav-dropdown-link i,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link i,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-header-icon i {
        position: static !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        float: none !important;
        line-height: 1 !important;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-label {
        flex: 1;
        min-width: 0;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link:hover,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link.is-active {
        background: #fff7ed !important;
        color: #9a3412 !important;
        border-color: #fdba74 !important;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(249, 115, 22, 0.12);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link.is-active {
        box-shadow: inset 3px 0 0 var(--mag-primary, #ea580c), 0 4px 12px rgba(249, 115, 22, 0.1);
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link:hover .mag-nav-dropdown-icon,
    body.mag-ecom-body.h_menu header .desk-menu .menu-header-container .menu > li.menu-item-has-children .sub-menu.mag-nav-dropdown .mag-nav-dropdown-link.is-active .mag-nav-dropdown-icon {
        background: var(--mag-primary, #ea580c);
        border-color: var(--mag-primary, #ea580c);
        color: #fff;
    }
}

/* Mobile : panneau latéral — badges + cartes (aligné navbar) */
@media (max-width: 991px) {
    body.mag-ecom-body.h_menu .mag-nav-dropdown-header {
        display: none !important;
    }

    body.mag-ecom-body.h_menu .mag-nav-parent-chevron {
        display: inline-block !important;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-body {
        padding: 0;
        list-style: none !important;
        flex: none;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-list {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children > a.mag-nav-parent-link {
        position: relative;
    }

    body.mag-ecom-body.h_menu header .desk-menu .menu-container .menu > li.menu-item-has-children > a.mag-nav-parent-link .mag-nav-badge {
        position: absolute;
        top: 0.35rem;
        right: 0.85rem;
        min-width: 1rem;
        height: 1rem;
        font-size: 0.55rem;
    }

    body.mag-ecom-body.h_menu .mag-nav-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.1rem;
        height: 1.1rem;
        padding: 0 0.28rem;
        border-radius: 999px;
        background: #dc2626;
        color: #fff;
        font-size: 0.62rem;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 0 0 2px #fff;
        flex-shrink: 0;
    }

    body.mag-ecom-body.h_menu .mag-nav-badge[hidden] {
        display: none !important;
    }

    body.mag-ecom-body.h_menu .mag-nav-dropdown-icon--badge {
        position: relative;
    }

    body.mag-ecom-body.h_menu .mag-nav-badge--sm {
        position: absolute;
        top: -0.3rem;
        right: -0.35rem;
        min-width: 0.95rem;
        height: 0.95rem;
        font-size: 0.55rem;
        padding: 0 0.2rem;
    }
}

/* Flash messages Django — mini modals (même style que ecom / pbholdingsite) */
body.mag-ecom-body .ecom-flash-stack {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 24px));
    pointer-events: none;
}

body.mag-ecom-body .ecom-flash-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    animation: magFlashIn 0.28s ease;
    text-align: left;
}

body.mag-ecom-body .ecom-flash-toast.is-leaving {
    animation: magFlashOut 0.3s ease forwards;
}

body.mag-ecom-body .ecom-flash-toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}

body.mag-ecom-body .ecom-flash-toast-text {
    flex: 1;
    margin: 0;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

body.mag-ecom-body .ecom-flash-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -4px -4px 0 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

body.mag-ecom-body .ecom-flash-toast-close:hover {
    color: #111827;
    background: rgba(15, 23, 42, 0.06);
}

body.mag-ecom-body .ecom-flash-toast--success {
    background: #f0fdf4;
    border-color: #86efac;
}

body.mag-ecom-body .ecom-flash-toast--success .ecom-flash-toast-icon {
    color: #16a34a;
}

body.mag-ecom-body .ecom-flash-toast--error,
body.mag-ecom-body .ecom-flash-toast--danger {
    background: #fef2f2;
    border-color: #fca5a5;
}

body.mag-ecom-body .ecom-flash-toast--error .ecom-flash-toast-icon,
body.mag-ecom-body .ecom-flash-toast--danger .ecom-flash-toast-icon {
    color: #dc2626;
}

body.mag-ecom-body .ecom-flash-toast--warning {
    background: #fffbeb;
    border-color: #fcd34d;
}

body.mag-ecom-body .ecom-flash-toast--warning .ecom-flash-toast-icon {
    color: #d97706;
}

body.mag-ecom-body .ecom-flash-toast--info {
    background: #eff6ff;
    border-color: #93c5fd;
}

body.mag-ecom-body .ecom-flash-toast--info .ecom-flash-toast-icon {
    color: #2563eb;
}

@keyframes magFlashIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes magFlashOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 575px) {
    body.mag-ecom-body .ecom-flash-stack {
        top: 8px;
        width: calc(100vw - 16px);
    }

    body.mag-ecom-body .ecom-flash-toast {
        padding: 12px;
    }

    body.mag-ecom-body .ecom-flash-toast-text {
        font-size: 0.95rem;
    }
}

/* ── Accès interdit (page + modal) ── */
body.access-denied-standalone {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(254, 226, 226, 0.55), transparent 65%),
        #f1f5f9;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.access-denied-standalone .access-denied-modal {
    position: fixed;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
}

body.access-denied-standalone .access-denied-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.35) !important;
}

.access-denied-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(62vh, 520px);
    padding: 1.5rem 1rem 2.5rem;
}

.access-denied-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 2.25rem 1.75rem 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(254, 226, 226, 0.85), transparent 70%),
        #fff;
    border: 1px solid #fecaca;
    border-radius: 20px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 16px 40px rgba(220, 38, 38, 0.08);
}

.access-denied-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.25rem;
    height: 4.25rem;
    margin-bottom: 1.1rem;
    border-radius: 18px;
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 1.65rem;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
}

.access-denied-card__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f87171;
}

.access-denied-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.55rem;
    font-weight: 700;
    color: #991b1b;
    letter-spacing: -0.02em;
}

.access-denied-card__message {
    margin: 0 0 0.5rem;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #475569;
}

.access-denied-card__hint {
    margin: 0 0 1.5rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #94a3b8;
}

.access-denied-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.access-denied-btn--logout {
    background: #0f172a;
    color: #fff !important;
    border: 1px solid #0f172a;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.access-denied-btn--logout:hover,
.access-denied-btn--logout:focus {
    background: #1e293b;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.access-denied-modal .modal-dialog {
    max-width: 420px;
}

.access-denied-modal__content {
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(254, 202, 202, 0.5);
}

.access-denied-modal__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1.15rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.access-denied-modal__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.access-denied-modal__header-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.access-denied-modal__body {
    padding: 1.75rem 1.5rem 1.15rem;
    text-align: center;
    background: #fff;
}

.access-denied-modal__lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 1.55rem;
}

.access-denied-modal__heading {
    margin: 0 0 0.45rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #991b1b;
}

.access-denied-modal__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f87171;
}

.access-denied-modal__text {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #64748b;
}

.access-denied-modal__hint {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #94a3b8;
}

.access-denied-modal__footer {
    display: flex;
    justify-content: center;
    padding: 0.35rem 1.5rem 1.5rem;
    background: #fff;
    border-top: none;
}

.access-denied-backdrop {
    background: rgba(15, 23, 42, 0.55) !important;
}

body.modal-open .access-denied-page {
    filter: blur(1px);
}

/* Liste pièces — filtres sous-catégories */
.piece-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
    width: 100%;
    padding-bottom: 0.35rem;
}
.piece-list-head__copy {
    flex: 1 1 220px;
    min-width: 0;
}
.piece-list-head__copy h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1c1917;
}
.piece-list-head__meta {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #78716c;
}
.piece-list-head__thumb {
    flex: 0 0 auto;
    width: 168px;
    height: 88px;
    border-radius: 12px;
    border: 1px solid #fed7aa;
    background: #fff7ed center / cover no-repeat;
    box-shadow: 0 6px 16px rgba(194, 65, 12, 0.08);
}
.scat-filter {
    flex: 1 0 100%;
    margin-top: 0.15rem;
    padding: 0.7rem 0.85rem 0.8rem;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}
.scat-filter__label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c2410c;
}
.scat-filter__label i {
    color: #f97316;
}
.scat-filter__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.scat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #fdba74;
    background: #fff;
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.scat-chip:hover,
.scat-chip:focus {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fb923c;
}
.scat-chip.is-active {
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.28);
}
.scat-chip.is-active:hover,
.scat-chip.is-active:focus {
    background: #ea580c;
    color: #fff;
}
.scat-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #ffedd5;
    color: #c2410c;
}
.scat-chip.is-active .scat-chip__count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.scat-pill {
    display: inline-flex;
    align-items: center;
    max-width: 14rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scat-pill--empty {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    font-weight: 500;
}
.mf-field--sous select {
    border-radius: 10px;
    border-color: #fed7aa;
    background: #fffaf5;
}

@media (max-width: 767px) {
    .piece-list-head__thumb {
        width: 120px;
        height: 68px;
    }
    .scat-filter__chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}
