/* =========================================================================
   1. GLOBAL PREMIUM STYLE, VARIABLES & BACKGROUND
   ========================================================================= */
:root {
  --primary-dark: #0f172a;    
  --accent-green: #0f172a;    
  --bg-light: #f8fafc;        
  --text-main: #334155;      
  --text-muted: #64748b;      
}

*, *::before, *::after { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background-color: #f1f5f9 !important; /* Kijivu laini cha kishua */
  color: #0f172a;
  overflow-x: hidden;
}

input, textarea, select { 
  font-size: 16px; 
}

/* =========================================================================
   2. PREMIUM HEADER & SEARCH BAR (WITH HOVER EFFECTS)
   ========================================================================= */
header {
  background-color: #111827;
  padding: 12px 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo h1 { 
  font-size: 22px; 
  font-weight: 800; 
  color: white; 
  margin: 0; 
  letter-spacing: -0.5px;
}
.logo span { 
  color: #38bdf8; 
} 

.header-buttons { 
  display: flex; 
  gap: 6px; 
  align-items: center;
}

.btn-header {
  background: #1e293b; 
  color: white; 
  border: 1px solid #334155;
  padding: 8px 14px; 
  border-radius: 20px; 
  font-weight: 700;
  cursor: pointer; 
  font-size: 12px; 
  text-transform: uppercase;
  transition: all 0.2s ease;
}
/* HOVER YA VITUFE VYA HEADER */
.btn-header:hover { 
  background: #2d3d5a !important; 
  border-color: #475569 !important;
  transform: translateY(-1px);
}

#postTriggerBtn { 
  background: var(--primary-dark); 
  border: 1px solid rgba(255, 255, 255, 0.2); 
}

.search-container { 
  display: flex; 
  justify-content: flex-end; 
}

#search, #search-input {
  padding: 7px 12px; 
  border-radius: 20px; 
  border: 1px solid #374151;
  background: #1e293b; 
  color: white; 
  outline: none; 
  font-size: 13px;
  width: 140px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* HOVER YA SEARCH BAR MTEJA AKITAKA KUGUSA */
#search:hover, #search-input:hover {
  border-color: #4b5563 !important;
  background: #233144 !important;
}
#search:focus, #search-input:focus {
  width: 190px;
  border-color: #38bdf8 !important;
  background: #273549;
  outline: none;
}

/* Responsive Header */
@media (max-width: 768px) {
  header { 
    justify-content: center; 
    text-align: center; 
    padding: 15px; 
  }
  .header-buttons { 
    justify-content: center; 
    width: 100%; 
  }
  .search-container { 
    width: 100%; 
    justify-content: center; 
    margin-top: 5px; 
  }
  #search, #search-input { 
    width: 92%; 
  }
  #search:focus, #search-input:focus { 
    width: 95%; 
  }
}

/* =========================================================================
   3. CLEAN BANNER AD
   ========================================================================= */
.banner-ad {
  width: 96%; 
  max-width: 800px;
  height: 140px;
  object-fit: cover;
  margin: 4px auto 0 auto !important;
  background: linear-gradient(135deg, #1f2937, #111827) !important;
  color: white; 
  padding: 12px !important;
  border-radius: 12px !important; 
  text-align: center; 
  border: none !important;
  margin-bottom: 4px;
}
.banner-ad h2 { 
  font-size: 16px; 
  font-weight: 800; 
}
.banner-badge {
  background: #1e293b; 
  color: white; 
  display: inline-block;
  padding: 4px 12px; 
  border-radius: 12px; 
  font-size: 12px; 
  margin-top: 4px;
}

/* =========================================================================
   4. CATEGORIES SECTION (ZERO GAPS)
   ========================================================================= */
#categories {
  display: flex; 
  gap: 6px; 
  padding: 6px 4% !important;
  background: #ffffff; 
  border-bottom: 1px solid #e2e8f0; 
  overflow-x: auto; 
  white-space: nowrap;
  margin: 4px 0 0 0 !important;
  scrollbar-width: none;
}
#categories::-webkit-scrollbar { 
  display: none; 
}

#categories button, .btn-cat {
  background: #f1f5f9; 
  color: #64748b; 
  border: 1.5px solid transparent;
  padding: 6px 14px; 
  border-radius: 20px; 
  cursor: pointer;
  font-weight: 700; 
  font-size: 12px;
  transition: all 0.2s;
}
#categories button:hover, .btn-cat:hover {
  background: #64748b; 
  color: white;
}
#categories button.active-cat, .btn-cat.active { 
  background: #64748b; 
  color: white; 
}

