/* ========================================
   CONFIGURATEUR V2 - VERSION COMPACTE
   ======================================== */

:root {
    --keyence-red: #E60012;
    --keyence-dark: #1a1a1a;
    --keyence-gray: #4a4a4a;
    --light-gray: #f8fafc;
    --border-light: #e2e8f0;
    --green: #10b981;
    --white: #ffffff;
}

/* ========================================
   CONTAINER PRINCIPAL - VERSION COMPACTE
   ======================================== */
.config-container {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr; /* fluid sidebar width */
    gap: clamp(12px, 1.2vw, 32px);
    width: calc(100% - 32px);
    max-width: 2000px;
    margin: 16px auto; /* margins preserved */
    padding: 0 16px;
    padding-bottom: 120px; /* space for footer */
    box-sizing: border-box;
}

/* ========================================
   SIDEBAR GAUCHE - COMPACTE
   ======================================== */
.config-sidebar {
    background: white;
    border-radius: 12px;
    padding: 18px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 80px;
    max-width: 420px;
    border-top: 4px solid var(--keyence-red);
}

.config-sidebar h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--keyence-dark);
    margin-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
    line-height: 1.2;
}

.specs-list {
    list-style: none;
    margin-bottom: 16px;
}

.specs-list li {
    font-size: 14px;
    color: var(--keyence-gray);
    padding: 7px 0;
    font-weight: 600;
    line-height: 1.3;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.specs-list li:last-child {
    border-bottom: none;
}

/* ========================================
   ACCESSOIRES OBLIGATOIRES - AMÉLIORÉ
   ======================================== */
.mandatory-accessories {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 16px 14px; /* ✅ Plus d'espace */
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.mandatory-accessories h3 {
    font-size: 16px; /* reduce heading size */
    font-weight: 800;
    color: #10b981;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.mandatory-accessories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mandatory-accessories li {
    font-size: 14px;
    color: #047857;
    padding: 5px 0;
    font-weight: 600;
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mandatory-accessories .check {
    color: #10b981;
    font-weight: 700;
    flex-shrink: 0;
}

/* Séparateur pour les accessoires Touch */
.mandatory-accessories li.separator {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #10b981;
    color: #047857;
    font-weight: 700;
}

.mandatory-accessories li.separator strong {
    color: #059669;
}

/* Style spécial pour les accessoires Touch */
.mandatory-accessories li.touch-accessory {
    padding-left: 12px;
    font-size: 11px;
    color: #065f46;
}
.config-preview {
    text-align: center;
    padding: 14px;
    background: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
}

.config-preview img {
    width: 100%;
    height: auto;
    max-height: 130px;
    object-fit: contain;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.config-preview img:hover {
    transform: scale(1.05);
}

.config-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--keyence-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--keyence-red);
    line-height: 1;
}

/* ========================================
   COLONNES DE CONFIGURATION - COMPACTES
   ======================================== */
.config-steps {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
    gap: clamp(12px, 1.2vw, 20px);
    align-items: start;
}

.config-column {
    background: white;
    border-radius: 12px;
    padding: 16px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    border: 2px solid transparent;
    border-top: 4px solid var(--keyence-red);
    transition: all 0.3s ease;
}

.config-column:hover {
    border-color: var(--keyence-red);
}

.config-column.locked-column {
    opacity: 0.6;
    filter: grayscale(0.1);
}

.config-column.locked-column .option-card,
.config-column.locked-column .accessory-item {
    pointer-events: none;
}

.config-column.locked-column .column-header::after {
    content: 'Verrouillee jusqu\'a l\'etape precedente';
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.column-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--keyence-red);
    color: white;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(230,0,18,0.3);
}

.column-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--keyence-dark);
    letter-spacing: -0.2px;
}

/* ========================================
   CARTES OPTIONS - COMPACTES
   ======================================== */
.option-card {
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 10px;
    margin-bottom: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: var(--keyence-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(230, 0, 18, 0.15);
    background: white;
}

.option-card.selected {
    background: linear-gradient(135deg, #fff5f5 0%, #fffafa 100%);
    border-color: var(--keyence-red);
    box-shadow: 0 4px 16px rgba(230, 0, 18, 0.18);
}

/* Checkmark badge on selected card */
.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--keyence-red);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(230,0,18,0.4);
}

.option-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-validate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-icon {
    font-size: 28px; /* ✅ Plus petit */
    margin-bottom: 6px;
}

.option-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--keyence-dark);
    margin-bottom: 8px;
    line-height: 1.2;
}

.option-card img {
    width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    margin-bottom: 8px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.option-card:hover img,
.option-card.selected img {
    transform: scale(1.04);
    border-color: rgba(230,0,18,0.25);
}

.combo-images {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}

.combo-images img {
    width: 48%;
    height: 52px; /* slightly reduced */
}

.dual-images {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}

.dual-images img {
    width: 48%;
    height: 52px; /* slightly reduced */
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: 6px;
}

.option-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 10px;
    border-top: 2px solid #e2e8f0;
}

.option-price .price-label {
    font-size: 13px; /* ✅ Plus petit */
    font-weight: 700;
    color: var(--keyence-gray);
    text-transform: uppercase;
}

.option-price .price-value {
    font-size: 18px; /* ✅ Plus petit */
    font-weight: 800;
    color: var(--keyence-red);
}

/* ========================================
   LISTE ACCESSOIRES - COMPACTE
   ======================================== */
