:root {
    /* Premium Dark Emerald Theme */
    --bg-main: #0f172a; /* Slate 900 */
    --bg-secondary: #1e293b; /* Slate 800 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-emerald: #10b981; /* Emerald 500 */
    --accent-emerald-dark: #059669; /* Emerald 600 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.product-card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.product-card:active {
    transform: scale(0.96);
}

/* Image placeholder styling */
.img-placeholder {
    height: 120px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    padding: 8px;
}

.product-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.product-price {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-emerald);
}

.btn-add {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px;
    font-weight: 700;
    width: 100%;
    margin-top: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-add:active {
    opacity: 0.8;
    transform: translateY(1px);
}

.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-main);
    border-radius: 10px;
    margin-top: 12px;
    padding: 4px;
    border: 1px solid var(--glass-border);
}

.qty-btn {
    background: transparent;
    color: var(--text-main);
    border: none;
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.qty-btn:active {
    background: var(--bg-secondary);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    border-top: 1px solid var(--glass-border);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    width: 25%;
    height: 100%;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-item svg {
    margin-bottom: 4px;
    transition: transform 0.3s, stroke 0.3s;
}

.nav-item.active {
    color: var(--accent-emerald);
}

.nav-item.active svg {
    transform: translateY(-2px);
    stroke: var(--accent-emerald);
}

/* Custom Scrollbar */
.page-animate {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background-color: var(--bg-secondary);
    border-radius: 10px;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-bubble.user {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
    background: var(--bg-secondary);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

/* Input field */
.chat-input-wrapper {
    position: fixed;
    bottom: 70px; /* above bottom nav */
    left: 0;
    right: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.chat-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 24px;
    padding: 12px 48px 12px 16px;
    font-size: 1rem;
    outline: none;
}

.chat-input:focus {
    border-color: var(--accent-emerald);
}

.chat-send-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-emerald);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

/* --- AI CHAT CAROUSEL --- */
.ai-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 10px 0;
    margin-top: 5px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
}
.ai-carousel::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
.ai-carousel-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.ai-carousel-img {
    height: 80px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.ai-carousel-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    line-height: 1.2;
}
.ai-carousel-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-emerald);
    margin-bottom: 8px;
}
.ai-carousel-btn {
    background: var(--accent-emerald);
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

