/* ---------- Configurador Ajax (wizard.html) ----------
   Hoja page-only (02-11-2026): solo la carga wizard.html, fuera de styles.css, que va al
   límite de su presupuesto y viaja a las ~3.800 fichas. Móvil primero: botones de 44 px
   o más, opciones a todo el ancho y la barra del total pegada abajo en el resumen. */

.wizard-hero {
    padding: 32px 0 20px;
    background: var(--bg-soft);
    text-align: center;
}
.wizard-hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; margin-bottom: 10px; }
.wizard-hero p { font-size: 16px; max-width: 540px; margin: 0 auto; }
.wizard-hero .wizard-alt-brand { margin-top: 10px; font-size: 14px; color: var(--text-muted); }
.wizard-hero .wizard-alt-brand a { color: var(--primary); text-decoration: underline; }
.wizard-section { padding: 20px 0 48px; }

.wizard-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
}
.wizard-progress {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    position: relative;
    margin-bottom: 12px;
}
.wizard-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width .3s ease;
}
.wizard-progress span {
    position: absolute;
    top: 14px;
    right: 0;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.wizard-step { display: none; padding-top: 24px; }
.wizard-step.active { display: block; animation: wizardIn .3s ease; }
@keyframes wizardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wizard-step h2 { font-size: 22px; margin-bottom: 18px; }
.wizard-step h2:focus { outline: none; }
.wizard-card.is-loading .wizard-step { visibility: hidden; }

.wizard-options { display: grid; gap: 10px; }
.wizard-options-grid { grid-template-columns: 1fr 1fr; }
.wizard-opt {
    text-align: left;
    min-height: 56px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    transition: border-color .15s ease, background .15s ease;
}
.wizard-opt:hover { border-color: var(--primary); }
.wizard-opt.selected { border-color: var(--primary); background: var(--bg-tint); }
.wizard-opt-rich { display: grid; gap: 4px; }
.wizard-opt-rich span { font-weight: 400; font-size: 14px; color: var(--text-soft); }
.wizard-opt-price { font-style: normal; font-size: 14px; font-weight: 700; color: var(--primary); }
.wizard-opt-price:empty { display: none; }
.wizard-out { color: var(--danger-text); }
.wizard-opt-multi { position: relative; padding-right: 52px; }
.wizard-opt-multi::after {
    content: '';
    position: absolute;
    right: 16px; top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
}
.wizard-opt-multi.selected::after {
    content: '✓';
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    color: var(--on-primary);
    font-size: 15px;
}
.wizard-hint { color: var(--text-muted); font-size: 14px; margin: -8px 0 16px; }
.wizard-hint-inline { color: var(--text-muted); font-size: 14px; font-weight: 400; }
.wizard-hint-after { color: var(--text-muted); font-size: 14px; margin: 12px 0 0; }
.wizard-kit-start { margin: 18px 0 0; font-size: 14px; color: var(--text-soft); }
.wizard-kit-start span { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wizard-chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg); color: var(--text);
    font-size: 14px; font-weight: 600; text-decoration: none;
}
.wizard-chip:hover { border-color: var(--primary); }
.wizard-chip[disabled] { opacity: .55; cursor: not-allowed; }
.wizard-nav {
    display: flex;
    justify-content: flex-start;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.wizard-nav:has(#wizardBack[hidden]) { display: none; }
.wizard-nav-build { border: none; padding-top: 8px; }
.wizard-nav-build .btn { width: 100%; }

/* --- Resumen --- */
.wizard-result h2 { font-size: 24px; margin-bottom: 8px; }
.wizard-result-intro { color: var(--text-soft); font-size: 15px; margin: 0 0 8px; }
.wizard-lines { list-style: none; margin: 0; padding: 0; }
.wizard-line {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas: "img info info" ". qty total";
    gap: 8px 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.wizard-line-img {
    grid-area: img; align-self: start;
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    background: #fff;
    display: grid; place-items: center; overflow: hidden;
}
.wizard-line-img img { width: 100%; height: 100%; object-fit: contain; }
.wizard-line-info { grid-area: info; display: grid; gap: 3px; min-width: 0; }
.wizard-line-name { color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.3; }
.wizard-line-note { color: var(--text-muted); font-size: 13px; line-height: 1.35; }
.wizard-line-unit { color: var(--text-soft); font-size: 13px; }
.wizard-badge-out { margin-left: 6px; color: var(--danger-text); font-weight: 700; }
.wizard-line-total { grid-area: total; text-align: right; white-space: nowrap; font-size: 15px; }
.wizard-line.is-zero, .wizard-line.is-out { opacity: .7; }
.wizard-line.is-out .wizard-line-total, .wizard-line.is-zero .wizard-line-total { text-decoration: line-through; }
.wizard-qty { grid-area: qty; display: inline-flex; align-items: center; gap: 4px; }
.wizard-qty button {
    width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text);
    font-size: 22px; line-height: 1; font-weight: 600;
}
.wizard-qty button:hover:not([disabled]) { border-color: var(--primary); }
.wizard-qty button[disabled] { opacity: .4; cursor: not-allowed; }
.wizard-qty output { min-width: 32px; text-align: center; font-weight: 700; font-size: 16px; }

.wizard-adjust { margin: 20px 0 0; }
.wizard-adjust h3 { font-size: 16px; margin-bottom: 10px; }
.wizard-adjust:focus { outline: none; }
.wizard-swaps { display: grid; gap: 8px; margin-bottom: 12px; }
.wizard-swaps .btn { justify-content: flex-start; text-align: left; white-space: normal; min-height: 48px; line-height: 1.35; font-size: 15px; }
.wizard-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wizard-stock-note {
    margin: 16px 0 0; padding: 12px 14px;
    border-left: 3px solid var(--danger-text);
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.wizard-stock-note a, .wizard-kit-alt a { color: var(--primary); text-decoration: underline; }
.wizard-kit-deal { margin: 14px 0 0; font-size: 14px; }
.wizard-kit-deal .link-btn { min-height: 44px; font-weight: 600; }
.wizard-ship { margin: 14px 0 0; color: var(--text-muted); font-size: 13px; }
.wizard-secondary { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 16px; }
.wizard-secondary .btn { flex: 1 1 200px; }
.wizard-lead-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 18px;
    margin: 0 0 16px;
    background: var(--bg-soft);
}
.wizard-lead-card summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: 16px; line-height: 1.3; }
.wizard-lead-card[open] { padding-bottom: 18px; }
.wizard-lead-card > p { margin: 0 0 16px; color: var(--text-soft); font-size: 14px; }
.wizard-lead-form { box-shadow: none; padding: 0; background: transparent; }
.wizard-kit-alt { font-size: 14px; color: var(--text-soft); margin-top: 12px; }

/* Barra del total: último hijo del resumen y pegada abajo, así se ve mientras se recorre
   todo el resumen (piezas, ajustes, revisión técnica) y no solo la lista. */
.wizard-buybar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px -40px 0;
    padding: 12px 40px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, .12);
}
.wizard-buybar-total { display: grid; line-height: 1.2; flex: 0 1 auto; min-width: 0; }
.wizard-buybar-total .price strong { font-size: 22px; white-space: nowrap; }
.wizard-buybar-total small { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.wizard-buybar .btn { flex: 1 1 auto; min-height: 52px; white-space: normal; }
/* El botón de WhatsApp flotante taparía la barra (y los importes de la derecha en el móvil):
   en el resumen sube por encima de la barra, y en el móvil se retira, porque el resumen ya
   tiene su propio «Enviar por WhatsApp». */
body.wizard-bar-on .wa-fab { bottom: 112px; }
.wizard-main ~ .site-footer { padding-bottom: 24px; }

@media (min-width: 640px) {
    .wizard-line {
        grid-template-columns: 64px minmax(0, 1fr) auto 104px;
        grid-template-areas: "img info qty total";
    }
    .wizard-line-img { width: 64px; height: 64px; }
}
@media (max-width: 720px) {
    .wizard-card { padding: 20px 16px; border-radius: var(--radius); }
    .wizard-step { padding-top: 20px; }
    .wizard-step h2 { font-size: 20px; }
    .wizard-buybar { margin: 16px -16px 0; padding-left: 16px; padding-right: 16px; }
    .wizard-buybar-total .price strong { font-size: 20px; }
    body.wizard-bar-on .wa-fab { display: none; }
}
@media (max-width: 380px) {
    .wizard-options-grid { grid-template-columns: 1fr; }
}
