/* =========================================================
   BUY A RUG — GLOBAL CHATBOT
========================================================= */

#buyarug-chatbot {
    position: relative;
    z-index: 999999;
}


/* =========================================================
   BODY LOCK WHEN WELCOME MODAL IS OPEN
========================================================= */

body.chatbot-modal-open {
    overflow: hidden;
}


/* =========================================================
   FLOATING CHAT BUTTON
========================================================= */

#chatbot-toggle {
    position: fixed;
    right: 28px;
    bottom: 28px;

    z-index: 999990;

    display: flex;
    align-items: center;

    height: 54px;

    padding: 0 21px 0 8px;

    border: 0;
    border-radius: 30px;

    background: #1b1916;
    color: #fff;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, .22);

    cursor: pointer;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        opacity .25s ease;
}

#chatbot-toggle:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 42px rgba(0, 0, 0, .28);
}

#chatbot-toggle .chatbot-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    margin-right: 10px;

    border-radius: 50%;

    background: #a88759;

    color: #fff;

    font-size: 14px;
}

#chatbot-toggle .chatbot-button-text {
    font-size: 11px;
    font-weight: 600;

    letter-spacing: 1px;
}


/* =========================================================
   FIRST VISITOR WELCOME MODAL
========================================================= */

#chatbot-welcome {
    position: fixed;

    inset: 0;

    z-index: 1000000;

    display: none;

    align-items: center;
    justify-content: center;
}

#chatbot-welcome.show {
    display: flex;
}


/* Overlay */

.chatbot-welcome-overlay {
    position: absolute;

    inset: 0;

    background:
        rgba(20, 18, 15, .68);

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);
}


/* Modal */

.chatbot-welcome-box {
    position: relative;

    z-index: 2;

    width: min(500px, calc(100% - 30px));

    padding:
        52px 48px 48px;

    background: #fff;

    border:
        1px solid #e5ded4;

    box-shadow:
        0 25px 90px rgba(0, 0, 0, .30);

    text-align: center;

    animation:
        chatbotWelcomeIn .35s ease;
}


/* Modal animation */

@keyframes chatbotWelcomeIn {

    from {
        opacity: 0;

        transform:
            translateY(25px)
            scale(.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* Close */

.chatbot-welcome-close {
    position: absolute;

    top: 13px;
    right: 16px;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #777;

    font-size: 27px;

    line-height: 34px;

    cursor: pointer;

    transition:
        color .2s ease,
        transform .2s ease;
}

.chatbot-welcome-close:hover {
    color: #1b1916;

    transform:
        rotate(90deg);
}


/* Logo */

.chatbot-welcome-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 60px;
    height: 60px;

    margin:
        0 auto 22px;

    border-radius: 50%;

    background: #1b1916;

    color: #c4a46e;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 15px;

    letter-spacing: 1px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .15);
}


/* Eyebrow */

.chatbot-welcome-label {
    display: block;

    margin-bottom: 12px;

    color: #a88759;

    font-size: 9px;

    font-weight: 600;

    letter-spacing: 3px;
}


/* Heading */

.chatbot-welcome-box h2 {
    margin:
        0 0 14px;

    color: #25221e;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 31px;

    font-weight: 400;

    line-height: 1.25;
}


/* Description */

.chatbot-welcome-box p {
    max-width: 400px;

    margin:
        0 auto 27px;

    color: #6f6a63;

    font-size: 13px;

    line-height: 1.8;
}


/* Main CTA */

.chatbot-welcome-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 190px;

    padding:
        14px 25px;

    border:
        1px solid #a88759;

    background: #a88759;

    color: #fff;

    font-size: 10px;

    font-weight: 600;

    letter-spacing: 1.3px;

    cursor: pointer;

    transition:
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.chatbot-welcome-button:hover {
    background: #8f7148;

    border-color: #8f7148;

    transform:
        translateY(-2px);
}

.chatbot-welcome-button i {
    margin-left: 10px;
}


/* =========================================================
   2 MINUTE INACTIVITY POPUP
========================================================= */

#chatbot-invite {
    position: fixed;

    right: 28px;
    bottom: 95px;

    z-index: 999995;

    width: 350px;

    padding:
        23px 23px 22px;

    background: #fff;

    border:
        1px solid #e4ded5;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, .18);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(15px);

    transition:
        opacity .3s ease,
        visibility .3s ease,
        transform .3s ease;
}

#chatbot-invite.show {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);
}


/* Close */

.chatbot-invite-close {
    position: absolute;

    top: 8px;
    right: 10px;

    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #777;

    font-size: 21px;

    cursor: pointer;
}

.chatbot-invite-close:hover {
    color: #1b1916;
}


