// ServicePageShell — navigation, related services, footer CTA, shared by every /services/* page.
// Consumes window.SERVICES_DATA. Each page imports Primitives.jsx first for <Icon>, <Button>, <Logo>.

const { useState: useStateSp, useEffect: useEffectSp } = React;

// ——— Division accent palettes
const SP_ACCENTS = {
  blue:   { primary: '#1E57D6', dark: '#1846B0', soft: '#EFF6FF', light: '#BFDBFE', glow: 'rgba(30,87,214,0.18)', ink: '#0B1220' },
  indigo: { primary: '#4F46E5', dark: '#4338CA', soft: '#EEF2FF', light: '#C7D2FE', glow: 'rgba(79,70,229,0.18)', ink: '#0B1220' },
  amber:  { primary: '#B45309', dark: '#92400E', soft: '#FFFBEB', light: '#FDE68A', glow: 'rgba(180,83,9,0.14)', ink: '#0B1220' },
  green:  { primary: '#039855', dark: '#027948', soft: '#ECFDF3', light: '#A6F4C5', glow: 'rgba(3,152,85,0.18)', ink: '#0B1220' },
};

function applyAccent(accent) {
  const a = SP_ACCENTS[accent] || SP_ACCENTS.blue;
  const root = document.documentElement.style;
  root.setProperty('--accent-primary', a.primary);
  root.setProperty('--accent-dark',    a.dark);
  root.setProperty('--accent-soft',    a.soft);
  root.setProperty('--accent-light',   a.light);
  root.setProperty('--glow-color',     a.glow);
}

// Static href / icon definitions for the Platform and Resources mega-menus.
// All visible labels are resolved at render-time via window.__i18n.t() so a
// language switch reflows the menus on the next render.
const platFeatured_HREF = 'ab-group-platform.html';
const SP_PLAT_SECTIONS_BASE = [
  { id: 'modules', labelKey: 'nav.section.modules', accent: '#1846B0',
    items: [
      { nameKey: 'nav.plat.shipments',   icon: 'shipments',   href: 'ab-group-platform.html#modules', descKey: 'nav.plat.shipments.desc' },
      { nameKey: 'nav.plat.quote',       icon: 'quote',       href: 'calculators.html',                descKey: 'nav.plat.quote.desc' },
      { nameKey: 'nav.plat.customs',     icon: 'shieldCheck', href: 'customs-brokerage.html',          descKey: 'nav.plat.customs.desc' },
      { nameKey: 'nav.plat.finance',     icon: 'coins',       href: 'ab-group-platform.html',          descKey: 'nav.plat.finance.desc' },
      { nameKey: 'nav.plat.analytics',   icon: 'analytics',   href: 'ab-group-platform.html',          descKey: 'nav.plat.analytics.desc' },
    ] },
  { id: 'platform', labelKey: 'nav.section.platform', accent: '#4F46E5',
    items: [
      { nameKey: 'nav.plat.integrations', icon: 'globe', href: 'ab-group-platform.html#integrations', descKey: 'nav.plat.integrations.desc' },
      { nameKey: 'nav.plat.api',          icon: 'docs',  href: 'ab-group-platform.html#api',          descKey: 'nav.plat.api.desc' },
    ] },
];

const resFeatured_HREF = 'compliance-certification.html';
const SP_RES_SECTIONS_BASE = [
  { id: 'trust', labelKey: 'nav.section.trust', accent: '#1846B0',
    items: [
      { nameKey: 'nav.res.compliance', icon: 'shieldCheck', href: 'compliance-certification.html', descKey: 'nav.res.compliance.desc' },
      { nameKey: 'nav.res.history',    icon: 'clock',       href: 'company-history.html',          descKey: 'nav.res.history.desc' },
    ] },
  { id: 'knowledge', labelKey: 'nav.section.knowledge', accent: '#4F46E5',
    items: [
      { nameKey: 'nav.res.calculators', icon: 'calculator', href: 'calculators.html', descKey: 'nav.res.calculators.desc' },
      { nameKey: 'nav.res.glossary',    icon: 'book',       href: 'glossary.html',    descKey: 'nav.res.glossary.desc' },
    ] },
  { id: 'company', labelKey: 'nav.section.company', accent: '#B45309',
    items: [
      { nameKey: 'nav.res.about',   icon: 'warehouse', href: 'about.html',   descKey: 'nav.res.about.desc' },
      { nameKey: 'nav.res.careers', icon: 'award',     href: 'careers.html', descKey: 'nav.res.careers.desc' },
    ] },
];

