/* ============================================================
   4 On Sierra — Asistente virtual (guionizado, sin backend)
   Markup generado por assets/asistente.js · prefijo .aos
   ============================================================ */
.aos {
    --aos-black: #010205;
    --aos-navy: #1B2A4A;
    --aos-navy-d: #0F1C35;
    --aos-surface: #0A1222;
    --aos-bubble: #16233F;
    --aos-steel: #7d95c4;
    --aos-steel-l: #a9badb;
    --aos-ink: #0F1C35;
    --aos-paper: #F2F5FA;
    --aos-line: rgba(169, 186, 219, 0.18);
    --aos-line-2: rgba(169, 186, 219, 0.36);
    --aos-text: #E8EDF6;
    --aos-sub: #B4C2DC;
    --aos-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --aos-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    --aos-gap: 16px;
    --aos-safe-b: env(safe-area-inset-bottom, 0px);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--aos-text);
    text-align: left;
}
.aos *, .aos *::before, .aos *::after { box-sizing: border-box; }
:where(.aos) p { margin: 0; text-align: inherit; hyphens: manual; }
:where(.aos) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.aos) a { -webkit-tap-highlight-color: transparent; }
.aos svg { display: block; flex-shrink: 0; }
.aos-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botón flotante ---------- */
.aos-launch-wrap {
    position: fixed; right: var(--aos-gap); bottom: calc(var(--aos-gap) + var(--aos-safe-b));
    z-index: 8400; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
    pointer-events: none;
    transition: transform 0.45s var(--aos-ease), opacity 0.25s ease, visibility 0s;
}
.aos.is-hidden .aos-launch-wrap,
.aos.is-foot:not(.is-open) .aos-launch-wrap,
.aos.is-avoid:not(.is-open) .aos-launch-wrap,
.aos:not(.is-ready) .aos-launch-wrap { opacity: 0; visibility: hidden; transition: transform 0.45s var(--aos-ease), opacity 0.2s ease, visibility 0s linear 0.2s; }
.aos.is-open .aos-launch-wrap { pointer-events: none; }

