/* ==========================================================================
   Booking assistant chat. Scoped to .mlc; rules that fight the site-wide
   resets in premium.css (square corners, no shadows, black uppercase
   submit buttons) carry !important.
   ========================================================================== */

.mlc {
    --c-ink: #16130f;
    --c-ink-2: #4a443c;
    --c-muted: #8a8278;
    --c-line: #e8e2d8;
    --c-bg: #f5f3ef;
    --c-card: #ffffff;
    --c-gold: #ffc219;
    --c-orange: #f57c00;
    --c-orange-soft: #fff6ea;
    --c-dark: #0f0d0b;
    --c-ease: cubic-bezier(.22, .61, .36, 1);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--c-ink);
}
.mlc *, .mlc *::before, .mlc *::after { box-sizing: border-box; }
.mlc [hidden] { display: none !important; }
.mlc button { font-family: inherit; text-transform: none !important; letter-spacing: normal !important; }
.mlc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Launcher ---------- */
.mlc-launch {
    position: fixed;
    right: 20px;
    bottom: 92px;              /* clear of the reCAPTCHA badge */
    z-index: 1150;
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    width: auto !important;
    padding: 8px 18px 8px 8px !important;
    border: 1px solid rgba(255, 194, 25, .35) !important;
    border-radius: 999px !important;
    background: var(--c-dark) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .55) !important;
    cursor: pointer;
    transition: transform .25s var(--c-ease), opacity .25s var(--c-ease);
}
.mlc-launch:hover { transform: translateY(-2px); }
.mlc-launch__icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--c-gold), var(--c-orange));
    color: var(--c-dark);
    font-size: 15px;
}
.mlc.is-open .mlc-launch { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ---------- Panel ---------- */
.mlc-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1160;
    width: 400px;
    height: min(680px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: 20px !important;
    box-shadow: 0 24px 60px -20px rgba(15, 13, 11, .45) !important;
    overflow: hidden;
    animation: mlcIn .28s var(--c-ease);
}
@keyframes mlcIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.mlc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 14px 16px;
    background: var(--c-dark);
    color: #fff;
}
.mlc-head__avatar {
    width: 38px; height: 38px; flex: none;
    border-radius: 50% !important;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--c-gold), var(--c-orange));
    color: var(--c-dark);
}
.mlc-head__text { flex: 1; min-width: 0; line-height: 1.25; }
.mlc-head__text strong { display: block; font-size: 15px; }
.mlc-head__text small { font-size: 12px; color: rgba(255, 255, 255, .65); display: inline-flex; align-items: center; gap: 6px; }
.mlc-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ecf72; box-shadow: 0 0 0 3px rgba(62, 207, 114, .2); }
.mlc-icon-btn {
    width: 36px !important; height: 36px; flex: none;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
    font-size: 15px !important;
    cursor: pointer;
    display: grid !important; place-items: center;
}
.mlc-icon-btn:hover { background: rgba(255, 255, 255, .16) !important; }

