/* ============================================================
   AS-BUILT 3D — Cotizador Online (widget popup)
   Prefijo abq- para no colisionar con estilos del sitio.
   Paleta = la del sitio en produccion (styles.css :root).
   ============================================================ */

.abq-root {
    --abq-bg: #0a0a0a;
    --abq-bg-card: #111111;
    --abq-bg-input: #1a1a1c;
    --abq-border: #2a2a2e;
    --abq-text: #ffffff;
    --abq-text-dim: #b0b0b5;
    --abq-accent: #2997ff;
    --abq-accent-hover: #0077ed;
    --abq-success: #30d158;
    --abq-whatsapp: #25d366;
    --abq-warn: #ffd60a;
    --abq-font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --abq-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --abq-radius: 16px;
    font-family: var(--abq-font-body);
    position: fixed;
    z-index: 99990;
    bottom: 0;
    right: 0;
    pointer-events: none; /* los hijos re-activan */
}

.abq-root *, .abq-root *::before, .abq-root *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Launcher (burbuja flotante) ---------- */
.abq-launcher {
    pointer-events: auto;
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1b6fd8 0%, var(--abq-accent) 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 22px 14px 16px;
    font-family: var(--abq-font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(41, 151, 255, .35);
    transition: transform .25s cubic-bezier(.25,.1,.25,1), box-shadow .25s;
}
.abq-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 40px rgba(41,151,255,.5); }
.abq-launcher svg { flex: 0 0 auto; }
.abq-launcher .abq-launcher-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    animation: abq-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes abq-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(41,151,255,.45); }
    70%  { box-shadow: 0 0 0 16px rgba(41,151,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(41,151,255,0); }
}
.abq-launcher-badge {
    position: absolute;
    top: -6px;
    right: -2px;
    background: var(--abq-success);
    color: #032;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: .04em;
}
.abq-hidden { display: none !important; }

/* ---------- Panel ---------- */
.abq-panel {
    pointer-events: auto;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 640px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    background: var(--abq-bg);
    border: 1px solid var(--abq-border);
    border-radius: var(--abq-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    animation: abq-panel-in .3s cubic-bezier(.25,.1,.25,1);
    color: var(--abq-text);
}
@keyframes abq-panel-in {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
    .abq-panel { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; bottom: 0; right: 0; }
}

/* ---------- Header ---------- */
.abq-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--abq-bg-card);
    border-bottom: 1px solid var(--abq-border);
    flex: 0 0 auto;
}
.abq-header-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1b6fd8, var(--abq-accent));
    display: grid; place-items: center;
    font-family: var(--abq-font-display);
    font-weight: 800; font-size: 13px; color: #fff;
    letter-spacing: -.02em;
    flex: 0 0 auto;
}
.abq-header-info { flex: 1 1 auto; min-width: 0; }
.abq-header-title {
    font-family: var(--abq-font-display);
    font-size: 15px; font-weight: 700; letter-spacing: .01em;
}
.abq-header-sub {
    font-size: 11.5px; color: var(--abq-text-dim);
    display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.abq-dot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--abq-success); box-shadow: 0 0 8px var(--abq-success); }
.abq-header-actions { display: flex; gap: 4px; }
.abq-iconbtn {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent; border: none;
    color: var(--abq-text-dim);
    border-radius: 8px; cursor: pointer;
    transition: background .2s, color .2s;
}
.abq-iconbtn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* barra de progreso */
.abq-progress { height: 3px; background: var(--abq-border); flex: 0 0 auto; }
.abq-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #1b6fd8, var(--abq-accent));
    transition: width .45s cubic-bezier(.25,.1,.25,1);
}

