/*
 * El chat de la portada (templates/landing/_assistant_widget.html.twig + landing-assistant.js), aparte de landing.css para que la
 * portada (landing-home.css) no cargue los estilos de las otras páginas públicas. Es copia de su bloque en landing.css, que siguen
 * usando la demo y las páginas legales, con sus colores puestos aquí: no depende de las variables de la página.
 */
.landing-assistant-root {
    --ink: #241a15;
    --muted: #7a6a60;
    --line: #e7ddd1;
    --teal: #ac6450;
    --teal-dark: #8a5440;
    --amber: #d8a24f;
    --charcoal: #221913;

    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.landing-assistant-root *,
.landing-assistant-root *::before,
.landing-assistant-root *::after {
    box-sizing: border-box;
}

.landing-assistant-launcher,
.landing-assistant-panel,
.landing-assistant-chip,
.landing-assistant-send,
.landing-assistant-icon-button,
.landing-assistant-input {
    font: inherit;
}

.landing-assistant-launcher {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 188px;
    min-height: 52px;
    padding: 8px 15px 8px 8px;
    border: 4px solid #fff;
    border-radius: 999px;
    background: var(--teal);
    color: #fff;
    box-shadow: 0 18px 45px rgba(18, 32, 31, 0.24);
    cursor: pointer;
    transition: transform 0.22s ease, opacity 0.18s ease, visibility 0.18s ease;
}

.landing-assistant-launcher:hover {
    transform: translateY(-2px);
}

.landing-assistant-launcher:focus-visible {
    transform: translateY(-2px);
    outline: 3px solid var(--amber);
    outline-offset: 3px;
}

.landing-assistant-root.is-open .landing-assistant-launcher {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.landing-assistant-launcher-avatar,
.landing-assistant-header-logo {
    display: grid;
    place-items: center;
    background: #fff;
    flex: none;
}

.landing-assistant-launcher-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.landing-assistant-launcher-avatar::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--amber);
}

.landing-assistant-launcher-avatar img {
    display: block;
    width: 25px;
    height: 25px;
}

.landing-assistant-launcher-copy {
    display: grid;
    gap: 2px;
    text-align: left;
}

.landing-assistant-launcher-copy strong {
    font-size: 0.84rem;
    line-height: 1.1;
    white-space: nowrap;
}

.landing-assistant-launcher-copy small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.7rem;
    line-height: 1.1;
    white-space: nowrap;
}

.landing-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    width: min(350px, calc(100vw - 28px));
    height: min(520px, calc(100dvh - 92px));
    overflow: hidden;
    border: 1px solid rgba(18, 32, 31, 0.14);
    border-radius: 8px;
    background: #f7f2ea;
    box-shadow: 0 26px 70px rgba(18, 32, 31, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(16px, 18px, 0) scale(0.92);
    transform-origin: bottom right;
    transition: opacity 0.26s ease, transform 0.3s ease;
}

.landing-assistant-root.is-open .landing-assistant-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
}

.landing-assistant-panel[hidden] {
    display: none !important;
}

.landing-assistant-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
    color: #fff;
    background: var(--charcoal);
}

.landing-assistant-header-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.landing-assistant-header-logo img {
    display: block;
    width: 32px;
    height: 32px;
}

.landing-assistant-header-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.landing-assistant-header-copy strong {
    font-size: 1rem;
    line-height: 1.15;
}

.landing-assistant-header-copy small {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
}

.landing-assistant-icon-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.landing-assistant-icon-button:hover,
.landing-assistant-icon-button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

.landing-assistant-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.landing-assistant-message {
    display: flex;
}

.landing-assistant-message-user {
    justify-content: flex-end;
}

.landing-assistant-message-assistant {
    justify-content: flex-start;
}

.landing-assistant-bubble {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.landing-assistant-message-user .landing-assistant-bubble {
    color: #fff;
    background: var(--teal);
}

.landing-assistant-message-assistant .landing-assistant-bubble {
    color: var(--ink);
    background: #fff;
    border: 1px solid rgba(18, 32, 31, 0.08);
}

.landing-assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 10px;
}

.landing-assistant-chip {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 999px;
    color: var(--teal-dark);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.landing-assistant-whatsapp {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid rgba(18, 32, 31, 0.08);
    color: var(--muted);
    font-size: 0.82rem;
}

.landing-assistant-whatsapp a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--teal-dark);
    font-weight: 700;
    text-decoration: none;
}

.landing-assistant-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(18, 32, 31, 0.08);
    background: #fff;
}

.landing-assistant-input {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    resize: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.landing-assistant-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.landing-assistant-send {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--teal);
    cursor: pointer;
}

.landing-assistant-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.landing-assistant-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 680px) {
    .landing-assistant-root {
        right: 14px;
        bottom: 14px;
    }

    /* El lanzador del chat, redondo y pequeño: no tapa los botones. */
    .landing-assistant-launcher {
        min-width: 0;
        width: 56px;
        height: 56px;
        min-height: 56px;
        padding: 0;
        justify-content: center;
    }

    .landing-assistant-launcher-copy {
        display: none;
    }
}
