﻿/* ===== Variables (dark app theme) ===== */
:root {
    --primary:       #3B9EFF;
    --primary-hover: #2A8EEF;
    --primary-glow:  rgba(59,158,255,0.25);
    --bg:            #0D0D0F;
    --surface:       #18181C;
    --surface-2:     #202028;
    --border:        rgba(255,255,255,0.08);
    --border-bright: rgba(255,255,255,0.16);
    --text:          #F0F0F5;
    --text-muted:    #8A8A9A;
    --text-dim:      #5A5A6A;
    --sidebar-w:     240px;
    --ai-sidebar-w:  360px;
    --topbar-h:      60px;
    --bottom-nav-h:  64px;
    --radius:        12px;
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.6);
    --transition:    0.2s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    display: flex;
    height: 100dvh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* ===== Left Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 300;
    transition: transform var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.sidebar-logo img { height: 48px; width: auto; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.s-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    text-align: left;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    position: relative;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
}
.s-nav-item i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.s-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.s-nav-item.active { background: rgba(59,158,255,0.12); color: var(--primary); }
.s-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-bottom {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.s-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 290;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ===== App Main ===== */
.app-main {
    margin-left: var(--sidebar-w);
    margin-right: var(--ai-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    transition: margin-right 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    flex-shrink: 0;
}

.topbar-hamburger {
    display: none;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--surface-2); color: var(--text); }

.topbar-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    max-width: 500px;
}
.topbar-search i { color: var(--text-dim); font-size: 14px; flex-shrink: 0; }
.topbar-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    padding: 9px 0;
}
.topbar-search input::placeholder { color: var(--text-dim); }

.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.topbar-icon-btn {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
    transition: background var(--transition), color var(--transition);
}
.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar-icon-btn.active { background: rgba(59,158,255,0.15); color: var(--primary); }
.topbar-icon-btn .s-badge {
    position: absolute;
    top: 4px; right: 4px;
    margin: 0;
    padding: 1px 5px;
    font-size: 10px;
}

/* ===== App Content + Views ===== */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
}

.view { display: none; padding: 24px; animation: fadeIn 0.2s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== HOME VIEW ===== */
.home-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    min-height: 55vh;
    padding: 40px 0 32px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.hero-eyebrow i { font-size: 11px; }

.hero-text h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #A678FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-visual { position: relative; }
.hero-img {
    width: 100%;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
}
.hero-glow {
    position: absolute;
    inset: -40px;
    background: radial-gradient(ellipse, var(--primary-glow) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* stats row */
.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.stat-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 18px;
    flex: 1;
    min-width: 160px;
}
.stat-chip > i {
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
}
.stat-chip strong { display: block; font-size: 15px; color: var(--text); }
.stat-chip span   { font-size: 12px; color: var(--text-muted); }

/* section label */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 16px;
}

/* quick cats */
.quick-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.qcat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
}
.qcat i { font-size: 13px; color: var(--primary); }
.qcat:hover {
    background: rgba(59,158,255,0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== SHOP VIEW: Filters ===== */
.filters-topbar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.cat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}
.cat-pill:hover { background: var(--surface-2); color: var(--text); }
.cat-pill.active {
    background: rgba(59,158,255,0.15);
    border-color: var(--primary);
    color: var(--primary);
}
.cat-pill i { font-size: 12px; }

.filters-right { display: flex; gap: 8px; flex-shrink: 0; }
.filter-select {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--transition);
}
.filter-select:hover, .filter-select:focus { border-color: var(--border-bright); color: var(--text); }

.results-bar { margin-bottom: 16px; }
#results-count { font-size: 13px; color: var(--text-dim); }

/* ===== Products Grid + Cards ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-md);
}

.product-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--primary); color: #fff;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; z-index: 2;
}
.product-badge.sale { background: #EF4444; }

.product-image {
    position: relative; height: 220px; overflow: hidden;
    background: var(--surface-2);
}
.product-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-image img { transform: scale(1.06); }

/* ── Blur-up lazy load animacija ────────────────────────────────────────── */
/* LQIP background rodomas kol įsikrauna reali nuotrauka */
.product-image img.nla-img {
    background-size: cover;
    background-position: center;
}
/* Kol kraunama: blurinta placeholder */
.product-image img.nla-img-loading {
    filter: blur(12px);
    transform: scale(1.04);
}
/* Įkrovus: lygi animacija į pilną kokybę */
.product-image img.nla-img-loaded {
    filter: none;
    transform: scale(1);
    transition: filter 0.4s ease, transform 0.4s ease;
}
/* Skeleton shimmer kol dar neprasidėjo krovimas */
@keyframes nla-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.product-image:not(:has(img.nla-img-loaded)) {
    background: linear-gradient(
        90deg,
        var(--surface-2) 25%,
        var(--surface)   50%,
        var(--surface-2) 75%
    );
    background-size: 400px 100%;
    animation: nla-shimmer 1.4s ease infinite;
}

