/* ============================================================
 * wp_configurator — front (modal + bouton CTA)
 * Tous les sélecteurs sont préfixés .wpcfg- pour ne rien casser
 * dans le thème actif.
 * ============================================================ */

/* ===== Bouton CTA (remplace "Ajouter au panier") ===== */
.wpcfg-cta {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: var(--wpcfg-color, #06b6d4);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .1s, box-shadow .15s, filter .15s;
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.25);
    text-transform: none;
    letter-spacing: 0.01em;
}
.wpcfg-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.wpcfg-cta:active { transform: translateY(0); }
.wpcfg-cta-icon { font-size: 17px; }

body.wpcfg-locked { overflow: hidden; }

/* ===== Overlay ===== */
.wpcfg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    --wpcfg-color: #06b6d4;
    --wpcfg-bg-0: #0b1120;
    --wpcfg-bg-1: #111a2e;
    --wpcfg-bg-2: #1a2540;
    --wpcfg-border: #243155;
    --wpcfg-text: #e6ecff;
    --wpcfg-text-dim: #8a96b8;
    --wpcfg-text-muted: #5d6a8a;
}
.wpcfg-overlay.wpcfg-open { display: flex; animation: wpcfg-fade .2s ease; }
@keyframes wpcfg-fade { from { opacity: 0; } to { opacity: 1; } }

.wpcfg-modal {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    background: var(--wpcfg-bg-0);
    color: var(--wpcfg-text);
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
}
@media (min-width: 1100px) {
    .wpcfg-modal { margin: 24px auto; border-radius: 16px; max-height: calc(100vh - 48px); }
}

.wpcfg-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 38px; height: 38px;
    border: none; background: rgba(255,255,255,0.05);
    color: var(--wpcfg-text);
    font-size: 22px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: grid; place-items: center;
    transition: background .15s, transform .1s;
}
.wpcfg-close:hover { background: rgba(255,255,255,0.12); transform: rotate(90deg); }

/* ===== Header (titre + progress) ===== */
.wpcfg-modal-head {
    padding: 26px 32px 16px;
    border-bottom: 1px solid var(--wpcfg-border);
    background: linear-gradient(180deg, rgba(6,182,212,0.08), transparent);
}
.wpcfg-modal-title {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--wpcfg-title, #ffffff);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}
.wpcfg-progress { display: flex; flex-direction: column; gap: 10px; }
.wpcfg-progress-track {
    height: 4px;
    background: var(--wpcfg-bg-2);
    border-radius: 2px;
    overflow: hidden;
}
.wpcfg-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--wpcfg-color), #6366f1);
    transition: width .35s ease;
}
.wpcfg-progress-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wpcfg-progress-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--wpcfg-bg-2);
    border: 1px solid var(--wpcfg-border);
    color: var(--wpcfg-text-dim);
    font-size: 12.5px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s;
}
.wpcfg-progress-step:hover { color: var(--wpcfg-text); }
.wpcfg-progress-step.wpcfg-step-current {
    background: var(--wpcfg-color);
    color: #06121a;
    border-color: var(--wpcfg-color);
    font-weight: 700;
}
.wpcfg-progress-step.wpcfg-step-done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}
.wpcfg-progress-step.wpcfg-step-future { opacity: 0.6; cursor: not-allowed; }
.wpcfg-progress-dot {
    display: inline-grid; place-items: center;
    min-width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    font-size: 11px;
    font-weight: 700;
}

/* ===== Body : contenu + récap ===== */
.wpcfg-modal-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    overflow: hidden;
    min-height: 0;
}
.wpcfg-overlay .wpcfg-step-content {
    padding: 28px 32px;
    overflow-y: auto;
    width: 100%;
    min-width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}
.wpcfg-step-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--wpcfg-text);
}
.wpcfg-step-desc {
    color: var(--wpcfg-text-dim);
    margin: 0 0 24px;
    font-size: 14px;
}

