/* ==========================================================================
   ESwap responsive layer
   The page designs are built at 1440px. These rules adapt them to laptops,
   tablets and phones. Breakpoints:
     ≤ 1100px  laptop / tablet landscape: menu collapses to ☰
     ≤ 900px   tablet portrait: two-column sections stack, type scales down
     ≤ 640px   phone: single column everywhere, tighter spacing
   Inline styles in the pages are overridden with !important on purpose.
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img { max-width: 100%; }
*, *::before, *::after { box-sizing: border-box; }
#eswap-root { overflow-x: clip; }

/* ---------- Header + ☰ menu ---------- */
.site-header { position: sticky; top: 0; z-index: 80; }
.site-header-inner { position: relative; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid #DADADA; border-radius: 12px;
  background: #fff; color: #0B0B0B; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.nav-toggle:focus-visible, .site-nav a:focus-visible { outline: 3px solid #067A5B; outline-offset: 2px; }
.nav-toggle .i-close { display: none; }
body.nav-open .nav-toggle .i-open { display: none; }
body.nav-open .nav-toggle .i-close { display: block; }

@media (max-width: 1100px) {
  .site-header-inner { flex-wrap: nowrap !important; gap: 10px !important; padding: 12px 20px !important; }
  .site-header-inner > a:first-child { margin-right: auto; }
  .nav-toggle { display: inline-flex; order: 3; flex: none; }
  .site-cta { order: 2; flex: none; }
  .site-nav {
    display: none !important; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column !important; flex-wrap: nowrap !important; gap: 0 !important;
    background: #fff; padding: 6px 20px 16px; border-bottom: 1px solid #E6E6E6;
    box-shadow: 0 16px 30px rgba(0, 0, 0, .12); font-size: 16px !important;
  }
  body.nav-open .site-nav { display: flex !important; }
  .site-nav a { padding: 14px 0 !important; border-bottom: 1px solid #F0F0F0 !important; min-height: 48px; }
  .site-nav a[aria-current="page"] { border-bottom: 2px solid #0BB286 !important; }
  .site-nav a:last-child { border-bottom: 0 !important; }
}
@media (max-width: 420px) {
  .site-header-inner > a:first-child img { height: 30px !important; }
  .site-cta, .site-cta > button { font-size: 13px !important; padding: 10px 14px !important; }
}

/* ---------- Type ---------- */
@media (max-width: 900px) {
  h1 { font-size: clamp(34px, 7.2vw, 56px) !important; line-height: 1.08 !important; letter-spacing: -0.5px !important; }
  h2 { font-size: clamp(28px, 5.6vw, 40px) !important; line-height: 1.12 !important; }
  h3 { line-height: 1.25 !important; }
}
@media (max-width: 640px) {
  h1 { font-size: clamp(32px, 9vw, 42px) !important; }
  h2 { font-size: clamp(26px, 7.4vw, 32px) !important; }
  p { font-size: max(15px, min(1em, 17px)); }
}

/* ---------- Section spacing ---------- */
@media (max-width: 900px) {
  section[style*="padding:88px 24px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="padding:0 24px 88px"] { padding-bottom: 64px !important; }
  section[style*="padding:64px 24px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
}
@media (max-width: 640px) {
  section[style*="24px"] { padding-left: 16px !important; padding-right: 16px !important; }
  section[style*="padding:88px 24px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  section[style*="padding:0 24px 88px"] { padding-bottom: 48px !important; }
  footer { padding: 48px 16px 28px !important; }
  [style*="padding:56px"] { padding: 28px 22px !important; }
  [style*="padding:48px 52px"], [style*="padding:52px"] { padding: 28px 20px !important; }
  [style*="padding:40px"] { padding: 26px 20px !important; }
  [style*="padding:36px"] { padding: 24px 20px !important; }
}

/* ---------- Two-column rows stack ---------- */
@media (max-width: 900px) {
  [style*="flex:1 1 560px"], [style*="flex:1 1 480px"], [style*="flex:1 1 460px"],
  [style*="flex:1 1 440px"], [style*="flex:1 1 420px"], [style*="flex:1 1 400px"],
  [style*="flex:1 1 380px"], [style*="flex:1 1 360px"] { flex-basis: 100% !important; }
  [style*="flex:0 1 300px"] { flex-basis: 100% !important; }
  [style*="gap:56px"], [style*="gap:64px"] { gap: 32px !important; }
  [style*="gap:48px"] { gap: 28px !important; }
}

/* ---------- Grids ---------- */
@media (max-width: 900px) {
  [style*="minmax(420px"], [style*="minmax(440px"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  [style*="grid-template-columns:repeat(auto-fit"], [style*="grid-template-columns:repeat(auto-fill"],
  [style*="grid-template-columns:1fr 1fr"], [style*="grid-template-columns:repeat(2"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(3,minmax(0,1fr))"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  footer [style*="grid-template-columns:repeat(auto-fit"] { grid-template-columns: 1fr 1fr !important; }
  footer [style*="grid-template-columns:repeat(auto-fit"] > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Fixed-height media boxes ---------- */
@media (max-width: 900px) {
  [style*="height:520px"], [style*="height:480px"] { height: 420px !important; }
}
@media (max-width: 640px) {
  [style*="height:520px"], [style*="height:480px"], [style*="height:440px"], [style*="height:420px"] { height: 320px !important; }
  [style*="min-height:600px"] { min-height: 560px !important; }
  [style*="min-height:380px"] { min-height: 240px !important; }
  iframe { min-height: 300px; }
}

/* ---------- Homepage hero slider: keep text readable on narrow screens ---------- */
@media (max-width: 640px) {
  #home [style*="linear-gradient(90deg"] { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.88) 100%) !important; }
  #home [style*="min-height:600px"] { align-items: flex-end !important; }
  #home [style*="padding:80px 24px"] { padding: 140px 16px 72px !important; }
}

/* ---------- ESwap Sharing steps carousel (homepage) ---------- */
@media (max-width: 1100px) { .steps-track > div { flex-basis: calc((100% - 24px) / 2) !important; } }
@media (max-width: 640px) {
  .steps-track { gap: 16px !important; }
  .steps-track > div { flex-basis: 86% !important; }
  .steps-track > div > div:first-child { height: 360px !important; }
}

/* ---------- Download banners: stack the phone, copy and QR/buttons ---------- */
@media (max-width: 640px) {
  [style*="flex:1 1 520px"] { flex-direction: column !important; align-items: flex-start !important; }
  [style*="flex:0 0 140px"] { flex: 0 0 auto !important; width: 120px !important; height: 250px !important; }
  .qr-card { width: 100% !important; }
}

/* ---------- "Get the App" menu ---------- */
@media (max-width: 640px) {
  [role="menu"][aria-label="Choose an ESwap app"] { position: fixed !important; left: 12px !important; right: 12px !important; width: auto !important; top: 70px !important; }
}

/* ---------- Prices, long words and wide content ---------- */
@media (max-width: 640px) {
  [style*="font-size:64px"], [style*="font-size:56px"] { font-size: 40px !important; }
  [style*="font-size:48px"] { font-size: 36px !important; }
  [style*="font-size:36px"] { font-size: 30px !important; }
  [style*="white-space:nowrap"] { white-space: normal !important; }
  [style*="font-size:32px;font-weight:800;white-space:nowrap"] { white-space: nowrap !important; }
  [style*="align-items:flex-end;gap:2px"] { align-items: flex-start !important; }
  a, button { word-break: normal; }
  input, select, textarea { font-size: 16px !important; }
}

/* ---------- QR codes: phones can't scan their own screen, so show store buttons instead ---------- */
@media (max-width: 640px) {
  .qr-img, .qr-scan { display: none !important; }
  .qr-card { padding: 0 !important; background: transparent !important; }
  .qr-tiles { gap: 10px !important; }
  .qr-tile { flex-direction: row !important; background: #0B0B0B; color: #fff !important; padding: 12px 18px; border-radius: 999px; min-height: 44px; align-items: center !important; }
  .qr-tile span { font-size: 14px !important; }
  [style*="background:#0B0B0B"] .qr-tile { background: #0BB286; color: #0B0B0B !important; }
}
