

        :root {
            --bg: #ffffff;
            --bg-secondary: #f8f8f8;
            --card: #ffffff;
            --border: #e8e8e8;
            --brand: #E31B23;
            --brand-light: #4a4a4a;
            --text: #1a1a1a;
            --text-secondary: #666666;
            --text-muted: #999999;
            --radius: 12px;
            --success: #16a34a;
            --error: #dc2626;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
            --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
            --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
        }

        .balance-card {
            background: var(--bg-secondary);
            padding: 12px 20px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid var(--border);
            min-width: 140px;
        }

        .balance-card i {
            font-size: 20px;
            color: var(--text-secondary);
        }

        .balance-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .balance-label {
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
        }

        .balance-amount {
            font-size: 20px;
            font-weight: 500;
            color: var(--text);
            transition: all 0.2s ease;
        }

        .balance-amount.updated {
            color: var(--success);
        }

/* Tabs */
.tabs {
    display: inline-flex;        /* shrink to fit content */
    gap: 4px;
    position: sticky;
    border-radius: 10px;
}

/* Tab Buttons */
.tab-btn {
    /* remove flex: 1 to prevent full width */
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: rgb(0, 0, 0);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap; /* prevent wrapping */
}
.tab-btn.active {
    color: white;
    background-color: var(--brand);
}
 .tab-btn:hover:not(.active) {
            color: var(--text);
        }

        .tab-btn i {
            font-size: 16px;
        }

        /* Section Title */
        .section-title {
            font-size: 16px;
            font-weight: 500;
            color: var(--text);
            display: flex;
            margin-left: 10px;
            align-items: center;
            gap: 8px;
            letter-spacing: -0.01em;
        }

        .section-title i {
            color: var(--text-secondary);
        }

        /* Products Grid */
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 16px;
            margin-bottom: 40px;
        }

/* Note: Changed to class selector .product-card */
.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    font-size: 13px;
    height: 100%; /* Ensures all cards in a row have equal height */
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}