/* Groupe */
.wpcfg-group {
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--wpcfg-border);
}
.wpcfg-group:last-child { border-bottom: none; }
.wpcfg-group-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--wpcfg-text);
}
.wpcfg-req { color: #ef4444; }
.wpcfg-group-desc {
    color: var(--wpcfg-text-dim);
    font-size: 13px;
    margin-bottom: 14px;
}
.wpcfg-group-rule {
    margin-top: 8px;
    color: var(--wpcfg-text-muted);
    font-size: 12px;
}
.wpcfg-group-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.15);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
    border-radius: 4px;
    font-size: 13px;
}
.wpcfg-group.wpcfg-group-invalid { animation: wpcfg-shake 0.3s; }
@keyframes wpcfg-shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-4px); }
    75%     { transform: translateX(4px); }
}

/* Options génériques */
.wpcfg-options { display: flex; flex-direction: column; gap: 8px; }
.wpcfg-options-color { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.wpcfg-options-image { flex-direction: column; gap: 12px; }

.wpcfg-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--wpcfg-bg-1);
    border: 1px solid var(--wpcfg-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
}
.wpcfg-opt input { display: none; }
.wpcfg-opt:hover { border-color: #2f3f6b; transform: translateY(-1px); }
.wpcfg-opt-checked {
    border-color: var(--wpcfg-color);
    background: rgba(6,182,212,0.08);
    box-shadow: 0 0 0 2px rgba(6,182,212,0.2);
}

.wpcfg-opt-bullet, .wpcfg-opt-square {
    width: 18px; height: 18px;
    border: 2px solid var(--wpcfg-border);
    flex-shrink: 0;
    transition: all .15s;
}
.wpcfg-opt-bullet { border-radius: 50%; }
.wpcfg-opt-square { border-radius: 4px; }
.wpcfg-opt-checked .wpcfg-opt-bullet,
.wpcfg-opt-checked .wpcfg-opt-square {
    border-color: var(--wpcfg-color);
    background: var(--wpcfg-color);
    box-shadow: inset 0 0 0 3px var(--wpcfg-bg-1);
}
.wpcfg-opt-checked .wpcfg-opt-square {
    box-shadow: inset 0 0 0 0 transparent;
    background: var(--wpcfg-color);
}

.wpcfg-opt-vis { display: inline-flex; align-items: center; }
.wpcfg-opt-vis img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--wpcfg-border); }
.wpcfg-mini-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--wpcfg-border); display: inline-block; }

.wpcfg-opt-name { flex: 1; font-size: 14px; }
.wpcfg-opt-impact {
    color: var(--wpcfg-color);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 13.5px;
}

/* Badge "1er mois offert" sur une option */
.wpcfg-opt-freebadge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
    white-space: nowrap;
}

/* Bandeau "économie premier mois" dans le récap latéral */
.wpcfg-recap-savings {
    margin: 12px 0 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.08));
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 8px;
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.wpcfg-recap-savings strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.wpcfg-recap-savings sup { font-size: 0.7em; }

/* Select */
.wpcfg-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--wpcfg-bg-1);
    color: var(--wpcfg-text);
    border: 1px solid var(--wpcfg-border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}
.wpcfg-select:focus { outline: none; border-color: var(--wpcfg-color); box-shadow: 0 0 0 3px rgba(6,182,212,0.2); }

/* Color swatch */
.wpcfg-opt-color {
    flex-direction: column;
    padding: 8px;
    width: 80px;
    text-align: center;
}
.wpcfg-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--wpcfg-border);
    transition: transform .15s, box-shadow .15s;
}
.wpcfg-opt-checked .wpcfg-swatch {
    border-color: var(--wpcfg-color);
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.3);
}
.wpcfg-opt-caption { font-size: 12px; color: var(--wpcfg-text-dim); }
.wpcfg-opt-caption em { color: var(--wpcfg-color); font-style: normal; font-weight: 700; }

