/* ----- RESET & VARIABLES ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #FFFFFF;
  --bg-section: #F4F7F6;
  --text-primary: #1A1A1A;
  --text-light: #5c5c5c;
  --border: #eaeaea;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.08);
  --font: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.2s ease;

  /* Network colors */
  --safaricom: #009B4D;
  --airtel: #E10000;
  --utility: #FFCC00;
}

body {
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ----- HEADER ----- */
.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.bingwa {
  color: var(--text-primary);
}
.soko {
  color: var(--safaricom);
}
.tagline {
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-left: 1rem;
  white-space: nowrap;
}
.whatsapp-icon svg {
  width: 28px;
  height: 28px;
  transition: var(--transition);
}
.whatsapp-icon:hover svg {
  transform: scale(1.05);
}
.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--safaricom);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--safaricom);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(0, 155, 77, 0.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 155, 77, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 155, 77, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 155, 77, 0); }
}

/* ----- FILTER BARS ----- */
.filter-bar {
  display: flex;
  overflow-x: auto;
  gap: 0.8rem;
  padding: 1rem 2rem;
  background: var(--bg-section);
  margin: 0 2rem 1.5rem 2rem;
  border-radius: 60px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.filter-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 40px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.filter-btn.active {
  background: var(--safaricom);
  color: white;
}
.filter-btn:hover:not(.active) {
  background: rgba(0, 155, 77, 0.1);
}
.secondary-filter {
  margin-top: 0;
  background: #fafafa;
  border-radius: 40px;
  padding: 0.8rem 1.5rem;
}

/* ----- PRODUCT GRID ----- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 2rem;
  margin-bottom: 2rem;
}
.product-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.network-strip {
  height: 4px;
  width: 100%;
  border-radius: 4px 4px 0 0;
  margin-bottom: 1rem;
}
.product-card.safaricom .network-strip { background: var(--safaricom); }
.product-card.airtel .network-strip { background: var(--airtel); }
.product-card.utility .network-strip { background: var(--utility); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.product-title {
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.validity-badge {
  display: inline-block;
  background: var(--bg-section);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
}
.price-container {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.currency { font-weight: 400; color: #666; }
.price-value { color: var(--safaricom); }

.okoa-badge {
  background: #f0f9f0;
  color: var(--safaricom);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.actions {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
}
.btn-buy, .btn-gift {
  flex: 1;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7rem 0;
  border-radius: 40px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: none;
}
.btn-buy {
  background: var(--safaricom);
  color: white;
}
.btn-buy:hover {
  filter: brightness(0.9);
}
.btn-gift {
  background: transparent;
  border: 1px solid var(--safaricom);
  color: var(--safaricom);
}
.btn-gift:hover {
  background: rgba(0, 155, 77, 0.05);
}
.btn-buy:active, .btn-gift:active {
  transform: scale(0.96);
}

/* ----- NETWORK‑SPECIFIC OVERRIDES ----- */
/* Safaricom (already default) */
/* Airtel – replace green with black/white */
.product-card.airtel .price-value {
  color: #000000; /* black price */
}
.product-card.airtel .okoa-badge {
  background: #f0f0f0;
  color: #000000;
}
.product-card.airtel .btn-buy {
  background: var(--airtel); /* red */
}
.product-card.airtel .btn-gift {
  border-color: var(--airtel);
  color: var(--airtel);
}
/* Utility (yellow) – override if needed */
.product-card.utility .btn-buy {
  background: var(--utility);
  color: #1A1A1A;
}
.product-card.utility .btn-gift {
  border-color: var(--utility);
  color: #1A1A1A;
}
.product-card.utility .price-value {
  color: #1A1A1A;
}
.product-card.utility .okoa-badge {
  background: #fff0cc;
  color: #1A1A1A;
}

/* ----- MODAL ----- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg-main);
  border-radius: 32px;
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  position: relative;
  text-align: center;
}
.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: #aaa;
}
.product-summary {
  margin-bottom: 1.5rem;
}
.product-summary h3 {
  font-weight: 800;
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}
#modalBody input {
  width: 100%;
  padding: 0.9rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 40px;
  margin-bottom: 1rem;
}
.save-number {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
  font-size: 0.9rem;
}
.pay-btn {
  background: var(--safaricom);
  color: white;
  border: none;
  width: 100%;
  padding: 0.9rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 40px;
  cursor: pointer;
  transition: var(--transition);
}
.pay-btn:hover {
  filter: brightness(0.95);
}
.spinner-container, .success-container {
  text-align: center;
  padding: 2rem 0;
}
.spinner {
  border: 4px solid var(--bg-section);
  border-top: 4px solid var(--safaricom);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.spinner-text {
  font-weight: 500;
  font-size: 1rem;
}
.checkmark {
  font-size: 4rem;
  color: var(--safaricom);
  margin-bottom: 1rem;
}
.success-container h3 {
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.done-btn {
  background: var(--safaricom);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

/* ----- FOOTER ----- */
.footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 2rem 2rem 1rem;
  margin-top: 3rem;
  border-radius: 30px 30px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-logo {
  font-size: 1.4rem;
  font-weight: 700;
}
.footer-logo span {
  color: var(--safaricom);
}
.footer h4 {
  color: white;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer ul {
  list-style: none;
  padding: 0;
}
.footer li {
  margin-bottom: 0.5rem;
}
.footer a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover {
  color: var(--safaricom);
}
.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
}
.disclaimer {
  font-size: 0.7rem;
  margin-top: 0.5rem;
}



/* ----- RESPONSIVE (mobile 2‑column grid) ----- */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 1rem;
  }
  .tagline {
    margin-left: 0;
    font-size: 0.8rem;
  }
  .filter-bar {
    margin: 0 1rem 1rem 1rem;
    padding: 0.8rem 1rem;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
    padding: 0 1rem;
  }
  .product-card {
    padding: 1rem;
  }
  .product-title {
    font-size: 1.3rem;
  }
  .price-container {
    font-size: 1.2rem;
  }
  .btn-buy, .btn-gift {
    font-size: 0.85rem;
    padding: 0.5rem 0;
  }
  .footer-trust {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
}
@media (max-width: 480px) {
  .filter-bar {
    gap: 0.5rem;
  }
  .filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  .product-grid {
    gap: 0.8rem;
  }
  .product-title {
    font-size: 1.1rem;
  }
  .validity-badge {
    font-size: 0.65rem;
  }
  .price-container {
    font-size: 1rem;
  }
  .btn-buy, .btn-gift {
    font-size: 0.75rem;
    padding: 0.4rem 0;
  }
}