/* Eyebrow */

.chatbot-invite-eyebrow {
    display: block;

    margin-bottom: 7px;

    color: #a88759;

    font-size: 8px;

    font-weight: 600;

    letter-spacing: 2px;
}


/* Heading */

.chatbot-invite-content strong {
    display: block;

    margin-bottom: 7px;

    color: #25221e;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 20px;

    font-weight: 400;
}


/* Text */

.chatbot-invite-content p {
    margin:
        0 0 16px;

    color: #777;

    font-size: 12px;

    line-height: 1.7;
}


/* Button */

.chatbot-invite-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        10px 17px;

    border:
        1px solid #a88759;

    background: #a88759;

    color: #fff;

    font-size: 9px;

    font-weight: 600;

    letter-spacing: 1px;

    cursor: pointer;

    transition:
        background .2s ease;
}

.chatbot-invite-button:hover {
    background: #8f7148;
}

.chatbot-invite-button i {
    margin-left: 8px;
}


/* =========================================================
   ACTUAL CHATBOT WINDOW
========================================================= */

#chatbot-window {
    position: fixed;

    right: 28px;
    bottom: 28px;

    z-index: 1000001;

    display: flex;

    flex-direction: column;

    width: 390px;
    height: 600px;

    overflow: hidden;

    background: #fff;

    border:
        1px solid #ded8ce;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, .25);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(20px)
        scale(.97);

    transition:
        opacity .3s ease,
        visibility .3s ease,
        transform .3s ease;
}

#chatbot-window.open {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   CHAT HEADER
========================================================= */

.chatbot-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-shrink: 0;

    min-height: 72px;

    padding:
        0 18px;

    background: #1b1916;

    color: #fff;
}


/* Agent */

.chatbot-agent {
    display: flex;

    align-items: center;
}


/* Avatar */

.chatbot-avatar {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 40px;
    height: 40px;

    margin-right: 10px;

    border:
        1px solid #b29466;

    border-radius: 50%;

    color: #c2a374;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 12px;

    letter-spacing: 1px;
}


/* Agent info */

.chatbot-agent-info strong {
    display: block;

    color: #fff;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 16px;

    font-weight: 400;
}

.chatbot-agent-info span {
    display: block;

    margin-top: 3px;

    color: #aaa39a;

    font-size: 9px;

    letter-spacing: 1px;
}


/* Close */

.chatbot-close {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #aaa39a;

    font-size: 25px;

    cursor: pointer;

    transition:
        color .2s ease,
        transform .2s ease;
}

.chatbot-close:hover {
    color: #fff;

    transform:
        rotate(90deg);
}


/* =========================================================
   CHAT MESSAGES
========================================================= */

.chatbot-messages {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding:
        22px 17px;

    background: #f8f6f2;

    scroll-behavior: smooth;
}


/* Scrollbar */

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d0c5b5;

    border-radius: 10px;
}


/* Message */

.chat-message {
    display: flex;

    max-width: 84%;

    margin-bottom: 12px;
}

.chat-message-content {
    padding:
        11px 13px;

    font-size: 12px;

    line-height: 1.65;

    word-break: break-word;
}


/* Bot */

.chat-message.bot {
    margin-right: auto;

    justify-content: flex-start;
}

.chat-message.bot
.chat-message-content {
    background: #fff;

    border:
        1px solid #e5dfd6;

    color: #4f4a44;
}


/* Customer */

.chat-message.user {
    margin-left: auto;

    justify-content: flex-end;
}

.chat-message.user
.chat-message-content {
    background: #292621;

    color: #fff;
}


/* =========================================================
   TYPING INDICATOR
========================================================= */

#chatbot-typing {
    display: none;

    align-items: center;

    gap: 4px;

    flex-shrink: 0;

    padding:
        0 18px 10px;

    background: #f8f6f2;
}

#chatbot-typing.show {
    display: flex;
}

#chatbot-typing span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #a88759;

    animation:
        chatbotTyping 1s infinite;
}

#chatbot-typing span:nth-child(2) {
    animation-delay: .15s;
}

#chatbot-typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes chatbotTyping {

    0%,
    60%,
    100% {
        opacity: .3;

        transform:
            translateY(0);
    }

    30% {
        opacity: 1;

        transform:
            translateY(-3px);
    }

}


/* =========================================================
   QUICK OPTIONS
========================================================= */

#chatbot-options {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    max-height: 115px;

    overflow-y: auto;

    padding:
        9px 14px;

    background: #fff;

    border-top:
        1px solid #eeeae3;
}


/* Individual option */

