/* ============================================
   Étape CÔTÉS — layout deux colonnes Mesplaques
   ============================================ */

.mp-cotes {
    background: #fff;
    margin: 0 -0.25rem;
}

.wizard-pane[data-pane="2"]:has(.mp-cotes:not([hidden])) .wizard-pane-title,
.wizard-pane[data-pane="2"]:has(.mp-cotes:not([hidden])) .wizard-pane-desc {
    display: none;
}

.mp-cotes-grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0;
    align-items: stretch;
    min-height: 420px;
}

.mp-cotes-divider {
    background: #d1d5db;
    width: 1px;
    min-height: 100%;
}

.mp-cotes-column {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: opacity 0.2s ease;
}

/* Ne pas bloquer les cases « supprimer » — seulement le contenu sous les actions */
.mp-cotes-column.is-disabled .mp-cotes-section,
.mp-cotes-column.is-disabled .mp-cotes-rule {
    opacity: 0.42;
    pointer-events: none;
}

.mp-cotes-column.is-disabled .mp-cotes-actions {
    opacity: 1;
    pointer-events: auto;
}

/* —— En-tête colonne —— */
.mp-cotes-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.mp-cotes-head-icon {
    width: 72px;
    height: 48px;
    color: #374151;
}

.mp-cotes-head-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111827;
    text-align: center;
}

/* —— Actions —— */
.mp-cotes-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.mp-cotes-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.mp-cotes-check input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
    cursor: pointer;
}

.mp-cotes-check span {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.mp-cotes-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    cursor: pointer;
}

.mp-cotes-reset:hover {
    color: #111827;
}

.mp-cotes-reset svg {
    flex-shrink: 0;
}

.mp-cotes-rule {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0 0 1.25rem;
}

/* —— Sections —— */
.mp-cotes-section {
    margin-bottom: 1.35rem;
}

.mp-cotes-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* —— Logo row —— */
.mp-cotes-logo-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.65rem;
}