// ——— Language toggle (subpage variant — same dropdown UI as SiteNav.LangToggle)
function ServiceLangToggle() {
  const [open, setOpen] = useStateSp(false);
  const wrapRef = React.useRef(null);
  const i18n = window.__useI18n();
  React.useEffect(() => {
    if (!open) return;
    const onDoc = (e) => { if (wrapRef.current && !wrapRef.current.contains(e.target)) setOpen(false); };
    const onKey = (e) => { if (e.key === 'Escape') setOpen(false); };
    document.addEventListener('mousedown', onDoc);
    document.addEventListener('keydown', onKey);
    return () => { document.removeEventListener('mousedown', onDoc); document.removeEventListener('keydown', onKey); };
  }, [open]);
  const items = [
    { code: 'en', label: i18n.t('lang.label.en'), short: 'EN' },
    { code: 'es', label: i18n.t('lang.label.es'), short: 'ES' },
  ];
  const current = items.find(i => i.code === i18n.lang) || items[0];
  return (
    <div ref={wrapRef} style={{ position: 'relative' }}>
      <button type="button" onClick={() => setOpen(v => !v)} aria-label={i18n.t('lang.toggle.aria')}
        aria-haspopup="listbox" aria-expanded={open}
        onMouseEnter={(e) => { e.currentTarget.style.background = '#f9fafb'; }}
        onMouseLeave={(e) => { e.currentTarget.style.background = open ? '#f2f4f7' : '#fff'; }}
        style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
          padding: '6px 10px', borderRadius: 8, background: open ? '#f2f4f7' : '#fff',
          border: '1px solid #d0d5dd', color: '#101828', fontSize: 12, fontWeight: 700,
          letterSpacing: '0.04em', whiteSpace: 'nowrap', fontFamily: 'inherit', cursor: 'pointer',
          transition: 'background 160ms ease' }}>
        <Icon name="globe" size={13}/>
        <span>{current.short}</span>
        <Icon name="chevronDown" size={12} style={{ opacity: 0.55,
          transform: open ? 'rotate(180deg)' : 'none', transition: 'transform 160ms' }}/>
      </button>
      {open && (
        <div role="listbox" style={{ position: 'absolute', top: 'calc(100% + 6px)', right: 0,
          minWidth: 160, padding: 4, background: '#fff', border: '1px solid #eaecf0',
          borderRadius: 10, boxShadow: '0 14px 28px -8px rgba(16,24,40,0.18), 0 4px 8px rgba(16,24,40,0.06)',
          zIndex: 60 }}>
          {items.map(it => {
            const active = it.code === i18n.lang;
            return (
              <button key={it.code} type="button" role="option" aria-selected={active}
                onClick={() => { i18n.setLang(it.code); setOpen(false); }}
                onMouseEnter={(e) => { if (!active) e.currentTarget.style.background = '#f9fafb'; }}
                onMouseLeave={(e) => { if (!active) e.currentTarget.style.background = 'transparent'; }}
                style={{ width: '100%', display: 'flex', alignItems: 'center', gap: 10,
                  padding: '8px 10px', borderRadius: 7, textAlign: 'left', cursor: 'pointer',
                  border: 0, background: active ? 'rgba(30,87,214,0.08)' : 'transparent',
                  color: '#101828', fontFamily: 'inherit', fontSize: 13,
                  fontWeight: active ? 700 : 500 }}>
                <span style={{ width: 22, fontSize: 11, fontWeight: 800,
                  letterSpacing: '0.06em', color: active ? '#1846B0' : '#667085',
                  fontFamily: 'JetBrains Mono, monospace' }}>{it.short}</span>
                <span style={{ flex: 1 }}>{it.label}</span>
                {active && (<Icon name="check" size={13} style={{ color: '#1846B0' }}/>)}
              </button>
            );
          })}
        </div>
      )}
    </div>
  );
}