.aos-launch {
    pointer-events: auto; position: relative;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--aos-navy); color: #fff;
    box-shadow: inset 0 0 0 1px rgba(180, 198, 230, 0.28), 0 6px 8px rgba(1, 2, 5, 0.32);
    display: grid; place-items: center;
    transition: transform 0.16s var(--aos-ease), background-color 0.2s ease;
}
.aos-launch:active { transform: scale(0.95); }
.aos-launch:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .aos-launch:hover { background: #24375f; } }
.aos-launch .aos-ic { grid-area: 1 / 1; transition: opacity 0.2s ease, transform 0.25s var(--aos-ease); }
.aos-launch .aos-ic-x { opacity: 0; transform: rotate(-45deg) scale(0.8); }
.aos.is-open .aos-launch .aos-ic-chat { opacity: 0; transform: rotate(45deg) scale(0.8); }
.aos.is-open .aos-launch .aos-ic-x { opacity: 1; transform: none; }
.aos-launch-dot {
    position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border-radius: 50%;
    background: var(--aos-steel-l); box-shadow: 0 0 0 2px var(--aos-navy);
    opacity: 0; transform: scale(0.6); transition: opacity 0.2s ease, transform 0.25s var(--aos-ease);
}
.aos.has-nudge .aos-launch-dot { opacity: 1; transform: none; }

/* Invitación */
.aos-nudge {
    pointer-events: auto; position: relative;
    width: min(272px, calc(100vw - 32px));
    background: var(--aos-paper); color: var(--aos-ink);
    border-radius: 14px; padding: 14px 44px 14px 16px;
    box-shadow: 0 6px 8px rgba(1, 2, 5, 0.28);
    transform-origin: bottom right;
    opacity: 0; transform: translateY(6px) scale(0.97); visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s var(--aos-ease), visibility 0s linear 0.18s;
}
.aos-nudge::after {
    content: ''; position: absolute; right: 22px; bottom: -6px; width: 12px; height: 12px;
    background: var(--aos-paper); transform: rotate(45deg); border-radius: 2px;
}
.aos.has-nudge:not(.is-open) .aos-nudge { opacity: 1; transform: none; visibility: visible; transition: opacity 0.3s ease, transform 0.35s var(--aos-ease), visibility 0s; }
.aos-nudge-main { display: block; width: 100%; text-align: left; min-height: 44px; }
.aos-nudge-t { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.aos-nudge-s { display: block; font-size: 13px; line-height: 1.4; color: #3b4a68; margin-top: 3px; }
.aos-nudge-x {
    position: absolute; top: 2px; right: 2px; width: 44px; height: 44px;
    display: grid; place-items: center; color: #3b4a68; border-radius: 10px;
}
.aos-nudge-x:active { transform: scale(0.94); }
.aos-nudge-main:focus-visible, .aos-nudge-x:focus-visible { outline: 2px solid var(--aos-navy); outline-offset: 2px; border-radius: 8px; }

/* ---------- Panel ---------- */
.aos-panel {
    position: fixed; z-index: 8450;
    right: var(--aos-gap); bottom: calc(var(--aos-gap) + 56px + 12px + var(--aos-safe-b));
    width: 384px; height: min(600px, calc(100svh - 56px - 12px - 2 * var(--aos-gap) - 24px));
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--aos-surface);
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px var(--aos-line), 0 8px 8px rgba(1, 2, 5, 0.35);
    transform-origin: bottom right;
    opacity: 0; transform: translateY(8px) scale(0.97); visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s var(--aos-ease), visibility 0s linear 0.16s;
}
.aos.is-open .aos-panel { opacity: 1; transform: none; visibility: visible; transition: opacity 0.22s ease, transform 0.26s var(--aos-ease), visibility 0s; }

/* Escritorio: sobre el hero y el scroll horizontal (#servicios) el botón sube por encima
   de su franja inferior (lista de divisiones / indicador 01-02-03 y contador) */
@media (min-width: 1024px) {
    .aos-launch-wrap { transform: translateY(calc(-1 * var(--aos-lift, 0px))); }
    .aos.is-open .aos-launch-wrap { transform: none; }
}

/* Móvil y tableta (<1024): el botón se acopla a la barra «Llamar / Escribir» (#rc-quickbar),
   aparece y se oculta con ella (tras el hero; oculto en contacto, footer y menú) y nunca flota sobre el contenido */
@media (max-width: 1023px) {
    .aos-launch-wrap { right: 10px; bottom: calc(10px + var(--aos-safe-b)); gap: 10px; }
    .aos-launch {
        border-radius: 12px; background: #0F1C35;
        box-shadow: inset 0 0 0 1px rgba(180, 198, 230, 0.22), 0 6px 8px rgba(1, 2, 5, 0.28);
    }
    .aos-launch-dot { top: 6px; right: 6px; box-shadow: 0 0 0 2px #0F1C35; }
    .aos:not(.is-qb):not(.is-open) .aos-launch-wrap { opacity: 0; visibility: hidden; transform: translateY(24px); transition: transform 0.45s var(--aos-ease), opacity 0.2s ease, visibility 0s linear 0.45s; }
    .aos-panel { bottom: calc(10px + 56px + 12px + var(--aos-safe-b)); height: min(600px, calc(100svh - 56px - 12px - 10px - 24px)); }
}
/* Barra acoplada: deja sitio al botón del asistente a su derecha */
@media (max-width: 559px) {
    html.aos-dock #rc-quickbar { left: 10px; width: calc(100% - 20px - 56px - 6px); transform: translate(0, calc(100% + 24px)); }
    html.aos-dock #rc-quickbar.is-on { transform: translate(0, 0); }
}

/* Cabecera */
.aos-head {
    flex-shrink: 0; display: flex; align-items: center; gap: 12px;
    padding: 12px 6px 12px 14px; background: var(--aos-navy-d);
    border-bottom: 1px solid var(--aos-line);
}
.aos-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--aos-black); display: grid; place-items: center; overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--aos-line-2);
}
.aos-avatar img { width: 30px; height: auto; filter: brightness(0) invert(1); }
.aos-id { flex: 1; min-width: 0; }
.aos-name { display: block; font-family: 'Bebas Neue', 'Inter', sans-serif; font-size: 24px; line-height: 1; letter-spacing: 0.04em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aos-role { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; line-height: 1.2; color: var(--aos-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aos-role::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--aos-steel-l); flex-shrink: 0; }
.aos-hbtn + .aos-hbtn { margin-left: -8px; }
.aos-hbtn {
    width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
    color: var(--aos-sub); text-decoration: none; flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.16s var(--aos-ease);
}
.aos-hbtn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .aos-hbtn:hover { background: rgba(169, 186, 219, 0.1); color: #fff; } }
.aos-hbtn:focus-visible { outline: 2px solid var(--aos-steel-l); outline-offset: -2px; }

/* Progreso de cotización */
.aos-prog { flex-shrink: 0; height: 2px; background: rgba(169, 186, 219, 0.12); overflow: hidden; opacity: 0; transition: opacity 0.2s ease; }
.aos-prog.is-on { opacity: 1; }
.aos-prog i { display: block; height: 100%; width: 100%; background: var(--aos-steel); transform-origin: left; transform: scaleX(0); transition: transform 0.4s var(--aos-ease); }

/* Mensajes */
.aos-log {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 6px;
    scrollbar-width: thin; scrollbar-color: rgba(169, 186, 219, 0.25) transparent;
    -webkit-overflow-scrolling: touch;
}
.aos-day { align-self: center; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--aos-sub); margin: 0 0 10px; }
.aos-row { display: flex; flex-direction: column; max-width: 86%; }
.aos-row.is-bot { align-self: flex-start; }
.aos-row.is-user { align-self: flex-end; align-items: flex-end; }
.aos-row.is-wide { max-width: 100%; width: 100%; }
.aos-row + .aos-row.is-user, .aos-row.is-user + .aos-row.is-bot { margin-top: 8px; }
.aos-bub {
    font-size: 15px; line-height: 1.5; padding: 10px 14px; border-radius: 16px;
    overflow-wrap: anywhere; white-space: pre-line;
}
.is-bot .aos-bub { background: var(--aos-bubble); color: var(--aos-text); border-bottom-left-radius: 6px; }
.is-user .aos-bub { background: var(--aos-paper); color: var(--aos-ink); border-bottom-right-radius: 6px; }
.aos-bub strong { font-weight: 600; color: #fff; }
.is-user .aos-bub strong { color: var(--aos-ink); }
/* Mensajes de varias líneas: justificados (pedido del dueño) */
.aos-bub.is-long { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.aos-time { font-size: 11px; color: rgba(180, 194, 220, 0.75); margin-top: 4px; padding: 0 4px; display: none; }
.aos-row.show-time .aos-time { display: block; }

/* Escribiendo… */
.aos-typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: var(--aos-bubble); border-radius: 16px; border-bottom-left-radius: 6px; margin-top: 2px; }
.aos-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--aos-steel-l); opacity: 0.35; animation: aos-dot 1.1s ease-in-out infinite; }
.aos-typing i:nth-child(2) { animation-delay: 0.15s; }
.aos-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aos-dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Entrada de mensajes */
.aos-anim .aos-row.is-new, .aos-anim .aos-typing.is-new { animation: aos-in 0.28s var(--aos-ease) both; }
.aos-anim .aos-row.is-user.is-new { animation-name: aos-in-r; }
@keyframes aos-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aos-in-r { from { opacity: 0; transform: translate(6px, 6px); } to { opacity: 1; transform: none; } }

