/*
 * Cotizador conversacional del botón de WhatsApp.
 * ------------------------------------------------------------
 * Estilos del popup tipo chat que abre el botón flotante de WhatsApp.
 * El posicionamiento del botón y del contenedor flotante vive en
 * site_header.css (.site-floating-actions / .wa-float); aquí sólo el panel.
 * Se carga global en layoutStart cuando hay chrome.
 * ------------------------------------------------------------
 */

/* El botón de WhatsApp pasa a ser <button> cuando el cotizador está activo. */
button.wa-float { border: 0; cursor: pointer; padding: 0; font: inherit; }
.wa-float.is-active { background: #1ebe57; }

/* ====== Panel ====== */
.waq {
    position: fixed;
    right: 18px;
    bottom: 86px;
    z-index: 95;
    width: min(360px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    background: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #ececef);
    border-radius: var(--radius-xl, 16px);
    box-shadow: var(--shadow-lg, 0 12px 32px -8px rgba(0,0,0,.18));
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s var(--ease-out-quart, ease), visibility .2s;
}
.waq.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }

/* ====== Cabecera ====== */
.waq__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm, .5rem);
    padding: .8rem .9rem;
    background: #075e54;
    color: #fff;
}
.waq__head-id { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.waq__head-id strong { display: block; font-size: .92rem; line-height: 1.2; }
.waq__head-id small { display: block; font-size: .72rem; opacity: .8; }
.waq__avatar {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #25d366; color: #fff;
}
.waq__close {
    flex: 0 0 auto;
    border: 0; background: transparent; color: #fff;
    font-size: 1.5rem; line-height: 1; cursor: pointer;
    width: 30px; height: 30px; border-radius: 8px;
    transition: background var(--transition, 150ms);
}
.waq__close:hover { background: rgba(255,255,255,.15); }

/* ====== Cuerpo / chat ====== */
.waq__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-md, 1rem);
    background:
        linear-gradient(rgba(229,221,213,.35), rgba(229,221,213,.35)),
        var(--color-bg-alt, #fafafa);
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.waq__bot {
    align-self: flex-start;
    max-width: 90%;
    margin: 0;
    padding: .6rem .75rem;
    background: #fff;
    border-radius: 4px 14px 14px 14px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
    font-size: .88rem;
    color: var(--color-text, #1a1a1a);
}

/* ====== Pasos ====== */
.waq__step { display: none; flex-direction: column; gap: .55rem; }
.waq__step.is-active { display: flex; animation: waqIn .22s var(--ease-out-quart, ease); }
@keyframes waqIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.waq__choices { display: flex; flex-direction: column; gap: .45rem; }
.waq__choice {
    display: block;
    width: 100%;
    text-align: left;
    padding: .7rem .85rem;
    border: 1px solid var(--color-border-strong, #d8d8de);
    border-radius: var(--radius, 10px);
    background: #fff;
    color: var(--color-text, #1a1a1a);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--transition,150ms), background var(--transition,150ms), transform var(--transition,150ms);
}
.waq__choice:hover { border-color: #25d366; background: #f3fdf6; transform: translateY(-1px); }
.waq__choice--repair span { display: flex; flex-direction: column; gap: .15rem; }
.waq__choice--repair small { font-weight: 500; color: var(--color-text-muted, #6b6b73); font-size: .76rem; }
.waq__choice--primary { background: #25d366; border-color: #25d366; color: #fff; }
.waq__choice--primary:hover { background: #1ebe57; border-color: #1ebe57; color: #fff; }
.waq__choice--link { color: #075e54; }

.waq__back {
    align-self: flex-start;
    margin-top: .15rem;
    border: 0; background: transparent;
    color: var(--color-text-muted, #6b6b73);
    font-size: .8rem; font-weight: 600; cursor: pointer;
    padding: .25rem 0;
}
.waq__back:hover { color: var(--color-text, #1a1a1a); }

/* ====== Formulario ====== */
.waq__summary {
    font-size: .82rem;
    color: var(--color-text-muted, #6b6b73);
    padding: .5rem .6rem;
    background: #fff;
    border-radius: var(--radius-sm, 6px);
    border: 1px dashed var(--color-border-strong, #d8d8de);
}
.waq__field { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--color-text-muted, #6b6b73); }
.waq__field input {
    font: inherit;
    font-weight: 500;
    padding: .55rem .65rem;
    border: 1px solid var(--color-border-strong, #d8d8de);
    border-radius: var(--radius-sm, 6px);
    background: #fff;
    color: var(--color-text, #1a1a1a);
}
.waq__field input:focus { outline: none; border-color: #25d366; box-shadow: 0 0 0 3px rgba(37,211,102,.15); }
.waq__honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.waq__submit {
    margin-top: .25rem;
    padding: .7rem;
    border: 0; border-radius: var(--radius, 10px);
    background: #25d366; color: #fff;
    font-size: .9rem; font-weight: 700; cursor: pointer;
    transition: background var(--transition,150ms);
}
.waq__submit:hover { background: #1ebe57; }
.waq__submit:disabled { opacity: .65; cursor: default; }

.waq__alert {
    font-size: .8rem;
    padding: .5rem .6rem;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-danger-soft, #fef2f2);
    color: var(--color-danger, #b91c1c);
}

/* ====== Resultado / precio ====== */
.waq__price {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    align-items: flex-start;
    padding: .8rem .9rem;
    background: #fff;
    border: 1px solid #25d366;
    border-radius: var(--radius, 10px);
}
.waq__price-label { font-size: .8rem; color: var(--color-text-muted, #6b6b73); }
.waq__price-value { font-size: 1.6rem; font-weight: 800; color: #075e54; font-variant-numeric: tabular-nums; }
.waq__price small { font-size: .72rem; color: var(--color-text-muted, #6b6b73); }

@media (max-width: 540px) {
    .waq { right: 16px; left: 16px; bottom: 84px; width: auto; max-height: 72vh; }
}
