/* =========================================================
   COSMO LINK SHIPPING — BRAND OVERRIDE
   Primary: #1A2453
   Orange:  #F17C21
   Gray:    #808285
========================================================= */

:root {
    --cosmo-navy: #1A2453;
    --cosmo-navy-dark: #111936;
    --cosmo-navy-light: #24356F;
    --cosmo-orange: #F17C21;
    --cosmo-orange-light: #FF9845;
    --cosmo-gray: #808285;
    --cosmo-white: #FFFFFF;
}


/* =========================================================
   CHATBOT ROOT
========================================================= */

#mf-ai-root {
    font-family: "Montserrat", Arial, Helvetica, sans-serif !important;
}


/* =========================================================
   BASE LAYOUT
   Position, sizing and open/close behaviour.
   Colours are set in the brand sections below.
========================================================= */

#mf-ai-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100000;
}

#mf-ai-root *,
#mf-ai-root *::before,
#mf-ai-root *::after {
    box-sizing: border-box;
}

#mf-ai-root button {
    font-family: inherit;
    cursor: pointer;
}


/* Launcher */

#mf-ai-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 54px;
    padding: 0 9px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
    animation: mf-ai-button-pulse 3s ease-in-out infinite;
    transition:
        transform .3s ease,
        border-color .3s ease,
        gap .3s ease,
        padding .3s ease;
}

#mf-ai-launcher:hover {
    transform: translateY(-3px);
}


/* Label hidden until hover / keyboard focus */

#mf-ai-launcher > span:not(.mf-ai-spark) {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-width .35s ease,
        opacity .25s ease;
}

#mf-ai-launcher:hover,
#mf-ai-launcher:focus-visible {
    gap: 10px;
    padding: 0 20px 0 9px;
}

#mf-ai-launcher:hover > span:not(.mf-ai-spark),
#mf-ai-launcher:focus-visible > span:not(.mf-ai-spark) {
    max-width: 140px;
    opacity: 1;
}

#mf-ai-launcher .mf-ai-spark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
}


/* Window */

#mf-ai-window {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 380px;
    height: min(600px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.98);
    transform-origin: bottom right;
    transition:
        opacity .3s ease,
        visibility .3s ease,
        transform .3s ease;
}

#mf-ai-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* Header */

#mf-ai-window .mf-ai-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}

#mf-ai-window .mf-ai-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

#mf-ai-window .mf-ai-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 17px;
}

#mf-ai-window .mf-ai-brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

#mf-ai-window .mf-ai-brand small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}

#mf-ai-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    transition: background .3s ease, border-color .3s ease;
}


/* Messages */

#mf-ai-messages {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#mf-ai-messages::-webkit-scrollbar {
    width: 5px;
}

#mf-ai-window .mf-ai-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#mf-ai-window .mf-ai-user {
    justify-content: flex-end;
}

#mf-ai-window .mf-ai-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

#mf-ai-window .mf-ai-bubble {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}

#mf-ai-window .mf-ai-bot .mf-ai-bubble {
    border-top-left-radius: 4px;
}

#mf-ai-window .mf-ai-user .mf-ai-bubble {
    border-top-right-radius: 4px;
}

#mf-ai-window .mf-ai-inline-link {
    color: #F17C21;
    text-decoration: none;
}

#mf-ai-window .mf-ai-inline-link:hover {
    text-decoration: underline;
}


/* Typing indicator */

#mf-ai-window .mf-ai-typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 16px;
}

#mf-ai-window .mf-ai-typing-bubble span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F17C21;
    animation: mf-ai-typing 1.2s ease-in-out infinite;
}

#mf-ai-window .mf-ai-typing-bubble span:nth-child(2) {
    animation-delay: .15s;
}

#mf-ai-window .mf-ai-typing-bubble span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes mf-ai-typing {

    0%,
    60%,
    100% {
        opacity: .35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}


/* Quick questions */

#mf-ai-window .mf-ai-quick {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

#mf-ai-window .mf-ai-quick::-webkit-scrollbar {
    display: none;
}

#mf-ai-window .mf-ai-quick button {
    flex-shrink: 0;
    padding: 8px 13px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}


/* Input */

#mf-ai-window .mf-ai-input {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px;
    padding: 5px 5px 5px 16px;
    border-radius: 100px;
}

#mf-ai-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13px;
}

#mf-ai-send {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 700;
    transition: box-shadow .3s ease, transform .3s ease;
}

