/* =========================================
   FLOATING CHAT BOT LAUNCHER (shared by every page)
   ========================================= */
.chat-bot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 64px;
    height: 64px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 20, 80, 0.25);
    cursor: pointer;
    z-index: 1000;
    border: 3px solid var(--white);
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* Migs avatar */
.chat-bot-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.chat-bot:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 20, 80, 0.3);
}
.chat-bot:focus-visible {
    outline: 3px solid var(--secondary-blue);
    outline-offset: 2px;
}
/* Unread dot */
.chat-bot::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background-color: var(--red-brand);
    border-radius: 50%;
    border: 3px solid var(--white);
}
/* Unread dot disappears once Migs has been opened */
.chat-bot.is-seen::after {
    display: none;
}
@media (prefers-reduced-motion: reduce) {
    .chat-bot { transition: none; }
    .chat-bot:hover { transform: none; }
}

/* CHAT WINDOW CONTAINER */
.chat-window-wrapper {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 360px;
    background-color: #f8f9fc;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    font-family: var(--font-family);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.chat-window-wrapper.show {
    display: flex;
}

/* CHAT HEADER */
.chat-header {
    background-color: #05143a;
    color: var(--white);
    padding: 19px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chat-header-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.chat-header-info p {
    font-size: 12px;
    color: #a0aacc;
}

.chat-close-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 19px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* CHAT BODY */
.chat-body {
    padding: 19px;
    overflow-y: auto;
    max-height: 400px;
}

.chat-bubble {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    color: var(--primary-blue);
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.chat-prompt {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 15px;
    margin: 24px 0 13px;
}

/* CHAT OPTIONS */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.chat-option-btn {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chat-option-btn:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chat-disclaimer {
    font-size: 11px;
    color: #888888;
    line-height: 1.4;
    text-align: left;
}

.chat-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 16px;
}

.chat-note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* HEADER ACTIONS */
.chat-header-actions {
    display: flex;
    gap: 8px;
}

/* CONVERSATION */
.chat-bubble.user-msg {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    margin-left: auto;
    width: fit-content;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px 8px 2px 8px;
}

.chat-bubble strong {
    font-weight: 700;
}

.chat-bubble p {
    margin-top: 8px;
}

.chat-options.is-retired {
    display: none;
}

.chat-options--chips {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.chat-chip {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.chat-chip:hover {
    border-color: var(--primary-blue);
    background-color: var(--light-blue-bg);
}

.chat-chip:focus-visible,
.chat-option-btn:focus-visible {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

/* Typing indicator */
.chat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-gray);
    animation: chat-typing 1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* Product card */
.chat-product {
    display: flex;
    gap: 12px;
    align-items: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--primary-blue);
    transition: border-color 0.2s ease;
}

.chat-product:hover {
    border-color: var(--primary-blue);
}

.chat-product-img {
    flex: 0 0 72px;
    height: 72px;
    background-color: #F6F6F6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-product-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.chat-product-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red-brand);
}

.chat-product-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.chat-product-meta {
    font-size: 12px;
    color: var(--text-gray);
}

.chat-product-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-blue);
}

/* Lists and links */
.chat-list {
    list-style: none;
    margin: 10px 0;
    padding: 0;
}

.chat-list li {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
}

.chat-list a,
.chat-compare a,
.chat-center a {
    color: var(--primary-blue);
    font-weight: 600;
}

.chat-list span {
    font-size: 12px;
    color: var(--text-gray);
}

.chat-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-blue);
    margin-bottom: 12px;
}

.chat-bubble .chat-link {
    margin: 4px 0 0;
}

.chat-contact {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.chat-contact a {
    color: var(--secondary-blue);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.chat-vehicle-gen {
    display: block;
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 2px;
}

.chat-muted {
    color: #999999;
}

.chat-tag {
    display: inline-block;
    background-color: var(--light-blue-bg);
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Comparison table */
.chat-compare {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.chat-compare table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--primary-blue);
    table-layout: fixed;
}

.chat-compare th,
.chat-compare td {
    padding: 8px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--border-light);
    overflow-wrap: anywhere;
}

.chat-compare thead th {
    border-top: none;
    font-size: 12px;
    line-height: 1.3;
}

.chat-compare tbody th {
    width: 72px;
    font-weight: 600;
    color: var(--text-gray);
}

/* Online stores */
.chat-stores {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.chat-stores a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.chat-stores a:hover {
    border-color: var(--primary-blue);
}

.chat-stores img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Service center result */
.chat-center {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--primary-blue);
}

.chat-center span {
    color: var(--text-gray);
}

@media (prefers-reduced-motion: reduce) {
    .chat-typing span { animation: none; }
}

/* CHAT FOOTER (INPUT AREA) */
.chat-footer {
    background-color: var(--white);
    padding: 16px 19px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #eaeaea;
}

.chat-input {
    flex: 1;
    padding: 13px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #999999;
}

.chat-send-btn {
    background-color: #05143a;
    color: var(--white);
    border: none;
    width: 45px;
    border-radius: 8px;
    font-size: 19px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.chat-send-btn:hover {
    background-color: #001f5b;
}

/* RESPONSIVE: Full screen on very small phones */
@media (max-width: 400px) {
    .chat-window-wrapper {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .chat-body {
        max-height: calc(100vh - 160px);
    }
}