/* =========================================================
   AMAR CHASMA AI SHOPPING ASSISTANT
   ========================================================= */

:root {
    --ac-ai-navy: #003B8F;
    --ac-ai-blue: #0066CC;
    --ac-ai-cyan: #19B8E8;
    --ac-ai-green: #79C72B;
    --ac-ai-ink: #12305F;
    --ac-ai-border: #DCE8F5;
    --ac-ai-soft: #F5FAFF;
    --ac-ai-white: #FFFFFF;
}


/* =========================================================
   MAIN WRAPPER
   ========================================================= */

.ac-ai-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    font-family:
        Manrope,
        Arial,
        sans-serif;
}


/* =========================================================
   FLOATING LAUNCHER
   ========================================================= */

.ac-ai-launcher {
    position: relative;

    display: flex;
    align-items: center;
    gap: 10px;

    height: 54px;
    padding: 6px 18px 6px 7px;

    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;

    background:
        linear-gradient(135deg,
            #003B8F 0%,
            #005CC8 60%,
            #0877D5 100%);

    color: #fff;

    box-shadow:
        0 14px 35px rgba(0, 59, 143, .30),
        0 4px 12px rgba(0, 0, 0, .10);

    cursor: pointer;

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


.ac-ai-launcher:hover {
    transform: translateY(-3px);

    box-shadow:
        0 18px 42px rgba(0, 59, 143, .36),
        0 5px 15px rgba(0, 0, 0, .12);
}


.ac-ai-launcher-icon {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #fff;

    color: var(--ac-ai-navy);

    font-size: 18px;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, .12);
}


.ac-ai-launcher-label {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}


.ac-ai-launcher-pulse {
    position: absolute;

    top: 6px;
    right: 9px;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--ac-ai-green);

    box-shadow:
        0 0 0 4px rgba(121, 199, 43, .14);
}


/* =========================================================
   CHAT PANEL
   ========================================================= */

.ac-ai-panel {
    position: fixed;

    right: 24px;
    bottom: 92px;

    width: 470px;
    height: 690px;

    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 110px);

    display: none;
    flex-direction: column;

    overflow: hidden;

    background: #fff;

    border: 1px solid rgba(0, 59, 143, .12);

    border-radius: 24px;

    box-shadow:
        0 30px 80px rgba(0, 39, 95, .22),
        0 10px 30px rgba(0, 0, 0, .10);

    z-index: 10000;
}


.ac-ai-panel.open {
    display: flex;

    animation:
        acAiPanelIn .25s ease both;
}


@keyframes acAiPanelIn {

    from {
        opacity: 0;
        transform:
            translateY(14px) scale(.97);
    }

    to {
        opacity: 1;
        transform:
            translateY(0) scale(1);
    }

}


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

.ac-ai-header {
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 15px 18px;

    color: #fff;

    background:
        linear-gradient(135deg,
            #003B8F 0%,
            #0059C9 58%,
            #18AEE5 100%);

    position: relative;

    overflow: hidden;
}


.ac-ai-header::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -70px;
    top: -100px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, .10);
}


.ac-ai-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
    position: relative;
    z-index: 2;
}


.ac-ai-brand-mark {
    flex: 0 0 86px;
    width: 86px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    position: relative;
    z-index: 2;
}


.ac-ai-mark-c1,
.ac-ai-mark-c2 {
    position: absolute;

    width: 31px;
    height: 31px;

    border: 4px solid #fff;

    border-radius: 50%;
}


.ac-ai-mark-c1 {
    left: 0;
    top: 1px;

    border-color:
        #20B9E9 #20B9E9 #20B9E9 #79C72B;
}


.ac-ai-mark-c2 {
    left: 13px;
    top: 1px;

    border-color:
        #20B9E9 #20B9E9 #79C72B #79C72B;
}


.ac-ai-brand-text {
    min-width: 0;
    position: relative;
    z-index: 2;
}


.ac-ai-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}


.ac-ai-title-row strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.02em;
}


.ac-ai-brand-text small {
    display: block;

    margin-top: 2px;

    font-size: 10px;
    font-weight: 500;

    color: rgba(255, 255, 255, .80);
}


.ac-ai-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 3px 7px;

    border-radius: 999px;

    background: rgba(255, 255, 255, .14);

    border: 1px solid rgba(255, 255, 255, .18);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: .06em;
}


.ac-ai-live span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--ac-ai-green);
}


.ac-ai-close {
    position: relative;
    z-index: 5;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 0;

    border-radius: 50%;

    background: rgba(255, 255, 255, .12);

    color: #fff;

    font-size: 14px;

    cursor: pointer;

    transition: background .2s ease;
}


.ac-ai-close:hover {
    background: rgba(255, 255, 255, .22);
}