#mf-ai-send:hover {
    transform: translateY(-2px);
}

#mf-ai-send:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}


/* Footer */

#mf-ai-window .mf-ai-footer {
    flex-shrink: 0;
    padding: 10px 16px 12px;
    text-align: center;
    font-size: 10.5px;
    letter-spacing: .5px;
}


/* Focus */

#mf-ai-root button:focus-visible,
#mf-ai-input:focus-visible {
    outline: 2px solid #F17C21;
    outline-offset: 3px;
}


/* Mobile */

@media (max-width: 600px) {

    #mf-ai-root {
        right: 16px;
        bottom: 16px;
    }

    #mf-ai-launcher {
        height: 50px;
        padding: 0 7px;
        font-size: 12px;
    }

    #mf-ai-launcher:hover,
    #mf-ai-launcher:focus-visible {
        padding: 0 16px 0 7px;
    }

    #mf-ai-window {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        height: calc(100dvh - 104px);
        max-height: 600px;
    }

}


/* =========================================================
   BACK-TO-TOP BUTTON
   Sits above the AI launcher instead of overlapping it.
   Overrides main.css (this file loads after it).
========================================================= */

.back-to-top-wrapper {
    right: 29px;
    bottom: 70px;
}

.back-to-top-wrapper.back-to-top-btn-show {
    bottom: 92px;
}

@media (max-width: 600px) {

    .back-to-top-wrapper {
        right: 19px;
        bottom: 60px;
    }

    .back-to-top-wrapper.back-to-top-btn-show {
        bottom: 80px;
    }

}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    #mf-ai-launcher,
    #mf-ai-window,
    #mf-ai-window .mf-ai-typing-bubble span {
        animation: none !important;
        transition: none !important;
    }

}


/* =========================================================
   FLOATING CHAT BUTTON
========================================================= */

#mf-ai-launcher {
    border: 1px solid rgba(241, 124, 33, 0.55) !important;

    background:
        linear-gradient(135deg,
            #1A2453,
            #111936) !important;

    color: #FFFFFF !important;

    box-shadow:
        0 15px 45px rgba(26, 36, 83, 0.40),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 30px rgba(241, 124, 33, 0.15) !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


#mf-ai-launcher:hover {
    border-color: rgba(241, 124, 33, 0.90) !important;

    box-shadow:
        0 20px 55px rgba(26, 36, 83, 0.45),
        0 0 45px rgba(241, 124, 33, 0.25) !important;
}


/* =========================================================
   CHAT LAUNCHER ICON
========================================================= */

#mf-ai-launcher .mf-ai-spark {
    background:
        linear-gradient(135deg,
            #F17C21,
            #FF9845) !important;

    color: #1A2453 !important;

    box-shadow:
        0 0 20px rgba(241, 124, 33, 0.35) !important;
}


/* =========================================================
   CHAT WINDOW
========================================================= */

#mf-ai-window {

    border:
        1px solid rgba(241, 124, 33, 0.20) !important;

    background:

        radial-gradient(circle at 100% 0%,
            rgba(241, 124, 33, 0.10),
            transparent 30%),

        radial-gradient(circle at 0% 100%,
            rgba(26, 36, 83, 0.20),
            transparent 35%),

        rgba(17, 25, 54, 0.98) !important;

    color: #FFFFFF !important;

    box-shadow:
        0 35px 100px rgba(0, 0, 0, 0.55),
        0 0 70px rgba(26, 36, 83, 0.25) !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


/* =========================================================
   CHAT HEADER
========================================================= */

#mf-ai-window .mf-ai-header {

    border-bottom:
        1px solid rgba(255, 255, 255, 0.09) !important;

    background:
        linear-gradient(135deg,
            #1A2453,
            #111936) !important;
}


/* =========================================================
   CHATBOT BRAND ICON
========================================================= */

#mf-ai-window .mf-ai-icon {

    background:
        linear-gradient(135deg,
            #F17C21,
            #FF9845) !important;

    color: #1A2453 !important;
}


/* =========================================================
   BRAND TEXT
========================================================= */

#mf-ai-window .mf-ai-brand strong {
    color: #FFFFFF !important;

    font-family:
        "Montserrat",
        Arial,
        sans-serif !important;

    font-weight: 700 !important;
}

#mf-ai-window .mf-ai-brand small {
    color: #B7BBC7 !important;

    font-family:
        "Montserrat",
        Arial,
        sans-serif !important;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