/* =========================================================================
   5. VIP / BOOSTED CONTAINER SYSTEM & DESIGN (GHOROFA MBILI & NO-GAP)
   ========================================================================= */
#vip-products {
  border-radius: 8px;
  width: 96%;
  margin: 4px auto 0 auto !important;
  padding: 8px 0 !important; /* Bila background ya kijivu - kadi zinaonekana peke yake */
  
  /* LASH NAZIMISHA MFUMO WA GHOROFA MBILI KWENDA KULIA */
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content; /* Inazuia kadi kusukumana au kuacha magap makubwa */
  
  /* RUHUSU SCROLL YA KWENDA KULIA KWENYE SIMU */
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px; /* Mapengo yamepunguzwa baina ya kadi za VIP */
  
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* Laini kabisa kwenye iPhones */
}
/* Display (grid/flex/none) inadhibitiwa na JS pekee - siyo CSS !important -
   ili container ifiche KWELI pale hakuna bidhaa za VIP (siyo kubaki kama
   sanduku tupu la kijivu). */

/* Inaficha kile kijiti cha scrollbar cha chini kwenye simu ili liwe nadhifu */
#vip-products::-webkit-scrollbar {
  display: none !important;
}

/* Kadi zinazoingia ndani ya VIP pekee ili zisivurugike upana wake */
#vip-products .product, 
#vip-products .product-card, 
#vip-products .pro-card {
  flex: none !important; 
  width: 160px !important; /* Upana mzuri wa kadi za VIP kioo cha simu kikae sawa */
  max-width: 160px !important;
  scroll-snap-align: start;
}


/* =========================================================================
   6. PRODUCTS GRID & CARD DESIGN SYSTEM (KADI ZA KAWAIDA NA VIP)
   ========================================================================= */
#products, .products-grid-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 2fr)) !important;
  gap: 4px !important; /* Mapengo yamepunguzwa kadi za kawaida chini */
  padding: 4px 1% !important;
}

/* KADI YA BIDHAA: RANGI NA AINA HAZIJABADILIKA HATA KIDOGO (ZINAFUATA ZA KWAKO) */
.product, .product-card, .pro-card {
  background: #ffffff !important;
  border-radius: 16px !important; /* Imelindwa kama picha ya mtumiaji */
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* Maandalizi ya Hover */
}

/* ANTI-SHAKING & IMAGE STYLE FOR ALL CARDS */
.pro-card img, .product img, .product-card img {
  width: 100% !important;
  height: 150px !important; /* Urefu ulionyooka kuzuia kadi kurefuka vibaya wima */
  object-fit: contain !important; /* Picha nzima INAONEKANA - haikatwi tena pembeni */
  background: #f8fafc !important; /* Nafasi tupu (letterbox) inajazwa rangi laini badala ya kukata picha */
  display: block !important;
}
/* HOVER YA KADI YA BIDHAA MTU AKITAKA KUGUSA */
.product:hover, .product-card:hover, .pro-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 12px -2px rgba(0,0,0,0.06) !important;
}

/* PICHA ZOTE MBILI */
.product img, .product-card img, .pro-card img {
  width: 100% !important;
  object-fit: contain !important;
  background: #f8fafc !important;
  display: block !important;
  padding: 0 !important; 
  margin: 0 !important;
}

.product-info, .pro-card-body {
  padding: 10px !important; /* Pengo safi la ndani ya maelezo */
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.product h3, .product-card h3, .pro-card-title {
  font-size: 12.5px !important; 
  font-weight: 700 !important;
  color: #0f172a !important; 
  margin: 0 0 4px 0 !important;
  min-height: 2.7em; /* nafasi ya mistari 2 - kadi zote zinabaki sawa kimo hata jina likiwa fupi */
  align-items: flex-start !important;
}

/* Jina la bidhaa (bila beji) - hili peke yake ndilo linalowekewa "clamp" ya
   mistari 2, ili lisikatike ghafla katikati ya neno kama awali (nowrap+ellipsis
   ya mstari mmoja); sasa linaruhusiwa kujaza mistari 2 kabla ya kukatwa. */
.safe-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.32;
  flex: 1 1 auto;
  min-width: 0;
}

.product .price, .product-card .price, .pro-card-price {
  font-size: 13px !important; 
  color: #0f172a !important;
  font-weight: 800 !important; 
  margin: 1px 0 !important;
}

