/* ============================================================
   GLOBAL.CSS — Trade2Join v1 Design System
   Centralized variables, reset, nav, footer, buttons, utilities
   ============================================================ */

/* ── CSS VARIABLES ── */
:root {
  /* Brand colours */
  --orange:        #E8642A;
  --orange-dark:   #C84E18;
  --orange-light:  #FF7A3D;
  --orange-pale:   #FFF0E8;
  --orange-glow:   rgba(232,100,42,0.15);

  /* Dark palette */
  --dark:   #0F1419;
  --dark-2: #1A2332;
  --dark-3: #243044;
  --mid:    #3D5166;

  /* Text */
  --text:         #2C3E50;
  --text-light:   #64748B;
  --text-lighter: #94A3B8;

  /* Borders & backgrounds */
  --border:       #E8EDF2;
  --border-light: #F1F5F9;
  --white:        #FFFFFF;

  /* Status */
  --success:       #10B981;
  --success-light: #D1FAE5;
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --error:         #EF4444;
  --error-light:   #FEE2E2;
  --gold:          #F59E0B;

  /* Radii */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(15,20,25,0.08);
  --shadow-md: 0 8px 40px rgba(15,20,25,0.12);
  --shadow-lg: 0 20px 60px rgba(15,20,25,0.16);
  --shadow-orange: 0 8px 32px rgba(232,100,42,0.25);

  /* Shorthand aliases (used in some page CSS) */
  --o:   #E8642A;
  --od:  #C84E18;
  --op:  #FFF0E8;
  --dk:  #0F1419;
  --dk2: #1A2332;
  --dk3: #243044;
  --tx:  #2C3E50;
  --tl:  #64748B;
  --tlr: #94A3B8;
  --bd:  #E8EDF2;
  --bl:  #F1F5F9;
  --wh:  #FFFFFF;
  --gr:  #10B981;
  --grl: #D1FAE5;
  --r:   16px;
  --rs:  10px;
  --sh:  0 4px 24px rgba(15,20,25,.07);
  --shm: 0 8px 40px rgba(15,20,25,.11);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* prevent any element from causing horizontal scroll */
  max-width: 100%;
}
body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--border-light); }
::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 3px; }

/* ── UTILITY ── */
.text-primary  { color: var(--orange) !important; }
.bg-primary    { background: var(--orange) !important; color: white !important; }
.fade-up       { opacity: 0; transform: translateY(30px); transition: all 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── BUTTONS ── */
.btn-ghost {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 500;
  color: var(--text); background: transparent;
  cursor: pointer; text-decoration: none;
  transition: all .2s; display: inline-block;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.btn-primary {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--orange); color: white;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(232,100,42,0.25);
  transition: all .2s; display: inline-block;
}
.btn-primary:hover { background: var(--orange-dark); color: white; }

/* ── SECTION COMMON ── */
section { padding: 90px 5%; }
.section-inner { max-width: 1280px; margin: 0 auto; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--orange); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px;
}
.section-label::before { content: ''; width: 20px; height: 2px; background: var(--orange); border-radius: 2px; }
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800; color: var(--dark);
  letter-spacing: -1px; line-height: 1.15;
}
.section-sub { font-size: 16px; color: var(--text-light); margin-top: 10px; font-weight: 300; }

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: sticky; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  width: 100%;
  max-width: 100%;
  overflow: visible; /* dropdowns must escape */
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800;
  color: var(--dark); text-decoration: none; letter-spacing: -0.5px;
}
.nav-logo span { color: var(--orange); }

.nav-links {
  display: flex; align-items: center; gap: 28px;
  list-style: none; margin-bottom: 0 !important;
}
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-light);
  text-decoration: none; transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--orange); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

/* Dropdown nav */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex; align-items: center; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-light);
  text-decoration: none; transition: color .2s;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active { color: var(--orange); }
.nav-dropdown-toggle.active svg,
.nav-dropdown-toggle:hover svg { stroke: var(--orange); }

.nav-dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: white; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15,20,25,0.14);
  border: 1.5px solid var(--border);
  min-width: 260px; padding: 8px;
  z-index: 500;
  animation: dropFade .18s ease;
}
@keyframes dropFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute; top: -7px; left: 50%;
  width: 13px; height: 13px;
  background: white;
  border-left: 1.5px solid var(--border); border-top: 1.5px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}
.nav-dropdown-menu::after {
  content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }

.nav-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text);
  transition: background .15s;
}
.nav-dropdown-item:hover { background: var(--orange-pale); color: var(--orange); }
.nav-dropdown-item:hover strong { color: var(--orange); }
.ndi-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.nav-dropdown-item:hover .ndi-icon { background: var(--orange-pale); }
.nav-dropdown-item strong { display: block; font-size: 13px; font-weight: 700; }
.nav-dropdown-item small  { display: block; font-size: 11px; color: var(--text-lighter); margin-top: 1px; }
.nav-dropdown-item:hover small { color: var(--orange-dark); }

/* ── HAMBURGER BUTTON ── */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm);
  transition: background .2s;
}
.nav-hamburger:hover { background: var(--border-light); }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: all .3s ease;
}
/* Hamburger open state */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU OVERLAY ── */
.mobile-menu {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 100vw;
  background: white; z-index: 199;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 5% 40px;
  flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border);
  animation: slideDown .25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu.open { display: flex; }

.mobile-menu .mobile-nav-link {
  display: block; padding: 14px 16px;
  font-size: 16px; font-weight: 500; color: var(--text);
  text-decoration: none; border-radius: var(--radius-sm);
  transition: all .2s;
}
.mobile-menu .mobile-nav-link:hover,
.mobile-menu .mobile-nav-link.active { background: var(--orange-pale); color: var(--orange); }

.mobile-menu .mobile-nav-group { margin-top: 8px; }
.mobile-menu .mobile-nav-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-lighter);
  padding: 8px 16px 4px;
}
.mobile-menu .mobile-nav-sub {
  display: block; padding: 10px 16px 10px 28px;
  font-size: 14px; color: var(--text-light);
  text-decoration: none; border-radius: var(--radius-sm);
  transition: all .2s;
}
.mobile-menu .mobile-nav-sub:hover { background: var(--orange-pale); color: var(--orange); }

.mobile-menu .mobile-cta-row {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.mobile-menu .mobile-cta-row .btn-ghost,
.mobile-menu .mobile-cta-row .btn-primary {
  width: 100%; text-align: center; padding: 13px;
  font-size: 15px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--dark); color: white; padding: 60px 5% 0;
}
.footer-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand-name {
  font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; margin-bottom: 14px;
}
.footer-brand-name span { color: var(--orange); }
.footer-desc {
  font-size: 14px; color: rgba(255,255,255,0.5);
  line-height: 1.8; margin-bottom: 24px; font-weight: 300;
}
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); font-size: 16px; cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.social-btn:hover { background: var(--orange); border-color: var(--orange); color: white; }
.footer-col-title {
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--orange); margin-bottom: 20px;
}
.footer-links {
  list-style: none; display: flex; flex-direction: column;
  gap: 10px; padding-left: 0 !important;
}
.footer-links a {
  font-size: 14px; color: rgba(255,255,255,0.6);
  text-decoration: none; transition: color .2s; font-weight: 300;
}
.footer-links a:hover { color: var(--orange); }
.footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-contact-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 300;
}
.footer-contact-item svg { color: var(--orange); flex-shrink: 0; margin-top: 2px; }
.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; font-size: 12px; color: rgba(255,255,255,0.35);
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-bottom-links a {
  color: rgba(255,255,255,0.35); text-decoration: none; transition: color .2s;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* ============================================================
   RESPONSIVE — GLOBAL
   ============================================================ */

/* Hard stop on horizontal overflow for all sections and footer */
section,
footer,
nav {
  max-width: 100%;
}

/* Sections that have decorative pseudo-elements bleeding right:
   clip them so they never cause a scrollbar.
   These sections have no dropdowns or absolute children that need to escape. */
.cats-section,
.pros-section,
.testimonials-section,
.areas-section,
.trust-bar,
.join-section,
footer {
  overflow: clip;
}

/* Tablet */
@media (max-width: 1024px) {
  section { padding: 70px 4%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
  section { padding: 56px 4%; }

  /* Nav: hide desktop links, show hamburger */
  .nav-links { display: none !important; }
  .nav-cta   { display: none !important; }
  .nav-hamburger { display: flex; }

  /* Footer: stack to 2 cols */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Mobile portrait */
@media (max-width: 480px) {
  section { padding: 44px 4%; }

  .nav-inner { height: 56px; }
  .mobile-menu { top: 56px; }

  /* Footer: single column */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand-name { font-size: 18px; }
  .footer-bottom-links { gap: 12px; }

  .section-title { font-size: clamp(22px, 6vw, 32px); }
  .section-sub   { font-size: 14px; }

  /* Ensure nothing bleeds on very small screens */
  * { max-width: 100%; }
  img, video, iframe { max-width: 100%; height: auto; }
}