// ——— Mega nav
function ServiceNav({ currentSlug }) {
  const [open, setOpen] = useStateSp(null);
  const i18n = window.__useI18n();
  const t = i18n.t;
  const data = window.SERVICES_DATA;
  const H = window.SERVICES_HELPERS || {};
  const byDiv = {};
  data.services.forEach(s => { (byDiv[s.division] = byDiv[s.division] || []).push(s); });

  // Resolve translatable mega-menu data fresh each render. URLs stay English.
  const platFeatured = {
    eyebrow: t('nav.mega.platform.eyebrow'),
    title:   t('nav.mega.platform.title'),
    desc:    t('nav.mega.platform.desc'),
    cta:     t('nav.mega.platform.cta'),
    href:    platFeatured_HREF,
  };
  const resFeatured = {
    eyebrow: t('nav.mega.resources.eyebrow'),
    title:   t('nav.mega.resources.title'),
    desc:    t('nav.mega.resources.desc'),
    cta:     t('nav.mega.resources.cta'),
    href:    resFeatured_HREF,
  };

  // Stash slug so the sticky-header CTA can pass it to the quote widget.
  if (typeof window !== 'undefined') window.__SERVICE_PAGE_SLUG = currentSlug || null;

  return (
    <React.Fragment>
    <header className="desktop-nav-header" style={{ position: 'sticky', top: 0, zIndex: 40, background: 'rgba(255,255,255,0.86)',
      backdropFilter: 'saturate(180%) blur(14px)', WebkitBackdropFilter: 'saturate(180%) blur(14px)',
      borderBottom: '1px solid rgba(234,236,240,0.9)' }}
      onMouseLeave={() => setOpen(null)}>
      <div style={{ width: '100%', padding: '10px 40px',
        display: 'flex', alignItems: 'center', gap: 24 }}>
        <a href="../Homepage.html" style={{ display: 'inline-flex', alignItems: 'center',
          textDecoration: 'none' }}>
          <BrandLogo size={36}/>
        </a>
        <nav style={{ display: 'flex', gap: 22, flex: 1, marginLeft: 8 }}>
          <div style={{ position: 'relative' }}
            onMouseEnter={() => setOpen('platform')}>
            <a href="ab-group-platform.html" style={{ ...navLink,
              color: open === 'platform' ? '#0B1220' : '#344054' }}>
              {t('nav.platform')} <Icon name="chevronDown" size={14}/>
            </a>
          </div>
          <div style={{ position: 'relative' }}
            onMouseEnter={() => setOpen('services')}>
            <a href="index.html" style={{ ...navLink,
              color: open === 'services' ? '#0B1220' : '#344054' }}>
              {t('nav.services')} <Icon name="chevronDown" size={14}/>
            </a>
          </div>
          <div style={{ position: 'relative' }}
            onMouseEnter={() => setOpen('resources')}>
            <a href={resFeatured.href} style={{ ...navLink,
              color: open === 'resources' ? '#0B1220' : '#344054' }}>
              {t('nav.resources')} <Icon name="chevronDown" size={14}/>
            </a>
          </div>
        </nav>
        <div style={{ display: 'flex', alignItems: 'center', gap: 2 }}>
          {[
            { label: 'Facebook',  href: 'https://www.facebook.com/abgroupshipping',
              path: 'M22 12.06C22 6.5 17.52 2 12 2S2 6.5 2 12.06c0 5 3.66 9.15 8.44 9.94v-7.03H7.9v-2.91h2.54V9.84c0-2.52 1.49-3.91 3.77-3.91 1.09 0 2.24.2 2.24.2v2.47h-1.26c-1.24 0-1.63.78-1.63 1.57v1.89h2.78l-.44 2.91h-2.34V22c4.78-.79 8.44-4.94 8.44-9.94z' },
            { label: 'X',         href: 'https://x.com/abgroupshipping',
              path: 'M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.45-6.231zm-1.161 17.52h1.833L7.084 4.126H5.117l11.966 15.644z' },
            { label: 'Instagram', href: 'https://www.instagram.com/abgroupshipping',
              path: 'M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.42.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.42.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41-.56-.22-.96-.48-1.38-.9-.42-.42-.68-.82-.9-1.38-.16-.42-.36-1.06-.41-2.23C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.42-.16 1.06-.36 2.23-.41C8.42 2.17 8.8 2.16 12 2.16M12 0C8.74 0 8.33.01 7.05.07 5.78.13 4.9.33 4.14.63c-.79.31-1.46.72-2.13 1.39C1.34 2.69.93 3.36.62 4.14.33 4.9.13 5.78.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.06 1.27.26 2.15.56 2.91.31.79.72 1.46 1.39 2.13.67.67 1.34 1.08 2.13 1.39.76.3 1.64.5 2.91.56C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c1.27-.06 2.15-.26 2.91-.56.79-.31 1.46-.72 2.13-1.39.67-.67 1.08-1.34 1.39-2.13.3-.76.5-1.64.56-2.91.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.06-1.27-.26-2.15-.56-2.91-.31-.79-.72-1.46-1.39-2.13C21.31 1.34 20.64.93 19.86.62 19.1.33 18.22.13 16.95.07 15.67.01 15.26 0 12 0zm0 5.84A6.16 6.16 0 1 0 18.16 12 6.16 6.16 0 0 0 12 5.84zm0 10.16A4 4 0 1 1 16 12a4 4 0 0 1-4 4zm6.41-11.85a1.44 1.44 0 1 0 1.44 1.44 1.44 1.44 0 0 0-1.44-1.44z' },
            { label: 'LinkedIn',  href: 'https://www.linkedin.com/company/abgroupshipping',
              path: 'M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.34V9h3.42v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.07 2.07 0 1 1 0-4.13 2.07 2.07 0 0 1 0 4.13zM7.12 20.45H3.56V9h3.56v11.45zM22.23 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45C23.2 24 24 23.23 24 22.28V1.72C24 .77 23.2 0 22.23 0z' },
          ].map((s) => (
            <a key={s.label} href={s.href} target="_blank" rel="noopener noreferrer"
              aria-label={s.label} title={s.label}
              style={{ width: 26, height: 26, borderRadius: 7,
                display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                color: '#667085', textDecoration: 'none', transition: 'all 0.15s ease' }}
              onMouseEnter={e => { e.currentTarget.style.background = '#f2f4f7';
                e.currentTarget.style.color = '#1846B0'; }}
              onMouseLeave={e => { e.currentTarget.style.background = 'transparent';
                e.currentTarget.style.color = '#667085'; }}>
              <svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor"
                xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
                <path d={s.path}/>
              </svg>
            </a>
          ))}
        </div>
        <div aria-hidden style={{ width: 1, height: 16, background: '#eaecf0' }}/>
        <ServiceLangToggle/>
        <a href="../login.html" style={{ fontSize: 13, fontWeight: 500, color: '#344054', textDecoration: 'none', whiteSpace: 'nowrap' }}>{t('nav.signin')}</a>
        <a href="tel:+13056352525"
          onMouseEnter={(e) => { e.currentTarget.style.background = '#f9fafb'; }}
          onMouseLeave={(e) => { e.currentTarget.style.background = '#fff'; }}
          style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
            padding: '6px 11px', borderRadius: 8,
            background: '#fff', border: '1px solid #d0d5dd',
            color: '#101828', fontSize: 12.5, fontWeight: 600,
            letterSpacing: '-0.005em', textDecoration: 'none',
            whiteSpace: 'nowrap',
            transition: 'all 180ms cubic-bezier(0.16,1,0.3,1)' }}>
          <Icon name="phone" size={13}/> {t('nav.expert')}
        </a>
        <Button variant="primary" size="sm" iconAfter="arrowRight"
          style={{ whiteSpace: 'nowrap' }}
          onClick={() => window.__abgsCTA && window.__abgsCTA.openQuote('service-shell-sticky-quote',
            { svc: window.__SERVICE_PAGE_SLUG })}>
          {t('nav.quote_cta')}
        </Button>
      </div>

      {/* Mega panel — Services */}
      {open === 'services' && (
        <div style={{ position: 'absolute', top: '100%', left: 0, right: 0,
          background: '#fff', borderBottom: '1px solid #eaecf0',
          boxShadow: '0 20px 40px -16px rgba(16,24,40,0.12)' }}
          onMouseEnter={() => setOpen('services')}>
          <div style={{ width: '100%', padding: '36px 40px 44px',
            display: 'grid', gridTemplateColumns: '1.2fr 1fr 0.9fr 0.9fr 0.9fr', gap: 36 }}>
            {/* Featured tile */}
            <a href="index.html"
              style={{ position: 'relative', display: 'block', borderRadius: 14,
                padding: '24px 24px 22px',
                background: 'linear-gradient(155deg, #0B1220 0%, #1846B0 100%)',
                color: '#fff', textDecoration: 'none', overflow: 'hidden',
                boxShadow: '0 12px 28px -16px rgba(24,70,176,0.5)' }}>
              <div aria-hidden style={{ position: 'absolute', inset: 0,
                backgroundImage: 'linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px)',
                backgroundSize: '24px 24px', opacity: 0.6, pointerEvents: 'none' }}/>
              <div style={{ position: 'relative' }}>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
                  padding: '4px 9px', borderRadius: 9999,
                  background: 'rgba(255,255,255,0.12)',
                  border: '1px solid rgba(255,255,255,0.18)',
                  fontSize: 10.5, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase' }}>
                  <Icon name="sparkles" size={11}/> {t('nav.mega.services.eyebrow')}
                </div>
                <div style={{ fontSize: 24, fontWeight: 700, letterSpacing: '-0.02em',
                  marginTop: 14, lineHeight: 1.15, whiteSpace: 'pre-line' }}>
                  {t('nav.mega.services.title')}
                </div>
                <p style={{ margin: '8px 0 0', fontSize: 13, lineHeight: 1.55,
                  color: 'rgba(240,247,255,0.78)' }}>
                  {t('nav.mega.services.desc')}
                </p>
                <div style={{ marginTop: 16, display: 'flex', flexWrap: 'wrap', gap: 6 }}>
                  {[t('nav.mega.services.bdg.logistics'), t('nav.mega.services.bdg.fulfillment'), t('nav.mega.services.bdg.trade'), t('nav.mega.services.bdg.storage')].map((b, idx) => (
                    <span key={idx} style={{ padding: '3px 8px',
                      background: 'rgba(255,255,255,0.1)',
                      border: '1px solid rgba(255,255,255,0.16)',
                      borderRadius: 4, fontSize: 10.5, fontWeight: 700,
                      letterSpacing: '0.04em',
                      fontFamily: 'JetBrains Mono, monospace' }}>{b}</span>
                  ))}
                </div>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
                  marginTop: 18, fontSize: 13, fontWeight: 600,
                  color: '#bfdbfe' }}>
                  {t('nav.mega.services.cta')} <Icon name="arrowRight" size={13}/>
                </div>
              </div>
            </a>
            {data.divisions.map(div => (
              <div key={div.id}>
                <div style={{ fontSize: 11, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase', color: '#98a2b3', marginBottom: 14 }}>{H.divLabel ? H.divLabel(div) : div.label}</div>
                <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
                  {byDiv[div.id].map(s => (
                    <a key={s.slug} href={s.url || `${s.slug}.html`}
                      style={{ display: 'flex', alignItems: 'center', gap: 10,
                        padding: '7px 10px', borderRadius: 8, textDecoration: 'none',
                        background: s.slug === currentSlug ? '#f9fafb' : 'transparent',
                        color: s.slug === currentSlug ? '#0B1220' : '#344054',
                        fontSize: 13.5, fontWeight: 500, letterSpacing: '-0.005em' }}
                      onMouseEnter={e => e.currentTarget.style.background = '#f9fafb'}
                      onMouseLeave={e => e.currentTarget.style.background = s.slug === currentSlug ? '#f9fafb' : 'transparent'}>
                      <Icon name={s.icon} size={14} style={{ color: 'var(--accent-dark, #1846B0)', opacity: 0.75 }}/>
                      {H.svcName ? H.svcName(s) : s.name}
                    </a>
                  ))}
                </div>
              </div>
            ))}
          </div>
        </div>
      )}

      {/* Mega panel — Platform */}
      {open === 'platform' && (
        <div style={{ position: 'absolute', top: '100%', left: 0, right: 0,
          background: '#fff', borderBottom: '1px solid #eaecf0',
          boxShadow: '0 20px 40px -16px rgba(16,24,40,0.12)' }}
          onMouseEnter={() => setOpen('platform')}>
          <div style={{ width: '100%', padding: '24px 40px 28px',
            display: 'grid', gridTemplateColumns: '1.4fr 1.2fr 1fr', gap: 40,
            alignItems: 'stretch' }}>
            <a href={platFeatured.href}
              style={{ position: 'relative', display: 'flex', flexDirection: 'column',
                justifyContent: 'space-between', borderRadius: 12,
                padding: '16px 18px',
                background: 'linear-gradient(155deg, #0B1220 0%, #1846B0 100%)',
                color: '#fff', textDecoration: 'none', overflow: 'hidden',
                boxShadow: '0 12px 28px -16px rgba(24,70,176,0.5)' }}>
              <div aria-hidden style={{ position: 'absolute', inset: 0,
                backgroundImage: 'linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px)',
                backgroundSize: '24px 24px', opacity: 0.6, pointerEvents: 'none' }}/>
              <div style={{ position: 'relative' }}>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
                  padding: '3px 8px', borderRadius: 9999,
                  background: 'rgba(255,255,255,0.12)',
                  border: '1px solid rgba(255,255,255,0.18)',
                  fontSize: 10, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase' }}>
                  <Icon name="sparkles" size={10}/> {platFeatured.eyebrow}
                </div>
                <div style={{ fontSize: 20, fontWeight: 700, letterSpacing: '-0.02em',
                  marginTop: 10, lineHeight: 1.15 }}>
                  {platFeatured.title}
                </div>
                <p style={{ margin: '6px 0 0', fontSize: 12.5, lineHeight: 1.5,
                  color: 'rgba(240,247,255,0.78)' }}>
                  {platFeatured.desc}
                </p>
              </div>
              <div style={{ position: 'relative', marginTop: 12,
                display: 'flex', alignItems: 'center', justifyContent: 'space-between',
                gap: 10, flexWrap: 'wrap' }}>
                <div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
                  {['SHIPMENTS','QUOTE','CUSTOMS','FINANCE','API'].map(b => (
                    <span key={b} style={{ padding: '2px 6px',
                      background: 'rgba(255,255,255,0.1)',
                      border: '1px solid rgba(255,255,255,0.16)',
                      borderRadius: 4, fontSize: 9.5, fontWeight: 700,
                      letterSpacing: '0.04em',
                      fontFamily: 'JetBrains Mono, monospace' }}>{b}</span>
                  ))}
                </div>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 5,
                  fontSize: 11.5, fontWeight: 600, color: '#bfdbfe',
                  whiteSpace: 'nowrap' }}>
                  {platFeatured.cta} <Icon name="arrowRight" size={11}/>
                </div>
              </div>
            </a>
            {SP_PLAT_SECTIONS_BASE.map(sec => (
              <div key={sec.id}>
                <div style={{ fontSize: 10.5, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase', color: '#98a2b3', marginBottom: 8 }}>
                  {t(sec.labelKey)}
                </div>
                <div style={{ display: 'flex', flexDirection: 'column', gap: 0 }}>
                  {sec.items.map(it => (
                    <a key={it.nameKey} href={it.href}
                      style={{ display: 'grid', gridTemplateColumns: '18px 1fr',
                        gap: 10, alignItems: 'start',
                        padding: '6px 8px', borderRadius: 6, textDecoration: 'none' }}
                      onMouseEnter={e => e.currentTarget.style.background = '#f9fafb'}
                      onMouseLeave={e => e.currentTarget.style.background = 'transparent'}>
                      <Icon name={it.icon} size={13}
                        style={{ color: sec.accent, opacity: 0.85, marginTop: 2 }}/>
                      <div>
                        <div style={{ fontSize: 12.5, fontWeight: 600, color: '#0B1220',
                          letterSpacing: '-0.005em', lineHeight: 1.3 }}>
                          {t(it.nameKey)}
                        </div>
                        <div style={{ fontSize: 11, color: '#667085',
                          lineHeight: 1.35, marginTop: 1 }}>
                          {t(it.descKey)}
                        </div>
                      </div>
                    </a>
                  ))}
                </div>
              </div>
            ))}
          </div>
        </div>
      )}

      {/* Mega panel — Resources */}
      {open === 'resources' && (
        <div style={{ position: 'absolute', top: '100%', left: 0, right: 0,
          background: '#fff', borderBottom: '1px solid #eaecf0',
          boxShadow: '0 20px 40px -16px rgba(16,24,40,0.12)' }}
          onMouseEnter={() => setOpen('resources')}>
          <div style={{ width: '100%', padding: '24px 40px 28px',
            display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr', gap: 40,
            alignItems: 'stretch' }}>
            <a href={resFeatured.href}
              style={{ position: 'relative', display: 'flex', flexDirection: 'column',
                justifyContent: 'space-between', borderRadius: 12,
                padding: '14px 16px',
                background: 'linear-gradient(155deg, #0B1220 0%, #1846B0 100%)',
                color: '#fff', textDecoration: 'none', overflow: 'hidden',
                boxShadow: '0 12px 28px -16px rgba(24,70,176,0.5)' }}>
              <div aria-hidden style={{ position: 'absolute', inset: 0,
                backgroundImage: 'linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px)',
                backgroundSize: '24px 24px', opacity: 0.6, pointerEvents: 'none' }}/>
              <div style={{ position: 'relative' }}>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
                  padding: '3px 8px', borderRadius: 9999,
                  background: 'rgba(255,255,255,0.12)',
                  border: '1px solid rgba(255,255,255,0.18)',
                  fontSize: 10, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase' }}>
                  <Icon name="shieldCheck" size={10}/> {resFeatured.eyebrow}
                </div>
                <div style={{ fontSize: 18, fontWeight: 700, letterSpacing: '-0.02em',
                  marginTop: 8, lineHeight: 1.15 }}>
                  {resFeatured.title}
                </div>
                <p style={{ margin: '4px 0 0', fontSize: 12, lineHeight: 1.45,
                  color: 'rgba(240,247,255,0.78)' }}>
                  {resFeatured.desc}
                </p>
              </div>
              <div style={{ position: 'relative', marginTop: 10,
                display: 'flex', alignItems: 'center', justifyContent: 'space-between',
                gap: 10, flexWrap: 'wrap' }}>
                <div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
                  {['C-TPAT','NVOCC','IAC','HAZMAT','CBW','FMC'].map(b => (
                    <span key={b} style={{ padding: '2px 6px',
                      background: 'rgba(255,255,255,0.1)',
                      border: '1px solid rgba(255,255,255,0.16)',
                      borderRadius: 4, fontSize: 9.5, fontWeight: 700,
                      letterSpacing: '0.04em',
                      fontFamily: 'JetBrains Mono, monospace' }}>{b}</span>
                  ))}
                </div>
                <div style={{ display: 'inline-flex', alignItems: 'center', gap: 5,
                  fontSize: 11.5, fontWeight: 600, color: '#bfdbfe',
                  whiteSpace: 'nowrap' }}>
                  {resFeatured.cta} <Icon name="arrowRight" size={11}/>
                </div>
              </div>
            </a>

            {SP_RES_SECTIONS_BASE.map(sec => (
              <div key={sec.id}>
                <div style={{ fontSize: 10.5, fontWeight: 700, letterSpacing: '0.1em',
                  textTransform: 'uppercase', color: '#98a2b3', marginBottom: 8 }}>
                  {t(sec.labelKey)}
                </div>
                <div style={{ display: 'flex', flexDirection: 'column', gap: 0 }}>
                  {sec.items.map(it => (
                    <a key={it.nameKey} href={it.href}
                      style={{ display: 'grid', gridTemplateColumns: '18px 1fr',
                        gap: 10, alignItems: 'start',
                        padding: '6px 8px', borderRadius: 6, textDecoration: 'none' }}
                      onMouseEnter={e => e.currentTarget.style.background = '#f9fafb'}
                      onMouseLeave={e => e.currentTarget.style.background = 'transparent'}>
                      <Icon name={it.icon} size={13}
                        style={{ color: sec.accent, opacity: 0.85, marginTop: 2 }}/>
                      <div>
                        <div style={{ fontSize: 12.5, fontWeight: 600, color: '#0B1220',
                          letterSpacing: '-0.005em', lineHeight: 1.3 }}>
                          {t(it.nameKey)}
                        </div>
                        <div style={{ fontSize: 11, color: '#667085',
                          lineHeight: 1.35, marginTop: 1 }}>
                          {t(it.descKey)}
                        </div>
                      </div>
                    </a>
                  ))}
                </div>
              </div>
            ))}
          </div>
        </div>
      )}
    </header>
    {(() => {
      const C = typeof window !== 'undefined' ? window.ContactModalRoot : null;
      return C ? <C/> : null;
    })()}
    </React.Fragment>
  );
}
const navLink = { display: 'inline-flex', alignItems: 'center', gap: 4,
  fontSize: 13.5, fontWeight: 500, color: '#344054', textDecoration: 'none',
  letterSpacing: '-0.005em' };