.product-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
    opacity: 0; transition: opacity var(--transition);
}
.product-card:hover .product-overlay { opacity: 1; }

.overlay-btn {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 16px;
    transition: background var(--transition), transform var(--transition);
}
.overlay-btn:hover { background: var(--primary); transform: scale(1.1); }

.product-info { padding: 16px 20px; }
.product-info h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.3; }

.product-rating {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 12px; font-size: 13px; color: #F59E0B;
}
.product-rating span { color: var(--text-dim); margin-left: 4px; }

.product-price { display: flex; align-items: baseline; gap: 10px; }
.product-price .price { font-size: 20px; font-weight: 700; color: var(--primary); }
.product-price .price-old { font-size: 14px; color: var(--text-dim); text-decoration: line-through; }

/* Delivery badge on card */
.delivery-badge {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 10px;
    font-size: 11px; font-weight: 600;
    color: #10B981; background: rgba(16,185,129,0.1);
    padding: 3px 9px; border-radius: 20px;
}

/* Loading & empty states */
.loading-state, .no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-dim);
}
.loading-state i, .no-results i { font-size: 40px; margin-bottom: 12px; }
.loading-state p, .no-results p { font-size: 15px; margin-top: 12px; }

/* ===== CATEGORIES VIEW ===== */
.view-header { margin-bottom: 28px; }
.view-header h2 { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.view-header p { font-size: 15px; color: var(--text-muted); }

.cat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.cat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-align: left;
    transition: all var(--transition);
    cursor: pointer;
}
.cat-card:hover {
    background: var(--surface-2);
    border-color: var(--border-bright);
    transform: translateX(4px);
}
.cat-card-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(59,158,255,0.12);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: 22px; flex-shrink: 0;
    transition: background var(--transition);
}
.cat-card:hover .cat-card-icon { background: rgba(59,158,255,0.22); }
.cat-card-text h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.cat-card-text p  { font-size: 12px; color: var(--text-muted); }
.cat-arrow { margin-left: auto; color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

/* ===== AI VIEW – now handled by right sidebar ===== */

.ai-chat-header {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.ai-avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), #A678FF);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    flex-shrink: 0;
}
.ai-chat-header h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ai-online { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #10B981; }
.ai-dot {
    width: 7px; height: 7px;
    background: #10B981; border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

/* message bubbles from ai-chat.js */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}
.message.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message.assistant {
    background: var(--surface-2);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.ai-chat-footer {
    padding: 16px 0 20px;
}
.ai-chips {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.ai-chip {
    padding: 7px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12px; color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}
.ai-chip:hover { border-color: var(--primary); color: var(--primary); background: rgba(59,158,255,0.08); }

.ai-input-row {
    display: flex; gap: 10px; align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 6px 6px 16px;
    transition: border-color var(--transition);
}
.ai-input-row:focus-within { border-color: var(--primary); }
.chat-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text); font-size: 14px; padding: 8px 0;
}
.chat-input::placeholder { color: var(--text-dim); }
.chat-send {
    width: 38px; height: 38px;
    background: var(--primary); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}
.chat-send:hover { background: var(--primary-hover); transform: scale(1.05); }

/* ===== ABOUT VIEW ===== */
.about-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all var(--transition);
}
.about-card:hover { border-color: var(--border-bright); transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.about-card > i { font-size: 28px; color: var(--primary); margin-bottom: 14px; display: block; }
.about-card h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.about-card p  { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ===== CONTACT VIEW ===== */
.contact-app-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    align-items: start;
}
.contact-info-cards { display: flex; flex-direction: column; gap: 12px; }
.info-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.info-card > i { font-size: 20px; color: var(--primary); flex-shrink: 0; }
.info-card div strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.info-card div span  { font-size: 13px; color: var(--text-muted); }

.contact-form-app {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px 13px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 100px; }

.sent-msg {
    text-align: center; padding: 40px 0;
    color: #10B981;
}
.sent-msg i { font-size: 48px; margin-bottom: 12px; }
.sent-msg p { font-size: 15px; color: var(--text-muted); }

/* ===== Buttons ===== */
.btn-app {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}
.btn-primary {
    background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 16px var(--primary-glow); }
.btn-ghost {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text); }

