:root {
    --primary: #f68b1e; --primary-dark: #e57e1b; --secondary: #282828; --bg-grey: #f5f5f5;
    --text-main: #282828; --text-light: #5f5f63; --success: #007a3d; --danger: #e23b3b;
    --border-color: #e0e0e0; --white: #ffffff; --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --footer-bg: #1a1a1a; --font-title: 'Bubblegum Sans', cursive; --font-body: 'Times New Roman', Times, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font-body); background-color: var(--bg-grey); color: var(--text-main); margin: 0; padding-bottom: 70px; font-size: 16px; line-height: 1.5; }

h1, h2, h3, h4, .logo, .section-title, .overlay-header h2, .detail-title, .footer-col h4, .trust-text, .newsletter h3, .package-name, .auth-heading, .portal-heading, .promo-title { font-family: var(--font-title); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }

/* =========================================
   HEADER & NAV
   ========================================= */
.app-header { background: var(--secondary); padding: 12px 20px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.header-top { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.logo { color: var(--primary); font-size: 1.8rem; letter-spacing: -1px; white-space: nowrap; text-transform: uppercase; text-decoration: none; transition: text-shadow 0.3s; }
.logo:hover { text-shadow: 0 0 8px rgba(246,139,30,0.5); }
.logo span { color: var(--white); }
.search-bar { display: flex; flex: 1; background: var(--white); border-radius: 8px; overflow: hidden; height: 40px; position: relative; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
.search-input { flex: 1; border: none; padding: 0 12px; font-size: 1rem; font-family: var(--font-body); outline: none; transition: background 0.2s; }
.search-input:focus { background: #fff9e6; }
.clear-search { position: absolute; right: 50px; top: 50%; transform: translateY(-50%); background: #eee; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 1rem; color: #666; }
.clear-search.show { display: flex; }
.search-btn { background: var(--primary); border: none; width: 45px; cursor: pointer; color: white; font-size: 1.1rem; transition: background 0.2s; }
.search-btn:active { background: var(--primary-dark); }
.desktop-nav { display: none; gap: 20px; align-items: center; }
.desktop-nav a, .desktop-nav button { color: white; text-decoration: none; font-size: 1.1rem; transition: color 0.2s; background: none; border: none; font-family: var(--font-body); cursor: pointer; }
.desktop-nav a:hover, .desktop-nav button:hover { color: var(--primary); }
.desktop-nav .sell-btn { background: var(--primary); padding: 8px 15px; border-radius: 20px; color: white; font-family: var(--font-title); transition: transform 0.2s, box-shadow 0.2s; }
.desktop-nav .sell-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(246,139,30,0.4); }
.sub-header { display: flex; justify-content: space-between; align-items: center; color: var(--white); }
.location-btn { background: none; border: 1px solid #444; color: #ccc; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; display: flex; align-items: center; gap: 5px; cursor: pointer; font-family: var(--font-body); }

/* =========================================
   MAIN LAYOUT & STOREFRONT
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.search-info { background: #fff3cd; color: #856404; padding: 10px 15px; margin: 10px 0; border-radius: 8px; font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; animation: fadeInUp 0.3s ease; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 25px 0 15px; border-bottom: 2px solid var(--border-color); padding-bottom: 5px; }
.section-title { font-size: 1.4rem; color: var(--text-main); margin: 0; }
.see-all { color: var(--primary); font-size: 1rem; text-decoration: none; font-weight: bold; }
.cat-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item { display: flex; flex-direction: column; align-items: center; min-width: 70px; text-align: center; cursor: pointer; background: none; border: none; font-family: var(--font-body); padding: 0; }
.cat-circle { width: 60px; height: 60px; border-radius: 50%; background: var(--white); border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; transition: 0.3s; box-shadow: var(--shadow); }
.cat-item:hover .cat-circle { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 4px 15px rgba(246,139,30,0.2); }
.cat-name { font-size: 0.95rem; margin-top: 5px; color: var(--text-main); }
.timer { display: flex; gap: 4px; font-family: var(--font-title); }
.time-box { background: var(--secondary); color: white; padding: 4px 8px; border-radius: 4px; font-size: 1rem; animation: pulse 2s infinite; }

.announcement-bar { background: var(--secondary); color: white; text-align: center; padding: 8px 15px; font-size: 0.85rem; font-weight: bold; letter-spacing: 0.5px; border-bottom: 1px solid #444; }
.announcement-bar span { color: var(--primary); margin: 0 10px; }

/* =========================================
   COMPACT HERO SECTION (JUMIA/JIJI STYLE)
   ========================================= */
.hero-section-modern { 
    display: flex; align-items: center; 
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%); 
    color: white; padding: 25px 0; overflow: hidden; position: relative; 
}
.hero-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; width: 100%; }

.hero-content { flex: 1; padding-right: 30px; z-index: 2; }
.hero-badge { display: inline-block; background: rgba(246, 139, 30, 0.15); color: var(--primary); padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; margin-bottom: 10px; border: 1px solid var(--primary); }
.hero-title-modern { font-family: var(--font-title); font-size: 2rem; line-height: 1.1; margin: 0 0 10px 0; color: white; }
.hero-title-modern span { color: var(--primary); text-shadow: 0 0 10px rgba(246,139,30,0.3); display: inline-block; }
.hero-subtitle { font-size: 0.95rem; color: #b0b0b0; margin-bottom: 15px; line-height: 1.5; max-width: 400px; display: none; }
.hero-cta-btn { 
    display: inline-block; background: var(--primary); color: white; padding: 10px 25px; 
    border-radius: 50px; text-decoration: none; font-weight: bold; font-size: 0.95rem; 
    font-family: var(--font-title); transition: all 0.3s; 
    box-shadow: 0 4px 15px rgba(246, 139, 30, 0.4); border: none; cursor: pointer;
}
.hero-cta-btn:hover { background: var(--white); color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(246, 139, 30, 0.6); }

.hero-image-container { flex: 0 0 250px; position: relative; display: flex; justify-content: center; align-items: center; }
.hero-main-img { 
    max-width: 100%; height: auto; border-radius: 12px; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.4); 
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); z-index: 2;
}
.hero-main-img:hover { transform: scale(1.03); }

.hero-floating-badge { display: none; }

.promo-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; z-index: 10; }
.promo-card { background: white; padding: 25px 30px; border-radius: 16px; display: flex; align-items: center; gap: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); transition: transform 0.2s; border: 1px solid var(--border-color); }
.promo-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.promo-icon { font-size: 2.5rem; background: #fff3e0; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; }
.promo-text { margin: 0; color: var(--text-light); font-size: 0.95rem; }

/* =========================================
   MODERN PRODUCT GRID (VERCEL STYLE)
   ========================================= */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.product-card { background: var(--white); border-radius: 12px; overflow: hidden; border: none; position: relative; transition: 0.3s; display: flex; flex-direction: column; cursor: pointer; opacity: 0; animation: fadeInUp 0.4s ease-out forwards; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.product-card:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.1); transform: translateY(-5px); }
.img-wrapper { position: relative; aspect-ratio: 1 / 1; background: #fafafa; overflow: hidden; }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .product-img { transform: scale(1.08); }
.badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; color: white; font-family: var(--font-body); font-weight: bold; letter-spacing: 0.3px; }
.badge.official { background: rgba(40, 40, 40, 0.85); backdrop-filter: blur(4px); } 
.badge.imported { background: rgba(38, 86, 240, 0.85); backdrop-filter: blur(4px); }
.badge.discount { background: var(--danger); }
.hover-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); transform: translateY(100%); transition: transform 0.3s ease; z-index: 2; }
.product-card:hover .hover-overlay { transform: translateY(0); }
.add-cart-btn { display: block; width: 100%; padding: 12px; border: none; background: var(--white); color: var(--secondary); font-size: 0.95rem; font-family: var(--font-body); font-weight: bold; border-radius: 6px; cursor: pointer; transition: 0.2s; text-decoration: none; text-align: center; }
.add-cart-btn:hover { background: var(--primary); color: var(--white); }
.card-body { padding: 15px 5px; display: flex; flex-direction: column; flex: 1; }
.prod-title { font-size: 1rem; color: var(--text-main); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; font-weight: 500; }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; } 
.current-price { font-size: 1.15rem; color: var(--text-main); font-weight: bold; } 
.old-price { text-decoration: line-through; color: var(--text-light); font-size: 0.85rem; } 
.empty-state { grid-column: 1 / -1; text-align: center; padding: 40px 20px; background: white; border-radius: 8px; margin-top: 10px; }