// ——— Breadcrumbs
function Breadcrumbs({ division, name }) {
  const i18n = window.__useI18n();
  const t = i18n.t;
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 12,
      color: '#667085', letterSpacing: '-0.005em', flexWrap: 'wrap' }}>
      <a href="../Homepage.html" style={{ textDecoration: 'none', color: '#667085' }}>{t('shell.crumb.home')}</a>
      <Icon name="chevronRight" size={12}/>
      <a href="index.html" style={{ textDecoration: 'none', color: '#667085' }}>{t('shell.crumb.services')}</a>
      <Icon name="chevronRight" size={12}/>
      <span style={{ color: '#667085' }}>{division}</span>
      <Icon name="chevronRight" size={12}/>
      <span style={{ color: '#0B1220', fontWeight: 600 }}>{name}</span>
    </div>
  );
}

// ——— Section title block
function SectionHeader({ kicker, title, lead, align = 'left' }) {
  return (
    <div style={{ textAlign: align, maxWidth: align === 'center' ? 820 : 760,
      margin: align === 'center' ? '0 auto' : '0' }}>
      {kicker && (
        <div style={{ fontSize: 12, fontWeight: 600, letterSpacing: '0.08em',
          textTransform: 'uppercase', color: 'var(--accent-dark, #1846B0)' }}>{kicker}</div>
      )}
      <h2 style={{ margin: '14px 0 16px', fontSize: 44, fontWeight: 700,
        letterSpacing: '-0.03em', lineHeight: 1.05, color: '#0B1220' }}>{title}</h2>
      {lead && (
        <p style={{ margin: 0, fontSize: 17.5, lineHeight: 1.55, color: '#475467',
          letterSpacing: '-0.005em' }}>{lead}</p>
      )}
    </div>
  );
}