.mp-cotes-logo-preview {
    grid-row: 1 / 3;
    position: relative;
    width: 72px;
    height: 72px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-cotes-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mp-cotes-logo-preview .mp-cotes-eu-stars {
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.mp-cotes-logo-preview .mp-cotes-region-logo {
    width: 88%;
    height: 88%;
    object-fit: contain;
}

.mp-cotes-logo-remove {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.mp-cotes-logo-preview.has-custom .mp-cotes-logo-remove,
.mp-cotes-logo-preview:hover .mp-cotes-logo-remove {
    opacity: 1;
}

.mp-cotes-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 36px;
    padding: 0.4rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.mp-cotes-btn-outline:hover {
    border-color: #9ca3af;
    color: #111827;
}

.mp-cotes-btn-outline svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* —— Dropdown stylé —— */
.mp-cotes-dropdown {
    position: relative;
    width: 100%;
}

.mp-cotes-dropdown__native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.mp-cotes-dropdown__face {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.5rem 2rem 0.5rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    pointer-events: none;
}

.mp-cotes-dropdown__swatch {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.mp-cotes-dropdown__swatch.is-pattern-carbon {
    background: repeating-linear-gradient(45deg, #111 0, #111 4px, #333 4px, #333 8px);
}

.mp-cotes-dropdown__swatch.is-pattern-camouflage {
    background: linear-gradient(135deg, #4a6741 25%, #3d5c3a 25%, #3d5c3a 50%, #5a4a32 50%, #5a4a32 75%, #4a6741 75%);
    background-size: 8px 8px;
}

.mp-cotes-dropdown__label {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #111827;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-cotes-dropdown__badge {
    display: none;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: #16a34a;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.mp-cotes-dropdown__badge.is-visible {
    display: inline-block;
}

.mp-cotes-dropdown__chevron {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.mp-cotes-dropdown--dept .mp-cotes-dropdown__face {
    padding-left: 0.75rem;
}

.mp-cotes-dropdown--dept .mp-cotes-dropdown__label {
    font-weight: 700;
}

/* —— Footer étape côtés —— */
.wizard-footer.is-cotes-step {
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.wizard-footer.is-cotes-step .wizard-btn-ghost {
    border: 2px solid var(--mp-gold, #e8b923);
    color: var(--mp-gold, #c9a227);
    background: transparent;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-style: normal;
    padding: 0.65rem 1.25rem;
}

.wizard-footer.is-cotes-step .wizard-btn-ghost svg {
    display: none;
}

.wizard-footer.is-cotes-step .wizard-btn-ghost:hover {
    background: rgba(201, 162, 39, 0.08);
    color: #a8861f;
}

.wizard-footer.is-cotes-step .wizard-footer-cotes-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.wizard-footer.is-cotes-step .mp-cotes-skip {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
}

.wizard-footer.is-cotes-step .mp-cotes-skip:hover {
    color: #111827;
}

.wizard-footer.is-cotes-step .wizard-btn-primary {
    background: var(--mp-gold, #e8b923);
    color: #111827;
    border: none;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.7rem 1.5rem;
}

.wizard-footer.is-cotes-step .wizard-btn-primary:hover {
    background: var(--mp-gold-hover, #dbb84a);
}

.wizard-footer.is-cotes-step #wizardNext svg {
    display: none;
}

/* —— Modal visuels —— */
.mp-cotes-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mp-cotes-modal[hidden] {
    display: none;
}

.mp-cotes-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 19, 0.55);
}

.mp-cotes-modal__panel {
    position: relative;
    width: min(480px, 100%);
    max-height: 85vh;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.mp-cotes-modal__panel--large {
    width: min(860px, 96vw);
}

.mp-cotes-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.mp-cotes-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.mp-cotes-modal__close:hover { color: #111827; background: #f3f4f6; }

.mp-cotes-modal__title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111827;
}

/* Barre de recherche */
.mp-cotes-modal__search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    color: #9ca3af;
}
.mp-cotes-modal__search-row input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
    color: #111827;
    background: transparent;
}

/* Onglets */
.mp-cotes-modal__tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0;
}
.mp-cotes-modal__tab {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.mp-cotes-modal__tab.is-active,
.mp-cotes-modal__tab:hover { color: #111827; border-bottom-color: #111827; }

/* Pagination */
.mp-cotes-modal__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: 0.75rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}
.mp-cotes-modal__page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #374151;
}
.mp-cotes-modal__page-btn:hover:not(:disabled) { background: #f3f4f6; }
.mp-cotes-modal__page-btn:disabled { opacity: 0.35; cursor: default; }

.mp-cotes-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 54vh;
}

.mp-cotes-visual-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #374151;
}

.mp-cotes-visual-item:hover,
.mp-cotes-visual-item.is-selected {
    border-color: var(--mp-gold, #c9a227);
    color: #111827;
}

.mp-cotes-visual-item img {
    width: 40px;
    height: 28px;
    object-fit: contain;
}

/* Bibliothèque : fond sombre pour que les logos blancs soient visibles */
.mp-cotes-visual-item--library {
    background: #1c1c1e;
    border-color: #2d2d2f;
    color: #d1d5db;
}
.mp-cotes-visual-item--library img {
    width: 44px;
    height: 32px;
    object-fit: contain;
    border-radius: 2px;
    background: transparent;
}
.mp-cotes-visual-item--library span {
    color: #9ca3af;
}
.mp-cotes-visual-item--library:hover,
.mp-cotes-visual-item--library.is-selected {
    border-color: #c9a227;
    color: #f9fafb;
}
.mp-cotes-visual-item--library:hover span {
    color: #f9fafb;
}

.mp-cotes-visual-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 28px;
    font-size: 0.75rem;
    font-weight: 900;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 4px;
}

.mp-cotes-visual-trim {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 28px;
    font-size: 0.6rem;
    font-weight: 900;
    font-style: italic;
    color: #ffdd00;
    background: #111;
    border-radius: 4px;
    padding: 2px;
    text-align: center;
    line-height: 1.1;
}

.mp-cotes-legacy-slot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mp-cotes-trim-select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.mp-cotes-trim-select:hover,
.mp-cotes-trim-select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.mp-cotes-trim-select optgroup {
    font-weight: 700;
    color: #6b7280;
    font-size: 0.75rem;
}
.mp-cotes-trim-select option {
    font-weight: 600;
    color: #111827;
}

.mp-cotes-extras {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 767px) {
    .mp-cotes-grid {
        grid-template-columns: 1fr;
    }

    .mp-cotes-divider {
        display: none;
    }

    .mp-cotes-column + .mp-cotes-column {
        border-top: 1px solid #e5e7eb;
    }

    .mp-cotes-logo-row {
        grid-template-columns: 64px 1fr;
    }
}