/* =========================================================
   HEADER MESSAGE
   ========================================================= */

.ac-ai-header-message {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 66px;

    padding: 12px 18px;

    color: #fff;

    background:
        linear-gradient(135deg,
            #0753AE,
            #0D83D9);
}


.ac-ai-header-message strong {
    display: block;

    font-size: 13px;
    font-weight: 800;
}


.ac-ai-header-message span {
    display: block;

    margin-top: 2px;

    font-size: 10px;

    opacity: .82;
}


.ac-ai-sparkle {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, .14);

    font-size: 18px;

    transform: rotate(-8deg);
}


/* =========================================================
   MESSAGE AREA
   ========================================================= */
.ac-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background:
        linear-gradient(180deg,
            #F7FBFF 0%,
            #FFFFFF 35%,
            #FAFCFF 100%);
    scrollbar-width: thin;
    scrollbar-color: #BCD2E9 transparent;
}

.ac-ai-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ac-ai-messages::-webkit-scrollbar-thumb {
    background: #BCD2E9;
    border-radius: 999px;
}


/* =========================================================
   BOT MESSAGE
   ========================================================= */
.ac-ai-message {
    display: flex;
    gap: 9px;
    margin-bottom: 10px;
}

.ac-ai-avatar {
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    margin-top: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E5F5FF, #DDF5EC);
    color: var(--ac-ai-navy);
    font-size: 13px;
    border: 1px solid #CFE8F5;
}

.ac-ai-bubble {
    max-width: 84%;
    padding: 12px 14px;
    border-radius: 4px 16px 16px 16px;
    background: #fff;
    border: 1px solid #E0EBF5;
    box-shadow: 0 4px 16px rgba(0, 59, 143, .05);
}

.ac-ai-text {
    white-space: pre-line;
    line-height: 1.45;
    padding-top: 5px;
    padding-bottom: 5px;
}

.ac-ai-bubble-greeting {
    color: var(--ac-ai-ink);
    font-size: 13px;
    font-weight: 800;
}

.ac-ai-bubble p {
    margin: 5px 0;
    color: #45617F;
    font-size: 12px;
    line-height: 1.55;
}

.ac-ai-bubble-question {
    color: var(--ac-ai-navy);
    font-size: 11px;
    font-weight: 700;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.ac-ai-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 2px 0 10px 40px;
}


.ac-ai-quick-card {
    min-height: 72px;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px;

    border: 1px solid #DFEAF5;

    border-radius: 13px;

    background: rgba(255, 255, 255, .88);

    color: var(--ac-ai-ink);

    box-shadow:
        0 3px 12px rgba(0, 59, 143, .04);

    text-align: left;

    cursor: pointer;

    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}


.ac-ai-quick-card:hover {
    transform: translateY(-2px);

    border-color: #AFCFEA;

    box-shadow:
        0 8px 20px rgba(0, 59, 143, .09);
}


.ac-ai-quick-card>span:last-child {
    min-width: 0;
}


.ac-ai-quick-card strong,
.ac-ai-quick-card small {
    display: block;
}


.ac-ai-quick-card strong {
    font-size: 10px;
    font-weight: 800;

    white-space: nowrap;
}


.ac-ai-quick-card small {
    margin-top: 1px;

    font-size: 9px;

    color: #70849A;

    white-space: nowrap;
}


.ac-ai-quick-icon {
    flex: 0 0 32px;

    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    font-size: 13px;
}


.ac-blue {
    color: #0869C7;
    background: #E5F2FF;
}


.ac-pink {
    color: #D84E92;
    background: #FFE8F2;
}


.ac-orange {
    color: #E88416;
    background: #FFF0DD;
}


.ac-green {
    color: #3C9A37;
    background: #E5F8E6;
}


.ac-purple {
    color: #7752D5;
    background: #EFE9FF;
}


.ac-cyan {
    color: #0799B5;
    background: #E1F8FC;
}


/* =========================================================
   USER MESSAGE
   ========================================================= */

.ac-ai-message-user {
    display: flex;
    justify-content: flex-end;
    margin-left: 42px;
    margin-bottom: 6px;
}