/* Override active color for Airtel filter button (more specific) */
.filter-bar .filter-btn.active[data-network="Airtel"] {
    background: var(--airtel) !important;
    color: white;
}

/* Override hover for non‑active Airtel button (remove green tint) */
.filter-bar .filter-btn[data-network="Airtel"]:hover:not(.active) {
    background: rgba(225, 0, 0, 0.1) !important;
}



.airtel-mode .filter-btn.active {
    background: var(--airtel) !important;
    color: white;
}

/* ----- BOTTOM FILTER BAR (fixed) ----- */
.bottom-filter-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.6rem 1.2rem;
    border-radius: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99;
    border: 1px solid var(--border);
}

.bottom-filter-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.bottom-filter-btn[data-network="Safaricom"] {
    color: var(--safaricom);
    border: 1px solid var(--safaricom);
}
.bottom-filter-btn[data-network="Safaricom"]:hover,
.bottom-filter-btn[data-network="Safaricom"].active {
    background: var(--safaricom);
    color: white;
}

.bottom-filter-btn[data-network="Airtel"] {
    color: var(--airtel);
    border: 1px solid var(--airtel);
}
.bottom-filter-btn[data-network="Airtel"]:hover,
.bottom-filter-btn[data-network="Airtel"].active {
    background: var(--airtel);
    color: white;
}



/* Mobile adjustments */
@media (max-width: 480px) {
    .bottom-filter-bar {
        padding: 0.4rem 1rem;
        gap: 0.6rem;
    }
    .bottom-filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    .floating-wa {
        bottom: 90px;
    }
}

.floating-wa {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px; /* Icon size */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.floating-wa:hover {
    transform: scale(1.1); /* Subtle lift on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: white; /* Keeps icon white */
}

/* Ensure Font Awesome is loaded in your <head> if it isn't already */
/* ----- HERO SECTION – Clean & Airy ----- */