/* ---------- Messages ---------- */
.mlc-log {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.mlc-msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.mlc-msg--user { align-items: flex-end; }
.mlc-bubble {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 16px !important;
    font-size: 14.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.mlc-msg--bot .mlc-bubble {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-bottom-left-radius: 6px !important;
}
.mlc-msg--user .mlc-bubble {
    background: var(--c-dark);
    color: #fff;
    border-bottom-right-radius: 6px !important;
}
.mlc-msg--error .mlc-bubble { border-color: #f3c1b8; background: #fff6f4; }
.mlc-bubble p { margin: 0 0 6px; font-size: inherit; line-height: inherit; color: inherit; }
.mlc-bubble p:last-child { margin-bottom: 0; }
.mlc-bubble ul { margin: 4px 0 6px; padding-left: 18px; }
.mlc-bubble li { margin: 2px 0; }
.mlc-bubble a { color: var(--c-orange); text-decoration: underline; }
.mlc-msg--user .mlc-bubble a { color: var(--c-gold); }

.mlc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mlc-chip {
    width: auto !important;
    padding: 7px 12px !important;
    border: 1px solid var(--c-line) !important;
    border-radius: 999px !important;
    background: var(--c-card) !important;
    color: var(--c-ink) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
}
.mlc-chip:hover { border-color: var(--c-orange) !important; color: var(--c-orange) !important; }

.mlc-typing { display: inline-flex; gap: 4px; padding: 14px 16px !important; }
.mlc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: mlcDot 1.2s infinite ease-in-out; }
.mlc-typing span:nth-child(2) { animation-delay: .15s; }
.mlc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mlcDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Cards (vehicles, checkout) ---------- */
.mlc-card {
    width: 100%;
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: 16px !important;
    overflow: hidden;
}
.mlc-trip {
    padding: 12px 14px;
    background: var(--c-dark);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
}
.mlc-trip__row { display: flex; gap: 8px; align-items: baseline; }
.mlc-trip__row i { width: 14px; flex: none; color: var(--c-gold); font-size: 11px; }
.mlc-trip__row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlc-trip__when { margin-top: 6px; color: rgba(255, 255, 255, .7); font-size: 12px; }

.mlc-cars {
    display: flex;
    gap: 10px;
    padding: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.mlc-car {
    flex: 0 0 168px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--c-line);
    border-radius: 14px !important;
    background: #fff;
}
.mlc-car img { width: 100%; height: 72px; object-fit: contain; }
.mlc-car strong { font-size: 13.5px; line-height: 1.25; }
.mlc-car small { color: var(--c-muted); font-size: 12px; }
.mlc-car__price { font-size: 17px; font-weight: 700; margin-top: 2px; }
.mlc-car__price.is-na { font-size: 12.5px; font-weight: 500; color: var(--c-muted); }
.mlc-car button {
    margin-top: 6px;
    width: 100% !important;
    padding: 8px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--c-orange) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
}
.mlc-car button:disabled { background: var(--c-line) !important; color: var(--c-muted) !important; cursor: default; }
.mlc-card__foot { padding: 0 14px 12px; font-size: 12px; color: var(--c-muted); }

.mlc-sum { padding: 12px 14px; display: grid; gap: 10px; }
.mlc-sum__veh { display: flex; gap: 10px; align-items: center; }
.mlc-sum__veh img { width: 72px; height: 44px; object-fit: contain; flex: none; }
.mlc-sum__veh strong { display: block; font-size: 14px; }
.mlc-sum__veh small { color: var(--c-muted); font-size: 12px; }
.mlc-rows { display: grid; gap: 4px; font-size: 13px; }
.mlc-rows div { display: flex; justify-content: space-between; gap: 12px; }
.mlc-rows dt { color: var(--c-muted); }
.mlc-rows dd { margin: 0; text-align: right; color: var(--c-ink-2); min-width: 0; overflow-wrap: anywhere; }
.mlc-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-top: 10px;
    border-top: 1px dashed var(--c-line);
    font-weight: 700;
}
.mlc-total span:last-child { font-size: 20px; }
.mlc-pay { display: grid; gap: 8px; padding: 0 14px 14px; }
.mlc-pay form { margin: 0; }
.mlc-pay button {
    width: 100% !important;
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    padding: 12px !important;
    border-radius: 12px !important;
    border: 1px solid var(--c-line) !important;
    background: #fff !important;
    color: var(--c-ink) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
}
.mlc-pay button.is-primary { background: var(--c-orange) !important; border-color: var(--c-orange) !important; color: #fff !important; }
.mlc-pay button:disabled { opacity: .6; cursor: progress; }
.mlc-pay__secure { text-align: center; font-size: 11.5px; color: var(--c-muted); }
.mlc-stale { padding: 10px 14px 14px; font-size: 12.5px; color: var(--c-muted); }

/* ---------- Composer ---------- */
.mlc-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 6px 12px 0;
    padding: 6px 6px 6px 14px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 22px !important;
}
.mlc-compose:focus-within { border-color: var(--c-orange); box-shadow: 0 0 0 3px rgba(245, 124, 0, .12) !important; }
.mlc-compose textarea {
    flex: 1;
    min-height: 36px;
    max-height: 120px;
    padding: 8px 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    resize: none;
    background: transparent !important;
    font: inherit;
    font-size: 16px !important;   /* no iOS zoom */
    line-height: 1.35;
    color: var(--c-ink);
}
.mlc-send {
    width: 36px !important; height: 36px; flex: none;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--c-orange) !important;
    color: #fff !important;
    font-size: 15px !important;
    display: grid !important; place-items: center;
    cursor: pointer;
}
.mlc-send:disabled { background: var(--c-line) !important; color: var(--c-muted) !important; cursor: default; }
.mlc-foot { margin: 6px 16px 10px; font-size: 11px; line-height: 1.35; color: var(--c-muted); text-align: center; }