.ac-ai-message-user .ac-ai-bubble {
    width: fit-content;
    max-width: 85%;
    padding: 10px 14px;
    color: #fff;
    background:
        linear-gradient(135deg,
            #0062C9,
            #0078D7);
    border: 0;
    border-radius: 16px 4px 16px 16px;
    box-shadow: 0 5px 15px rgba(0, 102, 204, .18);
    line-height: 1.45;
}


.ac-ai-message-user .ac-ai-bubble p,
.ac-ai-message-user .ac-ai-bubble-question {
    color: #fff;
}


/* =========================================================
   PRODUCT RESULTS
   ========================================================= */

.ai-product-results {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;

    margin-top: 12px;
}


.ai-product-card {
    display: flex;
    flex-direction: column;

    min-width: 0;

    overflow: hidden;

    border: 1px solid #DFEAF5;

    border-radius: 14px;

    background: #fff;

    color: var(--ac-ai-ink);

    text-decoration: none;

    box-shadow:
        0 4px 15px rgba(0, 59, 143, .05);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}


.ai-product-card:hover {
    transform: translateY(-3px);

    border-color: #AFCFEA;

    box-shadow:
        0 10px 24px rgba(0, 59, 143, .11);
}


.ai-product-image-wrap {
    position: relative;

    height: 125px;

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

    padding: 10px;

    background:
        linear-gradient(145deg,
            #F4F9FD,
            #FFFFFF);
}


.ai-product-card img {
    width: 100%;
    height: 105px;

    object-fit: contain;

    transition: transform .25s ease;
}


.ai-product-card:hover img {
    transform: scale(1.04);
}


.ai-product-card-info {
    padding: 9px 10px 11px;
}


.ai-product-card-name {
    min-height: 32px;

    color: var(--ac-ai-ink);

    font-size: 10px;
    font-weight: 800;
    line-height: 1.45;
}


.ai-product-card-price {
    margin-top: 6px;

    color: var(--ac-ai-blue);

    font-size: 12px;
    font-weight: 800;
}


.ai-product-card-old-price {
    margin-left: 4px;

    color: #98A6B5;

    font-size: 9px;
    font-weight: 500;

    text-decoration: line-through;
}


.ai-product-card-action {
    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 8px;

    min-height: 30px;

    border-radius: 8px;

    background: #E8F4FF;

    color: var(--ac-ai-navy);

    font-size: 9px;
    font-weight: 800;
}


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

.ac-ai-input-area {
    padding: 12px 14px 11px;

    background: #fff;

    border-top: 1px solid #E3EDF6;
}


.ac-ai-input-box {
    display: flex;
    align-items: center;
    gap: 6px;

    min-height: 52px;

    padding: 5px 6px 5px 8px;

    border: 1px solid #D9E6F2;

    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 3px 12px rgba(0, 59, 143, .04);

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


.ac-ai-input-box:focus-within {
    border-color: #76B8E9;

    box-shadow:
        0 0 0 4px rgba(0, 102, 204, .07);
}


.ac-ai-input-box input {
    flex: 1;

    min-width: 0;

    height: 38px;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--ac-ai-ink);

    font-size: 12px;
}


.ac-ai-input-box input::placeholder {
    color: #9AA9B8;
}


.ac-ai-attach {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border: 0;
    background: transparent;

    color: #71879D;

    font-size: 15px;
}


.ac-ai-send {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border: 0;

    border-radius: 11px;

    background:
        linear-gradient(135deg,
            #003B8F,
            #0075D5);

    color: #fff;

    font-size: 13px;

    box-shadow:
        0 5px 12px rgba(0, 59, 143, .20);

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


.ac-ai-send:hover {
    transform: translateY(-1px);
}


.ac-ai-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}


.ac-ai-disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    margin-top: 7px;

    color: #9AA8B6;

    font-size: 8.5px;
    line-height: 1.4;
}


.ac-ai-disclaimer i {
    color: #6EBB45;
}


/* =========================================================
   LOADING
   ========================================================= */

.ac-ai-loading {
    display: flex;
    align-items: center;
    gap: 5px;
}


.ac-ai-loading span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--ac-ai-blue);

    animation: acAiDot 1.2s infinite ease-in-out;
}


.ac-ai-loading span:nth-child(2) {
    animation-delay: .15s;
}


.ac-ai-loading span:nth-child(3) {
    animation-delay: .3s;
}


@keyframes acAiDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .35;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }

}

/* =========================================================
   FAQ CHAT OPTIONS
   ========================================================= */

.ac-ai-faq-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px;
}

.ac-ai-faq-menu-title {
    margin-bottom: 3px;
    color: #003B8F;
    font-size: 11px;
    font-weight: 800;
}

.ac-ai-faq-category,
.ac-ai-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid #DFEAF5;
    border-radius: 10px;
    background: #F9FCFF;
    color: #123A68;
    text-align: left;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.ac-ai-faq-category:hover,
.ac-ai-faq-question:hover {
    background: #F0F8FF;
    border-color: #BBD8EF;
    transform: translateX(2px);
}

.ac-ai-faq-category-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #E4F5FF;
    color: #0066CC;
    font-size: 12px;
}

.ac-ai-faq-category>span:nth-child(2),
.ac-ai-faq-question>span {
    flex: 1;
    min-width: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.ac-ai-faq-category>i,
.ac-ai-faq-question>i {
    color: #8BA5BF;
    font-size: 10px;
}

.ac-ai-faq-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    padding: 8px;
    border-radius: 9px;
    color: #0066CC;
    background: #EEF7FF;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    transition: background .2s ease;
}