/* Image option — empilée verticalement, image à gauche + titre/desc à droite */
.wpcfg-opt-image {
    flex-direction: row;
    align-items: flex-start;
    padding: 14px;
    width: 100%;
    text-align: left;
    gap: 16px;
}
.wpcfg-opt-image .wpcfg-thumb {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--wpcfg-border);
    background: var(--wpcfg-bg-2);
    margin: 0;
}
.wpcfg-opt-image .wpcfg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wpcfg-no-image {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 32px; font-weight: 800;
    color: var(--wpcfg-text-muted);
}
.wpcfg-opt-image .wpcfg-opt-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wpcfg-opt-image .wpcfg-opt-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.wpcfg-opt-image .wpcfg-opt-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--wpcfg-text);
}
.wpcfg-opt-image .wpcfg-opt-price {
    color: var(--wpcfg-color);
    font-weight: 700;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wpcfg-opt-image .wpcfg-opt-desc {
    color: var(--wpcfg-text-dim);
    font-size: 13.5px;
    line-height: 1.55;
}
.wpcfg-opt-image .wpcfg-opt-desc p { margin: 0 0 6px; }
.wpcfg-opt-image .wpcfg-opt-desc p:last-child { margin-bottom: 0; }
.wpcfg-opt-image .wpcfg-opt-desc ul { margin: 4px 0; padding-left: 20px; }

@media (max-width: 600px) {
    .wpcfg-opt-image { flex-direction: column; }
    .wpcfg-opt-image .wpcfg-thumb { width: 100%; height: auto; }
}

/* Text / textarea */
.wpcfg-text {
    width: 100%;
    padding: 12px 14px;
    background: var(--wpcfg-bg-1);
    color: var(--wpcfg-text);
    border: 1px solid var(--wpcfg-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.wpcfg-text:focus { outline: none; border-color: var(--wpcfg-color); box-shadow: 0 0 0 3px rgba(6,182,212,0.2); }

/* Vérification nom de domaine */
.wpcfg-domain-wrap { position: relative; }
.wpcfg-domain-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    min-height: 0;
    transition: all .15s;
}
.wpcfg-domain-status:empty { display: none; }
.wpcfg-domain-loading { background: rgba(6,182,212,0.12); color: var(--wpcfg-text-dim); border: 1px solid rgba(6,182,212,0.3); }
.wpcfg-domain-warn    { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.4); }
.wpcfg-domain-free    { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.5); font-weight: 600; }
.wpcfg-domain-taken   { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.5); font-weight: 600; }