.chatbot-option {
    padding:
        8px 11px;

    border:
        1px solid #b59a72;

    border-radius: 20px;

    background: #fff;

    color: #806844;

    font-size: 10px;

    line-height: 1.2;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.chatbot-option:hover {
    background: #a88759;

    border-color: #a88759;

    color: #fff;
}


/* =========================================================
   INPUT
========================================================= */

.chatbot-input-area {
    display: flex;

    align-items: flex-end;

    flex-shrink: 0;

    padding:
        10px;

    background: #fff;

    border-top:
        1px solid #e7e2da;
}


/* Textarea */

.chatbot-input-area textarea {
    flex: 1;

    width: 100%;

    min-height: 38px;
    max-height: 90px;

    resize: none;

    padding:
        10px 12px;

    border: 0;

    outline: 0;

    background: #f5f3ef;

    color: #333;

    font-family: inherit;

    font-size: 12px;

    line-height: 1.45;
}

.chatbot-input-area textarea::placeholder {
    color: #9a948b;
}


/* Send */

#chatbot-send {
    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    width: 38px;
    height: 38px;

    margin-left: 7px;

    padding: 0;

    border: 0;

    background: #a88759;

    color: #fff;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

#chatbot-send:hover {
    background: #8f7148;

    transform:
        translateY(-1px);
}


/* =========================================================
   FOOTER NOTE
========================================================= */

.chatbot-footer-note {
    flex-shrink: 0;

    padding:
        6px 10px 9px;

    background: #fff;

    color: #aaa39a;

    font-size: 8px;

    text-align: center;

    letter-spacing: .5px;
}


/* =========================================================
   MOBILE
========================================================= */

@media(max-width:575px) {


    /* Floating button */

    #chatbot-toggle {
        right: 15px;

        bottom: 15px;

        height: 50px;

        padding:
            0 16px 0 7px;
    }


    #chatbot-toggle .chatbot-icon {
        width: 36px;
        height: 36px;

        margin-right: 8px;
    }


    #chatbot-toggle .chatbot-button-text {
        font-size: 10px;
    }


    /* Welcome modal */

    .chatbot-welcome-box {
        width:
            calc(100% - 28px);

        padding:
            44px 24px 34px;
    }


    .chatbot-welcome-box h2 {
        font-size: 27px;
    }


    .chatbot-welcome-box p {
        font-size: 12px;

        line-height: 1.7;
    }


    /* Inactivity popup */

    #chatbot-invite {
        right: 15px;

        left: 15px;

        bottom: 78px;

        width: auto;

        padding:
            20px;
    }


    /* Actual chat */

    #chatbot-window {
        right: 0;

        bottom: 0;

        width: 100%;

        height: 100dvh;

        max-height: 100dvh;

        border: 0;

        transform:
            translateY(20px);
    }


    #chatbot-window.open {
        transform:
            translateY(0);
    }


    .chatbot-header {
        min-height: 64px;

        padding:
            0 14px;
    }


    .chatbot-messages {
        padding:
            18px 13px;
    }


    .chat-message {
        max-width: 88%;
    }


    #chatbot-options {
        max-height: 125px;

        padding:
            8px 10px;
    }


    .chatbot-option {
        font-size: 9px;

        padding:
            7px 10px;
    }


    .chatbot-input-area {
        padding:
            8px;
    }


    .chatbot-footer-note {
        padding-bottom:
            calc(8px + env(safe-area-inset-bottom));
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media(max-width:360px) {

    #chatbot-toggle .chatbot-button-text {
        display: none;
    }

    #chatbot-toggle {
        width: 50px;
        height: 50px;

        padding: 7px;
    }

    #chatbot-toggle .chatbot-icon {
        width: 36px;
        height: 36px;

        margin: 0;
    }

    .chatbot-welcome-box {
        padding:
            40px 20px 30px;
    }

    .chatbot-welcome-box h2 {
        font-size: 24px;
    }

}
/* =========================================================
   CHATBOT SEARCH RESULTS
========================================================= */

.chatbot-results-wrapper {
    width: 100%;
}

.chatbot-search-results {
    width: 100%;
    margin-top: 5px;
}

.chatbot-result-section {
    margin-top: 18px;
}

.chatbot-result-heading {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.chatbot-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.chatbot-result-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all .2s ease;
}

.chatbot-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
}

.chatbot-result-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
}

.chatbot-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chatbot-result-info {
    padding: 9px;
}

.chatbot-result-title {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
}

.chatbot-result-sku {
    margin-top: 4px;
    font-size: 10px;
    color: #777;
}

.chatbot-result-price {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 600;
}

.chatbot-result-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
}

.chatbot-collection-card .chatbot-result-info {
    min-height: 65px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 480px) {

    .chatbot-result-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-result-image {
        height: 150px;
    }

}