/* ===== Right AI Sidebar ===== */
.ai-sidebar-right {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: var(--ai-sidebar-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 300;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.ai-right-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ai-right-title h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ai-right-title { flex: 1; }
.ai-right-close {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; color: var(--text-muted); font-size: 15px;
    margin-left: auto; flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}
.ai-right-close:hover { background: var(--surface-2); color: var(--text); }

.ai-sidebar-right .ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-right-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.ai-right-footer .ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.ai-right-footer .ai-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 5px 5px 5px 12px;
    transition: border-color var(--transition);
}
.ai-right-footer .ai-input-row:focus-within { border-color: var(--primary); }

.ai-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 280;
    backdrop-filter: blur(2px);
}
.ai-overlay.show { display: block; }

/* When AI sidebar is hidden (collapsed) */
body.ai-hidden .ai-sidebar-right {
    transform: translateX(100%);
}
body.ai-hidden .app-main {
    margin-right: 0;
}

/* ===== Cart Drawer ===== */
.cart-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    backdrop-filter: blur(2px);
}
.cart-overlay.show { display: block; }

.cart-drawer {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 360px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 500;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cart-drawer-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cart-close {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; color: var(--text-muted); font-size: 16px;
    transition: background var(--transition), color var(--transition);
}
.cart-close:hover { background: var(--surface-2); color: var(--text); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty { text-align: center; padding: 60px 0; color: var(--text-dim); }
.cart-empty i { font-size: 48px; margin-bottom: 12px; display: block; }
.cart-empty p { font-size: 14px; }

.cart-line {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cart-line-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.cart-line-price { font-size: 12px; color: var(--text-muted); }
.cart-line-remove {
    flex-shrink: 0; width: 30px; height: 30px;
    border-radius: 6px; color: var(--text-dim); font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.cart-line-remove:hover { background: rgba(239,68,68,0.1); color: #EF4444; }

.cart-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.cart-total-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; margin-bottom: 14px;
}
.cart-total-row strong { font-size: 18px; color: var(--primary); }

/* ===== Bottom Nav (mobile only) ===== */
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 200;
}
.bn-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    color: var(--text-dim);
    font-size: 10px; font-weight: 500;
    transition: color var(--transition);
    cursor: pointer;
    line-height: 1.2;
}
.bn-item i { font-size: 20px; }
.bn-item.active { color: var(--primary); }
.bn-item:hover { color: var(--text-muted); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    /* AI sidebar collapses on tablet – needs toggle */
    .ai-sidebar-right {
        transform: translateX(100%);
        z-index: 400;
    }
    .ai-sidebar-right.mobile-open {
        transform: translateX(0);
    }
    .app-main {
        margin-right: 0;
    }
    /* body.ai-hidden has no extra effect at this size */
    body.ai-hidden .app-main { margin-right: 0; }

    .home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .hero-visual { display: none; }
    .hero-text h1 { font-size: 40px; }
    .contact-app-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Show hamburger, hide sidebar by default */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .topbar-hamburger { display: flex; }

    /* App main takes full width */
    .app-main { margin-left: 0; }

    /* Bottom nav visible */
    .bottom-nav { display: flex; }

    /* Add padding for bottom nav */
    .app-content { padding-bottom: var(--bottom-nav-h); }

    /* AI view height fix */
    #view-ai { height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h)); }

    .hero-text h1 { font-size: 32px; }
    .stat-chip { min-width: 140px; }
    .home-hero { padding: 24px 0 16px; }

    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .view { padding: 16px; }

    .cart-drawer { width: 100%; max-width: 380px; }
    .filters-topbar { flex-direction: column; }
    .filters-right { width: 100%; }
    .filter-select { flex: 1; }
}

@media (max-width: 480px) {
    .hero-text h1 { font-size: 26px; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .product-image { height: 160px; }
    .stats-row { gap: 10px; }
    .stat-chip { padding: 10px 12px; }
    .cat-cards-grid { grid-template-columns: 1fr; }
    .about-app-grid { grid-template-columns: 1fr; }
}