// ——— Stats strip
function StatsStrip({ items }) {
  return (
    <div style={{ display: 'grid', gridTemplateColumns: `repeat(${items.length}, 1fr)`,
      gap: 0, border: '1px solid #eaecf0', borderRadius: 16, overflow: 'hidden',
      background: 'linear-gradient(180deg, #fff 0%, #fafbfc 100%)' }}>
      {items.map((it, i) => (
        <div key={i} style={{ padding: '28px 28px',
          borderLeft: i > 0 ? '1px solid #eaecf0' : 'none' }}>
          <div style={{ fontSize: 11, fontWeight: 600, letterSpacing: '0.08em',
            textTransform: 'uppercase', color: 'var(--accent-dark, #1846B0)' }}>{it.label}</div>
          <div style={{ fontSize: 40, fontWeight: 700, letterSpacing: '-0.03em',
            color: '#0B1220', marginTop: 10, fontVariantNumeric: 'tabular-nums' }}>{it.value}</div>
          {it.note && (
            <div style={{ fontSize: 13, color: '#667085', marginTop: 6 }}>{it.note}</div>
          )}
        </div>
      ))}
    </div>
  );
}

// ——— Whats included grid
function IncludedGrid({ items }) {
  return (
    <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16 }}>
      {items.map((it, i) => (
        <div key={i} className="lift" style={{ padding: 24, background: '#fff',
          border: '1px solid #eaecf0', borderRadius: 14 }}>
          <div style={{ width: 40, height: 40, borderRadius: 10,
            background: 'var(--accent-soft, #EFF6FF)', color: 'var(--accent-dark, #1846B0)',
            display: 'grid', placeItems: 'center', marginBottom: 16 }}>
            <Icon name={it.icon} size={20}/>
          </div>
          <div style={{ fontSize: 16, fontWeight: 700, color: '#0B1220',
            letterSpacing: '-0.015em', marginBottom: 6 }}>{it.title}</div>
          <div style={{ fontSize: 13.5, lineHeight: 1.55, color: '#667085' }}>{it.desc}</div>
        </div>
      ))}
    </div>
  );
}