/* SAFU YA MUHTASARI: ENEO (LOCATION) NA MUDA WA KUPOSTIWA (RELATIVE TIME) */
.pro-card-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-top: 4px !important;
  padding-top: 4px !important;
  border-top: 1px dashed #f1f5f9 !important;
}
.pro-card-location {
  font-size: 10.5px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 62% !important;
}
.pro-card-time {
  font-size: 10px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* STAILI YA BEJI MPYA YA TRUSTED TULIYOHAMISHA KUTOKA HTML */
.safe-badge-trusted {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  font-size: 9px !important;
  font-weight: bold !important;
  margin-left: 5px !important;
  margin-bottom: 2px !important; /* Inazuia bei na beji kukutana vibaya */
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  letter-spacing: 0.5px !important;
}
.safe-badge-trusted i {
  font-size: 10px !important;
}

/* =========================================================================
   7. MAPACHA VITUFE SYSTEM (BUTTONS)
   ========================================================================= */
.product-actions, .product-card div[style*="display: flex"] {
  display: flex !important;
  flex-direction: row !important;
  gap: 3px !important;
  padding: 0 8px 8px 8px !important;
  width: 100% !important;
  margin-top: auto !important;
}

.btn-icon-wa, .btn-icon-share {
  flex: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 30px !important;
  border-radius: 4px !important;
  border: none !important; 
  color: white !important;
  cursor: pointer !important; 
  font-size: 0 !important;
  background: #1e293b !important;
  transition: background 0.2s ease;
}
.btn-icon-wa:hover, .btn-icon-share:hover {
  background: #2a3a54 !important;
}

/* =========================================================================
   8. MODALS, TOAST & POST FORM
   ========================================================================= */
.modal, #productModal {
  display: none; 
  position: fixed !important; 
  z-index: 9999999 !important;
  left: 0 !important; 
  top: 0 !important; 
  width: 100% !important; 
  height: 100% !important;
  background-color: rgba(15, 23, 42, 0.7) !important; 
  backdrop-filter: blur(4px);
}
.modal-content {
  background-color: white; 
  margin: 12% auto; 
  padding: 30px;
  width: 90%; 
  max-width: 420px; 
  border-radius: 24px; 
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.close-modal { 
  position: absolute; 
  right: 20px; 
  top: 15px; 
  font-size: 28px; 
  cursor: pointer; 
  color: #94a3b8; 
}
.product-modal-img { 
  width: 100%; 
  border-radius: 16px; 
  margin-bottom: 15px; 
}
.product-modal-price { 
  font-size: 20px; 
  font-weight: 800; 
  color: var(--primary-dark); 
  margin: 10px 0; 
}

#postSection {
  max-width: 450px; 
  margin: 10px auto; 
  padding: 15px;
  background: white; 
  border-radius: 8px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
#postSection input, #postSection select, #postSection textarea {
  width: 100%; 
  padding: 10px; 
  margin-bottom: 8px; 
  border: 1px solid #cbd5e1; 
  border-radius: 6px;
}
#submit-prod-btn {
  width: 100%; 
  background: #1e293b; 
  color: white; 
  padding: 12px; 
  border: none; 
  border-radius: 6px; 
  font-weight: 700;
}

#toast {
  display: none; 
  position: fixed; 
  bottom: 30px; 
  left: 50%; 
  transform: translateX(-50%); 
  background: #0f172a; 
  color: white; 
  padding: 10px 20px; 
  border-radius: 30px; 
  z-index: 20000; 
  font-size: 14px;
}

footer { 
  background: #0f172a; 
  color: #cbd5e1; 
  text-align: center; 
  padding: 30px 15px; 
  margin-top: 30px; 
}
footer a { 
  color: #cbd5e1; 
}
.footer-wa-btn { 
  background: #1e293b; 
  color: white; 
  padding: 10px 20px; 
  border-radius: 20px; 
  text-decoration: none; 
  font-weight: 700; 
}

/* =========================================================================
   9. REKEBISHO LA UHAKIKA: VIP 2x2 NA SLIDE YA PEMBENI (MAX-WIDTH: 600px)
   ========================================================================= */
@media (max-width: 600px) {
  /* BIDHAA ZA KAWAIDA ZA CHINI: ZINABAKI VILEVILE, MAPENGO MADOGO */
  #products { 
    grid-template-columns: repeat(2, 2fr) !important; 
    gap: 4px !important; 
    padding: 6px 1% !important;
  }

  /* =========================================================================
   👑 MPANGILIO MPYA WA VIP KWENYE SIMU (FINYA MAGAP YA PEMBENI)
   ========================================================================= */