.accessories-list .accessory-item {
    display: grid;
    grid-template-columns: 22px 54px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 10px;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.accessory-item:hover {
    border-color: var(--keyence-red);
    background: white;
    box-shadow: 0 4px 12px rgba(230,0,18,0.1);
}

.accessory-item.selected {
    border-color: var(--keyence-red);
    background: linear-gradient(135deg, #fff5f5, white);
}

.accessory-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 14px;
    accent-color: var(--keyence-red);
}

.accessories-list .accessory-item img {
    width: 50px !important; /* ✅ Plus petit */
    height: 50px !important;
    min-width: 50px;
    max-width: 50px;
    object-fit: contain !important;
    background: white;
    padding: 4px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
    grid-column: 2;
    grid-row: 1 / span 2;
}

.accessory-icon {
    width: 50px !important;
    height: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 6px;
    font-size: 28px;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
    grid-column: 2;
    grid-row: 1 / span 2;
}

.accessory-info {
    flex: 1;
    min-width: 0;
    grid-column: 3;
    grid-row: 1;
}

.accessory-info strong {
    display: block;
    font-size: 15px; /* reduced to avoid visually dominant text */
    font-weight: 700;
    color: var(--keyence-dark);
    white-space: normal; /* allow wrapping */
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.accessory-price {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
    font-size: 16px;
    font-weight: 800;
    color: var(--keyence-red);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.1;
}

/* ========================================
   FOOTER PRIX TOTAL - COMPACT
   ======================================== */
.config-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--keyence-red), #c4000f);
    color: white;
    padding: 12px 24px; /* ✅ Padding réduit */
    box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}

.config-footer .footer-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* allow absolute placement of left/right actions */
    min-height: 76px;
}

.price-breakdown {
    font-size: 22px; /* ✅ Plus petit */
    font-weight: 700;
}

.total-price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.total-price-display .price-label {
    font-size: 12px;
    opacity: 0.9;
}

.total-price-display .price-value {
    font-size: 36px; /* ✅ Plus petit */
    font-weight: 900;
    color: #ffeb3b;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.btn-validate {
    padding: 16px 48px; /* ✅ Plus petit */
    background: white;
    color: var(--keyence-red);
    border: none;
    border-radius: 10px;
    font-size: 22px; /* ✅ Plus petit */
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-validate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Left actions in footer (reset / order) fixed to the left of the footer */
.config-footer .left-actions {
    position: absolute;
    left: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* center the total price exactly in the footer */
.config-footer .total-price-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.config-footer .total-price-display .price-label {
    font-size: 12px;
    opacity: 0.85;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.config-footer .right-actions {
    position: absolute;
    right: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* On small screens, revert to stacked layout */
@media (max-width: 800px) {
    .config-footer .footer-content {
        display: block;
        text-align: center;
        padding: 12px 8px;
    }
    .config-footer .left-actions,
    .config-footer .right-actions,
    .config-footer .total-price-display {
        position: static;
        transform: none;
        margin: 8px 0;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1400px) {
    .config-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .config-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 0;
    }

    /* Les étapes passent en premier, la sidebar en dessous */
    .config-steps {
        order: 1;
        grid-template-columns: repeat(2, 1fr);
    }

    .config-sidebar {
        order: 2;
        position: static;
        max-width: 100%;
    }
}
/* ========================================
   PRIX DYNAMIQUES (positif/négatif)
   ======================================== */
.option-price .price-value {
    font-size: 18px;
    font-weight: 800;
    transition: color 0.3s ease;
}

/* Prix positif (plus cher) */
.option-price .price-value[style*="color: rgb(230, 0, 18)"],
.option-price .price-value[style*="color: #E60012"] {
    color: #E60012 !important;
}

/* Prix négatif (économie) */
.option-price .price-value[style*="color: rgb(16, 185, 129)"],
.option-price .price-value[style*="color: #10b981"] {
    color: #10b981 !important;
    font-weight: 900;
}

/* Option actuellement sélectionnée */
.option-card.selected .price-value {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
/* ========================================
   SECTION FINANCEMENT (ACHAT / LOA)
   ======================================== */
.financing-section {
    background: linear-gradient(135deg, #fff9e6, #fff);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.financing-section h3 {
    font-size: 14px;
    font-weight: 800;
    color: #d97706;
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financing-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.financing-btn {
    flex: 1;
    padding: 10px 8px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.financing-btn:hover {
    border-color: #fbbf24;
    color: #d97706;
}

.financing-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.loa-options {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.loa-duration-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
}

#loa-duration {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    background: white;
}

#loa-duration:focus {
    outline: none;
    border-color: #fbbf24;
}

/* Prix LOA dans la preview */
.config-price.loa-mode .price-label {
    color: #d97706;
}

.config-price.loa-mode .price-value {
    color: #f59e0b;
}

.loa-info {
    font-size: 11px;
    color: #6b7280;
    margin-top: 6px;
    text-align: center;
    font-style: italic;
}
/* ========================================
   TAILLES PROGRESSIVES DES IMAGES PLATINES
   ======================================== */

/* Platine compacte : taille normale (référence) */
.option-card[data-id="IM-X1220"] img {
    height: 70px; /* Taille de base */
}

/* Platine moyenne : 30% plus grande */
.option-card[data-id="IM-X1330"] img {
    height: 91px; /* 70px × 1.3 = 91px */
}

/* Grande platine : 60% plus grande que la base */
.option-card[data-id="IM-X1540"] img {
    height: 112px; /* 70px × 1.6 = 112px */
}

/* Ajuster le conteneur pour les grandes images */
.config-column[data-step="1"] .option-card {
    min-height: 140px; /* reduced to avoid forcing vertical scroll */
}

/* ========================================
   DISABLED SECTIONS
   ======================================== */
.disabled-section {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
}

/* ========================================
   MODALE - DISABLED OPTIONS
   ======================================== */
.combo-option input[disabled] + span,
/* Si structure différente: label désactivé */
label.disabled-modal-option {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}