/* ---------- Placement around the rest of the page ---------- */
@media (max-width: 992px) {
    /* Above the mobile bottom nav (64px). */
    /* Phones keep a short label: an unlabelled icon doesn't say "AI assistant". */
    .mlc-launch { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); padding: 5px 14px 5px 5px !important; gap: 8px; }
    .mlc-launch__long, .mlc-launch__text small { display: none !important; }
    .mlc-launch__short { display: block !important; }
    .mlc-launch__icon { width: 38px; height: 38px; font-size: 15px; }
    .mlc-teaser { right: 14px; bottom: calc(132px + env(safe-area-inset-bottom)); width: min(300px, calc(100vw - 28px)); }
}
/* Booking wizard pages have their own bottom action bar. */
body:has(.mbk-bar) .mlc-launch { bottom: calc(96px + env(safe-area-inset-bottom)); }
body:has(.mbk-bar) .mlc-teaser { display: none !important; }

@media (max-width: 560px) {
    .mlc-panel {
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0 !important;
    }
    .mlc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
    .mlc-foot { margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
    body.mlc-lock { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .mlc-panel, .mlc-typing span { animation: none; }
    .mlc-log { scroll-behavior: auto; }
}

/* Full-screen chat on phones: the site's bottom nav would cover the composer. */
body.mlc-lock .mobile-bottom-nav,
body.mlc-lock #scrollTopBtn { display: none !important; }

/* ---------- AI labelling: launcher badge, header badge, teaser ---------- */
.mlc-launch__icon { position: relative; }
.mlc-launch__ai {
    position: absolute; top: -5px; right: -7px;
    padding: 1px 5px; border-radius: 999px;
    background: #fff; color: var(--c-dark);
    font: 800 9.5px/1.4 'Inter', system-ui, sans-serif; letter-spacing: .04em;
    box-shadow: 0 0 0 2px var(--c-dark);
}
.mlc-launch__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.mlc-launch__text strong { font-size: 14px; font-weight: 650; }
.mlc-launch__text small { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .65); margin-top: 2px; }
.mlc-launch__short { display: none; }
/* A soft pulse on first view draws the eye without being noisy. */
.mlc-launch.is-new .mlc-launch__icon::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--c-gold); animation: mlc-pulse 1.8s var(--c-ease) 3;
}
@keyframes mlc-pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }

.mlc-ai-badge {
    display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 6px; border-radius: 999px;
    background: linear-gradient(135deg, var(--c-gold), var(--c-orange)); color: var(--c-dark);
    font-size: 10px; font-weight: 800; letter-spacing: .04em;
}

.mlc-teaser {
    position: fixed; right: 20px; bottom: 156px; z-index: 1150;
    width: 300px;
    background: #fff; border: 1px solid var(--c-line); border-radius: 16px !important;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .35) !important;
    animation: mlc-teaser-in .35s var(--c-ease);
}
.mlc-teaser::after {
    content: ""; position: absolute; right: 34px; bottom: -7px; width: 14px; height: 14px;
    background: #fff; border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); transform: rotate(45deg);
}
@keyframes mlc-teaser-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mlc-teaser__body {
    display: flex !important; gap: 12px; align-items: flex-start; width: 100% !important;
    padding: 14px 34px 14px 14px !important; margin: 0;
    border: 0 !important; background: transparent !important; color: var(--c-ink) !important;
    text-align: left; cursor: pointer; font-weight: 400 !important; box-shadow: none !important;
}
.mlc-teaser__avatar {
    flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--c-gold), var(--c-orange)); color: var(--c-dark);
    font-size: 12px; font-weight: 800; letter-spacing: .03em;
}
.mlc-teaser__text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.4; color: var(--c-ink-2); }
.mlc-teaser__text strong { font-size: 13.5px; color: var(--c-ink); font-weight: 650; }
.mlc-teaser__text em { font-style: normal; font-weight: 650; color: var(--c-orange); margin-top: 2px; }
.mlc-teaser__close {
    position: absolute; top: 6px; right: 6px; z-index: 1;
    width: 26px !important; height: 26px; padding: 0 !important; border: 0 !important; border-radius: 50% !important;
    background: transparent !important; color: var(--c-muted) !important; font-size: 13px !important; cursor: pointer; box-shadow: none !important;
}
.mlc-teaser__close:hover { background: var(--c-bg) !important; color: var(--c-ink) !important; }
.mlc.is-open .mlc-teaser { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .mlc-teaser { animation: none; }
    .mlc-launch.is-new .mlc-launch__icon::after { animation: none; display: none; }
}
