/* ════════════════════════════════════════════════════════════════════════
   Simulateur Flexible — Design moderne avec apparition progressive
   ════════════════════════════════════════════════════════════════════════ */

.sim-flex {
    background: linear-gradient(135deg, #f8fdf3 0%, #ffffff 100%);
    border: 1px solid #e0ecd0;
    border-radius: 16px;
    padding: 32px;
    margin: 40px 0;
    box-shadow: 0 4px 20px rgba(124, 179, 66, 0.08);
}
@media (max-width: 640px) {
    .sim-flex { padding: 20px; border-radius: 12px; }
}

.sim-flex-header {
    text-align: center;
    margin-bottom: 32px;
}
.sim-flex-header h2 {
    font-size: 1.7rem;
    color: #162218;
    margin: 0 0 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.sim-flex-header .sim-flex-icon {
    font-size: 1.8rem;
}
.sim-flex-header p {
    color: #5a6b5e;
    font-size: 1rem;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* ─── Étape (carte) ─── */
.sim-step {
    background: white;
    border: 2px solid #e8efe2;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    position: relative;
    transition: all .3s ease;
}
.sim-step.is-hidden {
    display: none;
}
.sim-step.is-active {
    border-color: #7cb342;
    box-shadow: 0 2px 12px rgba(124, 179, 66, 0.15);
}
.sim-step.is-done {
    border-color: #c5e1a5;
    background: #f9fdf4;
}

.sim-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.sim-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7cb342;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}
.sim-step.is-done .sim-step-num {
    background: #689f38;
}
.sim-step.is-done .sim-step-num::after {
    content: '✓';
    font-size: 1.1rem;
}
.sim-step.is-done .sim-step-num-text { display: none; }

.sim-step-title {
    font-weight: 600;
    color: #162218;
    font-size: 1.05rem;
    flex: 1;
}
.sim-step-recap {
    display: none;
    font-size: .85rem;
    color: #5a6b5e;
    font-weight: 500;
}
.sim-step.is-done .sim-step-recap {
    display: inline-block;
    background: #e8f5d8;
    padding: 4px 10px;
    border-radius: 16px;
    color: #4a7a1f;
    font-weight: 600;
}

/* ─── Cartes de choix (série, DN) ─── */
.sim-choices {
    display: grid;
    gap: 10px;
}
.sim-choices.cols-4 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sim-choices.cols-6 { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

.sim-choice {
    background: white;
    border: 2px solid #e8efe2;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.sim-choice:hover {
    border-color: #7cb342;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.15);
}
.sim-choice.is-selected {
    border-color: #7cb342;
    background: #7cb342;
    color: white;
}
.sim-choice-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sim-choice-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sim-choice-thumb.is-fallback {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border: 1px dashed #c0c0c0;
}
.sim-choice-thumb.is-fallback::before {
    content: "🔧";
    font-size: 1.4rem;
    opacity: .55;
}
.sim-choice.is-selected .sim-choice-thumb { background: rgba(255,255,255,.2); }
.sim-choice-code {
    font-weight: 700;
    font-size: 1.05rem;
    display: block;
}
.sim-choice-desc {
    font-size: .75rem;
    color: #5a6b5e;
    line-height: 1.3;
    display: block;
}
.sim-choice.is-selected .sim-choice-desc { color: rgba(255,255,255,.85); }
.sim-choice-price {
    font-size: .8rem;
    color: #4a7a1f;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}
.sim-choice.is-selected .sim-choice-price { color: white; }

/* ─── Cartes Famille d'embouts (étape avant combobox) ─── */
.sim-families-wrap {
    margin-bottom: 16px;
}
.sim-families-label {
    font-size: .88rem;
    color: #4a7a1f;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}
.sim-families {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 8px;
}
.sim-family {
    background: white;
    border: 2px solid #e8efe2;
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.sim-family:hover {
    border-color: #7cb342;
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.1);
}
.sim-family.is-selected {
    border-color: #7cb342;
    background: #f4faef;
    box-shadow: 0 2px 12px rgba(124, 179, 66, 0.18);
}
.sim-family-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sim-family-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sim-family-thumb.is-fallback {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border: 1px dashed #c0c0c0;
}
.sim-family-thumb.is-fallback::before {
    content: "🔌";
    font-size: 1.4rem;
    opacity: .55;
}
.sim-family-name {
    font-weight: 600;
    font-size: .78rem;
    color: #162218;
    line-height: 1.2;
    text-align: center;
}
.sim-family.is-selected .sim-family-name { color: #4a7a1f; }
.sim-family-count {
    font-size: .68rem;
    color: #888;
    font-weight: 500;
}
.sim-family.is-selected .sim-family-count { color: #4a7a1f; }
.sim-family-all {
    background: linear-gradient(135deg, #fff 0%, #f0f5ec 100%);
}
.sim-family-all .sim-family-thumb {
    background: #e8f5d8;
    border: none;
}
.sim-family-all .sim-family-thumb::before {
    content: "🔍";
    font-size: 1.5rem;
    opacity: .9;
}

@media (max-width: 480px) {
    .sim-families { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .sim-family { padding: 8px 6px; }
    .sim-family-thumb { width: 44px; height: 44px; }
    .sim-family-name { font-size: .72rem; }
}

/* ─── Combobox pour embouts (avec recherche) ─── */
.sim-combobox {
    position: relative;
}
.sim-combobox-input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 2px solid #e8efe2;
    border-radius: 10px;
    font-size: 1rem;
    color: #162218;
    background: white;
    transition: border-color .2s;
    box-sizing: border-box;
}
.sim-combobox-input:focus {
    outline: none;
    border-color: #7cb342;
}
.sim-combobox-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #7cb342;
    font-size: 1.2rem;
    transition: transform .2s;
}
.sim-combobox.is-open .sim-combobox-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.sim-combobox-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e8efe2;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
}
.sim-combobox.is-open .sim-combobox-dropdown { display: block; }
.sim-combobox-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f4f7f1;
    transition: background .15s;
}
.sim-combobox-option:hover, .sim-combobox-option.is-highlighted {
    background: #f4faef;
}
.sim-combobox-option:last-child { border-bottom: none; }
.sim-combobox-option-code {
    font-weight: 600;
    color: #162218;
    font-size: .95rem;
    margin-bottom: 2px;
}
.sim-combobox-option-desc {
    font-size: .78rem;
    color: #5a6b5e;
    line-height: 1.3;
}
.sim-combobox-option-price {
    float: right;
    color: #4a7a1f;
    font-weight: 600;
    font-size: .9rem;
}
.sim-combobox-empty {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: .9rem;
}

/* ─── Longueur (étape 3) ─── */
.sim-length-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.sim-length-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #e8efe2;
    border-radius: 10px;
    padding: 6px 8px;
    transition: border-color .2s;
}
.sim-length-input-wrap:focus-within { border-color: #7cb342; }
.sim-length-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f4faef;
    border: none;
    color: #4a7a1f;
    font-size: 1.4rem;
    cursor: pointer;
    font-weight: 600;
    transition: background .15s;
    line-height: 1;
}
.sim-length-btn:hover { background: #e8f5d8; }
.sim-length-input {
    width: 80px;
    border: none;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #162218;
    background: transparent;
    padding: 6px 0;
}
.sim-length-input:focus { outline: none; }
.sim-length-unit {
    font-size: 1rem;
    color: #5a6b5e;
    font-weight: 500;
}
.sim-length-help {
    font-size: .8rem;
    color: #888;
    margin-top: 6px;
}
.sim-length-warning {
    color: #d97706;
    font-weight: 500;
    margin-top: 8px;
    font-size: .85rem;
    display: none;
}

/* ─── Récap auto (produits liés) ─── */
.sim-auto-info {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .85rem;
    color: #92400e;
    margin-top: 12px;
}
.sim-auto-info strong { color: #78350f; }
.sim-auto-info ul {
    margin: 6px 0 0 0;
    padding-left: 20px;
}

/* ─── Bloc résultat final ─── */
.sim-result {
    background: linear-gradient(135deg, #7cb342 0%, #689f38 100%);
    color: white;
    border-radius: 14px;
    padding: 28px;
    margin-top: 24px;
    display: none;
    box-shadow: 0 8px 24px rgba(124, 179, 66, 0.25);
}
.sim-result.visible { display: block; animation: slideIn .3s ease-out; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sim-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.sim-result-header h3 {
    margin: 0;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sim-result-prices {
    display: flex;
    gap: 24px;
    align-items: baseline;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.sim-result-price-main {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
}
.sim-result-price-main small {
    font-size: 1rem;
    font-weight: 600;
    opacity: .85;
}
.sim-result-price-ttc {
    font-size: 1.15rem;
    opacity: .9;
}

.sim-result-toggle {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s;
}
.sim-result-toggle:hover { background: rgba(255,255,255,.25); }

.sim-result-detail {
    display: none;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 18px;
    font-size: .88rem;
}
.sim-result-detail.visible { display: block; }
.sim-result-detail-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.sim-result-detail-line:last-child { border-bottom: none; }
.sim-result-detail-line strong { font-weight: 700; }

.sim-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.sim-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    border: none;
    font-size: .95rem;
    cursor: pointer;
}
.sim-result-btn-primary {
    background: white;
    color: #4a7a1f;
}
.sim-result-btn-primary:hover {
    background: #f4faef;
    transform: translateY(-1px);
}
.sim-result-btn-secondary {
    background: rgba(255,255,255,.15);
    color: white;
    border: 1px solid rgba(255,255,255,.3);
}
.sim-result-btn-secondary:hover {
    background: rgba(255,255,255,.25);
}

.sim-result-disclaimer {
    font-size: .78rem;
    opacity: .85;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.15);
}

/* ─── Bandeau blocage anti-abus ─── */
.sim-flex-blocked {
    display: none;
    background: linear-gradient(90deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
    padding: 14px 18px;
    border-radius: 10px;
    color: #7f1d1d;
    margin-bottom: 18px;
    font-size: .92rem;
    line-height: 1.5;
}
.sim-flex-blocked.visible { display: block; }

/* ─── Lightbox image (clic sur vignette → grand format) ─────────────────── */
.sim-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 18, 0.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: simLightboxFade .2s ease-out;
}
.sim-lightbox.is-open {
    display: flex;
}
@keyframes simLightboxFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sim-lightbox-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: min(720px, 92vw);
    max-height: 88vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: simLightboxZoom .25s ease-out;
}
@keyframes simLightboxZoom {
    from { transform: scale(.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.sim-lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f8f8;
}

.sim-lightbox-caption {
    margin-top: 16px;
    color: #162218;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    line-height: 1.4;
}

.sim-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #7cb342;
    color: #4a7a1f;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.sim-lightbox-close:hover {
    background: #f4faef;
    transform: scale(1.05);
}

/* ─── Curseur "loupe" sur les vignettes cliquables ─── */
.sim-thumb, .sim-choice-thumb, .sim-product-card-thumb, .sim-family-thumb, .sim-gaine-reco .sim-thumb {
    position: relative;
}
.sim-thumb:not(.is-fallback), 
.sim-choice-thumb:not(.is-fallback),
.sim-product-card-thumb:not(.is-fallback),
.sim-family-thumb:not(.is-fallback) {
    cursor: zoom-in;
}
.sim-thumb:not(.is-fallback):hover img,
.sim-choice-thumb:not(.is-fallback):hover img,
.sim-product-card-thumb:not(.is-fallback):hover img,
.sim-family-thumb:not(.is-fallback):hover img {
    opacity: .85;
}
.sim-thumb:not(.is-fallback)::after,
.sim-choice-thumb:not(.is-fallback)::after,
.sim-product-card-thumb:not(.is-fallback)::after,
.sim-family-thumb:not(.is-fallback)::after {
    content: "🔍";
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(124, 179, 66, .9);
    color: white;
    font-size: .65rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
}
.sim-thumb:not(.is-fallback):hover::after,
.sim-choice-thumb:not(.is-fallback):hover::after,
.sim-product-card-thumb:not(.is-fallback):hover::after,
.sim-family-thumb:not(.is-fallback):hover::after {
    opacity: 1;
}

/* Sur mobile : lightbox plus petite */
@media (max-width: 480px) {
    .sim-lightbox-content {
        padding: 18px;
        max-width: 95vw;
    }
    .sim-lightbox-close {
        top: -8px;
        right: -8px;
        width: 36px;
        height: 36px;
    }
}

/* ─── Bandeau Récap collant (sticky top) + bouton Recommencer ─── */
.sim-recap-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, #ffffff 0%, #f9fdf4 100%);
    border: 2px solid #7cb342;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: 0 4px 16px rgba(124, 179, 66, 0.18);
    animation: simRecapSlideIn .3s ease-out;
}
@keyframes simRecapSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.sim-recap-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sim-recap-label {
    font-weight: 700;
    color: #4a7a1f;
    font-size: .92rem;
    flex-shrink: 0;
}
.sim-recap-text {
    color: #162218;
    font-size: .88rem;
    line-height: 1.5;
}
.sim-recap-text strong {
    color: #4a7a1f;
    background: #e8f5d8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .82rem;
    display: inline-block;
    margin: 2px 4px 2px 0;
    white-space: nowrap;
}
.sim-recap-reset {
    background: white;
    border: 2px solid #fecaca;
    color: #b91c1c;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
    white-space: nowrap;
}
.sim-recap-reset:hover {
    background: #fef2f2;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.12);
}

@media (max-width: 600px) {
    .sim-recap-bar {
        padding: 10px 14px;
        gap: 10px;
    }
    .sim-recap-reset {
        width: 100%;
        order: 99;
    }
    .sim-recap-text strong {
        font-size: .76rem;
    }
}

/* ─── Badge Stock (en stock / sur commande / limité) ─── */
.sim-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 4px;
    white-space: nowrap;
}
.sim-stock-badge.is-success {
    background: #dcfce7;
    color: #166534;
}
.sim-stock-badge.is-warning {
    background: #fef3c7;
    color: #92400e;
}
.sim-stock-badge.is-neutral {
    background: #f3f4f6;
    color: #4b5563;
}
.sim-combobox-option-info .sim-stock-badge {
    margin-left: 0;
    margin-top: 2px;
}
.sim-product-card-info .sim-stock-badge {
    display: inline-flex;
    margin-top: 6px;
}
.sim-choice .sim-stock-badge {
    font-size: .62rem;
    padding: 1px 6px;
    margin-top: 2px;
}
.sim-choice.is-selected .sim-stock-badge {
    background: rgba(255,255,255,0.92);
    color: #4a7a1f;
}
.sim-lot-item-info .sim-stock-badge {
    margin-top: 4px;
    font-size: .68rem;
}

.sim-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e8efe2;
    border-top-color: #7cb342;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Vignettes images dans listes (combobox) ─── */
.sim-combobox-option {
    display: flex;
    gap: 12px;
    align-items: center;
}
.sim-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.sim-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* Fallback en pur CSS — icône appareil photo grisée */
.sim-thumb.is-fallback {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border: 1px dashed #c0c0c0;
}
.sim-thumb.is-fallback::before {
    content: "📷";
    font-size: 1.4rem;
    opacity: .55;
}

.sim-combobox-option-info { flex: 1; min-width: 0; }
.sim-combobox-option-code,
.sim-combobox-option-desc { display: block; }

/* ─── Carte produit (après sélection embout/coupleur) ─── */
.sim-product-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f9fdf4;
    border: 2px solid #7cb342;
    border-radius: 12px;
    padding: 14px 18px;
    position: relative;
    transition: all .2s ease;
}
.sim-product-card:hover {
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.15);
}
.sim-product-card-thumb {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    background: white;
    border: 1px solid #e8efe2;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.sim-product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Fallback grande carte : icône + texte */
.sim-product-card-thumb.is-fallback {
    background: linear-gradient(135deg, #f8f8f8 0%, #ededed 100%);
    border: 1px dashed #c0c0c0;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    text-align: center;
    line-height: 1.2;
}
.sim-product-card-thumb.is-fallback::before {
    content: "📷";
    font-size: 1.8rem;
    opacity: .55;
    display: block;
}
.sim-product-card-thumb.is-fallback::after {
    content: "Visuel bientôt disponible";
    color: #707070;
    font-weight: 500;
    font-size: .68rem;
    display: block;
    padding: 0 4px;
}

.sim-product-card-info {
    flex: 1;
    min-width: 0;
}
.sim-product-card-code {
    font-weight: 700;
    font-size: 1.05rem;
    color: #162218;
    margin-bottom: 4px;
}
.sim-product-card-desc {
    font-size: .85rem;
    color: #5a6b5e;
    line-height: 1.4;
}
.sim-product-card-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #fecaca;
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all .15s ease;
    line-height: 1;
}
.sim-product-card-remove:hover {
    background: #fee2e2;
    transform: scale(1.05);
}

/* Sur mobile : layout plus compact */
@media (max-width: 480px) {
    .sim-product-card-thumb {
        width: 64px;
        height: 64px;
    }
    .sim-product-card-thumb.is-fallback::before { font-size: 1.4rem; }
    .sim-product-card-thumb.is-fallback::after { font-size: .62rem; }
    .sim-product-card-code { font-size: .95rem; }
    .sim-product-card-desc { font-size: .78rem; }
}

/* ─── Carte LOT (coupleur + bouchon côte à côte) ─── */
.sim-lot-card {
    background: #f9fdf4;
    border: 2px solid #7cb342;
    border-radius: 12px;
    padding: 16px 50px 16px 18px;  /* padding-right pour laisser place à ❌ */
    position: relative;
    transition: all .2s ease;
}
.sim-lot-card:hover {
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.15);
}

.sim-lot-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.sim-lot-item {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sim-lot-item-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: white;
    border: 1px solid #e8efe2;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sim-lot-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sim-lot-item-thumb.is-fallback {
    background: linear-gradient(135deg, #f8f8f8 0%, #ededed 100%);
    border: 1px dashed #c0c0c0;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
}
.sim-lot-item-thumb.is-fallback::before {
    content: "📷";
    font-size: 1.5rem;
    opacity: .55;
}
.sim-lot-item-thumb.is-fallback::after {
    content: "Bientôt";
    font-size: .58rem;
    color: #707070;
    font-weight: 500;
}

.sim-lot-item-info {
    flex: 1;
    min-width: 0;
}
.sim-lot-item-code {
    font-weight: 700;
    font-size: .95rem;
    color: #162218;
    margin-bottom: 2px;
}
.sim-lot-item-desc {
    font-size: .76rem;
    color: #5a6b5e;
    line-height: 1.3;
}
.sim-lot-item-tag {
    display: inline-block;
    font-size: .65rem;
    background: #e8f5d8;
    color: #4a7a1f;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.sim-lot-plus {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #7cb342;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(124, 179, 66, 0.3);
}

.sim-lot-total {
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #c5e1a5;
}
.sim-lot-total-label {
    font-size: .85rem;
    color: #4a7a1f;
    font-weight: 600;
}
.sim-lot-total-price {
    font-size: 1.15rem;
    color: #4a7a1f;
    font-weight: 700;
}

/* Sur mobile : items empilés au lieu de côte à côte */
@media (max-width: 600px) {
    .sim-lot-card {
        padding: 14px 44px 14px 14px;
    }
    .sim-lot-row {
        flex-direction: column;
        gap: 10px;
    }
    .sim-lot-item {
        width: 100%;
    }
    .sim-lot-item-thumb {
        width: 64px;
        height: 64px;
    }
    .sim-lot-plus {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
        transform: rotate(90deg); /* + devient ↓ visuellement quand empilé */
    }
}

/* ─── Toggle Oui/Non (étapes facultatives) ─── */
.sim-toggle-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sim-toggle-btn {
    flex: 1;
    min-width: 100px;
    padding: 14px 18px;
    background: white;
    border: 2px solid #e8efe2;
    border-radius: 10px;
    color: #162218;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .2s ease;
    user-select: none;
}
.sim-toggle-btn:hover {
    border-color: #7cb342;
    transform: translateY(-1px);
}
.sim-toggle-btn.is-selected {
    background: #7cb342;
    color: white;
    border-color: #7cb342;
}
.sim-toggle-btn.is-no.is-selected {
    background: #6b7280;
    border-color: #6b7280;
}
.sim-toggle-icon { font-size: 1.1rem; margin-right: 6px; }

/* ─── Sub-options (révélation après toggle) ─── */
.sim-sub-options {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e0ecd0;
}
.sim-sub-options.visible { display: block; animation: slideIn .25s ease-out; }

.sim-sub-label {
    font-size: .88rem;
    color: #4a7a1f;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* ─── Gaine : carte de recommandation ─── */
.sim-gaine-reco {
    background: #f4faef;
    border: 2px solid #7cb342;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.sim-gaine-reco .sim-thumb {
    width: 64px;
    height: 64px;
}
.sim-gaine-reco-info { flex: 1; min-width: 0; }

/* ─── Bloc calcul détaillé de la gaine ─── */
.sim-gaine-calcul {
    margin-top: 10px;
}
.sim-gaine-calcul-inner {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: .88rem;
}
.sim-gaine-calcul-line {
    padding: 3px 0;
    color: #78350f;
    line-height: 1.5;
}
.sim-gaine-calcul-line small {
    color: #92400e;
    font-style: italic;
    font-size: .85em;
}
.sim-gaine-calcul-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #fcd34d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #92400e;
    font-weight: 600;
}
.sim-gaine-calcul-total strong {
    color: #b45309;
    font-size: 1.05rem;
    font-weight: 700;
}
.sim-gaine-reco-code {
    font-weight: 700;
    color: #4a7a1f;
    font-size: 1.05rem;
}
.sim-gaine-reco-desc {
    font-size: .82rem;
    color: #5a6b5e;
    margin-top: 2px;
}
.sim-gaine-reco-price {
    color: #4a7a1f;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
}
.sim-gaine-change-btn {
    display: inline-block;
    background: white;
    border: 1px solid #c5e1a5;
    color: #4a7a1f;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s;
    margin-top: 8px;
}
.sim-gaine-change-btn:hover { background: #f4faef; }

/* ─── Longueur en cm ─── */
.sim-length-equiv {
    font-size: .95rem;
    color: #4a7a1f;
    font-weight: 600;
    margin-left: 12px;
}
.sim-length-input {
    width: 90px !important;
}

/* ─── Mention sertissage améliorée ─── */
.sim-auto-info-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #f59e0b;
    font-size: .8rem;
    color: #92400e;
    line-height: 1.5;
}
.sim-auto-info-detail strong { color: #78350f; }

/* ─── État "bloqué" : simulateur visible mais désactivé ─────────────────── */
/* Quand le client a atteint sa limite, on ne cache pas le simulateur :    */
/* on le grise et on bloque les interactions. C'est plus visuel et         */
/* le client comprend mieux qu'il s'agit d'une limite atteinte temporaire. */
/* ⚠️ Le HTML utilise id="simFlexBody" (pas class), donc on cible par ID. */
#simFlexBody.is-blocked {
    position: relative;
    opacity: .45;
    filter: grayscale(80%);
    pointer-events: none;       /* Désactive TOUS les clics */
    user-select: none;          /* Pas de sélection texte */
    transition: opacity .3s ease, filter .3s ease;
}
/* Voile gris léger par-dessus pour bien marquer la désactivation */
#simFlexBody.is-blocked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(245,245,245,0.15) 100%);
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}
/* On masque aussi le récap collant en haut (plus pertinent quand bloqué) */
/* (le récap est à l'extérieur de simFlexBody donc on le cible séparément en JS) */