/* Header - Fixed Height Area */
.product-header {
    background: var(--bg-secondary);
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.product-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    /* Prevent long names from breaking layout */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-amount {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Body - Flexible Space */
.product-body {
    padding: 12px;
    flex-grow: 1; /* Pushes the footer to the bottom regardless of text length */
    display: flex;
    flex-direction: column;
}

.product-description {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
    /* Handling word wraps and long descriptions */
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limits description to 3 lines (optional) */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer - Responsive Layout */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto; /* Ensures it stays at the bottom of the card */
    width: 100%;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0; 
}

.price-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 2px;
}

.buy-btn {
    flex: 1; /* Allows button to fill remaining space */
    white-space: nowrap;
    padding: 10px 16px;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.buy-btn:hover:not(:disabled) {
    background: var(--brand-light);
    filter: brightness(1.1);
}

.buy-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.buy-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid var(--border);
}

/* Responsive breakpoint for small mobile screens */
@media (max-width: 360px) {
    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-price {
        justify-content: center;
    }
}



      .floating-cart-btn {
    display: none;
    position: fixed;
    bottom: 44px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: rgb(0, 0, 0);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;

    /* Smooth fade */
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.floating-cart-btn:active {
    transform: scale(0.95);
}


        .cart-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            background: var(--error);
            color: white;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            font-size: 11px;
            font-weight: 600;
            display: none;
            align-items: center;
            justify-content: center;
            border: 2px solid white;
        }

        /* Cart Container */
        .cart-container {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 400px;
            max-height: 600px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 24px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
            z-index: 1000;
            display: none;
        }

        .cart-container.show {
            display: block;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .cart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }

        .cart-header h3 {
            font-size: 16px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text);
        }

        .close-cart {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
            cursor: pointer;
            padding: 4px;
            transition: all 0.15s ease;
            border-radius: 4px;
        }

        .close-cart:hover {
            background: var(--bg-secondary);
            color: var(--text);
        }

        .cart-items {
            max-height: 320px;
            overflow-y: auto;
            margin-bottom: 20px;
        }

        .cart-items::-webkit-scrollbar {
            width: 6px;
        }

        .cart-items::-webkit-scrollbar-track {
            background: transparent;
        }

        .cart-items::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        .cart-items::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        .cart-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: 8px;
            margin-bottom: 8px;
            border: 1px solid var(--border);
        }

        .cart-item-info {
            flex: 1;
        }

        .cart-item-name {
            font-weight: 500;
            margin-bottom: 4px;
            color: var(--text);
            font-size: 14px;
        }

        .cart-item-price {
            color: var(--text-secondary);
            font-size: 12px;
        }

        .cart-item-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .qty-btn {
            width: 26px;
            height: 26px;
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            font-weight: 500;
            font-size: 14px;
        }

        .qty-btn:hover {
            background: var(--brand);
            border-color: var(--brand);
            color: white;
        }

        .qty-btn:active {
            transform: scale(0.9);
        }

        .cart-item-controls span {
            min-width: 20px;
            text-align: center;
            font-weight: 500;
            font-size: 14px;
        }

        .cart-total {
            padding: 16px 0;
            border-top: 1px solid var(--border);
            margin-bottom: 16px;
        }

        .total-row {
            display: flex;
            justify-content: space-between;
            font-size: 16px;
            font-weight: 500;
            color: var(--text);
        }

        .checkout-btn {
            width: 100%;
            padding: 12px 16px;
            background: var(--brand);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .checkout-btn:hover:not(:disabled) {
            background: var(--brand-light);
        }

        .checkout-btn:active:not(:disabled) {
            transform: scale(0.98);
        }

        .checkout-btn:disabled {
            background: var(--bg-secondary);
            color: var(--text-muted);
            cursor: not-allowed;
            border: 1px solid var(--border);
        }

        .empty-cart {
            text-align: center;
            padding: 48px 20px;
            color: var(--text-muted);
        }

        .empty-cart i {
            font-size: 42px;
            margin-bottom: 12px;
            opacity: 0.3;
        }

        .empty-cart p {
            font-size: 14px;
        }

        /* Notification */
        .notification {
            position: fixed;
            top: 24px;
            right: 24px;
            background: var(--card);
            border: 1px solid var(--border);
            padding: 14px 20px;
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            animation: slideInNotif 0.3s ease;
            z-index: 1001;
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 300px;
        }
        .notification i {
            font-size: 20px;
        }

        .notification.success i {
            color: var(--success);
        }

        .notification.error i {
            color: var(--error);
        }

        .notification span {
            font-size: 14px;
            color: var(--text);
        }

        @keyframes slideInNotif {
            from { transform: translateX(100px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        /* Tab Content */
        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container {
                padding: 16px;
            }

            .balance-cards {
                width: 100%;
            }

            .balance-card {
                flex: 1;
                min-width: 0;
            }

            .products-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .cart-container {
                width: calc(100% - 32px);
                right: 16px;
                left: 16px;
                bottom: 16px;
            }

            .floating-cart-btn {
                width: 52px;
                height: 52px;
                font-size: 22px;
                bottom: 70px;
                right: 16px;
            }

            .notification {
                left: 16px;
                right: 16px;
                top: 16px;
                min-width: auto;
            }
        }

        @media (max-width: 480px) {

            .balance-cards {
                flex-direction: column;
                gap: 8px;
            }

            .balance-card {
                width: 100%;
            }
 .tabs {
        flex-direction: row; /* keep horizontal */
        overflow-x: auto;    /* allow horizontal scrolling if needed */
        gap: 4px;
    }

    .tab-btn {     /* prevent shrinking, keep button width */
        padding: 12px;
    }

    /* Optional: hide scrollbar in some browsers */
    .tabs::-webkit-scrollbar {
        display: none;
    }
        }
.empty-catalog {
    text-align: center;
    padding: 40px;
    color: #888;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.empty-catalog i {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
}
