/* ====================================================
   Chinandogo Electronics Store — Shared Stylesheet
   Applies to all pages. Page-specific CSS goes in $extraCSS.
   ==================================================== */

/* BASE RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", Arial, sans-serif; background: #ffffff; color: #111827; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(92%, 1240px); margin: 0 auto; }

/* TOP BAR */
.top-bar { background: #f7f8fa; border-bottom: 1px solid #eceff3; font-size: 13px; color: #202733; }
.top-bar-inner { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.top-info { display: flex; align-items: center; width: 100%; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.top-info span,
.top-currency { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; }
.top-info i { color: #4b5563; }
.top-currency { font-weight: 800; }
.top-currency i { font-size: 10px; }

/* HEADER */
.main-header { background: #ffffff; border-bottom: 1px solid #eef1f5; }
.main-header-inner {
  min-height: 82px;
  display: grid;
  grid-template-columns: 230px minmax(330px, 1fr) minmax(340px, 430px) auto;
  align-items: center;
  gap: 22px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: #eef7ff; border: 3px solid #1479c9; color: #1479c9;
  display: grid; place-items: center; font-size: 20px; position: relative;
}
.logo-icon::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(20,121,201,.25); border-radius: 50%;
}
.logo-text { font-size: 29px; font-weight: 900; letter-spacing: -.7px; color: #0f172a; line-height: 1; }
.logo-text span { color: #1479c9; }

.nav { display: flex; align-items: center; justify-content: center; gap: 42px; font-size: 13px; font-weight: 900; letter-spacing: .4px; }
.nav a { color: #111827; display: inline-flex; align-items: center; gap: 5px; }
.nav a:hover, .nav a.active { color: #1479c9; }

.search-box { height: 46px; background: #f6f7f9; border-radius: 7px; display: flex; align-items: center; overflow: hidden; border: 1px solid #eef1f5; width: 100%; min-width: 0; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; height: 100%; padding: 0 17px; font-size: 14px; color: #111827; }
.search-box button { width: 50px; height: 100%; border: none; background: transparent; color: #111827; font-size: 20px; cursor: pointer; }

/* CART BUTTON (wide style) */
.cart-button {
  width: auto; min-width: 106px; padding: 0 11px; justify-self: end;
  background: #060606; color: #ffffff; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; font-size: 22px; position: relative; height: 52px;
}
.cart-icon-wrap { position: relative; display: inline-grid; place-items: center; line-height: 1; }
.cart-button sup {
  position: absolute; top: -7px; right: -7px;
  min-width: 21px; height: 21px; border-radius: 999px;
  background: #1479c9; border: 2px solid #ffffff; color: #ffffff;
  display: grid; place-items: center; font-size: 10px; font-weight: 900;
}
.cart-total-header { font-size: 12px; font-weight: 900; white-space: nowrap; line-height: 1; }

.menu-toggle {
  display: none; width: 42px; height: 42px;
  background: #ffffff; color: #111827; border: 1px solid #dfe6ee;
  border-radius: 8px; font-size: 20px; cursor: pointer;
}

/* CATEGORY STRIP */
.category-strip { background: #086bd4; color: #ffffff; }
.category-grid { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 58px; align-items: stretch; }
.category-item {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; font-weight: 900; text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,.12); padding: 10px 8px;
  transition: .2s ease; white-space: nowrap;
}
.category-item:last-child { border-right: 1px solid rgba(255,255,255,.12); }
.category-item i { font-size: 19px; opacity: .95; }
.category-item:hover { background: #055db8; }

/* FOOTER NEWSLETTER */
.footer-newsletter { background: #086bd4; color: #ffffff; padding: 22px 0; margin-top: 0; }
.footer-newsletter-inner { display: grid; grid-template-columns: 1.3fr 1fr .7fr; align-items: center; gap: 24px; }
.newsletter-left { display: flex; align-items: center; gap: 15px; font-size: 18px; font-weight: 800; }
.newsletter-left i { font-size: 24px; }
.footer-newsletter-form {
  height: 38px; background: #ffffff; display: flex; align-items: center;
  border-radius: 999px; overflow: hidden; padding: 3px;
}
.footer-newsletter-form input { flex: 1; height: 100%; border: none; outline: none; padding: 0 16px; font-size: 13px; }
.footer-newsletter-form button {
  height: 100%; border: none; border-radius: 999px;
  background: #111111; color: #ffffff; padding: 0 24px; font-size: 12px; font-weight: 900; cursor: pointer;
}
.footer-social { display: flex; justify-content: flex-end; align-items: center; gap: 13px; }
.footer-social strong { margin-right: 6px; font-size: 13px; }
.footer-social a {
  width: 30px; height: 30px; background: #ffffff; color: #086bd4;
  border-radius: 50%; display: grid; place-items: center; font-size: 13px; transition: .2s ease;
}
.footer-social a:hover { background: #111111; color: #ffffff; }

/* FOOTER */
.site-footer { background: #111d29; color: #ffffff; }
.footer-main {
  padding: 38px 0 40px;
  background: radial-gradient(circle at 15% 10%, rgba(20,121,201,.08), transparent 28%),
              linear-gradient(180deg, #101b27, #0d1721);
}
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 44px; align-items: start; }
.footer-logo { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.footer-logo .logo-icon { width: 35px; height: 35px; font-size: 16px; border-width: 2px; background: rgba(20,121,201,.08); }
.footer-logo .logo-text { color: #ffffff; font-size: 22px; }
.footer-brand p { color: #cbd5e1; font-size: 14px; line-height: 1.65; max-width: 250px; margin-bottom: 18px; }

/* FOOTER INFO LIST */
.footer-info-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.footer-info-list li { display: flex; gap: 6px; align-items: flex-start; color: #b8c6d8; }
.footer-info-list li strong { color: #ffffff; font-weight: 700; white-space: nowrap; }

.footer-col h4 { color: #ffffff; font-size: 14px; font-weight: 900; text-transform: uppercase; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { color: #cbd5e1; font-size: 13px; font-weight: 500; transition: .2s ease; }
.footer-col a:hover { color: #ffffff; padding-left: 4px; }

.accept-icons { display: flex; flex-wrap: wrap; gap: 10px; max-width: 180px; }
.accept-icons span { min-width: 64px; height: 34px; border-radius: 4px; background: #ffffff; color: #111827; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.accept-icons .mpesa { color: #18a34a; }
.accept-icons .visa { color: #1434cb; }
.accept-icons .master { color: #e11d48; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); background: #0d1721; padding: 18px 0; }
.footer-bottom-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; color: #cbd5e1; font-size: 13px; }
.powered-by { text-align: center; }
.powered-by a { color: #ffffff; font-weight: 800; }
.powered-by a:hover { color: #1479c9; }
.footer-bottom-links { display: flex; justify-content: flex-end; gap: 20px; }
.footer-bottom-links a:hover { color: #ffffff; }

/* FOOTER PAYMENT METHODS */
.footer-payment-methods { display: flex; align-items: center; gap: 10px; }
.footer-payment-methods strong { color: #7a8fa6; font-size: 11px; text-transform: uppercase; }
.footer-payment-methods span { padding: 3px 9px; border: 1px solid #2a3f55; border-radius: 4px; font-size: 11px; font-weight: 700; color: #d1e4f7; background: rgba(20,121,201,.12); }

/* RESPONSIVE — 1180px */
@media (max-width: 1180px) {
  .main-header-inner { grid-template-columns: 210px minmax(250px, 1fr) minmax(280px, 360px) auto; gap: 18px; }
  .nav { gap: 26px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* RESPONSIVE — 980px */
@media (max-width: 980px) {
  .footer-newsletter-inner { grid-template-columns: 1fr; text-align: center; }
  .newsletter-left, .footer-social { justify-content: center; }
}

/* RESPONSIVE — 920px */
@media (max-width: 920px) {
  .container { width: 94%; }
  .top-bar-inner { justify-content: center; text-align: center; }
  .top-info span:nth-child(1),
  .top-info span:nth-child(3),
  .top-currency { display: none; }

  .main-header { background: #086bd4; }
  .main-header-inner {
    min-height: auto; padding: 12px 0;
    display: grid; grid-template-columns: 44px 1fr auto; gap: 12px;
  }

  .menu-toggle { display: grid; place-items: center; grid-column: 1; grid-row: 1; }
  .logo { grid-column: 2; grid-row: 1; justify-content: center; }
  .logo-icon { background: #ffffff; width: 38px; height: 38px; font-size: 17px; border-color: #ffffff; }
  .logo-text { color: #ffffff; font-size: 24px; }
  .logo-text span { color: #d8ecff; }

  /* Cart button mobile */
  .cart-button { grid-column: 3; grid-row: 1; width: auto; min-width: 86px; height: 44px; padding: 0; background: transparent; border-radius: 0; color: #fff; gap: 6px; }
  .cart-button .cart-icon-wrap { font-size: 22px; color: #fff; }
  .cart-button sup { top: -10px; right: -12px; min-width: 19px; height: 19px; background: #fff; color: #086bd4; border: 2px solid #086bd4; font-size: 10px; }
  .cart-total-header { display: inline-block; color: #fff; font-size: 11px; font-weight: 900; }

  .search-box { grid-column: 1 / -1; grid-row: 2; height: 43px; background: #ffffff; }

  .nav {
    display: none; grid-column: 1 / -1; grid-row: 3;
    background: #ffffff; border-radius: 9px;
    flex-direction: column; align-items: stretch; gap: 0; overflow: hidden;
  }
  .nav.active { display: flex; }
  .nav a { padding: 13px 16px; border-bottom: 1px solid #eef1f5; }

  .category-strip { display: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-bottom-inner { display: flex; flex-direction: column; align-items: flex-start; }
  .powered-by { text-align: left; order: 3; }
  .footer-bottom-links { justify-content: flex-start; }
}

/* RESPONSIVE — 640px */
@media (max-width: 640px) {
  .main-header-inner { grid-template-columns: 44px 1fr auto; }
}

/* RESPONSIVE — 560px */
@media (max-width: 560px) {
  .footer-newsletter-form { height: 42px; }
  .footer-newsletter-form button { padding: 0 14px; font-size: 11px; }
  .footer-grid { grid-template-columns: 1fr; }
}
