/* Sales chat widget. Shared by both brands; colours come from the theme
   variables each brand already publishes through /theme.css, so the widget
   picks up the brand rather than carrying its own palette. */

.chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    font-family: inherit;
}

.chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    background: var(--theme-color, #14213d);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    /* Layered and colour-tinted rather than a flat drop shadow. */
    box-shadow: 0 1px 2px rgba(20, 33, 61, 0.18), 0 8px 24px -6px rgba(20, 33, 61, 0.34);
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.18s ease;
}

.chat-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(20, 33, 61, 0.2), 0 12px 30px -6px rgba(20, 33, 61, 0.4);
}

.chat-toggle:focus-visible {
    outline: 2px solid var(--accent-color, #f0a202);
    outline-offset: 3px;
}

.chat-toggle:active {
    transform: translateY(0);
}

.chat-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 58px;
    width: min(360px, calc(100vw - 40px));
    background: #fff;
    border: 1px solid rgba(20, 33, 61, 0.1);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(20, 33, 61, 0.08), 0 22px 48px -12px rgba(20, 33, 61, 0.3);
}

.chat[data-chat-open] .chat-panel {
    display: block;
}

.chat-head {
    padding: 13px 16px;
    background: var(--theme-color, #14213d);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.chat-head span {
    display: block;
    font-weight: 400;
    font-size: 12.5px;
    opacity: 0.75;
    margin-top: 2px;
}

.chat-log {
    max-height: 340px;
    min-height: 120px;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-line {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-line-bot {
    align-self: flex-start;
    background: #f2f4f8;
    color: #14213d;
    border-bottom-left-radius: 4px;
}

.chat-line-you {
    align-self: flex-end;
    background: var(--theme-color, #14213d);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(20, 33, 61, 0.09);
}

/* The input's label is for screen readers only. Defined here rather than
   assumed from the brand stylesheets: neither of them ships a
   `visually-hidden` utility, so relying on one printed "Your question" on the
   page and squeezed the input to half its width. */
.chat .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-form input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(20, 33, 61, 0.16);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
}

.chat-form input:focus-visible {
    outline: 2px solid var(--accent-color, #f0a202);
    outline-offset: 1px;
}

.chat-form button {
    padding: 10px 15px;
    border: none;
    border-radius: 9px;
    background: var(--accent-color, #f0a202);
    color: #14213d;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.chat-form button:hover {
    opacity: 0.88;
}

.chat-form button:focus-visible {
    outline: 2px solid var(--theme-color, #14213d);
    outline-offset: 2px;
}

.chat-form[data-chat-busy='true'] button {
    opacity: 0.5;
    cursor: default;
}

.chat-note {
    padding: 0 16px 12px;
    font-size: 11.5px;
    line-height: 1.5;
    color: #6b7280;
}

@media (prefers-reduced-motion: reduce) {
    .chat-toggle {
        transition: none;
    }
}