/* ===== Récap panel ===== */
.wpcfg-recap {
    background: var(--wpcfg-bg-1);
    border-left: 1px solid var(--wpcfg-border);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.wpcfg-recap-title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wpcfg-text-dim);
}
.wpcfg-recap-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}
.wpcfg-recap-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--wpcfg-border);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
}
.wpcfg-recap-list li:last-child { border-bottom: none; }
.wpcfg-recap-grp { font-size: 11.5px; color: var(--wpcfg-text-muted); text-transform: uppercase; letter-spacing: 0.04em; grid-column: 1 / -1; }
.wpcfg-recap-val { color: var(--wpcfg-text); font-size: 13.5px; }
.wpcfg-recap-impact { color: var(--wpcfg-color); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.wpcfg-recap-empty { color: var(--wpcfg-text-muted); font-style: italic; padding: 20px 0 !important; }
.wpcfg-recap-base, .wpcfg-recap-supplement {
    display: flex; justify-content: space-between;
    color: var(--wpcfg-text-dim); font-size: 13px;
    padding: 6px 0;
}
.wpcfg-recap-supplement {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}
.wpcfg-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--wpcfg-color);
    font-size: 13px;
    padding: 2px 0;
}
.wpcfg-recap-row > span:first-child { color: var(--wpcfg-text-dim); }
.wpcfg-recap-row > span:last-child { color: var(--wpcfg-color); font-weight: 700; font-variant-numeric: tabular-nums; }
.wpcfg-recap-row.wpcfg-recap-line > span:last-child { color: var(--wpcfg-text); }
.wpcfg-recap-row.wpcfg-recap-bonus > span { color: #10b981 !important; font-weight: 600; }
.wpcfg-recap-bonus-line { color: #10b981; font-weight: 600; }
.wpcfg-recap-total {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid var(--wpcfg-border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--wpcfg-text-dim);
}
.wpcfg-recap-total strong { font-size: 22px; color: var(--wpcfg-text); font-variant-numeric: tabular-nums; }

/* ===== Récap final (étape) ===== */
.wpcfg-recap-final-list {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
    background: var(--wpcfg-bg-1);
    border: 1px solid var(--wpcfg-border);
    border-radius: 10px;
    overflow: hidden;
}
.wpcfg-recap-final-list li {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--wpcfg-border);
    align-items: baseline;
}
.wpcfg-recap-final-list li:last-child { border-bottom: none; }
.wpcfg-recap-final-grp { color: var(--wpcfg-text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.wpcfg-recap-final-val { color: var(--wpcfg-text); font-size: 15px; font-weight: 600; }
.wpcfg-recap-final-impact { color: var(--wpcfg-color); font-weight: 700; font-variant-numeric: tabular-nums; }
.wpcfg-recap-final-totals {
    background: var(--wpcfg-bg-1);
    border: 1px solid var(--wpcfg-border);
    border-radius: 10px;
    padding: 16px 18px;
}
.wpcfg-recap-final-totals > div {
    display: flex; justify-content: space-between;
    padding: 6px 0;
    color: var(--wpcfg-text-dim);
    font-size: 14px;
}
.wpcfg-recap-final-grand {
    margin-top: 6px; padding-top: 14px !important;
    border-top: 2px solid var(--wpcfg-border);
    color: var(--wpcfg-text-dim);
    font-weight: 600;
}
.wpcfg-recap-final-grand strong {
    font-size: 24px; color: var(--wpcfg-text); font-variant-numeric: tabular-nums;
}
.wpcfg-empty-final { text-align: center; padding: 40px; color: var(--wpcfg-text-muted); }

/* ===== Footer ===== */
.wpcfg-modal-foot {
    padding: 18px 32px;
    border-top: 1px solid var(--wpcfg-border);
    background: var(--wpcfg-bg-1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.wpcfg-foot-spacer { flex: 1; }
.wpcfg-btn {
    padding: 12px 24px;
    border: 1px solid var(--wpcfg-border);
    background: var(--wpcfg-bg-2);
    color: var(--wpcfg-text);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.wpcfg-btn:hover:not(:disabled) { border-color: var(--wpcfg-color); }
.wpcfg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wpcfg-btn-primary {
    background: var(--wpcfg-color);
    color: #06121a;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(6,182,212,0.25);
}
.wpcfg-btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .wpcfg-modal-body { grid-template-columns: 1fr; }
    .wpcfg-recap {
        order: -1;
        border-left: none;
        border-bottom: 1px solid var(--wpcfg-border);
        max-height: 220px;
    }
    .wpcfg-modal-head { padding: 18px 18px 12px; }
    .wpcfg-modal-title { font-size: 19px; }
    .wpcfg-step-content { padding: 18px; }
    .wpcfg-modal-foot { padding: 14px 18px; }
    .wpcfg-recap-final-list li { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================================
   DÉMOS — boutons cliquables (étape + option) ajoutés en 2026-04-30
   ============================================================ */
.wpcfg-demos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.wpcfg-demo-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--wpcfg-accent, #06b6d4), color-mix(in srgb, var(--wpcfg-accent, #06b6d4) 70%, #ffffff 30%));
    color: #fff !important; text-decoration: none !important;
    border-radius: 999px; border: 0;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.wpcfg-demo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
    opacity: .95;
}
.wpcfg-demo-icon { font-size: 14px; }
.wpcfg-demo-arrow { font-size: 11px; opacity: .85; }

.wpcfg-opt-wrap { display: flex; flex-direction: column; gap: 4px; }
.wpcfg-opt-wrap .wpcfg-demos { margin: 4px 0 0 28px; gap: 6px; }
.wpcfg-opt-wrap .wpcfg-demo-btn { padding: 5px 10px; font-size: 11px; }
