/*
 * El chat de citas de Molvox en la web (templates/landing/_booking_chat.html.twig, assets/molvox-chat.js). Como el chat de
 * Encario: botón flotante en píldora, panel oscuro con burbujas, opciones claras para tocar. Con el cobre de Molvox.
 * En /citas (`.is-page`) el panel va abierto y a todo el alto, sin botón flotante.
 */
.mv-chat {
    --mv-bg: #1a1310;
    --mv-panel: #221913;
    --mv-panel-strong: #2d221c;
    --mv-text: #f6f1ea;
    --mv-muted: #c9b9ad;
    --mv-line: rgba(246, 241, 234, .14);
    --mv-copper: #b9705a;
    --mv-copper-btn: #9a5a46;
    --mv-copper-hover: #8a5440;
    --mv-paper: #f6f1ea;
    --mv-ink: #241a15;
    --mv-ease: cubic-bezier(.16, 1, .3, 1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--mv-text);
    font-size: 15px;
    line-height: 1.45;
}

.mv-chat *, .mv-chat *::before, .mv-chat *::after { box-sizing: border-box; }
.mv-chat [hidden] { display: none !important; }

/* ------------------------------------------------------------- flotante (portada) */
.mv-chat.is-landing {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.mv-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 6px 20px 6px 7px;
    border: 0;
    border-radius: 999px;
    background: var(--mv-copper-btn);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
    transition: transform .2s var(--mv-ease), background-color .2s;
}
.mv-chat-launcher:hover { background: var(--mv-copper-hover); transform: translateY(-1px); }
.mv-chat-launcher img { width: 38px; height: 38px; padding: 4px; border-radius: 50%; background: var(--mv-bg); }
.mv-chat-launcher:focus-visible, .mv-chat button:focus-visible, .mv-chat a:focus-visible, .mv-chat input:focus-visible {
    outline: 3px solid #f2c2a8;
    outline-offset: 2px;
}

.mv-chat-teaser {
    position: relative;
    margin: 0;
    padding: 10px 34px 10px 14px;
    border-radius: 16px 16px 4px 16px;
    background: var(--mv-paper);
    color: var(--mv-ink);
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.mv-chat-teaser-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--mv-ink);
    font-size: 18px;
    cursor: pointer;
}

.mv-chat.is-landing .mv-chat-panel {
    width: min(400px, calc(100vw - 32px));
    height: min(620px, calc(100svh - 110px));
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    animation: mv-chat-in .35s var(--mv-ease);
}
@keyframes mv-chat-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- panel */
.mv-chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--mv-panel);
    border: 1px solid var(--mv-line);
}

.mv-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    background: var(--mv-panel-strong);
    border-bottom: 1px solid var(--mv-line);
}
.mv-chat-head img { width: 36px; height: 36px; padding: 4px; border-radius: 50%; background: var(--mv-bg); }
.mv-chat-head div { flex: 1; display: grid; min-width: 0; }
.mv-chat-head strong { font-size: 16px; }
.mv-chat-head small { color: var(--mv-muted); font-size: 13px; }
.mv-chat-icon {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(246, 241, 234, .08);
    color: var(--mv-text);
    font-size: 20px;
    cursor: pointer;
}
.mv-chat-icon:hover { background: rgba(246, 241, 234, .16); }

.mv-chat-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mv-bubble {
    max-width: 88%;
    padding: 10px 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    animation: mv-chat-in .3s var(--mv-ease);
}
.mv-bubble.is-bot { align-self: flex-start; border-radius: 4px 16px 16px 16px; background: var(--mv-panel-strong); }
.mv-bubble.is-me { align-self: flex-end; border-radius: 16px 4px 16px 16px; background: var(--mv-copper-btn); color: #fff; font-weight: 600; }
.mv-bubble a { color: #f2c2a8; }
.mv-bubble-note { align-self: flex-start; margin: -4px 0 0 4px; color: var(--mv-muted); font-size: 12px; }

.mv-options { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.mv-option {
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: var(--mv-paper);
    color: var(--mv-ink);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform .15s var(--mv-ease), background-color .15s;
}
.mv-option:hover { background: #fff; transform: translateY(-1px); }
.mv-option small { color: #7a6a60; font-weight: 500; font-size: 13px; }
.mv-options.is-used .mv-option { opacity: .45; pointer-events: none; }
.mv-options.is-used .mv-option.is-picked { opacity: 1; outline: 2px solid var(--mv-copper); }

.mv-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px; border-radius: 4px 16px 16px 16px; background: var(--mv-panel-strong); }
.mv-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mv-muted); animation: mv-dot 1s infinite ease-in-out; }
.mv-typing i:nth-child(2) { animation-delay: .15s; }
.mv-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mv-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.mv-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--mv-line);
    background: var(--mv-panel-strong);
}
.mv-chat-input input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--mv-line);
    border-radius: 12px;
    background: var(--mv-bg);
    color: var(--mv-text);
    font: inherit;
    font-size: 16px;
}
.mv-chat-send {
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--mv-copper-btn);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.mv-chat-send:hover { background: var(--mv-copper-hover); }
.mv-chat-send:disabled { opacity: .6; cursor: default; }

.mv-chat-foot { padding: 8px 14px 10px; text-align: center; font-size: 13px; color: var(--mv-muted); }
.mv-chat-foot a { color: var(--mv-muted); text-decoration: underline; text-underline-offset: 2px; }
.mv-chat-foot a:hover { color: var(--mv-text); }
.mv-chat-noscript { padding: 0 14px 14px; color: var(--mv-muted); }

/* ------------------------------------------------------------- /citas */
body.mv-citas {
    margin: 0;
    min-height: 100svh;
    background:
        radial-gradient(60% 40% at 80% 0%, rgba(185, 112, 90, .28), transparent 70%),
        radial-gradient(50% 40% at 0% 100%, rgba(216, 162, 79, .14), transparent 70%),
        #1a1310;
    color: #f6f1ea;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mv-citas-main { width: min(560px, 100% - 32px); margin: 0 auto; padding: 24px 0 16px; display: grid; gap: 10px; }
.mv-citas-brand img { display: block; height: 28px; width: auto; }
.mv-citas-title { margin: 18px 0 0; font-size: clamp(32px, 8vw, 48px); font-weight: 850; line-height: 1.04; }
.mv-citas-lead { margin: 0 0 8px; color: #c9b9ad; font-size: 17px; }
.mv-chat.is-page .mv-chat-panel { height: min(680px, calc(100svh - 190px)); min-height: 460px; border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }

@media (max-width: 680px) {
    .mv-chat-launcher span { display: none; }
    .mv-chat-launcher { padding: 6px; }
    .mv-chat.is-landing .mv-chat-panel { height: calc(100svh - 96px); }
}

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

/* El asistente de la portada (para negocios) entra desde este chat: su botón propio no se ve. */
body.has-mv-chat .landing-assistant-launcher { display: none !important; }

/* Y al revés: con el chat de negocios abierto, el botón «Pide cita» (y su bocadillo) no se ve; vuelve al cerrarlo. */
body.is-business-chat-open .mv-chat.is-landing { display: none !important; }