.ac-ai-faq-all:hover {
    background: #E1F1FF;
}

.ac-ai-faq-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    padding: 7px 9px;

    border: 0;

    border-radius: 8px;

    background: #F1F6FB;

    color: #42617F;

    font-size: 9px;
    font-weight: 700;

    cursor: pointer;
}


.ac-ai-faq-back:hover {
    background: #E5EFF7;
}

.ai-brand-logo {
    width: 72px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex: 0 0 72px;

    text-decoration: none;
}

.ai-brand-logo img {
    display: block;
    width: 86px;
    height: auto;
    max-width: 86px;
    max-height: 42px;
    object-fit: contain;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    .ac-ai-assistant {
        right: 14px;
        bottom: 14px;
    }

    /*
     * Mobile AI panel
     * Use dynamic viewport height so the panel responds
     * correctly when the mobile keyboard opens.
     */
    .ac-ai-panel {
        position: fixed;

        top: 10px;
        right: 10px;
        left: 10px;
        bottom: auto;

        width: auto;
        height: calc(100dvh - 20px);

        max-width: none;
        max-height: none;

        display: none;

        border-radius: 20px;

        overflow: hidden;

        overscroll-behavior: contain;
    }

    .ac-ai-panel.open {
        display: flex;
    }

    /*
     * Keep both header sections fixed inside the panel.
     */
    .ac-ai-header {
        flex: 0 0 auto;
        min-height: 70px;
        height: 70px;
    }

    .ac-ai-header-message {
        flex: 0 0 auto;
        min-height: 58px;
        height: 58px;
    }

    /*
     * Only the message section should scroll.
     */
    .ac-ai-messages {
        flex: 1 1 auto;
        min-height: 0;

        overflow-y: auto;
        overflow-x: hidden;

        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;

        touch-action: pan-y;

        padding: 14px;
    }

    /*
     * Keep input area fixed at the bottom of the panel.
     */
    .ac-ai-input-area {
        flex: 0 0 auto;
    }

    /*
     * Quick actions
     */
    .ac-ai-quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
        margin-left: 39px;
    }

    .ac-ai-quick-card {
        min-height: 66px;
    }

    /*
     * Product results
     */
    .ai-product-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /*
     * User messages
     */
    .ac-ai-message-user {
        margin-left: 28px;
    }

    .ac-ai-message-user .ac-ai-bubble {
        max-width: 90%;
        padding: 9px 13px;
    }

    /*
     * Launcher
     */
    .ac-ai-launcher {
        width: 52px;
        height: 52px;
        justify-content: center;
        padding: 6px;
    }

    .ac-ai-launcher-label {
        display: none;
    }

    .ac-ai-launcher-icon {
        width: 40px;
        height: 40px;
    }
}


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

@media (max-width: 480px) {

    .ac-ai-panel {
        top: 8px;
        right: 8px;
        left: 8px;
        bottom: auto;

        width: auto;
        height: calc(100dvh - 16px);

        border-radius: 18px;
    }

    .ac-ai-header {
        min-height: 68px;
        height: 68px;
        padding: 12px 14px;
    }

    .ac-ai-header-message {
        min-height: 56px;
        height: 56px;
        padding: 10px 14px;
    }

    .ac-ai-brand-mark {
        flex-basis: 68px;
        width: 68px;
    }

    .ai-brand-logo {
        width: 68px;
        height: 38px;
    }

    .ai-brand-logo img {
        width: 68px;
        max-width: 68px;
        max-height: 38px;
    }

    .ac-ai-brand-text {
        min-width: 0;
    }

    .ac-ai-title-row strong {
        font-size: 13px;
    }

    .ac-ai-brand-text small {
        font-size: 9px;
    }

    .ac-ai-live {
        padding: 2px 5px;
        font-size: 7px;
    }

    .ac-ai-close {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    .ac-ai-header-message strong {
        font-size: 12px;
    }

    .ac-ai-header-message span {
        font-size: 9px;
    }

    .ac-ai-sparkle {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        font-size: 15px;
    }

    .ac-ai-messages {
        padding: 13px;
    }

    .ac-ai-input-area {
        padding: 10px 10px 9px;
    }
}

/* =========================================================
   AI OPEN STATE
   Keep the main website header sticky while the AI panel
   is open. `overflow: clip` prevents background scrolling
   without creating a new scrolling container that breaks
   position: sticky.
   ========================================================= */

html.ac-ai-open,
body.ac-ai-open {
    overflow: clip;
    /*overflow: hidden;*/
}

body.ac-ai-open {
    overscroll-behavior: none;
}