/* --- Chat Popup Styles (Scoped under .chat-popup-container) --- */
.chat-popup-container ._keyfocus *:focus, 
.chat-popup-container input:not([disabled]):focus, 
.chat-popup-container textarea:not([disabled]):focus, 
.chat-popup-container select:not([disabled]):focus {
    box-shadow: none;
}

.chat-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 250px;
    background: none;
    z-index: 1000;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
    overflow: visible;
}

.chat-popup-container.chat-expanded {
    width: 380px;
}

.chat-popup-container .chatbot-wrapper {
    width: 100%;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid rgba(231, 229, 228, 0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-popup-container .chatbot-wrapper.compact {
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 102, 107, 0.2);
    background: transparent;
    border: none;
    overflow: visible;
}

.chat-popup-container .chatbot-wrapper.compact .chat-header,
.chat-popup-container .chatbot-wrapper.compact .sample-conversation {
    display: none;
}

.chat-popup-container .chatbot-wrapper.compact .compact-view {
    background: transparent;
    padding: 0;
    height: auto;
    justify-content: flex-end;
}

.chat-popup-container .chatbot-wrapper.expanded {
    height: 550px;
    background: white;
    border: 1px solid rgba(231, 229, 228, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.255);
}

.chat-popup-container .avatar-wrapper {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: floatAvatar 3s ease-in-out infinite;
}

@keyframes floatAvatar {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

.chat-popup-container .avatar-icon {
    width: 40px;
    height: 40px;
    color: #00666B;
}

.chat-popup-container .chat-header {
    background: linear-gradient(135deg, #008087 0%, #00666B 100%);
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: relative;
}

.chat-popup-container .header-left-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.chat-popup-container .header-title-block h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.chat-popup-container .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a5f3fc;
}

.chat-popup-container .status-dot {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-popup-container .header-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chat-popup-container .header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.chat-popup-container .header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chat-popup-container .compact-view {
    padding: 16px;
    height: calc(100% - 120px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 30%, #99f6e4 100%);
}

.chat-popup-container .sample-conversation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.chat-popup-container .sample-message {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 14px;
    color: #374151;
    max-width: 85%;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInMessage 0.6s ease-out forwards;
}

.chat-popup-container .sample-message:nth-child(1) { animation-delay: 0.3s; }
.chat-popup-container .sample-message:nth-child(2) { animation-delay: 0.7s; }

.chat-popup-container .sample-message.user-msg {
    align-self: flex-end;
    background: #00666B;
    color: white;
    transform: translateX(20px);
}

.chat-popup-container .highlight-text {
    color: #00666B;
    font-weight: 600;
}

.chat-popup-container .sample-message.user-msg .highlight-text {
    color: #a5f3fc;
}

@keyframes slideInMessage {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-popup-container .compact-input-wrapper {
    position: relative;
    background: #f9f9f9;
    border: 3px solid #00666B;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 102, 107, 0.15);
}

.chat-popup-container .compact-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: -28px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 8px solid transparent;
    border-top: 28px solid #00666B;
    filter: drop-shadow(0 3px 3px rgba(0,102,107,0.12));
}

.chat-popup-container .compact-input-wrapper::before {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 6px solid transparent;
    border-top: 22px solid #f9f9f9;
    z-index: 1;
}

.chat-popup-container .compact-input-wrapper:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 107, 0.25);
    transform: translateY(-2px);
}

.chat-popup-container .typing-placeholder {
    font-size: 15px;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.chat-popup-container .typing-text {
    display: inline-block;
}

.chat-popup-container .cursor-blink {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: #00666B;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.chat-popup-container .input-icon {
    width: 22px;
    height: 22px;
    color: #00666B;
}

.chat-popup-container .expanded-view {
    display: none;
    height: calc(100% - 80px);
    flex-direction: column;
    background: #f5f5f4;
}

.chat-popup-container .chatbot-wrapper.expanded .expanded-view {
    display: flex;
}

.chat-popup-container .chatbot-wrapper.expanded .compact-view {
    display: none;
}

.chat-popup-container .welcome-section {
    background: linear-gradient(135deg, #008087 0%, #00666B 100%);
    padding: 16px 20px;
    color: white;
    animation: fadeInDown 0.4s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-popup-container .welcome-text {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
}

.chat-popup-container .messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-popup-container .messages-container::-webkit-scrollbar {
    width: 6px;
}

.chat-popup-container .messages-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-popup-container .message-bubble {
    max-width: 85%;
    animation: messagePop 0.3s ease-out;
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-popup-container .user-message {
    align-self: flex-end;
    background: #00666B;
    color: white;
    padding: 12px 16px;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 102, 107, 0.3);
}

.chat-popup-container .user-message p {
    font-size: 14px;
    line-height: 1.5;
}

.chat-popup-container .bot-message-wrapper {
    align-self: flex-start;
    width: 100%;
}

.chat-popup-container .bot-bubble {
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 20px;
    border-top-left-radius: 4px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chat-popup-container .bot-text {
    font-size: 14px;
    line-height: 1.6;
    color: #44403c;
}

.chat-popup-container .typing-container {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 20px;
    border-top-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chat-popup-container .typing-container span {
    width: 8px;
    height: 8px;
    background: #a8a29e;
    border-radius: 50%;
    animation: popup-bounce 1.4s infinite ease-in-out both;
}

@keyframes popup-bounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}

.chat-popup-container .product-card-container {
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.chat-popup-container .product-card-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.chat-popup-container .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f4;
}

.chat-popup-container .recommendation-label {
    font-size: 11px;
    font-weight: 600;
    color: #78716c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-popup-container .item-counter {
    font-size: 12px;
    color: #a8a29e;
}

.chat-popup-container .image-wrapper {
    position: relative;
    background: #f5f5f4;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-popup-container .product-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
    transition: transform 0.3s;
}

.chat-popup-container .product-card-container:hover .product-img {
    transform: scale(1.05);
}

.chat-popup-container .carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.chat-popup-container .product-card-container:hover .carousel-nav-btn {
    opacity: 1;
}

.chat-popup-container .carousel-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.chat-popup-container .carousel-nav-btn.prev-btn {
    left: 12px;
}

.chat-popup-container .carousel-nav-btn.next-btn {
    right: 12px;
}

.chat-popup-container .product-info-section {
    padding: 16px;
}

.chat-popup-container .product-details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.chat-popup-container .product-name-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #292524;
    margin-bottom: 4px;
    line-height: 1.3;
    margin-top: 0;
}

.chat-popup-container .sku-code {
    font-size: 11px;
    color: #a8a29e;
}

.chat-popup-container .pricing-section {
    text-align: right;
}

.chat-popup-container .current-price {
    font-size: 20px;
    font-weight: 700;
    color: #00666B;
}

.chat-popup-container .original-price {
    font-size: 12px;
    color: #a8a29e;
    text-decoration: line-through;
}

.chat-popup-container .action-buttons-row {
    display: flex;
    gap: 8px;
}

.chat-popup-container .primary-action-btn {
    flex: 1;
    background: #00666B;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0, 102, 107, 0.3);
}

.chat-popup-container .primary-action-btn:hover {
    background: #004f54;
    transform: translateY(-1px);
}

.chat-popup-container .icon-action-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #d6d3d1;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
    color: #78716c;
}

.chat-popup-container .icon-action-btn:hover {
    border-color: #00666B;
    color: #00666B;
}

.chat-popup-container .dots-container {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 16px 16px;
}

.chat-popup-container .carousel-dot {
    width: 10px;
    height: 10px;
    background: #d6d3d1;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.chat-popup-container .carousel-dot.active-dot {
    width: 20px;
    background: #00666B;
    border-radius: 3px;
}

.chat-popup-container .features-section {
    margin-top: 12px;
}

.chat-popup-container .features-title {
    font-size: 14px;
    font-weight: 600;
    color: #292524;
    margin-bottom: 12px;
}

.chat-popup-container .features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-popup-container .feature-item {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #57534e;
}

.chat-popup-container .feature-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: #00666B;
    border-radius: 50%;
}

.chat-popup-container .feature-item strong {
    color: #292524;
    font-weight: 600;
}

.chat-popup-container .secondary-action-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: 2px solid #44403c;
    background: transparent;
    color: #44403c;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-popup-container .secondary-action-btn:hover {
    background: #44403c;
    color: white;
}

.chat-popup-container .input-section {
    background: white;
    border-top: 1px solid #e7e5e4;
    padding: 16px;
}

.chat-popup-container .input-box-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f5f5f4;
    border: 1px solid #e7e5e4;
    border-radius: 20px;
    padding: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.chat-popup-container .input-box-wrapper:focus-within {
    border-color: #00666B;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 107, 0.1);
}

.chat-popup-container .text-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 14px;
    color: #44403c;
    resize: none;
    outline: none;
    min-height: 44px;
    max-height: 100px;
    font-family: inherit;
}

.chat-popup-container .text-input::placeholder {
    color: #9ca3af;
}

.chat-popup-container .submit-button {
    background: #00666B;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.chat-popup-container .submit-button:hover {
    background: #004f54;
    transform: scale(1.05);
}

.chat-popup-container .footer-text {
    text-align: center;
    margin-top: 8px;
    font-size: 10px;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-popup-container .icon-svg {
    width: 20px;
    height: 20px;
}

.chat-popup-container .icon-small-svg {
    width: 16px;
    height: 16px;
}

.chat-popup-container .hidden-content {
    display: none !important;
}

@keyframes minimizePulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.chat-popup-container .chat-icon {
    display: none;
}

@media only screen and (max-width: 768px) {
    .chat-popup-container .chat-icon {
        display: block;
        width: 32px;
        height: 26px;
        margin: 0;
    }
    
    .chat-popup-container {
        width: auto;
        bottom: 15px;
        right: 15px;
        box-shadow: unset;
    }
    
    .chat-popup-container .chatbot-wrapper.compact {
        box-shadow: none;
    }
    
    .chat-popup-container .chatbot-wrapper.compact .compact-view {
        flex-direction: unset;
    }
    
    .chat-popup-container .compact-input-wrapper {
        width: 40px;
        height: 40px;
        border-radius: 50% !important;
        background: white;
        border: 1px solid #00666B;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 30px rgba(0, 102, 107, 0.15);
    }
    
    .chat-popup-container .compact-input-wrapper::after,
    .chat-popup-container .compact-input-wrapper::before {
        display: none !important;
    }
    
    .chat-popup-container .typing-placeholder {
        display: none !important;
    }
    
    .chat-popup-container .search-icon {
        display: none !important;
    }
    
    .chat-popup-container .chat-icon {
        width: 24px;
        height: 18px;
    }
}

@media only screen and (max-width: 480px) {
    .chat-popup-container {
        bottom: auto;
        top: 60%;
        right: 6px;
    }
    
    .chat-popup-container.chat-expanded {
        width: calc(100% - 20px);
        top: auto;
        bottom: 6px;
    }
}