/* ============================================
   SITE HEADER + MEGA MENU

   Modelled on befreeltd.com's header: logo left, a white pill that holds
   the primary navigation in the centre, a globe (country) button and a
   pill-shaped "Contact Us" button on the right. Dropdowns open as white
   16px-radius panels below the pill.

   Measurements taken from befreeltd.com's own stylesheet where available:
     header height 94px · content width 1400px · pill 60px high
     nav text Noto Sans · active underline #3230E0
     panel radius 16px · panel padding 30px
     icon tiles #5A6C831A · card border warm cream · Contact Us Poppins pill
   ============================================ */

:root {
  --sh-h: 94px;
  --sh-text: #101010;
  --sh-hover: #0c1d39;
  --sh-primary: #3230e0;
  --sh-primary-hover: #262184;
  --sh-muted: rgba(2, 22, 38, 0.7);
  --sh-tile: rgba(90, 108, 131, 0.1);
  --sh-line: rgba(16, 16, 16, 0.06);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(254, 252, 250, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sh-line);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* On the homepage the header floats over the hero background. */
.site-header--overlay {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(12, 32, 57, 0.06);
}

.sh-inner {
  position: relative;
  max-width: 1400px;
  height: var(--sh-h);
  margin: 0 auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ---------- Logo ---------- */
.sh-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #230d4f;
  text-decoration: none;
}

/* The horizontal logo (mark beside the wordmark) from images/logo-h-dark */
.sh-logo img { display: block; width: auto; height: 64px; }

/* ---------- Centre pill ---------- */
.sh-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.sh-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: min(818px, 100%);
  height: 60px;
  margin: 0;
  padding: 0 22px;
  list-style: none;
  background: #ffffff;
  border: 1px solid rgba(16, 16, 16, 0.04);
  border-radius: 100px;
  box-shadow: 0 1px 2px rgba(12, 32, 57, 0.03);
}

.sh-item {
  position: static;
  display: flex;
  height: 100%;
}

.sh-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: none;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 17.5px;
  font-weight: 400;
  line-height: 30px;
  color: var(--sh-text);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.sh-link:hover { color: var(--sh-hover); }

.sh-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.6;
  fill: none;
  transition: transform 0.2s ease;
}

/* Underline for the open or current section - Befree's 1px primary rule,
   drawn at 2px so it holds on non-retina screens. */
.sh-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--sh-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.sh-item:hover > .sh-link::after,
.sh-item.is-open > .sh-link::after,
.sh-link[aria-current="true"]::after {
  transform: scaleX(1);
}

.sh-item:hover > .sh-link svg,
.sh-item.is-open > .sh-link svg {
  transform: rotate(180deg);
}

/* ---------- Right-hand actions ---------- */
.sh-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.sh-globe-item {
  position: relative;
  display: flex;
}

.sh-globe {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(90, 108, 131, 0.1);
  color: #7c8798;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sh-globe:hover,
.sh-globe-item.is-open .sh-globe {
  background: rgba(50, 48, 224, 0.1);
  color: var(--sh-primary);
}

.sh-globe svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.sh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 25px;
  border-radius: 100px;
  background: var(--sh-primary);
  color: #ffffff;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.sh-cta:hover { background: var(--sh-primary-hover); color: #ffffff; }

/* ---------- Dropdown panels ---------- */
.sh-panel {
  position: absolute;
  top: calc((var(--sh-h) + 60px) / 2 + 5px);
  left: 30px;
  right: 30px;
  z-index: 5;
  padding: 30px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(242, 242, 242, 1), 0 28px 60px -18px rgba(12, 32, 57, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  text-align: left;
  cursor: default;
}

/* An invisible bridge over the gap between pill and panel, so the pointer
   can travel down without the menu closing. */
.sh-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}

.sh-item:hover > .sh-panel,
.sh-item.is-open > .sh-panel,
.sh-item:has(:focus-visible) > .sh-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.sh-panel--sm {
  left: 50%;
  right: auto;
  width: min(760px, calc(100% - 40px));
  transform: translate(-50%, 8px);
}

.sh-item:hover > .sh-panel--sm,
.sh-item.is-open > .sh-panel--sm,
.sh-item:has(:focus-visible) > .sh-panel--sm {
  transform: translate(-50%, 0);
}

.sh-panel__label {
  margin: 0 0 18px;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--sh-text);
}

/* Services mega panel: link grid left, country cards right */
.sh-mega {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 363px;
  gap: 50px;
}

.sh-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sh-links--one { grid-template-columns: minmax(0, 1fr); }