/* Tarjeta de servicio */
.aos-card { background: var(--aos-bubble); border-radius: 16px; border-bottom-left-radius: 6px; overflow: hidden; }
.aos-card-img { aspect-ratio: 16 / 8; background: var(--aos-navy-d); overflow: hidden; }
.aos-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aos-card-b { padding: 12px 14px 14px; }
.aos-card-cat { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--aos-steel-l); }
.aos-card-t { font-family: 'Bebas Neue', 'Inter', sans-serif; font-size: 28px; line-height: 0.95; letter-spacing: 0.02em; color: #fff; margin: 6px 0 8px; text-wrap: balance; }
.aos-card-p { font-size: 14.5px; line-height: 1.55; color: var(--aos-text); text-align: justify; -webkit-hyphens: auto; hyphens: auto; }

/* Ficha de cotización */
.aos-sheet { background: var(--aos-paper); color: var(--aos-ink); border-radius: 14px; padding: 16px 16px 6px; }
.aos-sheet-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid rgba(15, 28, 53, 0.14); }
.aos-sheet-t { font-family: 'Bebas Neue', 'Inter', sans-serif; font-size: 26px; line-height: 1; letter-spacing: 0.03em; }
.aos-sheet-d { font-size: 12px; color: #3b4a68; white-space: nowrap; }
.aos-sheet dl { margin: 0; }
.aos-sheet-r { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(15, 28, 53, 0.08); font-size: 14px; line-height: 1.4; }
.aos-sheet-r:last-child { border-bottom: 0; }
.aos-sheet dt { color: #3b4a68; font-size: 12px; letter-spacing: 0.04em; padding-top: 1px; }
.aos-sheet dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; text-align: left; }

/* Tarjeta de contacto */
.aos-contact { display: grid; gap: 6px; }
.aos-cbtn {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px;
    background: var(--aos-bubble); color: #fff; text-decoration: none; border-radius: 12px;
    transition: background-color 0.2s ease, transform 0.16s var(--aos-ease);
}
.aos-cbtn:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .aos-cbtn:hover { background: #1d2d50; } }
.aos-cbtn:focus-visible { outline: 2px solid var(--aos-steel-l); outline-offset: 2px; }
.aos-cbtn svg { color: var(--aos-steel-l); }
.aos-cbtn b { display: block; font-size: 15px; font-weight: 600; }
.aos-cbtn small { display: block; font-size: 12px; color: var(--aos-sub); margin-top: 1px; }

/* Respuestas rápidas */
.aos-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; }
.aos-chip {
    min-height: 44px; padding: 10px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 500; line-height: 1.25; text-align: left; text-decoration: none;
    color: var(--aos-text); background: transparent;
    box-shadow: inset 0 0 0 1px var(--aos-line-2);
    display: inline-flex; align-items: center; gap: 8px;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.16s var(--aos-ease);
}
.aos-chip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .aos-chip:hover { background: rgba(125, 149, 196, 0.14); box-shadow: inset 0 0 0 1px var(--aos-steel); } }
.aos-chip:focus-visible { outline: 2px solid var(--aos-steel-l); outline-offset: 2px; }
.aos-chip.is-primary { background: var(--aos-paper); color: var(--aos-ink); box-shadow: none; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .aos-chip.is-primary:hover { background: #fff; box-shadow: none; } }
.aos-chip.is-quiet { color: var(--aos-sub); box-shadow: none; padding-left: 12px; padding-right: 12px; }
.aos-chip[aria-pressed="true"] { background: var(--aos-steel); color: var(--aos-black); box-shadow: none; }
.aos-chip .aos-chk { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px currentColor; display: grid; place-items: center; flex-shrink: 0; }
.aos-chip .aos-chk svg { opacity: 0; }
.aos-chip[aria-pressed="true"] .aos-chk svg { opacity: 1; }
.aos-chip[disabled] { opacity: 0.45; cursor: default; }
.aos-anim .aos-chips.is-new .aos-chip { animation: aos-in 0.26s var(--aos-ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

/* Entrada de texto */
.aos-form {
    flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 10px calc(10px + var(--aos-safe-b)) 14px;
    border-top: 1px solid var(--aos-line); background: var(--aos-surface);
}
.aos-input {
    flex: 1; min-width: 0; min-height: 44px; max-height: 120px;
    font: inherit; font-size: 16px; line-height: 1.4; color: #fff;
    background: rgba(169, 186, 219, 0.08); border: 0; border-radius: 12px;
    padding: 11px 14px; resize: none; outline: none;
    box-shadow: inset 0 0 0 1px var(--aos-line);
    transition: box-shadow 0.18s ease, background-color 0.18s ease;
}
.aos-input::placeholder { color: #93a3c2; opacity: 1; }
.aos-input:focus { box-shadow: inset 0 0 0 1px var(--aos-steel); background: rgba(169, 186, 219, 0.12); }
.aos-send {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--aos-paper); color: var(--aos-ink);
    transition: opacity 0.18s ease, transform 0.16s var(--aos-ease);
}
.aos-send:active { transform: scale(0.94); }
.aos-send[disabled] { opacity: 0.35; cursor: default; }
.aos-send:focus-visible { outline: 2px solid var(--aos-steel-l); outline-offset: 2px; }

/* Resaltado del formulario de contacto prellenado */
#contact-form.aos-filled { outline: 2px solid #7d95c4; outline-offset: 10px; border-radius: 6px; transition: outline-color 1.2s ease; }
#contact-form.aos-filled.aos-filled-out { outline-color: rgba(125, 149, 196, 0); }

/* ---------- Móvil: panel a pantalla casi completa ---------- */
@media (max-width: 639px) {
    .aos { --aos-gap: 12px; }
    .aos-panel {
        inset: 0; width: 100%; height: 100%; height: 100svh; max-height: none; border-radius: 0;
        box-shadow: none;
        transform: translateY(24px); transform-origin: bottom center;
        transition: opacity 0.18s ease, transform 0.2s var(--aos-drawer), visibility 0s linear 0.2s;
    }
    .aos.is-open .aos-panel { transition: opacity 0.22s ease, transform 0.32s var(--aos-drawer), visibility 0s; }
    .aos-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
    .aos-row { max-width: 90%; }
    .aos.is-open .aos-launch-wrap { opacity: 0; visibility: hidden; }
}
@media (min-width: 640px) and (max-height: 560px) {
    .aos-panel { height: calc(100svh - 56px - 12px - 2 * var(--aos-gap) - 8px); }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
    .aos-launch-wrap, .aos-panel, .aos.is-open .aos-panel, .aos-nudge, .aos.has-nudge:not(.is-open) .aos-nudge,
    .aos-launch, .aos-launch .aos-ic, .aos-chip, .aos-cbtn, .aos-hbtn, .aos-prog i, .aos-send, .aos-launch-dot {
        transition: opacity 0.12s ease !important; /* visibility cambia al instante: el foco puede moverse sin esperar */
    }
    .aos-panel, .aos-nudge, .aos-launch .aos-ic { transform: none !important; }
    .aos-anim .aos-row.is-new, .aos-anim .aos-typing.is-new, .aos-anim .aos-chips.is-new .aos-chip { animation: none !important; }
    .aos-typing i { animation: none; opacity: 0.7; }
    .aos-launch:active, .aos-chip:active, .aos-cbtn:active, .aos-hbtn:active, .aos-send:active { transform: none; }
    .aos-prog i { transition: none !important; }
}
@media print { .aos { display: none !important; } }

/* WhatsApp: ícono en verde de la marca WhatsApp para que se reconozca (solo el ícono) */
.aos-ic-wa { color: #25D366 !important; }
