/* DMU Fast Order — styles du drawer de commande rapide */

/* ── Bouton déclencheur ── */
.ps-dmufastorder .header-block__action-btn {
    background: none;
    border: none;
}
.ps-dmufastorder .dmu-picto-wrapper {
    position: relative;
    display: inline-flex;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.ps-dmufastorder .dmu-picto-wrapper .header-block__img {
    position: absolute;
    top: 0;
    left: 0;
}
.ps-dmufastorder .dmu-picto-hover {
    opacity: 0;
}
.ps-dmufastorder .header-block__action-btn:hover .dmu-picto-default {
    opacity: 0;
}
.ps-dmufastorder .header-block__action-btn:hover .dmu-picto-hover {
    opacity: 1;
}

/* ── Overlay ── */
.dmu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    animation: dmu-fade-in 0.2s ease;
}

@keyframes dmu-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Drawer ── */
.dmu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dmu-drawer.is-open {
    transform: translateX(0);
}

/* ── Header ── */
.dmu-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.dmu-drawer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #2d2d2d;
}
.dmu-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.dmu-drawer-close:hover {
    background: #f0f0f0;
    color: #2d2d2d;
}

/* ── Body ── */
.dmu-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Toast succès ── */
.dmu-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e6f4ea;
    border: 1px solid #34a853;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.875rem;
    color: #1b5e20;
    flex-wrap: wrap;
}
.dmu-toast-icon {
    display: flex;
    align-items: center;
    color: #34a853;
    flex-shrink: 0;
}
.dmu-toast-text {
    flex: 1;
}
.dmu-toast-link {
    color: #1b5e20;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.dmu-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #1b5e20;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.7;
}
.dmu-toast-close:hover {
    opacity: 1;
}

/* ── Récapitulatif d'erreurs ── */
.dmu-errors {
    background: #fdecea;
    border: 1px solid #e53935;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.8rem;
    color: #b71c1c;
}
.dmu-errors ul {
    margin: 0;
    padding: 0 0 0 18px;
}
.dmu-errors li {
    margin-bottom: 4px;
}
.dmu-errors li:last-child {
    margin-bottom: 0;
}

/* ── Onglets ── */
.dmu-tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    gap: 0;
}
.dmu-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    transition: color 0.15s, border-color 0.15s;
}
.dmu-tab:hover {
    color: #2d2d2d;
}
.dmu-tab.active {
    color: #2d2d2d;
    border-bottom-color: #2d2d2d;
}

/* ── Panneaux ── */
.dmu-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Lignes de saisie manuelle ── */
.dmu-lines-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dmu-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.dmu-line-ref-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}
.dmu-ref-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.dmu-ref-input:focus {
    border-color: #2d2d2d;
}
.dmu-ref-input[readonly] {
    background: #f5f5f5;
    cursor: default;
}
.dmu-qty-input {
    width: 72px;
    flex-shrink: 0;
    padding: 8px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.dmu-qty-input:focus {
    border-color: #2d2d2d;
}
.dmu-line-remove {
    width: 32px;
    height: 36px;
    flex-shrink: 0;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #999;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}
.dmu-line-remove:hover {
    background: #fdecea;
    border-color: #e53935;
    color: #e53935;
}
.dmu-unlock-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
}
.dmu-unlock-btn:hover {
    color: #2d2d2d;
    background: #f0f0f0;
}

/* ── Autocomplétion ── */
.dmu-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}
.dmu-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.1s;
}
.dmu-autocomplete-item:hover {
    background: #f5f5f5;
}
.dmu-ac-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.dmu-ac-no-thumb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #f0f0f0;
    border-radius: 3px;
}
.dmu-ac-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dmu-ac-name {
    font-weight: 500;
    color: #2d2d2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dmu-ac-no-results {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dmu-ac-no-results__title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2d2d2d;
}
.dmu-ac-no-results__hint {
    font-size: 0.75rem;
    color: #888;
}
.dmu-ac-combination {
    color: #444;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dmu-ac-ref {
    color: #888;
}
mark.dmu-highlight {
    background: #fff3cd;
    color: inherit;
    padding: 0;
    border-radius: 2px;
}

/* ── Bouton "Ajouter une ligne" ── */
.dmu-add-line-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed #aaa;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    font-size: 0.8rem;
    padding: 6px 12px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    align-self: flex-start;
}
.dmu-add-line-btn:hover {
    background: #f5f5f5;
    border-color: #666;
    color: #2d2d2d;
}

/* ── Import CSV ── */
.dmu-csv-help {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
}
.dmu-csv-help code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}
.dmu-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #2d2d2d;
    text-decoration: underline;
    cursor: pointer;
}
.dmu-download-link:hover {
    opacity: 0.7;
}
.dmu-file-upload {
    position: relative;
}
.dmu-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.dmu-file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #2d2d2d;
    transition: background 0.15s, border-color 0.15s;
}
.dmu-file-label:hover {
    background: #ebebeb;
    border-color: #aaa;
}
.dmu-file-input:focus-visible + .dmu-file-label {
    outline: 2px solid #2d2d2d;
    outline-offset: 2px;
}

/* ── Comportement panier ── */
.dmu-cart-behavior {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 14px;
    margin-top: auto;
}
.dmu-cart-behavior-legend {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 4px;
}
.dmu-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #2d2d2d;
    cursor: pointer;
    margin-top: 8px;
}
.dmu-radio-label:first-of-type {
    margin-top: 6px;
}

/* ── Footer + bouton soumettre ── */
.dmu-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.dmu-submit-btn {
    width: 100%;
    padding: 12px;
    background: #2d2d2d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
}
.dmu-submit-btn:hover {
    background: #444;
}
.dmu-submit-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .dmu-drawer {
        width: 100vw;
    }
}