#mf-ai-close {

    border:
        1px solid rgba(255, 255, 255, 0.12) !important;

    background:
        rgba(255, 255, 255, 0.06) !important;

    color: #FFFFFF !important;
}

#mf-ai-close:hover {

    background:
        rgba(241, 124, 33, 0.15) !important;

    border-color:
        rgba(241, 124, 33, 0.40) !important;
}


/* =========================================================
   CHAT MESSAGES
========================================================= */

#mf-ai-window .mf-ai-bubble {

    border:
        1px solid rgba(255, 255, 255, 0.08) !important;

    background:
        rgba(255, 255, 255, 0.055) !important;

    color:
        #E6E8EE !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


/* =========================================================
   BOT AVATAR
========================================================= */

#mf-ai-window .mf-ai-avatar {

    background:
        linear-gradient(135deg,
            #F17C21,
            #FF9845) !important;

    color:
        #1A2453 !important;
}


/* =========================================================
   USER MESSAGE
========================================================= */

#mf-ai-window .mf-ai-user .mf-ai-bubble {

    border-color:
        rgba(241, 124, 33, 0.30) !important;

    background:
        linear-gradient(135deg,
            rgba(241, 124, 33, 0.20),
            rgba(26, 36, 83, 0.35)) !important;

    color:
        #FFFFFF !important;
}


/* =========================================================
   QUICK QUESTIONS
========================================================= */

#mf-ai-window .mf-ai-quick {

    border-top:
        1px solid rgba(255, 255, 255, 0.06) !important;
}


#mf-ai-window .mf-ai-quick button {

    border:
        1px solid rgba(241, 124, 33, 0.25) !important;

    background:
        rgba(255, 255, 255, 0.035) !important;

    color:
        #D9DCE5 !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


#mf-ai-window .mf-ai-quick button:hover {

    background:
        rgba(241, 124, 33, 0.12) !important;

    border-color:
        rgba(241, 124, 33, 0.50) !important;

    color:
        #FFFFFF !important;
}


/* =========================================================
   INPUT AREA
========================================================= */

#mf-ai-window .mf-ai-input {

    border:
        1px solid rgba(255, 255, 255, 0.12) !important;

    background:
        rgba(255, 255, 255, 0.045) !important;
}


#mf-ai-input {

    color:
        #FFFFFF !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


#mf-ai-input::placeholder {

    color:
        #9A9DA8 !important;
}


/* =========================================================
   SEND BUTTON
========================================================= */

#mf-ai-send {

    background:
        linear-gradient(135deg,
            #F17C21,
            #FF9845) !important;

    color:
        #1A2453 !important;

    font-family:
        "Montserrat",
        Arial,
        sans-serif !important;
}


#mf-ai-send:hover {

    box-shadow:
        0 7px 20px rgba(241, 124, 33, 0.30) !important;
}


/* =========================================================
   ACTION LINKS
========================================================= */

#mf-ai-window .mf-ai-action {

    border:
        1px solid rgba(241, 124, 33, 0.35) !important;

    background:
        rgba(241, 124, 33, 0.08) !important;

    color:
        #FFFFFF !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


#mf-ai-window .mf-ai-action:hover {

    background:
        rgba(241, 124, 33, 0.16) !important;

    border-color:
        rgba(241, 124, 33, 0.55) !important;
}


/* =========================================================
   TYPING INDICATOR
========================================================= */

#mf-ai-window .mf-ai-typing span {

    background:
        #F17C21 !important;
}


/* =========================================================
   SCROLLBAR
========================================================= */

#mf-ai-messages::-webkit-scrollbar-thumb {

    background:
        rgba(241, 124, 33, 0.35) !important;
}

#mf-ai-messages::-webkit-scrollbar-thumb:hover {

    background:
        rgba(241, 124, 33, 0.60) !important;
}


/* =========================================================
   FOOTER
========================================================= */

#mf-ai-window .mf-ai-footer {

    color:
        rgba(180, 184, 195, 0.70) !important;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif !important;
}


/* =========================================================
   ANIMATION
========================================================= */

@keyframes mf-ai-button-pulse {

    0%,
    100% {

        box-shadow:
            0 15px 45px rgba(0, 0, 0, 0.40),
            0 0 30px rgba(241, 124, 33, 0.12);
    }

    50% {

        box-shadow:
            0 18px 48px rgba(0, 0, 0, 0.42),
            0 0 40px rgba(241, 124, 33, 0.22);
    }
}