:root {
    --primary-color: #27ae60;
    --primary-dark: #1e8449;
    --secondary-color: #f1c40f;
    --accent-color: #e67e22;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --chat-bg: rgba(255, 255, 255, 0.95);
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --user-msg-bg: linear-gradient(to right, #27ae60, #2ecc71);
    --bot-msg-bg: #ffffff;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body,
html {
    height: 100%;
    overflow: hidden;
    background: var(--bg-gradient);
}

#chat-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    margin: 0 auto;
    background: var(--chat-bg);
    position: relative;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

#chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid #eee;
}

#sidebar {
    width: 320px;
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

#cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

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

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
}

.total-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

header {
    padding: 20px 25px;
    background: white;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.logo-container {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
}

.shop-info h1 {
    font-size: 1.1rem;
    color: var(--text-main);
}

.status-online {
    font-size: 0.75rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-right: 6px;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fdfdff;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.user-message {
    align-self: flex-end;
    background: var(--user-msg-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
}

.product-list-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0 15px;
    scrollbar-width: none;
}

.product-list-container::-webkit-scrollbar {
    display: none;
}

.product-card {
    width: 170px;
    background: white;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.product-img-container {
    height: 110px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    padding: 12px;
    text-align: center;
}

.product-name {
    font-weight: 600;
    font-size: 0.85rem;
    height: 2.2rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 5px;
}

.typing-indicator {
    padding: 12px 18px;
    background: white;
    border: 1px solid #eee;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: none;
    align-self: flex-start;
    margin-bottom: 10px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #ccd;
    border-radius: 50%;
    animation: bounce 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

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

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
        background: var(--primary-color);
    }
}

.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

#user-input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid #e0e0e0;
    outline: none;
}

#send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    #chat-container {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        height: auto;
        max-height: 35vh;
        border-top: 1px solid #eee;
    }

    #chat-main {
        height: 65vh;
        border-right: none;
    }
}