/* Legacy main.css gives .site-branding width:100%. Keep the logo to its
   intrinsic size in every WordPress shell, including non-home routes. */
#masthead .site-branding.speego-branding {
  width: auto !important;
  flex: 0 0 auto !important;
}

/* Contact details must fit beside Policy without wrapping or touching it. */
#masthead .speego-header-topbar-inner {
  gap: 16px !important;
  min-width: 0;
}
#masthead .speego-header-contact {
  min-width: 0;
  gap: 12px !important;
}
#masthead .speego-header-contact-item,
#masthead .speego-header-contact-val {
  white-space: nowrap;
  font-size: 12px !important;
}
#masthead .speego-topbar-policy { flex: 0 0 auto; }

/* Shared click state must agree with the dropdown selector on every template. */
#masthead .speego-policy-dropdown {
  display: none !important;
  top: var(--speego-header-dropdown-top, calc(100% + 8px)) !important;
}
#masthead .speego-policy-menu.is-open .speego-policy-dropdown { display: block !important; }
#masthead .speego-policy-dropdown a { min-height: 44px; }
#masthead .speego-header-contact-popover-link {
  display: none !important;
  top: var(--speego-header-dropdown-top, calc(100% + 8px)) !important;
  width: max-content !important;
  max-width: calc(100vw - 32px) !important;
  min-height: 44px;
  box-sizing: border-box !important;
  padding: 8px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  transition: none !important;
}
#masthead .speego-header-contact-popover[open] .speego-header-contact-popover-link {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
}
/* Hide closed positioned links even when a touch browser retains focus. */
#masthead .speego-header-contact-popover:not([open]) > .speego-header-contact-popover-link {
  display: none !important;
}

:root {
  --speego-header-expanded-height: 108px;
}
@media (max-width: 991px) {
  :root {
    --speego-header-expanded-height: 96px;
  }
}

/* All non-home pages start directly beneath the fixed header. */
body:not(.home):not(:has(#home)) #app-main,
#app-main:not(:has(#home)):not(:has(.speego-hero-section)),
body:has(#app-main #speego-consultation-form):not(:has(#home)) #app-main,
body:has(.page-about) #app-main,
body:has(.page-sourcing) #app-main,
body:has(.page-shipping-routes) #app-main,
body:has(.page-fulfillment) #app-main,
body:has(.page-import-export) #app-main,
body:has([data-nav="knowledge"]) #app-main,
body[data-route-nav="knowledge"] #app-main,
body.speego-knowledge-single #app-main,
body.single-knowledge #app-main,
body.tax-knowledge_category #app-main {
  padding-top: var(--speego-header-expanded-height, 108px) !important;
}

/* Use the same logo size across the imported page templates. */
#masthead .speego-branding .speego-logo-img {
  height: 38px !important;
  max-height: 42px !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  object-fit: contain !important;
}
@media (min-width: 768px) and (max-width: 991px) {
  #masthead .speego-branding .speego-logo-img {
    height: 34px !important;
    max-height: 36px !important;
    width: auto !important;
    max-width: none !important;
  }
}
@media (max-width: 767px) {
  #masthead .speego-branding .speego-logo-img {
    height: 30px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 600px) {
  #masthead .speego-header-topbar { height: 32px !important; }
  body.is-header-scrolled #masthead .speego-header-topbar { margin-top: -32px !important; }
  #masthead .speego-header-topbar-inner { padding: 0 16px !important; }
  #masthead .speego-header-contact-val,
  #masthead .speego-header-contact-sep { display: none !important; }
  #masthead .speego-policy-toggle { min-height: 28px; font-size: 11px !important; }
}

@media (max-width: 991px) {
  /* Touch navigation uses the click state alone. Closed menus occupy no space;
     hover/focus cannot leave an invisible submenu in the mobile layout. */
  #masthead .speego-nav-has-sub > .speego-nav-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    /* Touch Safari retains :hover after a tap. The desktop -50% translation
       must not move these in-flow rows outside the scrollable mobile menu. */
    transform: none !important;
    transition: none !important;
  }
  #masthead .speego-nav-has-sub:not(.is-open) > .speego-nav-dropdown {
    display: none !important;
    pointer-events: none !important;
  }
  #masthead .speego-nav-has-sub.is-open > .speego-nav-dropdown {
    display: block !important;
    pointer-events: auto !important;
  }
  #masthead .speego-nav-has-sub .speego-nav-dropdown-link {
    opacity: 1 !important;
    visibility: visible !important;
    color: #04243d !important;
    -webkit-text-fill-color: #04243d !important;
    transform: none !important;
  }
  #masthead .speego-nav-has-sub .speego-nav-dropdown-link:hover,
  #masthead .speego-nav-has-sub .speego-nav-dropdown-link:focus,
  #masthead .speego-nav-has-sub .speego-nav-dropdown-link:active,
  #masthead .speego-nav-has-sub .speego-nav-dropdown-link.active {
    color: #FF6A00 !important;
    -webkit-text-fill-color: #FF6A00 !important;
    background-color: #FFF4ED !important;
  }
}

@media (min-width: 601px) and (max-width: 850px) {
  #masthead .speego-header-contact { gap: 8px !important; }
  #masthead .speego-header-contact-item,
  #masthead .speego-header-contact-val { font-size: 11px !important; }
}

