:root {
    --primary: #0073e6;
    --primary-hover: #005bb5;
    --orange: #f68b1e;
    --orange-hover: #e07a16;
    --bg-main: #f5f5f5;
    --white: #ffffff;
    --text-dark: #282828;
    --text-muted: #75757a;
    --border: #e2e2e2;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); }

/* Top Navbar */
.navbar { background: var(--white); box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; padding: 15px 0; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; }

.brand .logo-link { color: var(--text-dark); font-size: 1.5rem; font-weight: 900; text-decoration: none; }
.brand .highlight { color: var(--primary); }
.brand i { color: var(--primary); margin-right: 5px; }

.search-bar { display: flex; flex: 1; max-width: 600px; margin: 0 30px; }
.search-bar input { flex: 1; padding: 10px 15px; border: 1px solid var(--border); border-right: none; border-radius: 4px 0 0 4px; font-size: 0.95rem; outline: none; }
.search-bar input:focus { border-color: var(--orange); }
.search-btn { background: var(--orange); color: var(--white); border: none; padding: 0 20px; font-weight: 700; border-radius: 0 4px 4px 0; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 4px rgba(246,139,30,0.3); }
.search-btn:hover { background: var(--orange-hover); }

.nav-actions { display: flex; gap: 20px; align-items: center; }
.action-item { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; color: var(--text-dark); transition: 0.2s; }
.action-item:hover { color: var(--primary); }
.action-item i { font-size: 1.2rem; }

.cart-icon-wrapper { position: relative; }
.cart-badge { position: absolute; top: -8px; right: -10px; background: var(--orange); color: white; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; }

/* Store Layout */
.store-layout { max-width: 1200px; margin: 20px auto; display: flex; gap: 20px; padding: 0 15px; align-items: flex-start; }

/* Sidebar Categories */
.sidebar { width: 220px; background: var(--white); border-radius: 8px; padding: 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: sticky; top: 80px; flex-shrink: 0; }
.category-list { list-style: none; }
.category-list li { padding: 10px 15px; font-size: 0.9rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-dark); border-left: 3px solid transparent; transition: 0.2s; }
.category-list li i { width: 16px; color: var(--text-muted); text-align: center; }
.category-list li:hover, .category-list li.active { background: #f9f9f9; color: var(--orange); border-left-color: var(--orange); }
.category-list li:hover i, .category-list li.active i { color: var(--orange); }

/* Main Content */
.main-content { flex: 1; }

.promo-banner { background: linear-gradient(135deg, var(--primary) 0%, #00428a 100%); border-radius: 8px; padding: 40px; color: white; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 15px rgba(0,115,230,0.2); }
.promo-text h2 { font-size: 1.2rem; font-weight: 500; margin-bottom: 5px; opacity: 0.9; }
.promo-text h1 { font-size: 3rem; font-weight: 900; margin-bottom: 15px; color: #ffeb3b; }

.section-title { background: var(--white); padding: 15px 20px; border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.section-title h3 { font-size: 1.2rem; font-weight: 700; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* Product Cards */
.product-card { background: var(--white); border-radius: 4px; padding: 15px; transition: transform 0.2s, box-shadow 0.2s; position: relative; display: flex; flex-direction: column; cursor: pointer; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10; }
.product-image { width: 100%; height: 180px; object-fit: contain; margin-bottom: 15px; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--orange); color: white; padding: 3px 8px; font-size: 0.7rem; font-weight: 700; border-radius: 3px; }
.product-name { font-size: 0.9rem; color: var(--text-dark); margin-bottom: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px;}
.product-price { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); margin-bottom: 3px; }
.product-old-price { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; margin-bottom: 12px; height: 16px; }
.add-to-cart-btn { width: 100%; padding: 10px; border: none; background: var(--primary); color: white; font-weight: 600; border-radius: 4px; cursor: pointer; transition: 0.2s; margin-top: auto; }
.add-to-cart-btn:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(0,115,230,0.3); }

/* Cart Overlay */
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none; transition: 0.3s; }
.cart-overlay.active { opacity: 1; pointer-events: all; }
.cart-modal { position: absolute; top: 0; right: -400px; width: 400px; max-width: 100%; height: 100%; background: var(--white); transition: 0.3s ease-out; display: flex; flex-direction: column; }
.cart-overlay.active .cart-modal { right: 0; }
.cart-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { font-size: 1.2rem; }
.close-cart { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.cart-items { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.cart-item { display: flex; gap: 15px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.cart-item-img { width: 60px; height: 60px; object-fit: contain; }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.cart-item-price { font-weight: 700; color: var(--orange); }
.remove-item { background: none; border: none; color: #ff3b3b; cursor: pointer; font-size: 0.8rem; margin-top: 5px; font-weight: 600;}
.cart-footer { padding: 20px; border-top: 1px solid var(--border); background: #f9f9f9; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; }
.checkout-btn { width: 100%; padding: 15px; border: none; background: var(--orange); color: white; font-weight: 700; font-size: 1rem; border-radius: 4px; cursor: pointer; box-shadow: 0 4px 10px rgba(246,139,30,0.3); transition: 0.2s;}
.checkout-btn:hover { background: var(--orange-hover); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; opacity: 0; pointer-events: none; transition: 0.3s; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box { background: var(--white); width: 90%; max-width: 400px; border-radius: 12px; padding: 30px; position: relative; transform: translateY(20px); transition: 0.3s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.modal-close:hover { color: #ff3b3b; }
.modal-box h2 { margin-bottom: 20px; font-size: 1.5rem; color: var(--primary); font-weight: 800; }
.order-card { border: 1px solid var(--border); border-radius: 6px; padding: 15px; margin-bottom: 10px; }
.order-card h4 { font-size: 0.9rem; margin-bottom: 5px; color: var(--text-dark); }
.order-status { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; background: #e0f2fe; color: #0284c7; }
 
/* Auth UI Enhancements */
.auth-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 25px; }
.auth-tab { flex: 1; padding: 12px; background: none; border: none; font-size: 1rem; font-weight: 800; cursor: pointer; color: #888; border-bottom: 3px solid transparent; transition: 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-input { width: 100%; padding: 12px 15px; margin-bottom: 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; transition: 0.2s; outline: none; }
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,115,230,0.1); }
.name-input { display: none; }
.name-input.show { display: block; }

.auth-submit { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: 0.2s; margin: 10px 0; }
.auth-submit:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,115,230,0.2); }

.error-text { color: #ff3b3b; font-size: 0.8rem; margin-bottom: 12px; display: none; font-weight: 600; text-align: center; background: #fff5f5; padding: 8px; border-radius: 4px; }

.auth-divider { text-align: center; margin: 25px 0; border-bottom: 1px solid #eee; line-height: 0.1em; }
.auth-divider span { background: #fff; padding: 0 15px; color: #94a3b8; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* Existing styling continues... */

/* Premium Checkout Box */
.checkout-box { max-width: 500px; padding: 0; overflow: hidden; }
.checkout-header { background: linear-gradient(135deg, var(--primary) 0%, #00428a 100%); padding: 30px; color: white; display: flex; align-items: center; gap: 15px; }
.checkout-header h2 { color: white; margin: 0; font-size: 1.4rem; }
.checkout-content { padding: 30px; }

.order-summary-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin-bottom: 25px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-muted); font-size: 0.95rem; }
.summary-total { display: flex; justify-content: space-between; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #cbd5e1; font-weight: 800; font-size: 1.2rem; color: var(--text-dark); }

.payment-method-box label, .phone-input-group label { display: block; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.mpesa-option { border: 2px solid var(--primary); border-radius: 8px; padding: 12px 15px; display: flex; align-items: center; gap: 12px; background: #f0f9ff; cursor: pointer; margin-bottom: 25px; }
.mpesa-option img { height: 24px; }
.mpesa-option span { font-weight: 700; color: #1e40af; }

.input-with-icon { position: relative; }
.input-with-icon i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-with-icon input { width: 100%; padding: 12px 15px 12px 45px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1.1rem; font-weight: 600; outline: none; transition: 0.2s; }
.input-with-icon input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,115,230,0.1); }
.input-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }

.pay-btn { margin-top: 30px; width: 100%; padding: 18px; border: none; background: #22c55e; color: white; font-weight: 800; font-size: 1.1rem; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 15px; transition: 0.3s; box-shadow: 0 10px 15px -3px rgba(34,197,94,0.3); }
.pay-btn:hover { background: #16a34a; transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(34,197,94,0.4); }

/* tracking-box Styles */
.tracking-box { max-width: 600px; padding: 0; overflow: hidden; }
.tracking-header { padding: 30px; border-bottom: 1px solid #e2e8f0; }
.tracking-header h2 { margin: 0; color: var(--text-dark); }
.tracking-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }
.tracking-content { padding: 20px; max-height: 500px; overflow-y: auto; }

.tracked-order { border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 20px; padding: 20px; background: white; }
.order-meta { display: flex; justify-content: space-between; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.order-id { font-weight: 800; color: var(--primary); }
.order-date { font-size: 0.85rem; color: var(--text-muted); }

/* Timeline UI */
.timeline { position: relative; padding-left: 30px; margin: 20px 0; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; width: 2px; height: 100%; background: #e2e8f0; }
.step { position: relative; padding-bottom: 20px; }
.step::before { content: ''; position: absolute; left: -26px; top: 0; width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; border: 3px solid white; z-index: 2; }
.step.completed::before { background: #22c55e; }
.step.active::before { background: var(--orange); animation: pulse 2s infinite; }
.step-title { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); }
.step-time { font-size: 0.75rem; color: var(--text-muted); }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(246,139,30, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(246,139,30, 0); }
    100% { box-shadow: 0 0 0 0 rgba(246,139,30, 0); }
}

.tracked-items { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.tracked-item-img { width: 50px; height: 50px; object-fit: contain; border: 1px solid #f1f5f9; border-radius: 6px; }

/* --- RESPONSIVE STYLES --- */
@media (max-width: 900px) {
    .store-layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; display: flex; overflow-x: auto; padding: 0; background: var(--white); z-index: 10; scrollbar-width: none; border-bottom: 2px solid #eee; }
    .sidebar::-webkit-scrollbar { display: none; }
    .category-list { display: flex; width: max-content; }
    .category-list li { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 15px 20px; }
    .category-list li:hover, .category-list li.active { border-left-color: transparent; border-bottom-color: var(--orange); }
}

@media (max-width: 600px) {
    .navbar { padding: 10px 0; }
    .search-bar { display: none; }
    .nav-actions { gap: 12px; }
    .action-item span { display: none; }
    .promo-banner { padding: 20px; flex-direction: column; text-align: center; }
    .promo-text h1 { font-size: 2rem; }
    .promo-text p { font-size: 0.8rem; }
    
    .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .product-card { padding: 10px; }
    .product-image { height: 140px; }
    .product-name { font-size: 0.8rem; height: 35px; }
    .product-price { font-size: 1rem; }
    
    .modal-box { width: 95% !important; padding: 15px !important; }
    .checkout-header, .tracking-header { padding: 15px !important; }
    .checkout-content { padding: 15px !important; }
    .pay-btn { padding: 15px; font-size: 0.95rem; }
    .summary-total { font-size: 1rem; }
}