// ——— How it works numbered steps
function HowItWorks({ steps }) {
  return (
    <div style={{ display: 'grid', gridTemplateColumns: `repeat(${steps.length}, 1fr)`,
      gap: 0, position: 'relative' }}>
      {/* connector line */}
      <div aria-hidden style={{ position: 'absolute', top: 24, left: `${100/(steps.length*2)}%`,
        right: `${100/(steps.length*2)}%`, height: 1, borderTop: '1px dashed #d0d5dd' }}/>
      {steps.map((s, i) => (
        <div key={i} style={{ padding: '0 20px', textAlign: 'center', position: 'relative' }}>
          <div style={{ width: 48, height: 48, borderRadius: 9999,
            background: 'var(--accent-dark, #1846B0)', color: '#fff',
            display: 'grid', placeItems: 'center', margin: '0 auto',
            fontFamily: 'JetBrains Mono, monospace', fontSize: 14, fontWeight: 700,
            letterSpacing: '0.02em',
            boxShadow: '0 10px 20px -8px rgba(30,87,214,0.3), inset 0 1px 0 rgba(255,255,255,0.2)',
            position: 'relative', zIndex: 1 }}>
            {String(i + 1).padStart(2, '0')}
          </div>
          <div style={{ fontSize: 16, fontWeight: 700, color: '#0B1220',
            letterSpacing: '-0.015em', marginTop: 20 }}>{s.title}</div>
          <div style={{ fontSize: 13.5, lineHeight: 1.55, color: '#667085',
            marginTop: 8, maxWidth: 220, marginLeft: 'auto', marginRight: 'auto' }}>{s.desc}</div>
        </div>
      ))}
    </div>
  );
}

// ——— Customer quote
function CustomerQuote({ quote, author, title, company, logo, metric }) {
  return (
    <div style={{ position: 'relative',
      background: 'linear-gradient(180deg, #fff 0%, var(--accent-soft, #EFF6FF) 100%)',
      border: '1px solid #eaecf0', borderRadius: 20, padding: '48px 56px',
      display: 'grid', gridTemplateColumns: '1.4fr 0.8fr', gap: 48, alignItems: 'center' }}>
      <div>
        <div style={{ fontSize: 72, lineHeight: 0.8, color: 'var(--accent-dark, #1846B0)',
          opacity: 0.3, fontFamily: 'Georgia, serif' }}>“</div>
        <p style={{ margin: '8px 0 28px', fontSize: 22, lineHeight: 1.4,
          color: '#0B1220', letterSpacing: '-0.015em', fontWeight: 500 }}>{quote}</p>
        <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
          <div style={{ width: 44, height: 44, borderRadius: 9999,
            background: 'var(--accent-dark, #1846B0)', color: '#fff',
            display: 'grid', placeItems: 'center', fontWeight: 700, fontSize: 14 }}>
            {(author || '').split(' ').map(n => n[0]).slice(0, 2).join('')}
          </div>
          <div>
            <div style={{ fontSize: 14, fontWeight: 700, color: '#0B1220' }}>{author}</div>
            <div style={{ fontSize: 13, color: '#667085' }}>{title} · {company}</div>
          </div>
        </div>
      </div>
      {metric && (
        <div style={{ textAlign: 'center', padding: 28, background: '#fff',
          borderRadius: 16, border: '1px solid #eaecf0' }}>
          <div style={{ fontSize: 48, fontWeight: 700, letterSpacing: '-0.03em',
            color: 'var(--accent-dark, #1846B0)', fontVariantNumeric: 'tabular-nums' }}>
            {metric.value}
          </div>
          <div style={{ fontSize: 13, color: '#475467', marginTop: 8,
            letterSpacing: '-0.005em' }}>{metric.label}</div>
        </div>
      )}
    </div>
  );
}