/* Shared shell footer, including the standalone Sourcing templates. */
@media (max-width: 768px) {
  #colophon .speego-footer-top {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 28px 16px !important;
  }
  #colophon .speego-footer-top > .speego-footer-brand {
    grid-column: 1 / -1;
  }
  #colophon .speego-footer-top > div {
    min-width: 0;
  }
}

/* Fit all seven labels, language switcher and quote button on small laptops. */
@media (min-width: 992px) and (max-width: 1199px) {
  #masthead .speego-header-navbar-inner {
    padding-left: 20px !important;
    padding-right: 20px !important;
    gap: 10px !important;
  }
  #masthead .speego-branding .speego-logo-img {
    height: 34px !important;
    max-height: 36px !important;
    width: auto !important;
    max-width: none !important;
  }
  #masthead .speego-nav-menu { gap: 8px !important; }
  #masthead .speego-nav-link { font-size: 12px !important; }
  #masthead .speego-header-cta-wrap { gap: 8px !important; }
  #masthead .speego-header-quote-btn {
    padding-left: 14px !important;
    padding-right: 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
}

/* Compact language codes in the shared header dropdown. */
#masthead .speego-lang-dropdown {
  min-width: 128px !important;
  padding: 4px !important;
}
#masthead .speego-lang-option {
  min-height: 32px !important;
  padding: 6px 10px !important;
  gap: 8px !important;
  font-size: 12px !important;
  line-height: 18px !important;
}
#masthead .speego-lang-option .speego-lang-flag {
  width: 16px !important;
  height: 12px !important;
}
#masthead .speego-lang-option.active::after {
  padding-left: 10px;
  font-size: 12px;
}
@media (max-width: 991px) {
  #masthead .speego-lang-option { min-height: 44px !important; }
}

/* Footer social icons (Elementor snippet) under the tagline. */
#colophon .speego-footer-social,
.speego-site-footer .speego-footer-social {
  display: block !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

#colophon .speego-footer-social .elementor,
#colophon .speego-footer-social .elementor-section,
#colophon .speego-footer-social .elementor-container,
#colophon .speego-footer-social .elementor-column,
#colophon .speego-footer-social .elementor-widget-wrap,
#colophon .speego-footer-social .elementor-widget-wrap.elementor-element-populated,
#colophon .speego-footer-social .elementor-widget,
#colophon .speego-footer-social .elementor-widget-social-icons,
#colophon .speego-footer-social .elementor-widget-container,
.speego-site-footer .speego-footer-social .elementor,
.speego-site-footer .speego-footer-social .elementor-section,
.speego-site-footer .speego-footer-social .elementor-container,
.speego-site-footer .speego-footer-social .elementor-column,
.speego-site-footer .speego-footer-social .elementor-widget-wrap,
.speego-site-footer .speego-footer-social .elementor-widget-wrap.elementor-element-populated,
.speego-site-footer .speego-footer-social .elementor-widget,
.speego-site-footer .speego-footer-social .elementor-widget-social-icons,
.speego-site-footer .speego-footer-social .elementor-widget-container {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#colophon .speego-footer-social .elementor-social-icons-wrapper,
.speego-site-footer .speego-footer-social .elementor-social-icons-wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
}

#colophon .speego-footer-social .elementor-grid-item,
.speego-site-footer .speego-footer-social .elementor-grid-item {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
}

#colophon .speego-footer-social .elementor-icon.elementor-social-icon,
.speego-site-footer .speego-footer-social .elementor-icon.elementor-social-icon {
  width: 36px !important;
  height: 36px !important;
  font-size: 15px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: transform 0.2s ease, opacity 0.2s ease !important;
  box-sizing: border-box !important;
}

#colophon .speego-footer-social .elementor-icon.elementor-social-icon:hover,
.speego-site-footer .speego-footer-social .elementor-icon.elementor-social-icon:hover {
  transform: translateY(-2px) !important;
  opacity: 0.9 !important;
}

#colophon .speego-footer-social .elementor-social-icon svg,
.speego-site-footer .speego-footer-social .elementor-social-icon svg {
  width: 15px !important;
  height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  display: block !important;
  fill: currentColor !important;
}

/* Ensure footer and containers span full width with correct link formatting */
#footer-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #041a2d !important;
  display: block !important;
  box-sizing: border-box !important;
  clear: both !important;
}

#colophon,
.site-footer,
.speego-site-footer {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
  background-color: #041a2d !important;
  box-sizing: border-box !important;
  clear: both !important;
}

#colophon .speego-footer-links,
.speego-site-footer .speego-footer-links {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  font-size: 14px !important;
  line-height: 2.15 !important;
  color: #94a3b8 !important;
}

#colophon .speego-footer-links li,
.speego-site-footer .speego-footer-links li {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#colophon .speego-footer-links li a,
.speego-site-footer .speego-footer-links li a {
  color: #94a3b8 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  display: inline !important;
  transition: color 0.15s ease !important;
  white-space: normal !important;
}

#colophon .speego-footer-links li a:hover,
.speego-site-footer .speego-footer-links li a:hover {
  color: #FF6A00 !important;
  padding-left: 0 !important;
}
