
        :root {
            --tg-theme-bg-color: #ffffff;
            --tg-theme-text-color: #000000;
            --tg-theme-hint-color: #999999;
            --tg-theme-link-color: #2481cc;
            --tg-theme-button-color: #2481cc;
            --tg-theme-button-text-color: #ffffff;
            --tg-theme-secondary-bg-color: #f4f4f5;
            --accent: #ff6b6b;
            --success: #2ecc71;
            color-scheme: light dark;
        }

        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        
        body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    overflow-x: hidden;
    padding-bottom: 140px; /* Increased from 80px to account for Cart Footer (70px) + Bottom Nav (70px) */
}

        /* --- Header --- */
        .app-header {
            position: sticky;
            top: 0;
            z-index: 100;
            background: var(--tg-theme-bg-color);
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        .logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px; }
        .header-actions { display: flex; gap: 15px; }
        .icon-btn {
            background: none;
            border: none;
            font-size: 1.3rem;
            color: var(--tg-theme-text-color);
            cursor: pointer;
            position: relative;
        }
        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--accent);
            color: white;
            font-size: 0.7rem;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        /* --- Views --- */
        .view { display: none; animation: fadeIn 0.3s ease; padding: 0 0 20px 0; }
        .view.active { display: block; }

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

        /* --- Product Grid --- */
        .hero {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px 20px;
            margin-bottom: 20px;
            border-radius: 0 0 20px 20px;
        }
        .hero h1 { margin: 0 0 10px 0; font-size: 1.5rem; }
        .hero p { margin: 0; opacity: 0.9; font-size: 0.9rem; }

        .section-title {
            padding: 0 20px;
            margin: 20px 0 10px;
            font-weight: 700;
            font-size: 1.1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .product-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            padding: 0 20px;
        }

        .product-card {
            background: var(--tg-theme-bg-color);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            transition: transform 0.2s;
            cursor: pointer;
        }
        .product-card:active { transform: scale(0.98); }
        .product-img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            background: #eee;
        }
        .product-info { padding: 12px; }
        .product-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .product-price { color: var(--tg-theme-link-color); font-weight: 700; font-size: 1rem; }
        .product-cat { font-size: 0.75rem; color: var(--tg-theme-hint-color); margin-bottom: 5px; }

        /* --- Product Detail --- */
        .detail-img {
            width: 100%;
            height: 350px;
            object-fit: cover;
            border-radius: 0 0 20px 20px;
        }
        .detail-content { padding: 20px; }
        .detail-title { font-size: 1.5rem; margin: 0 0 10px 0; }
        .detail-price { font-size: 1.8rem; color: var(--tg-theme-link-color); font-weight: 800; margin-bottom: 15px; display: block; }
        .detail-desc { color: var(--tg-theme-hint-color); line-height: 1.5; margin-bottom: 30px; font-size: 0.95rem; }

        .btn-primary {
            width: 100%;
            padding: 15px;
            background: var(--tg-theme-button-color);
            color: var(--tg-theme-button-text-color);
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: opacity 0.2s;
        }
        .btn-primary:active { opacity: 0.8; }

        /* --- Cart --- */
        .cart-item {
            display: flex;
            gap: 15px;
            background: var(--tg-theme-bg-color);
            padding: 15px;
            margin: 0 20px 15px;
            border-radius: 12px;
            align-items: center;
        }
        .cart-img { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; }
        .cart-details { flex: 1; }
        .cart-title { font-weight: 600; margin-bottom: 5px; }
        .cart-price { color: var(--tg-theme-hint-color); font-size: 0.9rem; }
        .cart-controls { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
        .qty-btn {
            width: 28px;
            border: 1px solid var(--tg-theme-hint-color);
            color: var(--tg-theme-text-color);
            background: var(--tg-theme-secondary-bg-color);
            height: 28px;
            border-radius: 50%;
            border: 1px solid #ddd;
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .cart-empty {
            text-align: center;
            padding: 50px 20px;
            color: var(--tg-theme-hint-color);
        }
        .cart-empty i { font-size: 3rem; margin-bottom: 15px; display: block; }

        /* REPLACE the existing .cart-footer styles with these: */
.cart-footer {
    position: fixed;
    bottom: 70px; /* Changed from 0 to sit above the nav (nav is roughly 60-70px) */
    left: 0;
    right: 0;
    background: var(--tg-theme-bg-color);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    border-top: 1px solid rgba(0,0,0,0.05);
}
        .total-label { color: var(--tg-theme-hint-color); font-size: 0.9rem; }
        .total-price { font-size: 1.3rem; font-weight: 800; }

        /* --- Checkout --- */
        .checkout-form {
            background: var(--tg-theme-bg-color);
            padding: 20px;
            margin: 20px;
            border-radius: 12px;
        }
        .form-group { margin-bottom: 20px; }
        .form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
        .form-input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-text-color);
            border: 1px solid var(--tg-theme-hint-color);
        }
        .payment-methods { display: flex; gap: 10px; margin-bottom: 20px; }
        .pay-option {
            flex: 1;
            border: 2px solid #ddd;
            border: 2px solid var(--tg-theme-hint-color); /* Instead of #ddd */
            color: var(--tg-theme-text-color);
            padding: 15px;
            border-radius: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }
        .pay-option.active { border-color: var(--tg-theme-link-color);
             background: rgba(36, 129, 204, 0.05);
                  
            }
        .pay-option i { font-size: 1.5rem; margin-bottom: 5px; display: block; }

        /* --- Success Animation --- */
        .success-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: var(--tg-theme-bg-color);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            display: none;
        }
        .checkmark-circle {
            width: 100px; height: 100px;
            background: var(--success);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .checkmark-circle i { color: white; font-size: 3rem; }
        @keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
        
        .receipt {
            background: var(--tg-theme-secondary-bg-color);
            color: var(--tg-theme-text-color);
            border: 1px solid var(--tg-theme-hint-color);
            border-top: 4px solid var(--success);
            padding: 20px;
            width: 80%;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
            text-align: left;
            margin-top: 20px;
            border-top: 4px solid var(--success);
        }
        .receipt-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; }
        .receipt-total { border-top: 1px dashed #ccc; padding-top: 10px; margin-top: 10px; font-weight: bold; font-size: 1.1rem; }

        /* --- Orders --- */
        .order-card {
            background: var(--tg-theme-bg-color);
            margin: 0 20px 15px;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 5px rgba(0,0,0,0.03);
        }
        .order-header {
            padding: 15px;
            border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .order-id { font-weight: 600; font-size: 0.9rem; }
        .order-status {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        .status-completed { background: #d4edda; color: #155724; }
        .status-pending { background: #fff3cd; color: #856404; }
        .order-body { padding: 15px; }
        .order-item-small { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
        .order-item-small img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

        /* --- Bottom Nav --- */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--tg-theme-bg-color);
            display: flex;
            justify-content: space-around;
            padding: 10px 0;
            border-top: 1px solid rgba(0,0,0,0.05);
            z-index: 100;
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--tg-theme-hint-color);
            text-decoration: none;
            font-size: 0.7rem;
            gap: 4px;
            background: none;
            border: none;
            width: 100%;
        }
        .nav-item.active { color: var(--tg-theme-link-color); }
        .nav-item i { font-size: 1.2rem; }

        /* Utility */
        .hidden { display: none !important; }
    