/* ── KorExBridge App Shell ───────────────────────────────────────────
   Loaded on every page. Hides old desktop navbar/footer and applies
   the 480px mobile-app wrapper + topbar + slide menu + bottom nav.
──────────────────────────────────────────────────────────────────── */

:root {
  --primary: #1a56db;
  --dark:    #0f172a;
  --gray:    #64748b;
  --border:  #e2e8f0;
  --bg:      #f1f5f9;
}

/* Gray page background (desktop shows it as frame) */
body {
  background: var(--bg) !important;
  padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
}

/* ── Hide old desktop elements ─────────────── */
.navbar    { display: none !important; }
.footer    { display: none !important; }
.page-hero { display: none !important; }

/* ── App wrapper ────────────────────────────── */
.app {
  max-width: 480px;
  margin: 0 auto;
  background: white;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
  position: relative;
}

/* Override old page wrappers — no extra max-width or side margins */
.hiw-page, .pricing-page, .contact-page,
.guide-wrap, .shipping-page, .legal-page,
.blog-page, .blog-hero, .blog-body {
  max-width: none !important;
  margin: 0 !important;
}

/* Make tables scroll inside 480px on narrow content */
.fee-table-wrap,
.carrier-table,
.compare-table,
.hiw-page table,
.pricing-page table,
.guide-wrap table {
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}
/* Keep correct table rendering when wrapped */
.carrier-table tbody,
.carrier-table thead,
.carrier-table tr,
.compare-table tbody,
.compare-table thead,
.compare-table tr,
.fee-table tbody,
.fee-table thead,
.fee-table tr {
  display: table-row-group;
}
.carrier-table thead { display: table-header-group; }
.compare-table thead { display: table-header-group; }
.fee-table thead     { display: table-header-group; }

/* ── Topbar ─────────────────────────────────── */
.app-topbar {
  position: sticky;
  top: 0; z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
}
.app-topbar-logo {
  font-size: 1.2rem; font-weight: 800;
  display: flex; align-items: center; gap: 0;
  text-decoration: none; color: var(--dark);
}
.app-topbar-logo em { font-style: normal; color: var(--primary); }
.app-menu-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.app-menu-btn span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; }

/* ── Slide menu ─────────────────────────────── */
.app-slide-menu {
  position: fixed; top: 0; right: -100%;
  width: 280px; height: 100%;
  background: white; z-index: 200;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  padding: 24px 0;
}
.app-slide-menu.open { right: 0; }
.app-slide-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px 20px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.app-slide-header span { font-size: 1.1rem; font-weight: 800; }
.app-slide-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray); }
.app-slide-menu a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; font-size: 15px; font-weight: 500;
  color: var(--dark); border-bottom: 1px solid #f8fafc; text-decoration: none;
}
.app-slide-menu a i { width: 20px; color: var(--gray); }
.app-slide-menu a:hover { background: #f8fafc; }
.app-slide-cta {
  margin: 20px 24px 0; display: block;
  background: var(--primary); color: white !important;
  text-align: center; padding: 14px; border-radius: 12px;
  font-weight: 700; font-size: 15px; text-decoration: none;
}
.app-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 199;
}
.app-overlay.open { display: block; }

/* ── Page header (replaces .page-hero) ─────── */
.app-page-header {
  background: linear-gradient(160deg, #0f172a 0%, #1a3a6e 100%);
  padding: 24px 20px 22px;
  color: white;
}
.app-page-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.app-page-header p  { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.5; margin: 0; }

/* ── Mini footer ────────────────────────────── */
.app-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
}
.app-footer-logo { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; color: var(--dark); }
.app-footer-logo em { font-style: normal; color: var(--primary); }
.app-footer-social { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.app-footer-social a {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; text-decoration: none;
}
.app-footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 4px 16px; margin-bottom: 12px;
}
.app-footer-links a { font-size: 12px; color: var(--gray); text-decoration: none; }
.app-footer-links a:hover { color: var(--primary); }
.app-footer-copy { font-size: 11px; color: #94a3b8; }

/* ── Bottom nav ─────────────────────────────── */
.app-bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: white; border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.app-bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: center; height: 60px;
}
.app-bn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; padding: 8px 4px; color: #94a3b8;
  text-decoration: none; position: relative; transition: color 0.2s;
}
.app-bn.active { color: var(--primary); }
.app-bn.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--primary); border-radius: 0 0 2px 2px;
}
.app-bn i { font-size: 18px; }
.app-bn-label { font-size: 10px; font-weight: 600; }
.app-bn-cta {
  background: var(--primary); border-radius: 12px;
  padding: 9px 14px; color: white !important;
}
.app-bn-cta::before { display: none !important; }
.app-bn-cta i { font-size: 15px; }

/* ── Slide menu JS ──────────────────────────── */
/* (JS inlined per page) */