/* ---------- Chat ---------- */
.abq-chat {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.abq-chat::-webkit-scrollbar { width: 5px; }
.abq-chat::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.abq-msg { display: flex; gap: 9px; max-width: 92%; animation: abq-msg-in .28s ease-out; }
@keyframes abq-msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.abq-msg-bot { align-self: flex-start; }
.abq-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.abq-avatar {
    width: 28px; height: 28px; flex: 0 0 auto;
    border-radius: 8px;
    background: linear-gradient(135deg, #1b6fd8, var(--abq-accent));
    display: grid; place-items: center;
    margin-top: 2px;
}
.abq-avatar svg { display: block; }
.abq-bubble {
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
}
.abq-msg-bot .abq-bubble { background: var(--abq-bg-card); border: 1px solid var(--abq-border); border-top-left-radius: 4px; }
.abq-msg-user .abq-bubble { background: var(--abq-accent); color: #fff; border-top-right-radius: 4px; }
.abq-bubble strong { font-weight: 600; }
.abq-bubble small { color: var(--abq-text-dim); font-size: 11.5px; }

/* typing */
.abq-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.abq-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--abq-text-dim);
    animation: abq-blink 1.2s infinite;
}
.abq-typing span:nth-child(2) { animation-delay: .15s; }
.abq-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes abq-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- Chips ---------- */
.abq-chips {
    display: flex; flex-wrap: wrap; gap: 7px;
    padding: 2px 0 4px 37px;
    animation: abq-msg-in .3s ease-out;
}
.abq-chip {
    background: var(--abq-bg-input);
    border: 1px solid var(--abq-border);
    color: var(--abq-text);
    font-family: var(--abq-font-body);
    font-size: 12.5px;
    padding: 8px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
    text-align: left;
}
.abq-chip:hover { border-color: var(--abq-accent); background: rgba(41,151,255,.12); transform: translateY(-1px); }
.abq-chip-hint { display: block; font-size: 10.5px; color: var(--abq-text-dim); margin-top: 1px; }

/* tarjetas de servicio (paso 0) */
.abq-services {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 2px 0 4px 37px;
    animation: abq-msg-in .3s ease-out;
}
.abq-service-card {
    background: var(--abq-bg-card);
    border: 1px solid var(--abq-border);
    border-radius: 12px;
    padding: 11px 12px;
    cursor: pointer;
    text-align: left;
    color: var(--abq-text);
    font-family: var(--abq-font-body);
    transition: border-color .2s, background .2s, transform .15s;
}
.abq-service-card:hover { border-color: var(--abq-accent); background: rgba(41,151,255,.1); transform: translateY(-2px); }
.abq-service-icon { font-size: 19px; line-height: 1; margin-bottom: 6px; }
.abq-service-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.abq-service-price { font-size: 11px; color: var(--abq-accent); margin-top: 3px; font-weight: 500; }

/* ---------- Formulario lead ---------- */
.abq-leadform {
    display: flex; flex-direction: column; gap: 8px;
    padding: 4px 0 4px 37px;
    animation: abq-msg-in .3s ease-out;
}
.abq-leadform input {
    background: var(--abq-bg-input);
    border: 1px solid var(--abq-border);
    border-radius: 10px;
    color: var(--abq-text);
    font-family: var(--abq-font-body);
    font-size: 13px;
    padding: 10px 12px;
    outline: none;
    transition: border-color .2s;
    width: 100%;
}
.abq-leadform input:focus { border-color: var(--abq-accent); }
.abq-leadform input.abq-invalid { border-color: #ff453a; }
.abq-lead-submit {
    background: var(--abq-accent); color: #fff;
    border: none; border-radius: 10px;
    font-family: var(--abq-font-display);
    font-size: 13.5px; font-weight: 600;
    padding: 11px; cursor: pointer;
    transition: background .2s;
}
.abq-lead-submit:hover { background: var(--abq-accent-hover); }
.abq-lead-privacy { font-size: 10.5px; color: var(--abq-text-dim); line-height: 1.4; }

/* ---------- Tarjeta de cotizacion ---------- */
.abq-quote {
    margin-left: 37px;
    background: linear-gradient(180deg, #121a26 0%, var(--abq-bg-card) 100%);
    border: 1px solid rgba(41,151,255,.4);
    border-radius: 14px;
    overflow: hidden;
    animation: abq-msg-in .4s ease-out;
}
.abq-quote-head {
    padding: 12px 15px;
    background: rgba(41,151,255,.12);
    border-bottom: 1px solid rgba(41,151,255,.25);
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.abq-quote-head-title { font-family: var(--abq-font-display); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.abq-quote-ref { font-size: 10.5px; color: var(--abq-text-dim); font-family: ui-monospace, 'Cascadia Mono', monospace; }
.abq-quote-body { padding: 13px 15px; }
.abq-quote-lines { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.abq-quote-lines td { font-size: 12px; padding: 4.5px 0; vertical-align: top; }
.abq-quote-lines td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.abq-quote-lines .abq-line-dim td { color: var(--abq-text-dim); font-weight: 400; }
.abq-quote-lines tr.abq-line-total td {
    border-top: 1px solid var(--abq-border);
    padding-top: 9px; font-size: 12.5px;
}
.abq-price-list { color: var(--abq-text-dim); text-decoration: line-through; font-weight: 500; }
.abq-price-online-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 2px; flex-wrap: wrap; }
.abq-price-online-label { font-size: 12px; color: var(--abq-text-dim); display: flex; align-items: center; gap: 7px; }
.abq-badge-discount {
    background: var(--abq-success); color: #032;
    font-size: 10px; font-weight: 800;
    padding: 2px 7px; border-radius: 999px;
    letter-spacing: .03em;
}
.abq-price-online {
    font-family: var(--abq-font-display);
    font-size: 30px; font-weight: 800;
    color: var(--abq-accent);
    letter-spacing: -.02em;
}
.abq-price-online small { font-size: 14px; font-weight: 600; color: var(--abq-text-dim); }
.abq-quote-meta { font-size: 10.5px; color: var(--abq-text-dim); line-height: 1.55; margin-top: 9px; }
.abq-quote-ctas { display: flex; flex-direction: column; gap: 8px; padding: 0 15px 15px; }
.abq-cta {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    border: none; border-radius: 11px;
    font-family: var(--abq-font-display);
    font-size: 14px; font-weight: 600;
    padding: 12px; cursor: pointer;
    text-decoration: none;
    transition: transform .15s, filter .2s;
}
.abq-cta:hover { transform: translateY(-1px); filter: brightness(1.1); }
.abq-cta-wsp { background: var(--abq-whatsapp); color: #05240f; }
.abq-cta-mail { background: var(--abq-bg-input); color: var(--abq-text); border: 1px solid var(--abq-border); }
.abq-cta-restart { background: transparent; color: var(--abq-text-dim); font-size: 12px; padding: 6px; }

/* ---------- Input ---------- */
.abq-inputbar {
    flex: 0 0 auto;
    display: flex; gap: 8px;
    padding: 10px 12px;
    background: var(--abq-bg-card);
    border-top: 1px solid var(--abq-border);
}
.abq-inputbar input {
    flex: 1 1 auto;
    background: var(--abq-bg-input);
    border: 1px solid var(--abq-border);
    border-radius: 999px;
    color: var(--abq-text);
    font-family: var(--abq-font-body);
    font-size: 13px;
    padding: 10px 16px;
    outline: none;
    transition: border-color .2s;
    min-width: 0;
}
.abq-inputbar input:focus { border-color: var(--abq-accent); }
.abq-send {
    width: 40px; height: 40px; flex: 0 0 auto;
    border: none; border-radius: 50%;
    background: var(--abq-accent); color: #fff;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.abq-send:hover { background: var(--abq-accent-hover); transform: scale(1.06); }
.abq-send:disabled { background: var(--abq-border); cursor: not-allowed; transform: none; }
.abq-footerline {
    flex: 0 0 auto;
    text-align: center;
    font-size: 9.5px;
    color: #5a5a60;
    padding: 0 10px 8px;
    background: var(--abq-bg-card);
}

/* ---------- Panel modo/config (demo) ---------- */
.abq-config {
    position: absolute;
    top: 62px; right: 10px;
    width: calc(100% - 20px);
    max-width: 340px;
    background: #16161a;
    border: 1px solid var(--abq-border);
    border-radius: 12px;
    padding: 14px;
    z-index: 5;
    box-shadow: 0 16px 50px rgba(0,0,0,.55);
    animation: abq-msg-in .2s ease-out;
}
.abq-config h4 { font-family: var(--abq-font-display); font-size: 13px; margin-bottom: 10px; }
.abq-config-row { display: flex; gap: 7px; margin-bottom: 9px; }
.abq-mode-btn {
    flex: 1; padding: 8px;
    background: var(--abq-bg-input);
    border: 1px solid var(--abq-border);
    color: var(--abq-text-dim);
    border-radius: 9px; font-size: 12px; cursor: pointer;
    font-family: var(--abq-font-body);
    transition: all .2s;
}
.abq-mode-btn.abq-mode-active { border-color: var(--abq-accent); color: #fff; background: rgba(41,151,255,.15); font-weight: 600; }
.abq-config input {
    width: 100%;
    background: var(--abq-bg-input);
    border: 1px solid var(--abq-border);
    border-radius: 9px;
    color: var(--abq-text);
    font-size: 12px;
    font-family: ui-monospace, monospace;
    padding: 8px 10px;
    outline: none;
}
.abq-config input:focus { border-color: var(--abq-accent); }
.abq-config-note { font-size: 10.5px; color: var(--abq-text-dim); line-height: 1.5; margin-top: 8px; }
.abq-config-note strong { color: var(--abq-warn); }
.abq-config-status { font-size: 11px; margin-top: 6px; }
.abq-config-status.ok { color: var(--abq-success); }
.abq-config-status.err { color: #ff453a; }

/* accesibilidad */
.abq-root :focus-visible { outline: 2px solid var(--abq-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .abq-root *, .abq-root *::before, .abq-root *::after { animation: none !important; transition: none !important; }
}
