/* ============================================================
   TELESHOP KENYA - Core stylesheet
   Mobile-first. No horizontal scroll. Lightweight (no framework).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body, 'Inter', sans-serif);
  color: var(--color-black, #111);
  background: var(--site-bg, #f4f6f8);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4, h5 { font-family: var(--font-header, 'Poppins', sans-serif); line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Boxed layout: the whole site sits inside a centered, shadowed "card" on a
   distinct background - a genuinely different visual treatment from wide,
   not just a narrower container. */
.layout-boxed { background: var(--site-bg, #eef1f4); }
.layout-boxed .site-shell {
  max-width: 1320px;
  margin: 0 auto;
  background: var(--content-bg, #fff);
  box-shadow: 0 0 40px rgba(0,0,0,.08);
  min-height: 100vh;
}
.layout-boxed .container { max-width: 1180px; }
.layout-wide .site-shell { background: transparent; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: #fff; padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------- Header ---------------- */
.site-header { background: var(--header-bg, #fff); border-bottom: 1px solid rgba(0,0,0,.06); z-index: 100; }
.site-header.is-sticky { position: sticky; top: 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand-logo { max-height: 42px; }
.brand-text { font-family: var(--font-header); font-weight: 800; font-size: 1.35rem; color: var(--color-primary); }

.nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: 0; cursor: pointer; z-index: 110;
}
.nav-toggle span { display: block; height: 2px; background: var(--nav-color, #111); border-radius: 2px; }

.main-nav {
  font-family: var(--font-nav);
  position: fixed; top: 0; right: -100%; height: 100vh; width: min(78vw, 320px);
  background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column; padding: 0 24px 24px;
  transition: right .25s ease; overflow-y: auto; z-index: 210;
}
.main-nav.open { right: 0; }
.nav-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; margin-bottom: 8px; border-bottom: 1px solid #eee;
  position: sticky; top: 0; background: #fff;
}
.nav-drawer-title { font-family: var(--font-header); font-weight: 800; color: var(--color-primary); }
.nav-close {
  background: #f3f4f6; border: 0; width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; color: #333; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nav-close:hover { background: #e5e7eb; }
.nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 205;
}
.nav-backdrop.open { display: block; }
.main-nav a {
  color: var(--nav-color, #111); font-weight: 600; padding: 12px 10px; border-radius: 8px; margin-bottom: 4px;
}
.main-nav a.active, .main-nav a:hover { color: var(--nav-active-color); background: var(--nav-active-bg); }
.nav-cart { display: flex; align-items: center; gap: 6px; }
.cart-count {
  background: var(--color-secondary); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-drawer-header { display: none; }
  .nav-backdrop { display: none !important; }
  .main-nav {
    position: static; height: auto; width: auto; box-shadow: none; flex-direction: row;
    padding: 0; align-items: center; gap: 4px; overflow: visible;
  }
}

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; padding: 56px 0; text-align: center;
}
.hero.dark { background: linear-gradient(135deg, #0b1f16, #06282c); }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin-bottom: .4em; }
.hero p { font-size: 1.05rem; opacity: .95; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-outline { background: transparent; border-color: currentColor; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:hover { opacity: .92; }

/* ---------------- Section wrapper ---------------- */
.section { padding: 48px 0; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.section-head p { color: #666; }

/* ---------------- Category cards ---------------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.provider-card {
  background: var(--content-bg, #fff); border-radius: 14px; padding: 22px 16px; text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); border-top: 4px solid var(--color-primary);
  transition: transform .15s ease;
}
.provider-card:hover { transform: translateY(-4px); }
.provider-card .icon { font-size: 2rem; margin-bottom: 8px; }

/* ---------------- Product grid ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.product-card {
  background: var(--content-bg, #fff); border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); display: flex; flex-direction: column;
}
.product-card img { aspect-ratio: 1/1; object-fit: cover; background: #f0f2f4; }
.product-card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .name { font-weight: 700; font-size: .95rem; }
.product-card .cat { font-size: .78rem; color: #888; }
.product-card .price { font-weight: 800; color: var(--color-primary); font-size: 1.05rem; margin-top: auto; }
.product-list-item {
  display: flex; gap: 16px; background: var(--content-bg,#fff); border-radius: 12px; padding: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); align-items: center;
}
.product-list-item img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.badge-out { background: #eee; color: #999; padding: 2px 8px; border-radius: 6px; font-size: .72rem; }

/* ---------------- Why choose us ---------------- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.feature-card { text-align: center; padding: 20px; }
.feature-card .icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--nav-active-bg); display: flex; align-items: center; justify-content: center; color: var(--color-primary); font-weight: 800; }

/* ---------------- Testimonials ---------------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.testimonial-card { background: var(--content-bg,#fff); border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.stars { color: #f5a623; letter-spacing: 2px; }

/* ---------------- FAQ ---------------- */
.faq-item { border-bottom: 1px solid #e4e7eb; padding: 14px 0; }
.faq-item summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 10px; color: #555; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.form-control {
  width: 100%; padding: 12px 14px; border: 1px solid #d7dbe0; border-radius: 10px; background: #fff;
}
.form-control:focus { outline: 2px solid var(--color-accent); border-color: var(--color-accent); }
.notice {
  padding: 12px 16px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px;
}
.notice-warning { background: #fff7e6; border: 1px solid #e6b800; color: #7a5b00; }
.notice-error { background: #fdeceb; border: 1px solid var(--color-secondary); color: #9d1f2e; }
.notice-success { background: #e9f8ef; border: 1px solid var(--color-primary); color: #0b5a31; }

/* ---------------- Cart / checkout ---------------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 12px 8px; border-bottom: 1px solid #eee; text-align: left; }
.qty-input { width: 60px; padding: 6px; border-radius: 8px; border: 1px solid #d7dbe0; }
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .checkout-grid { grid-template-columns: 1.3fr 1fr; } }
.summary-box { background: var(--content-bg,#fff); border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }

/* ---------------- Footer ---------------- */
.site-footer { padding: 48px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
.footer-col h4 { margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 8px; }
.social-links { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.footer-bottom { text-align: center; padding: 20px 0; margin-top: 32px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }

.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px; width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 90;
}

/* ---------------- Shop navigation: network tabs + merged category tree ---------------- */
/* This is pure navigation (links), not a form - clicking anything here jumps
   straight to that category's products, nothing to "fill in" or "submit". */
.shop-nav { margin-bottom: 22px; }

.network-tabs {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; margin-bottom: 16px;
  border-bottom: 2px solid #eee;
}
@media (min-width: 700px) { .network-tabs { flex-wrap: wrap; overflow-x: visible; } }
.network-tab {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; font-size: .92rem; font-weight: 700; color: #555;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.network-tab:hover { color: var(--color-primary); }
.network-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.pill-count { opacity: .7; font-weight: 600; font-size: .82em; }

/* Category tree: top-level categories with their subcategories shown
   together, all at once - no multi-step reveal, so the exact package a
   customer wants is always visible and one click away. */
.category-tree {
  display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 4px 0 4px;
}
.category-group { min-width: 0; }
.category-group-link {
  display: inline-block; font-size: .92rem; font-weight: 800; color: #222;
  padding: 4px 0; margin-bottom: 4px; border-bottom: 2px solid transparent;
}
.category-group-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.category-children { display: flex; flex-wrap: wrap; gap: 6px; }
.category-child-link {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--content-bg, #fff); color: #555; border: 1px solid #e4e7eb;
}
.category-child-link:hover { border-color: var(--color-primary); color: var(--color-primary); }
.category-child-link.active {
  background: var(--color-primary); border-color: var(--color-primary); color: #fff;
}

/* ---------------- Shop listing page ---------------- */
.breadcrumbs { font-size: .85rem; color: #777; margin: 18px 0 10px; }
.breadcrumbs a { color: #777; }
.breadcrumbs a:hover { color: var(--color-primary); }

.shop-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #eee;
}
.shop-title { font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 0; flex: 1 1 auto; }
.shop-result-count { color: #777; font-size: .85rem; margin: 0; flex: 0 0 auto; }
.sort-form { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sort-label { font-size: .85rem; font-weight: 600; color: #555; white-space: nowrap; }
.sort-form select { min-width: 170px; padding: 8px 10px; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Prevent any horizontal overflow on small screens */
img, table { max-width: 100%; }
table { display: block; overflow-x: auto; white-space: nowrap; }