.sh-links a {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px;
  margin: -8px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.sh-links a:hover { background: #f7f8fc; }

.sh-tile {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--sh-tile);
  color: var(--sh-primary);
  transition: background-color 0.18s ease;
}

.sh-links a:hover .sh-tile { background: rgba(50, 48, 224, 0.1); }

.sh-tile svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sh-links strong {
  display: block;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.35;
  color: #0c2039;
}

.sh-links span {
  display: block;
  margin-top: 3px;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--sh-muted);
}

/* "Need a custom engagement?" box */
.sh-custom {
  display: grid;
  grid-template-columns: 64px minmax(0, 182px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 26px;
  padding: 22px 28px;
  border: 1px solid #bfe0ef;
  border-radius: 16px;
  background: #f4fafd;
}

.sh-custom__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
  color: var(--sh-primary);
}

.sh-custom__icon svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sh-custom__title {
  margin: 0;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
  color: var(--sh-text);
}

.sh-custom__text {
  margin: 0;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 30px;
  color: var(--sh-text);
}

.sh-custom__btn {
  display: inline-flex;
  padding: 7px 30px;
  border-radius: 100px;
  background: var(--sh-primary);
  color: #ffffff;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 25px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.sh-custom__btn:hover { background: var(--sh-primary-hover); color: #ffffff; }

/* Country cards ("Where We Work") */
.sh-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sh-cards a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 127px;
  padding: 18px 12px;
  border: 1px solid #efe6dd;
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.sh-cards a:hover {
  border-color: #cfccf7;
  box-shadow: 0 10px 24px -14px rgba(50, 48, 224, 0.35);
  transform: translateY(-2px);
}

.sh-cards svg {
  width: 60px;
  height: 40px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 14px -6px rgba(12, 32, 57, 0.3);
}

.sh-cards span {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  color: var(--sh-text);
  text-align: center;
}

/* Globe (country) panel */
.sh-panel--globe {
  top: calc(100% + 14px);
  left: auto;
  right: -8px;
  width: 280px;
  padding: 14px;
}

.sh-panel--globe .sh-panel__label { margin: 4px 8px 10px; font-size: 14px; color: var(--sh-muted); }

.sh-globe-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.sh-globe-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 15px;
  color: var(--sh-text);
  text-decoration: none;
}

.sh-globe-list a:hover { background: #f7f8fc; color: var(--sh-primary); }

.sh-globe-list svg { width: 26px; height: 17px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

/* ---------- Hamburger + mobile panel ---------- */
.sh-burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(12, 32, 57, 0.08);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.sh-burger span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--sh-text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.sh-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sh-burger.active span:nth-child(2) { opacity: 0; }
.sh-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sh-mobile {
  position: fixed;
  top: var(--sh-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  overflow-y: auto;
  padding: 8px 20px 32px;
  background: #ffffff;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.sh-mobile.active {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}

.sh-mobile details { border-bottom: 1px solid #eef0f4; }

.sh-mobile summary,
.sh-mobile__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--sh-text);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.sh-mobile summary::-webkit-details-marker { display: none; }

.sh-mobile summary svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  transition: transform 0.2s ease;
}

.sh-mobile details[open] summary svg { transform: rotate(180deg); }

.sh-mobile__link { border-bottom: 1px solid #eef0f4; }

.sh-mobile ul {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.sh-mobile li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 15.5px;
  color: #33415a;
  text-decoration: none;
}

.sh-mobile li a:hover { background: #f7f8fc; color: var(--sh-primary); }

.sh-mobile li svg { width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

.sh-mobile__ctas {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.sh-mobile__ctas a {
  display: flex;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 100px;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 16px;
  text-decoration: none;
}

.sh-mobile__ctas .is-primary { background: var(--sh-primary); color: #ffffff; }
.sh-mobile__ctas .is-ghost { border: 1px solid #d9dcef; color: var(--sh-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .sh-menu { min-width: 0; padding: 0 12px; }
  .sh-link { padding: 0 11px; font-size: 16px; }
  .sh-actions { gap: 12px; }
}

@media (max-width: 1140px) {
  :root { --sh-h: 72px; }
  .sh-nav,
  .sh-globe-item { display: none; }
  .sh-inner { justify-content: space-between; }
  .sh-burger { display: flex; }
}

@media (max-width: 560px) {
  .sh-cta { display: none; }
  .sh-logo img { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .sh-link::after,
  .sh-panel,
  .sh-mobile,
  .sh-cards a,
  .sh-burger span { transition: none; }
}

@media print {
  .site-header,
  .sh-mobile { display: none; }
}