// ——— FAQ accordion
function FAQ({ items }) {
  const [open, setOpen] = useStateSp(null);
  return (
    <div style={{ border: '1px solid #eaecf0', borderRadius: 16, overflow: 'hidden',
      background: '#fff' }}>
      {items.map((it, i) => (
        <div key={i} style={{ borderTop: i > 0 ? '1px solid #eaecf0' : 'none' }}>
          <button onClick={() => setOpen(open === i ? null : i)}
            style={{ width: '100%', padding: '22px 28px', background: 'transparent',
              border: 0, cursor: 'pointer', display: 'flex', alignItems: 'center',
              justifyContent: 'space-between', gap: 24, textAlign: 'left',
              fontFamily: 'inherit' }}>
            <span style={{ fontSize: 16, fontWeight: 600, color: '#0B1220',
              letterSpacing: '-0.01em' }}>{it.q}</span>
            <span style={{ width: 30, height: 30, borderRadius: 9999,
              background: open === i ? 'var(--accent-dark, #1846B0)' : '#f2f4f7',
              color: open === i ? '#fff' : '#475467',
              display: 'grid', placeItems: 'center', flexShrink: 0,
              transition: 'all 200ms' }}>
              <Icon name={open === i ? 'x' : 'plus'} size={14}/>
            </span>
          </button>
          {open === i && (
            <div style={{ padding: '0 28px 24px', fontSize: 15, color: '#475467',
              lineHeight: 1.6, letterSpacing: '-0.005em' }}>{it.a}</div>
          )}
        </div>
      ))}
    </div>
  );
}

// ——— Related services
function RelatedServices({ currentSlug, relatedSlugs }) {
  const i18n = window.__useI18n();
  const t = i18n.t;
  const H = window.SERVICES_HELPERS || {};
  const byS = {};
  window.SERVICES_DATA.services.forEach(s => { byS[s.slug] = s; });
  const related = (relatedSlugs || []).map(sl => byS[sl]).filter(Boolean);
  if (!related.length) return null;
  return (
    <div>
      <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between',
        marginBottom: 28 }}>
        <div>
          <div style={{ fontSize: 12, fontWeight: 600, letterSpacing: '0.08em',
            textTransform: 'uppercase', color: 'var(--accent-dark, #1846B0)' }}>{t('shell.related.eyebrow')}</div>
          <h3 style={{ margin: '10px 0 0', fontSize: 28, fontWeight: 700,
            letterSpacing: '-0.02em', color: '#0B1220' }}>{t('shell.related.title')}</h3>
        </div>
        <a href="index.html" style={{ fontSize: 13, fontWeight: 600,
          color: 'var(--accent-dark, #1846B0)', textDecoration: 'none',
          display: 'inline-flex', alignItems: 'center', gap: 6 }}>
          {t('shell.related.full')} <Icon name="arrowRight" size={13}/>
        </a>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 16 }}>
        {related.slice(0, 4).map(s => (
          <a key={s.slug} href={`${s.slug}.html`} className="lift"
            style={{ padding: 22, background: '#fff', border: '1px solid #eaecf0',
              borderRadius: 14, textDecoration: 'none', color: 'inherit',
              display: 'flex', flexDirection: 'column', minHeight: 170 }}>
            <div style={{ width: 36, height: 36, borderRadius: 9,
              background: 'var(--accent-soft, #EFF6FF)', color: 'var(--accent-dark, #1846B0)',
              display: 'grid', placeItems: 'center', marginBottom: 14 }}>
              <Icon name={s.icon} size={18}/>
            </div>
            <div style={{ fontSize: 15, fontWeight: 700, color: '#0B1220',
              letterSpacing: '-0.015em', marginBottom: 6 }}>{H.svcName ? H.svcName(s) : s.name}</div>
            <div style={{ fontSize: 13, lineHeight: 1.5, color: '#667085',
              flex: 1 }}>{H.svcOne ? H.svcOne(s) : s.one}</div>
            <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6,
              marginTop: 14, fontSize: 12, fontWeight: 600,
              color: 'var(--accent-dark, #1846B0)' }}>
              {t('shell.related.learn')} <Icon name="arrowRight" size={12}/>
            </div>
          </a>
        ))}
      </div>
    </div>
  );
}