#vip-products {
    grid-template-rows: repeat(2, auto) !important; /* Mstari wa juu na chini pekee */
    grid-auto-flow: column !important;              /* Bidhaa zijipange kwenda kulia */
    
    /* 💥 DAWA YA MAGAP: Inalazimisha kila safu ya wima (column) iwe na upana wa kadi tu */
    grid-auto-columns: max-content !important; 
    
    overflow-x: auto !important;   
    overflow-y: hidden !important;
    gap: 4px !important; /* Nafasi ndogo na nadhifu kati ya kadi na kadi */
    padding: 6px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Kadi za VIP - Tunafuta flex na kuweka upana imara wa pixel */
#vip-products .product, 
#vip-products .product-card, 
#vip-products .pro-card {
    flex: none !important;      /* Inaua ule mfumo wa zamani uliokuwa unavuta ma-gap */
    width: 160px !important;    /* Upana thabiti ili kadi 2 zionekane vizuri kwenye kioo */
    max-width: 160px !important;
    scroll-snap-align: start;
}

/* INFICHA KILE KIJITI CHA SCROLLBAR ILI BANGO LIWE NADHFU KAMA APP YA INSTAGRAM */
#vip-products::-webkit-scrollbar {
    display: none !important;
}
}

/* =========================================================================
   9A. RESPONSIVE - DESKTOP/PC KUBWA (Zuia kunyoosha vibaya kwenye screen kubwa)
   ========================================================================= */
@media (min-width: 1100px) {
  header > div, #categories, #top-deals-wrap, #new-listings-wrap,
  #category-cards-wrap, #sort-bar, #vip-products, #new-listings, #products,
  #premium-store-banner, footer > div {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  }
}

/* =========================================================================
   9B. CATEGORY CARDS GRID (Muundo wa "Kama Amazon" - Kategoria 15, 3 kwa mstari)
   ========================================================================= */
.category-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
}
.mega-cat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mega-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px -4px rgba(15,23,42,0.14);
}
.mega-cat-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}
.mega-cat-card .mega-cat-body {
  padding: 10px 10px 12px 10px;
  text-align: left;
}
.mega-cat-card .mega-cat-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.mega-cat-card .mega-cat-count {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  margin-top: 3px;
}

@media (min-width: 480px) {
  .category-cards-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .mega-cat-card img { height: 110px; }
}

@media (min-width: 900px) {
  .category-cards-grid { grid-template-columns: repeat(5, 1fr) !important; max-width: 1100px; margin: 0 auto; }
  .mega-cat-card img { height: 130px; }
}

/* =========================================================================
   9C. TOP DEALS / NEW LISTINGS - kadi chache zisionekane "kutupu" (zinaenea)
   ========================================================================= */
#vip-products.few-items, #new-listings.few-items {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}
#vip-products.few-items .pro-card, #new-listings.few-items .pro-card {
  flex: 1 1 150px !important;
  max-width: 220px !important;
}
#new-listings {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  padding: 6px 4% 10px 4%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
#new-listings::-webkit-scrollbar { display: none; }
#new-listings .pro-card {
  width: 150px;
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  #new-listings { grid-template-rows: repeat(3, auto); }
  #new-listings .pro-card { width: 180px; }
}

/* USED ITEMS BANNER (picha + kichwa juu ya picha - mahali pako pa kuweka picha) */
.used-banner {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.used-banner img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}
.used-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,23,42,0.65), rgba(15,23,42,0.15));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.used-banner-overlay h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.used-banner-overlay button {
  background: #64748b;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
@media (min-width: 700px) {
  .used-banner img { height: 160px; }
  .used-banner-overlay h2 { font-size: 20px; }
}

/* CAMPUS ITEMS ROW - muundo sawa na New Listings/Used Items */
#campus-items {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  padding: 6px 4% 10px 4%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
#campus-items::-webkit-scrollbar { display: none; }
#campus-items .pro-card {
  width: 150px;
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  #campus-items { grid-template-rows: repeat(3, auto); }
  #campus-items .pro-card { width: 180px; }
}
#campus-items:has(.campus-empty-state) {
  display: block !important;
  padding: 6px 4% 14px 4%;
}
.campus-empty-state {
  width: 100%;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
}
.campus-empty-state span.campus-empty-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 8px;
}
.campus-empty-state p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}
.campus-empty-state button {
  background: #64748b;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* USED ITEMS ROW - muundo sawa na New Listings */
#used-items {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  padding: 6px 4% 10px 4%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
#used-items::-webkit-scrollbar { display: none; }
#used-items .pro-card {
  width: 150px;
  scroll-snap-align: start;
}
@media (min-width: 700px) {
  #used-items { grid-template-rows: repeat(3, auto); }
  #used-items .pro-card { width: 180px; }
}

