/* ───────────────────────────────────────────────────────────────
   SHEBA CREDIT — SHARED MOBILE / RESPONSIVE LAYER
   Loaded on every page AFTER the page's own styles so it can
   correct mobile layout without touching desktop appearance.
   All rules are scoped to <= 900px so desktop is never affected.
   ─────────────────────────────────────────────────────────────── */

/* Injected hamburger + drawer (from mobile-nav.js) — hidden on desktop. */
.sc-mnav-toggle { display: none; }
.sc-mnav-drawer, .sc-mnav-backdrop { display: none; }

/* ── Language switch (EN | አማ) — injected site-wide by lang.js ── */
.lang-switch { display: inline-flex; align-items: center; width: fit-content; border: 1px solid rgba(0,0,0,.12); border-radius: 980px; overflow: hidden; background: rgba(0,0,0,.03); flex-shrink: 0; }
.lang-switch button { font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 7px 8px; min-width: 44px; text-align: center; box-sizing: border-box; border: 0; background: transparent; color: #6E6E73; cursor: pointer; transition: background .2s, color .2s; }
.lang-switch button.lang-on { background: #187CC5; color: #fff; }
body.lang-am * { font-family: 'General Sans','Noto Sans Ethiopic',-apple-system,BlinkMacSystemFont,'Inter','Segoe UI',sans-serif !important; }

@media (max-width: 900px) {

  /* ── Global overflow guard: nothing should push past the viewport ── */
  html, body { max-width: 100%; overflow-x: hidden; }
  /* Constrain raster media to the viewport. SVG/canvas are left alone so
     inline charts, rings and icons keep their intrinsic dimensions. */
  img, video { max-width: 100%; height: auto; }
  table { max-width: 100%; }

  /* ── Hamburger button ──────────────────────────────────────────── */
  .sc-mnav-toggle {
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px; width: 42px; height: 42px; padding: 9px;
    background: transparent; border: 0; cursor: pointer;
    border-radius: 9px; margin-left: 4px; flex: 0 0 auto;
    -webkit-tap-highlight-color: transparent; z-index: 210;
  }
  .sc-mnav-toggle span {
    display: block; width: 22px; height: 2px; border-radius: 2px;
    background: #1D1D1F;
    transition: transform .28s ease, opacity .2s ease;
  }
  .sc-mnav-toggle.sc-dark span { background: rgba(255,255,255,.9); }
  .sc-mnav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .sc-mnav-toggle.open span:nth-child(2) { opacity: 0; }
  .sc-mnav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ── Drawer ────────────────────────────────────────────────────── */
  .sc-mnav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 998;
    background: rgba(0,0,0,.35); opacity: 0; pointer-events: none;
    transition: opacity .3s ease; backdrop-filter: blur(2px);
  }
  .sc-mnav-backdrop.open { opacity: 1; pointer-events: auto; }

  .sc-mnav-drawer {
    display: block; position: fixed; top: 0; right: 0; z-index: 999;
    width: min(82vw, 340px); height: 100%;
    background: #fff; color: #1D1D1F;
    box-shadow: -16px 0 50px rgba(0,0,0,.18);
    transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
    padding: 72px 22px 32px; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Close (×) button inside the drawer */
  .sc-mnav-close {
    position: absolute; top: 16px; right: 18px; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; line-height: 1; font-weight: 300;
    background: transparent; border: 0; cursor: pointer; border-radius: 50%;
    color: rgba(0,0,0,.4); -webkit-tap-highlight-color: transparent;
    transition: background .2s ease, color .2s ease, transform .2s ease;
  }
  .sc-mnav-close:hover { background: rgba(0,0,0,.05); color: #1D1D1F; transform: rotate(90deg); }
  .sc-mnav-drawer.sc-dark .sc-mnav-close { color: rgba(255,255,255,.5); }
  .sc-mnav-drawer.sc-dark .sc-mnav-close:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sc-mnav-drawer.sc-dark { background: #0d1117; color: #f5f5f7; }
  .sc-mnav-drawer.open { transform: translateX(0); }

  .sc-mnav-list { display: flex; flex-direction: column; gap: 0; }

  /* Regular nav items — a clean row with a chevron, divider and hover slide */
  .sc-mnav-list a:not(.sc-mnav-cta) {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    font-size: 17px; font-weight: 500; letter-spacing: -.01em;
    color: inherit; text-decoration: none; padding: 16px 12px;
    border-radius: 12px; border-bottom: 1px solid rgba(0,0,0,.06);
    transition: background .2s ease, color .2s ease, padding-left .2s ease;
  }
  .sc-mnav-drawer.sc-dark .sc-mnav-list a:not(.sc-mnav-cta) { border-bottom-color: rgba(255,255,255,.07); }
  .sc-mnav-list a:not(.sc-mnav-cta)::after {
    content: '\203A'; font-size: 20px; line-height: 1; font-weight: 400;
    color: rgba(0,0,0,.22); transition: transform .2s ease, color .2s ease;
  }
  .sc-mnav-drawer.sc-dark .sc-mnav-list a:not(.sc-mnav-cta)::after { color: rgba(255,255,255,.28); }
  .sc-mnav-list a:not(.sc-mnav-cta):hover { background: rgba(24,124,197,.07); color: #187CC5; padding-left: 18px; }
  .sc-mnav-list a:not(.sc-mnav-cta):hover::after { transform: translateX(4px); color: #187CC5; }

  /* Current page */
  .sc-mnav-list a.active { color: #187CC5; background: rgba(24,124,197,.09); font-weight: 600; }
  .sc-mnav-list a.active::after { color: #187CC5; }

  /* Primary call-to-action button */
  .sc-mnav-list a.sc-mnav-cta {
    margin-top: 18px; display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 16px; font-weight: 600; padding: 16px;
    color: #fff !important; border-radius: 12px;
    background: linear-gradient(135deg, #187CC5, #1268A8);
    box-shadow: 0 6px 18px rgba(24,124,197,.30);
    transition: transform .15s ease, box-shadow .2s ease;
  }
  .sc-mnav-list a.sc-mnav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(24,124,197,.42); }

  /* Staggered entrance each time the drawer opens */
  .sc-mnav-drawer.open .sc-mnav-list a { animation: scMnavIn .4s both; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(1) { animation-delay: .04s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(2) { animation-delay: .09s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(3) { animation-delay: .14s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(4) { animation-delay: .19s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(5) { animation-delay: .24s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(6) { animation-delay: .29s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(7) { animation-delay: .34s; }
  .sc-mnav-drawer.open .sc-mnav-list a:nth-child(8) { animation-delay: .39s; }
  @keyframes scMnavIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

  /* ── Hide the original desktop nav links / CTA on mobile ───────── */
  .nav .nav-center,
  .nav .nav-right { display: none !important; }
  /* Put the logo left and the hamburger hard-right on the inline .nav.
     Pin padding to 20px so the logo lines up identically on every page
     (the homepage nav was 40px, causing a sideways jump between pages). */
  .nav { display: flex !important; align-items: center; justify-content: space-between; padding-left: 20px !important; padding-right: 20px !important; }
  .sc-mnav-toggle { margin-left: auto; }

  /* ── HERO (index): keep headline & copy inside the viewport ─────── */
  .hero-content { padding: 0 22px; }
  .hero-headline { font-size: clamp(26px, 7.5vw, 40px) !important; line-height: 1.06; }
  .sc-mnav-lang { display: inline-flex; margin: 22px 28px 0; }
  .hero-tagline { font-size: 16px !important; max-width: 100%; }
  .hero-ctas { width: 100%; }
  .hero-btn { width: 100%; max-width: 320px; text-align: center; }
  .scroll-hint { display: none; }

  /* ── Generic section headings: never overflow ──────────────────── */
  .prod-sec-head h2, .ig-header h2, .how h2, .closing h2 { overflow-wrap: break-word; }
  .prod-sec-head p, .how-sub, .closing-sub { max-width: 100%; }

  /* ── Product tab row: make it a clean horizontal scroller ──────── */
  .prod-tabs {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 0 20px 4px;
    margin-left: -4px; margin-right: -4px;
  }
  .prod-tabs::-webkit-scrollbar { display: none; }
  .prod-tab { flex: 0 0 auto; }

  /* ── Product showcase cards (index): clamp big numbers ─────────── */
  .pp-card { padding: 26px 22px; }
  .pp-card-num { font-size: 50px !important; word-break: break-word; }

  /* ── Footer tidy ───────────────────────────────────────────────── */
  .ft-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .ft-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .ft-legal { flex-wrap: wrap; justify-content: center; gap: 14px; }
}

@media (max-width: 480px) {
  .ft-top { grid-template-columns: 1fr; }
}