/* =========================================
   PRODUCT DETAIL PAGE
   ========================================= */
.detail-page { padding-top: 30px; padding-bottom: 40px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
.detail-img-wrapper { position: relative; aspect-ratio: 1 / 1; background: #fafafa; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); }
.detail-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.detail-img-wrapper:hover .detail-img { transform: scale(1.05); }
.detail-badge { position: absolute; top: 15px; left: 15px; font-size: 0.9rem; padding: 6px 14px; }
.detail-info { display: flex; flex-direction: column; }
.detail-title { font-family: var(--font-title); font-size: 2rem; margin: 0 0 15px 0; line-height: 1.2; color: var(--text-main); }
.detail-price-row { display: flex; align-items: baseline; gap: 15px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.detail-current-price { font-size: 1.8rem; font-weight: bold; color: var(--text-main); }
.detail-old-price { font-size: 1.1rem; text-decoration: line-through; color: var(--text-light); }
.detail-perks { display: flex; flex-direction: column; gap: 15px; margin-bottom: 25px; }
.perk-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--bg-grey); border-radius: 10px; }
.perk-icon { font-size: 1.5rem; width: 40px; text-align: center; }
.perk-title { font-weight: bold; font-size: 1rem; color: var(--text-main); }
.perk-sub { font-size: 0.85rem; color: var(--text-light); }
.detail-desc { line-height: 1.7; color: var(--text-light); font-size: 1.05rem; margin-bottom: 30px; }
.detail-actions { display: flex; flex-direction: column; gap: 15px; }
.btn-cart, .btn-buy { display: block; width: 100%; padding: 16px; text-align: center; text-decoration: none; font-family: var(--font-body); font-size: 1.1rem; font-weight: bold; border-radius: 50px; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.btn-cart { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-cart:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(246, 139, 30, 0.3); }
.btn-buy { background: var(--primary); color: var(--white); }
.btn-buy:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(246, 139, 30, 0.3); }
.related-section { margin-top: 50px; }
.related-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.related-scroll::-webkit-scrollbar { display: none; }
.related-card { min-width: 160px; max-width: 160px; background: var(--white); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; scroll-snap-align: start; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.related-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.related-img-wrapper { position: relative; aspect-ratio: 1 / 1; background: #fafafa; overflow: hidden; }
.related-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.related-card:hover .related-img { transform: scale(1.05); }
.related-badge { position: absolute; top: 8px; left: 8px; font-size: 0.7rem; padding: 3px 8px; }
.related-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.related-title { font-size: 0.85rem; margin: 0 0 8px 0; color: var(--text-main); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-price { margin-top: auto; font-size: 1rem; font-weight: bold; color: var(--text-main); }

/* =========================================
   BOTTOM NAV & AUTH FORMS
   ========================================= */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: white; border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.nav-item { display: flex; flex-direction: column; align-items: center; color: #888; font-size: 0.8rem; cursor: pointer; position: relative; background: none; border: none; font-family: var(--font-body); padding: 0; text-decoration: none; }
.nav-item.active { color: var(--primary); } .nav-item svg { width: 24px; height: 24px; margin-bottom: 2px; fill: currentColor; transition: transform 0.2s; } .nav-item:hover svg { transform: translateY(-2px); }
.nav-cart-bg { position: absolute; top: -18px; background: var(--primary); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 2px 8px rgba(246, 139, 30, 0.5); border: 4px solid white; z-index: 1; transition: transform 0.2s; font-size: 1.2rem; }
.nav-cart-bg:active { transform: scale(0.9); }
.cart-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: white; width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); animation: pulse 2s infinite; }
.nav-cart-label { margin-top: 30px; }
.auth-container { max-width: 450px; margin: 40px auto; background: white; padding: 30px; border-radius: 12px; box-shadow: var(--shadow); animation: fadeInUp 0.5s ease; }
.auth-heading { text-align: center; font-size: 2.2rem; margin: 0 0 10px; color: var(--primary); }
.auth-sub { text-align: center; color: var(--text-light); margin-bottom: 25px; font-size: 1.1rem; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 25px; }
.auth-tab { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-weight: bold; color: var(--text-light); border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font-body); font-size: 1.1rem; transition: 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.form-group { margin-bottom: 20px; } .form-label { display: block; margin-bottom: 8px; font-size: 1.1rem; color: var(--text-main); font-weight: bold; }
.form-input { width: 100%; padding: 12px; border: 2px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: var(--font-body); background: white; transition: border-color 0.3s, box-shadow 0.3s; }
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(246,139,30,0.2); }
.submit-btn { width: 100%; padding: 15px; background: var(--primary); color: white; border: none; font-size: 1.2rem; font-family: var(--font-body); font-weight: bold; border-radius: 8px; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.submit-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(246,139,30,0.3); }

/* =========================================
   SELLER PORTAL & TABLES
   ========================================= */
.seller-portal-layout { display: flex; height: calc(100vh - 60px); }
.seller-sidebar { width: 250px; background: var(--secondary); color: white; padding: 20px 0; display: none; flex-direction: column; }
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid #444; margin-bottom: 10px; }
.sidebar-header h3 { margin: 0; color: var(--primary); font-size: 1.5rem; font-family: var(--font-title); }
.sidebar-header p { margin: 5px 0 0; font-size: 0.9rem; color: #aaa; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; flex: 1; }
.sidebar-nav li { padding: 15px 20px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; font-size: 1.05rem; border-left: 4px solid transparent; }
.sidebar-nav li:hover { background: #333; border-left-color: #555; }
.sidebar-nav li.active { background: #444; border-left-color: var(--primary); color: var(--primary); }
.seller-main { flex: 1; padding: 20px; overflow-y: auto; background: var(--bg-grey); }
.portal-heading { font-size: 1.8rem; margin: 0 0 20px 0; color: var(--text-main); }
.portal-mobile-tabs { display: flex; background: white; border-bottom: 2px solid var(--border-color); overflow-x: auto; } .portal-mobile-tabs::-webkit-scrollbar { display: none; }
.portal-tab-btn { padding: 15px 20px; border: none; background: none; font-family: var(--font-body); font-size: 1rem; cursor: pointer; border-bottom: 3px solid transparent; font-weight: bold; color: var(--text-light); white-space: nowrap; transition: 0.2s; text-decoration: none; }
.portal-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 25px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow); border-left: 5px solid var(--primary); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-value { font-size: 1.8rem; font-weight: bold; margin: 5px 0; font-family: var(--font-body); }
.stat-label { font-size: 0.9rem; color: var(--text-light); text-transform: uppercase; }
.data-table-container { background: white; border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th { background: var(--bg-grey); text-align: left; padding: 12px 15px; border-bottom: 2px solid var(--border-color); font-weight: bold; }
.data-table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
.data-table tr:hover { background: #f9f9f9; }
.action-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 5px; color: var(--text-light); transition: 0.2s; text-decoration: none; }
.action-btn:hover { color: var(--primary); transform: scale(1.1); }
.action-btn.delete:hover { color: var(--danger); }
.portal-card { background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 20px; }
.logout-btn { width: 100%; padding: 12px; background: var(--danger); color: white; border: none; font-family: var(--font-body); font-weight: bold; border-radius: 8px; cursor: pointer; margin-top: auto; transition: 0.2s; text-decoration: none; display: inline-block; }
.logout-btn:hover { opacity: 0.9; transform: translateY(-2px); }

/* =========================================
   SMART FINANCE DASHBOARD
   ========================================= */
.finance-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; align-items: start; margin-top: 30px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-header h3 { margin: 0; font-size: 1.2rem; }
.btn-sm { background: var(--bg-grey); border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; cursor: pointer; font-family: var(--font-body); }
.tx-list { display: flex; flex-direction: column; }
.tx-item { display: flex; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; flex-shrink: 0; }
.tx-in { background: #e6f9ee; color: var(--success); }
.tx-out { background: #fde8e8; color: var(--danger); }
.tx-details { flex: 1; }
.tx-cat { font-weight: bold; font-size: 0.95rem; color: var(--text-main); }
.tx-desc { font-size: 0.8rem; color: var(--text-light); }
.tx-amount { font-weight: bold; font-size: 1rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.loan-card { background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%); color: white; position: relative; overflow: hidden; border: none; }
.loan-badge { position: absolute; top: 15px; right: -30px; background: var(--success); color: white; padding: 5px 40px; font-size: 0.7rem; font-weight: bold; transform: rotate(45deg); text-transform: uppercase; }
.loan-card h3 { font-family: var(--font-title); font-size: 1.5rem; margin: 0 0 10px 0; }
.loan-sub { font-size: 0.9rem; color: #b0b0b0; line-height: 1.5; margin-bottom: 20px; }
.credit-limit-box { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 20px; }
.credit-limit-box span { font-size: 0.8rem; color: #b0b0b0; display: block; margin-bottom: 5px; }
.credit-limit-box h2 { margin: 0; color: var(--primary); font-family: var(--font-title); }
.loan-form label { font-size: 0.9rem; color: #ccc; display: block; margin-bottom: 8px; margin-top: 15px; }
.loan-form input, .loan-form textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: white; font-family: var(--font-body); outline: none; transition: 0.2s; }
.loan-form input:focus, .loan-form textarea:focus { border-color: var(--primary); background: rgba(255,255,255,0.15); }
.loan-form .submit-btn { background: var(--primary); border-radius: 50px; }
.active-loan-status { margin-top: 20px; text-align: center; }
.active-loan-status .stat-label { color: #ccc; }
.active-loan-status .stat-value { font-size: 1.8rem; color: white; }
.progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width 0.5s ease; }

/* =========================================
   WHATSAPP-STYLE CHAT INTERFACE
   ========================================= */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 160px); padding: 0; overflow: hidden; }
.chat-body { flex: 1; padding: 20px; overflow-y: auto; background: #e5ddd5; background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9c4bc' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.msg-row { display: flex; margin-bottom: 10px; }
.msg-out { justify-content: flex-end; }
.msg-in { justify-content: flex-start; }
.msg-bubble { position: relative; padding: 8px 12px; border-radius: 8px; max-width: 65%; box-shadow: 0 1px 1px rgba(0,0,0,0.1); word-wrap: break-word; }
.msg-out .msg-bubble { background: #d9fdd3; border-top-right-radius: 0; }
.msg-in .msg-bubble { background: #ffffff; border-top-left-radius: 0; }
.msg-text { margin: 0; line-height: 1.4; font-size: 0.95rem; padding-right: 60px; }
.deleted-text { font-style: italic; color: #888; }
.msg-meta { position: absolute; bottom: 5px; right: 8px; display: flex; align-items: center; gap: 5px; }
.time-tag { font-size: 0.7rem; color: #666; }
.edited-tag { font-size: 0.65rem; color: #888; font-style: italic; }
.read-tag { font-size: 0.8rem; color: var(--success); font-weight: bold; }
.reply-block { background: rgba(0,0,0,0.06); border-left: 3px solid var(--primary); padding: 5px 8px; border-radius: 4px; margin-bottom: 5px; font-size: 0.85rem; }
.reply-block strong { display: block; color: var(--primary); font-size: 0.8rem; }
.reply-block span { color: #555; }
.file-block { margin-bottom: 5px; }
.chat-img { max-width: 100%; max-height: 200px; border-radius: 4px; cursor: pointer; }
.file-block a { color: var(--primary); text-decoration: underline; font-weight: bold; font-size: 0.9rem; }
.reaction-badge { position: absolute; bottom: -10px; left: 10px; background: white; border: 1px solid #eee; border-radius: 20px; padding: 2px 6px; font-size: 0.85rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.context-menu { display: none; position: absolute; background: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 1000; min-width: 150px; overflow: hidden; }
.menu-item { padding: 10px 15px; cursor: pointer; font-size: 0.9rem; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.menu-item:hover { background: var(--bg-grey); }
.context-menu hr { margin: 0; border-color: #eee; }
.chat-footer { background: #f0f0f0; padding: 10px; border-top: 1px solid #ddd; }
.chat-form { display: flex; align-items: center; gap: 10px; }
.attach-btn { font-size: 1.5rem; cursor: pointer; color: #555; }
.chat-send-btn { width: auto; margin: 0; padding: 10px 20px; border-radius: 50%; line-height: 1; }
.reply-preview, .edit-preview { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 8px 12px; border-bottom: 1px solid #ddd; font-size: 0.85rem; color: #555; }
.cancel-btn { background: none; border: none; color: #888; cursor: pointer; font-size: 1.2rem; }
.chat-empty { text-align: center; color: #888; margin-top: 40%; }

/* =========================================
   FLOATING BUTTONS & AD POPUP
   ========================================= */
.floating-whatsapp {
    position: fixed; bottom: 80px; left: 20px; width: 55px; height: 55px; 
    background: #25D366; color: white; border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 1.8rem; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); 
    z-index: 90; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
}
.floating-whatsapp:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6); }

.floating-top {
    position: fixed; bottom: 80px; right: 20px; width: 45px; height: 45px; 
    background: var(--secondary); color: white; border-radius: 50%; border: none; 
    font-size: 1.2rem; cursor: pointer; z-index: 90; display: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: 0.2s;
}
.floating-top:hover { background: var(--primary); transform: translateY(-3px); }

/* Ad Popup */
.ad-popup {
    position: fixed; bottom: 140px; left: 20px; width: 300px; background: white; 
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 95; 
    display: none; transform: translateY(20px); opacity: 0; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); overflow: hidden;
}
.ad-popup.show { transform: translateY(0); opacity: 1; }
.ad-popup-close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #888; z-index: 10; }
.ad-popup-link { text-decoration: none; color: inherit; display: flex; gap: 12px; padding: 12px; }
.ad-popup-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.ad-popup-info { flex: 1; }
.ad-popup-info small { color: var(--primary); font-weight: bold; font-size: 0.75rem; text-transform: uppercase; }
.ad-popup-info h4 { margin: 4px 0; font-size: 0.9rem; font-family: var(--font-title); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-popup-price { font-weight: bold; font-size: 0.95rem; color: var(--text-main); }
.ad-popup-cart { display: block; text-align: center; padding: 10px; background: var(--primary); color: white; text-decoration: none; font-weight: bold; font-size: 0.9rem; transition: 0.2s; }
.ad-popup-cart:hover { background: var(--primary-dark); }

/* =========================================
   FOOTER
   ========================================= */
.shop-topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.shop-back-btn, .shop-cart-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); text-decoration: none; position: relative; display: flex; align-items: center; gap: 10px; font-family: var(--font-body); transition: color 0.2s; }
.shop-back-btn:hover { color: var(--primary); }
.shop-title { font-family: var(--font-title); font-size: 1.3rem; margin: 0; color: var(--text-main); }
.shop-cart-btn { color: var(--secondary); }
.shop-cart-badge { position: absolute; top: -5px; right: -12px; background: var(--danger); color: white; width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); }
.main-footer { background: var(--footer-bg); color: #ccc; margin-top: 40px; padding-bottom: 80px; }
.footer-top { border-bottom: 1px solid #333; padding: 40px 0; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.trust-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: center; margin-bottom: 30px; }
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform 0.3s; }
.trust-item:hover { transform: translateY(-5px); }
.trust-icon { font-size: 2.5rem; color: var(--primary); }
.trust-text { font-size: 1.2rem; color: white; margin: 0; }
.trust-sub { font-size: 0.9rem; color: #888; margin: 0; }
.newsletter { background: #252525; padding: 25px; border-radius: 12px; display: flex; flex-direction: column; gap: 15px; margin-bottom: 30px; }
.newsletter h3 { margin: 0; font-size: 1.4rem; color: white; }
.newsletter p { margin: 0; color: #aaa; font-size: 0.95rem; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-input { flex: 1; padding: 12px; border-radius: 8px; border: none; background: #333; color: white; font-family: var(--font-body); outline: none; transition: 0.2s; }
.newsletter-input:focus { background: #444; box-shadow: 0 0 0 2px var(--primary); }
.newsletter-btn { background: var(--primary); color: white; border: none; padding: 0 25px; border-radius: 8px; cursor: pointer; font-family: var(--font-body); font-weight: bold; transition: 0.2s; }
.newsletter-btn:hover { background: var(--primary-dark); }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-bottom: 40px; }
.footer-col h4 { color: white; font-size: 1.2rem; margin: 0 0 15px 0; border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 5px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #aaa; text-decoration: none; transition: 0.2s; font-size: 0.95rem; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.social-links { display: flex; gap: 15px; margin-top: 10px; }
.social-icon { width: 40px; height: 40px; background: #333; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: 0.2s; font-size: 1.1rem; font-weight: bold; }
.social-icon:hover { background: var(--primary); transform: translateY(-3px); }
.social-icon.whatsapp { background: #25D366; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.payment-methods { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pay-icon { background: white; color: black; padding: 5px 10px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; font-family: sans-serif; transition: 0.2s; }
.pay-icon:hover { transform: scale(1.05); }
.pay-icon.mpesa { color: #4CAF50; border: 1px solid #4CAF50; background: transparent; }
.dev-btn { display: inline-block; margin-top: 15px; padding: 10px 20px; background: linear-gradient(135deg, var(--primary), #ff9a3c); color: white; text-decoration: none; border-radius: 20px; font-family: var(--font-title); font-size: 1rem; transition: transform 0.2s, box-shadow 0.2s; }
.dev-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(246,139,30,0.4); }

/* =========================================
   RESPONSIVE: TABLETS (Min 768px)
   ========================================= */
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); } 
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .trust-badges { gap: 40px; } .newsletter { flex-direction: row; align-items: center; justify-content: space-between; } .newsletter-text { flex: 1; } .newsletter-form { min-width: 300px; }
    .footer-links { grid-template-columns: repeat(4, 1fr); }
    .detail-grid { grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
    .detail-actions { flex-direction: row; }
    .btn-cart, .btn-buy { flex: 1; }
    .related-card { min-width: 200px; max-width: 200px; }
}

/* =========================================
   RESPONSIVE: DESKTOP (Min 1024px)
   ========================================= */
@media (min-width: 1024px) {
    body { padding-bottom: 0; } .bottom-nav { display: none; } .desktop-nav { display: flex; } .sub-header { display: none; }
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .main-footer { padding-bottom: 0; } .footer-bottom { flex-direction: row; justify-content: space-between; }
    .portal-mobile-tabs { display: none; } .seller-sidebar { display: flex; }
    .hero-subtitle { display: block; }
    
    /* Floating Buttons Desktop Position */
    .floating-whatsapp { bottom: 30px; left: 30px; }
    .floating-top { bottom: 30px; right: 30px; }
    .ad-popup { bottom: 40px; left: 30px; }
}

/* =========================================
   RESPONSIVE: MOBILE APP-LIKE (Max 768px)
   ========================================= */
@media (max-width: 768px) {
    body { padding-bottom: 120px; }
    .container { padding: 0 10px; }

    /* Hero Mobile Compact */
    .hero-section-modern { padding: 20px 0; }
    .hero-container { text-align: center; }
    .hero-content { padding: 0; order: 2; }
    .hero-image-container { order: 1; flex: 0 0 150px; margin-bottom: 10px; width: 100%; }
    .hero-title-modern { font-size: 1.5rem; }
    .hero-subtitle { display: none; }
    
    .promo-strip { grid-template-columns: 1fr; margin-top: 20px; }
    .product-grid { gap: 12px; }
    .card-body { padding: 10px 5px; }
    .prod-title { font-size: 0.9rem; height: auto; -webkit-line-clamp: 1; } 
    .current-price { font-size: 1rem; }
    .hover-overlay { transform: translateY(0); position: relative; background: transparent; padding: 0 10px 10px; }
    .add-cart-btn { border: 2px solid var(--primary); background: var(--white); color: var(--primary); padding: 8px; font-size: 0.85rem; }
    .add-cart-btn:active { background: var(--primary); color: var(--white); }

    /* Detail Page Mobile Native App Feel */
    .detail-page { padding-top: 15px; padding-bottom: 0; }
    .detail-grid { gap: 15px; }
    .detail-img-wrapper { border-radius: 12px; aspect-ratio: 4 / 5; }
    .detail-title { font-size: 1.5rem; margin-bottom: 10px; }
    .detail-price-row { margin-bottom: 15px; padding-bottom: 15px; }
    .detail-current-price { font-size: 1.5rem; }
    .detail-perks { gap: 10px; margin-bottom: 15px; }
    .perk-item { padding: 12px; }
    .detail-desc { font-size: 1rem; margin-bottom: 15px; }
    .detail-actions { position: fixed; bottom: 58px; left: 0; right: 0; background: white; padding: 12px 15px; box-shadow: 0 -4px 15px rgba(0,0,0,0.1); z-index: 99; flex-direction: row; gap: 12px; border-radius: 0; }
    .btn-cart, .btn-buy { border-radius: 8px; padding: 14px; font-size: 1rem; }

    /* Finance Mobile */
    .finance-layout { grid-template-columns: 1fr; }

    /* Chat Mobile App Optimization */
    .chat-container { height: calc(100vh - 140px); }
    .msg-bubble { max-width: 85%; }
    .context-menu { position: fixed !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 180px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); }

    /* Footer Mobile */
    .main-footer { padding-bottom: 120px; } 
}
/* =========================================
   PASSWORD STRENGTH BAR
   ========================================= */
.password-wrapper { position: relative; }
.pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-light); font-size: 0.9rem; font-weight: 600; padding: 4px 6px; }
.strength-bar-wrap { margin-top: 8px; }
.strength-bar-track { height: 5px; background: #e0e0e0; border-radius: 10px; overflow: hidden; }
.strength-bar-fill { height: 100%; width: 0%; border-radius: 10px; transition: width 0.35s ease, background 0.35s ease; }
.strength-label { font-size: 0.8rem; margin-top: 5px; font-weight: 600; color: var(--text-light); }
.strength-hints { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.hint-chip { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; background: #f1f1f1; color: var(--text-light); transition: 0.25s; }
.hint-chip.passed { background: #e6fff0; color: #1a7a40; }

/* =========================================
   VENDORS TABLE — ACTION BUTTONS
   ========================================= */
.vendor-action-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 6px; font-size: 0.82rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; transition: 0.2s; line-height: 1; }
.vendor-action-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.vendor-action-btn.approve  { background: #e6fff0; color: #1a7a40; border: 1.5px solid #1a7a40; }
.vendor-action-btn.suspend  { background: #fff0f0; color: var(--danger); border: 1.5px solid var(--danger); }
.vendor-action-btn.delete   { background: #fff; color: #999; border: 1.5px solid #ddd; }
.vendor-action-btn.approve:hover { background: #1a7a40; color: #fff; }
.vendor-action-btn.suspend:hover { background: var(--danger); color: #fff; }
.vendor-action-btn.delete:hover  { background: var(--danger); color: #fff; border-color: var(--danger); }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; text-transform: capitalize; }
.status-pill.active    { background: #e6fff0; color: #1a7a40; }
.status-pill.pending   { background: #fff7e6; color: #b45309; }
.status-pill.suspended { background: #fff0f0; color: var(--danger); }

/* =========================================
   GENERAL RESPONSIVE IMPROVEMENTS
   ========================================= */
/* Portal cards stack nicely on small screens */
@media (max-width: 768px) {
    .portal-card { padding: 15px; }
    .portal-heading { font-size: 1.4rem; }

    /* Tables: horizontal scroll + min column widths */
    .data-table-container { border-radius: 8px; }
    .data-table th, .data-table td { padding: 10px 10px; font-size: 0.85rem; white-space: nowrap; }

    /* Auth / Login page */
    .auth-container { margin: 15px; padding: 20px; border-radius: 10px; }
    .auth-heading { font-size: 1.5rem; }
    .submit-btn { font-size: 1rem; padding: 13px; }

    /* Form inputs */
    .form-input { padding: 10px 12px; font-size: 0.95rem; }
    .form-label { font-size: 0.95rem; }

    /* Sidebar portal layout */
    .seller-portal-layout { flex-direction: column; }
    .seller-main { padding: 12px; }

    /* Stats grid on vendor/admin dashboards */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .stat-card { padding: 14px 12px !important; }

    /* Admin stats grid */
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .admin-stat-card { padding: 14px 12px !important; }

    /* Vendor action button group */
    .vendor-action-group { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Newsletter layout in footer */
    .newsletter { flex-direction: column; gap: 15px; }
    .newsletter-form { width: 100%; }
    .newsletter-input { min-width: 0; }

    /* Trust badges: 1 col on very small screens */
    .trust-badges { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .trust-icon { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .trust-badges { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
    .auth-container { margin: 10px; }
}