/* USED ITEMS - HALI YA "BADO HAKUNA" (empty state ya kirafiki) */
#used-items:has(.used-empty-state) {
  display: block !important;
  padding: 6px 4% 14px 4%;
}
.used-empty-state {
  width: 100%;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
}
.used-empty-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 8px;
}
.used-empty-state p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}
.used-empty-state button {
  background: #64748b;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* NEW / USED TOGGLE BUTTONS (ndani ya Mega-Category drill-down) */
.cond-toggle-btn {
  flex: 1;
  max-width: 160px;
  padding: 9px 14px;
  border-radius: 20px;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cond-toggle-btn.active {
  background: #64748b;
  color: white;
  border-color: #64748b;
}

/* =========================================================================
   10. KIPRO POLISH LAYER (CEO OPERATING SYSTEM UPGRADE)
   Rangi kuu (navy #0f172a, bluu #2563eb) HAZIJABADILIKA - hii ni muonekano
   wa ziada tu: shadows za kina zaidi, gradient nyororo, na micro-interactions
   kwa ajili ya Analytics/CEO Dashboard mpya.
   ========================================================================= */

/* Mstari mwembamba wa gradient juu ya header - muonekano wa "premium OS" */
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #2563eb);
  opacity: 0.6;
}
header { position: sticky; }

/* Kadi za bidhaa: kina kidogo zaidi cha kivuli wakati wa kupumzika, siyo tu hover */
.product, .product-card, .pro-card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 6px -1px rgba(15, 23, 42, 0.03) !important;
}

/* Beji za Elite/Pro zinazoonekana kwenye majina ya bidhaa - mwanga mdogo wa kifahari */
.safe-badge-area span {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

/* Vitufe vya kategoria: nafasi ya herufi kidogo kwa muonekano safi zaidi wa "app" */
#categories button, .btn-cat {
  letter-spacing: 0.3px;
}

/* Sidebar: mzunguko laini zaidi wa kivuli kwa menu ya CEO OS */
#admin-menu-zone a:hover {
  background: #f8fafc;
}

/* Dashboard cards (Analytics / CEO / Admin panels) zinazotengenezwa na JS
   zinapata mguso mdogo wa mwanga wa juu (glass sheen) bila kubadili rangi */
#ceo-dashboard-overlay > div,
#analytics-overlay > div,
#admin-products-overlay > div,
#admin-settings-overlay > div {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
}

/* Namba kubwa za takwimu (stat numbers) kwenye Dashboard/Analytics zipate
   mwonekano mzuri zaidi wa "kipro" bila kubadili rangi walizonazo tayari */
#ceo-dashboard-overlay [style*="font-weight:800"],
#analytics-overlay [style*="font-weight:800"] {
  letter-spacing: -0.5px;
}

/* Smooth fade-in kwa modal/overlay zote zinazoundwa kidhahania (JS-created) */
@keyframes sokohubFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#ceo-dashboard-overlay > div,
#analytics-overlay > div,
#admin-products-overlay > div,
#admin-settings-overlay > div,
#admin-lock-overlay > div,
#detail-overlay > div {
  animation: sokohubFadeIn 0.18s ease-out;
}

/* Kadi za bidhaa ndani ya "Duka Langu" (Elite Dashboard) - hover kama storefront */
.eliteproductcard {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.eliteproductcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px -2px rgba(15, 23, 42, 0.08) !important;
}

/* Scrollbar nyembamba na nadhifu ndani ya paneli za Admin (Chrome/Edge) */
#ceo-dashboard-overlay div::-webkit-scrollbar,
#analytics-overlay div::-webkit-scrollbar,
#admin-products-overlay div::-webkit-scrollbar {
  width: 6px;
}
#ceo-dashboard-overlay div::-webkit-scrollbar-thumb,
#analytics-overlay div::-webkit-scrollbar-thumb,
#admin-products-overlay div::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}