// ——— Division CTA block (footer-style, customized per division)
function DivisionCTA({ divisionId }) {
  const i18n = window.__useI18n();
  const t = i18n.t;
  const H = window.SERVICES_HELPERS || {};
  const div = window.SERVICES_DATA.divisions.find(d => d.id === divisionId);
  if (!div) return null;
  const tt = (key, fallback) => key && t ? t(key) : fallback;
  const ctaKicker    = tt(div.ctaKickerKey,    div.ctaKicker);
  const ctaTitle     = tt(div.ctaTitleKey,     div.ctaTitle);
  const ctaPrimary   = tt(div.ctaPrimaryKey,   div.ctaPrimary);
  const ctaSecondary = tt(div.ctaSecondaryKey, div.ctaSecondary);
  const bgByDiv = {
    logistics:   'linear-gradient(135deg, #0B1220 0%, #1846B0 100%)',
    fulfillment: 'linear-gradient(135deg, #1E1B4B 0%, #4F46E5 100%)',
    trade:       'linear-gradient(135deg, #1A1208 0%, #92400E 100%)',
  };
  // Per-page override (e.g. Replenishment uses AB Group blue, not fulfillment indigo)
  const ctaBg = window.__PAGE_CTA_BG_OVERRIDE || bgByDiv[divisionId] || bgByDiv.logistics;
  return (
    <section style={{ background: ctaBg,
      color: '#fff', position: 'relative', overflow: 'hidden' }}>
      <div aria-hidden style={{ position: 'absolute', top: -200, right: -200,
        width: 600, height: 600, borderRadius: '50%', filter: 'blur(120px)',
        background: 'rgba(255,255,255,0.08)' }}/>
      <div style={{ position: 'relative', maxWidth: 1600, margin: '0 auto',
        padding: '96px 64px', display: 'grid', gridTemplateColumns: '1.4fr 1fr',
        gap: 64, alignItems: 'center' }}>
        <div>
          <div style={{ fontSize: 12, fontWeight: 600, letterSpacing: '0.08em',
            textTransform: 'uppercase', color: 'rgba(255,255,255,0.6)' }}>{ctaKicker}</div>
          <h2 style={{ margin: '16px 0 20px', fontSize: 52, fontWeight: 700,
            letterSpacing: '-0.035em', lineHeight: 1.05 }}>{ctaTitle}</h2>
          <div style={{ display: 'flex', gap: 12, marginTop: 28 }}>
            <button onClick={() => window.__abgsCTA && window.__abgsCTA.openQuote(
              'division-cta-quote',
              { svc: window.__SERVICE_PAGE_SLUG }
            )}
              style={{ padding: '14px 22px', background: '#fff', color: '#0B1220',
              border: 0, borderRadius: 12, fontFamily: 'inherit', fontSize: 15,
              fontWeight: 600, cursor: 'pointer', display: 'inline-flex',
              alignItems: 'center', gap: 10 }}>
              {ctaPrimary}
              <Icon name="arrowRight" size={14}/>
            </button>
            <button onClick={() => {
              const intent = divisionId === 'logistics' ? 'logistics'
                : divisionId === 'fulfillment' ? 'sales'
                : divisionId === 'trade' ? 'compliance'
                : 'specialist';
              const topic = (H.divLabel ? H.divLabel(div) : div.label) || null;
              window.__abgsCTA && window.__abgsCTA.openContact('division-cta-talk',
                { intent, topic });
            }}
              style={{ padding: '14px 22px', background: 'rgba(255,255,255,0.1)',
              color: '#fff', border: '1px solid rgba(255,255,255,0.22)', borderRadius: 12,
              fontFamily: 'inherit', fontSize: 15, fontWeight: 600, cursor: 'pointer' }}>
              {ctaSecondary}
            </button>
          </div>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
          {[
            ['2,000+', t('shell.cta.shippers')],
            ['40+',    t('shell.cta.partners')],
            ['140',    t('shell.cta.countries')],
            ['99.8%',  t('shell.cta.ontime')],
          ].map(([v, l]) => (
            <div key={l} style={{ padding: 20, background: 'rgba(255,255,255,0.06)',
              border: '1px solid rgba(255,255,255,0.12)', borderRadius: 12 }}>
              <div style={{ fontSize: 30, fontWeight: 700, letterSpacing: '-0.02em',
                color: '#fff', fontVariantNumeric: 'tabular-nums' }}>{v}</div>
              <div style={{ fontSize: 12, color: 'rgba(255,255,255,0.65)',
                marginTop: 6, letterSpacing: '-0.005em' }}>{l}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ——— Page footer
function ServiceFooter() {
  const i18n = window.__useI18n();
  const t = i18n.t;
  return (
    <footer style={{ background: '#0B1220', color: 'rgba(255,255,255,0.7)',
      padding: '56px 64px 28px', fontSize: 13 }}>
      <div style={{ maxWidth: 1600, margin: '0 auto',
        display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr', gap: 48 }}>
        <div>
          <BrandLogo size={32} invert/>
          <p style={{ margin: '16px 0 0', maxWidth: 320, lineHeight: 1.55 }}>
            {t('sfooter.tagline')}
          </p>
        </div>
        <div>
          <div style={{ fontSize: 11, fontWeight: 700, letterSpacing: '0.1em',
            textTransform: 'uppercase', color: '#fff', marginBottom: 14 }}>{t('sfooter.col.services')}</div>
          <a href="index.html"          style={footerLink}>{t('sfooter.svc.all')}</a>
          <a href="ocean-freight.html"  style={footerLink}>{t('sfooter.svc.ocean')}</a>
          <a href="air-freight.html"    style={footerLink}>{t('sfooter.svc.air')}</a>
          <a href="customs-brokerage.html" style={footerLink}>{t('sfooter.svc.customs')}</a>
        </div>
        <div>
          <div style={{ fontSize: 11, fontWeight: 700, letterSpacing: '0.1em',
            textTransform: 'uppercase', color: '#fff', marginBottom: 14 }}>{t('sfooter.col.company')}</div>
          <a href="about.html" style={footerLink}>{t('sfooter.co.about')}</a>
          <a href="#" style={footerLink}>{t('sfooter.co.customers')}</a>
          <a href="#" style={footerLink}>{t('sfooter.co.press')}</a>
          <a href="#" style={footerLink}>{t('sfooter.co.careers')}</a>
        </div>
      </div>
      <div style={{ maxWidth: 1600, margin: '48px auto 0', paddingTop: 20,
        borderTop: '1px solid rgba(255,255,255,0.1)', display: 'flex',
        justifyContent: 'space-between', fontSize: 12, color: 'rgba(255,255,255,0.5)' }}>
        <div>{t('sfooter.copyright')}</div>
        <div style={{ display: 'flex', gap: 24 }}>
          <a href="#" style={{ color: 'inherit', textDecoration: 'none' }}>{t('sfooter.privacy')}</a>
          <a href="#" style={{ color: 'inherit', textDecoration: 'none' }}>{t('sfooter.terms')}</a>
          <a href="#" style={{ color: 'inherit', textDecoration: 'none' }}>{t('sfooter.cookies')}</a>
        </div>
      </div>
    </footer>
  );
}
const footerLink = { display: 'block', color: 'rgba(255,255,255,0.7)',
  textDecoration: 'none', padding: '4px 0', fontSize: 13 };

Object.assign(window, {
  ServiceNav, Breadcrumbs, SectionHeader, StatsStrip, IncludedGrid,
  HowItWorks, CustomerQuote, FAQ, RelatedServices, DivisionCTA,
  ServiceFooter, applyAccent, SP_ACCENTS,
});
