/* Supermaths mega-menu header */
html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

#smx-header,
#smx-header * {
  box-sizing: border-box;
}

#smx-header {
  --green: #70ad2b;
  --green-dark: #47851b;
  --navy: #182747;
  --pink: #e94e78;
  --orange: #ff9b42;
  --blue: #4b9de8;
  --purple: #9670db;
  --teal: #20a99a;
  --yellow: #ffd166;
  position: relative;
  z-index: 99990;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  color: var(--navy);
  font-family: 'Nunito Sans', sans-serif;
}

#smx-header a {
  text-decoration: none !important;
}

#smx-header button {
  font-family: inherit;
  /* Undo the old theme's global button style (padding: 0 30px; height: 40px; teal bg) */
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

#smx-header .smx-mobile-toggle,
#smx-header .smx-mobile-toggle:hover,
#smx-header .smx-mobile-toggle:focus {
  padding: 0 !important;
  color: var(--navy) !important;
}

#smx-header .smx-mobile-toggle svg {
  display: block;
  flex: 0 0 24px;
  min-width: 24px;
  stroke: currentColor;
}

/* ================= TOP BAR ================= */

#smx-header .smx-topbar {
  position: relative;
  z-index: 20;
  color: #fff;
  background: linear-gradient(105deg, #172440 0%, #263a60 65%, #34466c 100%);
}

#smx-header .smx-top-inner {
  width: calc(100% - 48px);
  max-width: 1740px;
  min-height: 44px;
  margin: auto;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#smx-header .smx-top-left,
#smx-header .smx-top-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

#smx-header .smx-top-info {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f5f8ff;
  font-size: 12px;
  font-weight: 700;
}

#smx-header .smx-top-info svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: #a7e96b;
}

#smx-header .smx-top-btn {
  position: relative;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.07);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  white-space: nowrap;
  transition: background .25s ease, transform .25s ease;
}

#smx-header .smx-top-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.17);
  transform: translateY(-1px);
}

#smx-header .smx-top-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

/* Animated booking button */
#smx-header .smx-top-btn.smx-highlight {
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(110deg, #69aa28, #2eaa83, #70ad2b, #4c9f34);
  background-size: 240% 100%;
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 0 0 0 rgba(112,173,43,.5);
  animation: smxGradient 4s ease infinite, smxPulse 2.2s ease-out infinite;
}

#smx-header .smx-top-btn.smx-highlight::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -65%;
  width: 42%;
  height: 180%;
  transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: smxShine 3.4s ease-in-out infinite;
  pointer-events: none;
}

#smx-header .smx-top-btn.smx-highlight:hover {
  color: #fff;
  background-position: 100% 50%;
  box-shadow: 0 5px 18px rgba(85,164,51,.4);
  transform: translateY(-2px) scale(1.025);
}

@keyframes smxGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes smxPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(112,173,43,.35); }
  50% { box-shadow: 0 0 0 5px rgba(112,173,43,0); }
}

@keyframes smxShine {
  0%, 60% { left: -65%; }
  85%, 100% { left: 135%; }
}

/* ================= MAIN HEADER ================= */

#smx-header .smx-main {
  position: relative;
  z-index: 30;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e8eee1;
  box-shadow: 0 5px 22px rgba(24,39,71,.07);
}

#smx-header .smx-main-inner {
  width: calc(100% - 48px);
  max-width: 1740px;
  min-height: 94px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 23px;
}

/* LOGO */
#smx-header .smx-logo {
  flex: 0 0 190px;
  width: 190px;
  min-width: 0;
  display: flex;
  align-items: center;
}

#smx-header .smx-logo img {
  display: block;
  width: 100%;
  max-width: 190px;
  max-height: 76px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

/* ================= NAVIGATION ================= */

#smx-header .smx-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

#smx-header .smx-item {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}

#smx-header .smx-link {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--navy);
  background: transparent;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}

#smx-header .smx-link > svg:first-child {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2.2;
  transition: transform .22s ease;
}

#smx-header .smx-link:hover > svg:first-child {
  transform: translateY(-1px);
}

#smx-header .smx-arrow {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  transition: transform .22s ease;
}

/* Hover style */
#smx-header .smx-item:hover > .smx-link,
#smx-header .smx-link:hover {
  color: var(--green-dark);
  background: #f1f8e9;
  border-color: #e3efd5;
}

/* ACTIVE PAGE */
#smx-header .smx-item > .smx-link.smx-active,
#smx-header .smx-item > a.smx-link[aria-current="page"],
#smx-header .smx-item > button.smx-link.smx-active {
  color: #fff !important;
  background: linear-gradient(135deg, #70ad2b 0%, #4d9223 100%) !important;
  border-color: #65a62a !important;
  box-shadow: 0 5px 13px rgba(91,150,39,.22);
}

#smx-header .smx-item > .smx-link.smx-active > svg,
#smx-header .smx-item > a.smx-link[aria-current="page"] > svg {
  color: #fff !important;
}

#smx-header .smx-item > .smx-link.smx-active::after,
#smx-header .smx-item > a.smx-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 23%;
  right: 23%;
  bottom: -5px;
  height: 3px;
  border-radius: 9px;
  background: var(--orange);
}

#smx-header .smx-item.is-open > .smx-link {
  color: var(--green-dark);
  background: #f1f8e9;
  border-color: #dcebcf;
}

#smx-header .smx-item.is-open > .smx-link .smx-arrow {
  transform: rotate(180deg);
}

/* ================= SIMPLE SUBMENUS ================= */

#smx-header .smx-simple {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100002;
  width: 250px;
  min-width: 220px;
  padding: 9px;
  margin: 0;
  border: 1px solid #e5ecd9;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(24,39,71,.17);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

#smx-header .smx-simple a {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
  overflow-wrap: anywhere;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

#smx-header .smx-simple a:last-child {
  margin-bottom: 0;
}

#smx-header .smx-simple a:hover {
  color: var(--green-dark);
  background: #f0f8e8;
  border-color: #e2efd4;
  transform: translateX(2px);
}

#smx-header .smx-simple a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--green);
}

/* Alternate submenu icon colours */
#smx-header .smx-simple a:nth-child(3n + 2) svg {
  color: var(--pink);
}
#smx-header .smx-simple a:nth-child(3n) svg {
  color: var(--blue);
}

/* ================= ABACUS MEGA MENU ================= */

#smx-header .smx-mega {
  position: fixed;
  top: var(--smx-menu-top, 150px);
  left: 20px;
  right: 20px;
  z-index: 100001;
  width: auto;
  max-width: 1570px;
  margin: 0 auto;
  padding: 21px;
  border: 1px solid #e5ecd9;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(24,39,71,.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

#smx-header .smx-mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -25px;
  height: 25px;
}

#smx-header .smx-mega-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: stretch;
  gap: 20px;
}

#smx-header .smx-mega-main {
  min-width: 0;
}



#smx-header .smx-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#smx-header .smx-card {
  --card-color: #4b8c22;
  --card-bg: #f0f8e8;
  min-width: 0;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border: 1px solid #e2ecd5;
  border-radius: 14px;
  color: var(--navy);
  background: linear-gradient(140deg, #fff, var(--card-bg));
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

#smx-header .smx-card:nth-child(6n + 2) {
  --card-color: #cf6c24;
  --card-bg: #fff0e3;
  border-color: #f5e0ce;
}

#smx-header .smx-card:nth-child(6n + 3) {
  --card-color: #ca3e73;
  --card-bg: #fceaf2;
  border-color: #f2dbe5;
}

#smx-header .smx-card:nth-child(6n + 4) {
  --card-color: #347fc4;
  --card-bg: #eaf4ff;
  border-color: #dceaf9;
}

#smx-header .smx-card:nth-child(6n + 5) {
  --card-color: #7e61c6;
  --card-bg: #f2edff;
  border-color: #e8e0fa;
}

#smx-header .smx-card:nth-child(6n) {
  --card-color: #159789;
  --card-bg: #e7f8f5;
  border-color: #d7efeb;
}

#smx-header .smx-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-color);
  box-shadow: 0 10px 24px rgba(24,39,71,.1);
  color: var(--card-color);
}

#smx-header .smx-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  width: 100%;
}

#smx-header .smx-card-icon {
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--card-color);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.035);
}

#smx-header .smx-card-icon svg {
  width: 22px;
  height: 22px;
}

#smx-header .smx-card-title {
  min-width: 0;
  padding-top: 2px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#smx-header .smx-card-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--card-color);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 900;
}

#smx-header .smx-card-bottom svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  transition: transform .2s ease;
}

#smx-header .smx-card:hover .smx-card-bottom svg {
  transform: translateX(3px);
}

#smx-header .smx-mega-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-left: 18px;
  border-left: 1px solid #e8eddf;
  max-height: 290px;
  overflow-y: auto;
}

#smx-header .smx-side-title {
  margin: 0 0 3px;
  color: #77876a;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
}

#smx-header .smx-side {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e8eddf;
  border-radius: 11px;
  color: var(--navy);
  background: #fafcf7;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  overflow-wrap: anywhere;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

#smx-header .smx-side:nth-of-type(3n + 1) {
  background: #f0f8e8;
}
#smx-header .smx-side:nth-of-type(3n + 2) {
  background: #fff2e8;
}
#smx-header .smx-side:nth-of-type(3n) {
  background: #f3efff;
}

#smx-header .smx-side:hover {
  border-color: #b7d99b;
  transform: translateY(-2px);
  color: var(--green-dark);
}

#smx-header .smx-side svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--green);
}

/* Desktop submenu visibility */
@media (min-width: 1051px) {
  #smx-header .smx-item:hover > .smx-simple,
  #smx-header .smx-item:focus-within > .smx-simple,
  #smx-header .smx-item.is-open > .smx-simple {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  #smx-header .smx-item:hover > .smx-mega,
  #smx-header .smx-item:focus-within > .smx-mega,
  #smx-header .smx-item.is-open > .smx-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

/* ================= TABLET / SMALL DESKTOP ================= */

@media (min-width: 1051px) and (max-width: 1450px) {
  #smx-header .smx-top-inner,
  #smx-header .smx-main-inner {
    width: calc(100% - 32px);
  }

  #smx-header .smx-main-inner {
    gap: 13px;
  }

  #smx-header .smx-logo {
    flex-basis: 155px;
    width: 155px;
  }

  #smx-header .smx-logo img {
    max-width: 155px;
  }

  #smx-header .smx-nav {
    gap: 3px;
  }

  #smx-header .smx-link {
    gap: 5px;
    padding: 9px 7px;
    font-size: 15px;
  }

  #smx-header .smx-link > svg:first-child {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  #smx-header .smx-arrow {
    width: 11px;
    height: 11px;
    flex-basis: 11px;
  }
}

/* ================= MOBILE TOGGLE ================= */

#smx-header .smx-mobile-toggle {
  display: none;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce9d0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3f9ed, #e9f5dc);
  color: var(--navy);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

#smx-header .smx-mobile-toggle:hover {
  background: #e4f2d5;
  transform: translateY(-1px);
}

#smx-header .smx-mobile-toggle svg {
  width: 24px;
  height: 24px;
}

/* ================= RESPONSIVE NAV ================= */

@media (max-width: 1050px) {
  #smx-header .smx-top-inner,
  #smx-header .smx-main-inner {
    width: calc(100% - 28px);
  }

  #smx-header .smx-top-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 9px 0;
  }

  #smx-header .smx-top-left,
  #smx-header .smx-top-right {
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
  }

  #smx-header .smx-top-info {
    font-size: 11px;
  }

  #smx-header .smx-top-btn {
    padding: 6px 9px;
    font-size: 10px;
  }

  #smx-header .smx-main-inner {
    min-height: 76px;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
  }

  #smx-header .smx-logo {
    flex: 0 1 175px;
    width: 175px;
    max-width: calc(100% - 60px);
  }

  #smx-header .smx-logo img {
    max-width: 175px;
    max-height: 58px;
  }

  #smx-header .smx-mobile-toggle {
    display: inline-flex;
  }

  #smx-header .smx-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-x: hidden;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 12px 14px 18px;
    border-top: 1px solid #e8eee1;
    background: #fff;
    box-shadow: 0 18px 32px rgba(24,39,71,.15);
  }

  #smx-header .smx-nav.smx-nav-open {
    display: flex;
  }

  #smx-header .smx-item {
    width: 100%;
    flex: 0 0 auto;
    min-width: 0;
  }

  #smx-header .smx-link {
    width: 100%;
    min-height: 47px;
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid #e9eee3;
    border-radius: 10px;
    background: #fbfcf9;
    color: var(--navy);
    font-size: 15px;
    text-align: left !important;
    white-space: normal;
  }

  #smx-header .smx-link > svg:first-child {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    margin: 0;
    color: var(--green);
  }

  #smx-header .smx-link .smx-arrow {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin-left: auto;
  }

  #smx-header .smx-item > .smx-link.smx-active,
  #smx-header .smx-item > a.smx-link[aria-current="page"] {
    color: #fff !important;
    background: linear-gradient(110deg, #70ad2b, #4c9224) !important;
  }

  #smx-header .smx-item > .smx-link.smx-active > svg,
  #smx-header .smx-item > a.smx-link[aria-current="page"] > svg {
    color: #fff !important;
  }

  #smx-header .smx-simple {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: none;
    margin: 5px 0 8px;
    padding: 7px;
    border: 1px solid #e7eddc;
    border-radius: 11px;
    background: #f8fbf4;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  #smx-header .smx-item.is-open > .smx-simple {
    display: block;
  }

  #smx-header .smx-simple a {
    justify-content: flex-start;
    text-align: left;
  }

  #smx-header .smx-mega {
    position: static;
    width: 100%;
    max-width: 100%;
    display: none;
    margin: 6px 0 8px;
    padding: 13px;
    border-radius: 14px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  #smx-header .smx-mega::before {
    display: none;
  }

  #smx-header .smx-item.is-open > .smx-mega {
    display: block;
  }

  #smx-header .smx-mega-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  #smx-header .smx-mega-heading {
    font-size: 15px;
    margin-bottom: 12px;
  }

  #smx-header .smx-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #smx-header .smx-card {
    min-height: 110px;
    padding: 10px;
    gap: 9px;
  }

  #smx-header .smx-card-top {
    gap: 8px;
    flex-direction: column;
  }

  #smx-header .smx-card-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  #smx-header .smx-card-icon svg {
    width: 19px;
    height: 19px;
  }

  #smx-header .smx-card-title {
    font-size: 12px;
  }

  #smx-header .smx-card-bottom {
    font-size: 10px;
  }

  #smx-header .smx-mega-side {
    padding: 13px 0 0;
    border-top: 1px solid #e8eddf;
    border-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #smx-header .smx-side-title {
    grid-column: 1 / -1;
  }

  #smx-header .smx-side {
    padding: 10px;
    gap: 8px;
    font-size: 11px;
  }
}

/* SMALL MOBILE */
@media (max-width: 600px) {
  #smx-header .smx-top-inner,
  #smx-header .smx-main-inner {
    width: calc(100% - 24px);
  }

  #smx-header .smx-top-left {
    gap: 6px 12px;
  }

  #smx-header .smx-top-right {
    gap: 6px;
  }

  #smx-header .smx-top-btn {
    min-height: 28px;
    padding: 6px 8px;
    font-size: 10px;
  }

  #smx-header .smx-main-inner {
    min-height: 70px;
  }

  #smx-header .smx-logo {
    flex-basis: 155px;
    width: 155px;
  }

  #smx-header .smx-logo img {
    max-width: 155px;
    max-height: 52px;
  }

  #smx-header .smx-mobile-toggle {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  #smx-header .smx-nav {
    padding: 10px 12px 16px;
  }

  #smx-header .smx-link {
    min-height: 45px;
    padding: 11px 12px;
    gap: 11px;
    font-size: 13px;
  }

  #smx-header .smx-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #smx-header .smx-card {
    min-height: 108px;
  }

  #smx-header .smx-mega {
    padding: 10px;
  }

  #smx-header .smx-mega-side {
    grid-template-columns: minmax(0, 1fr);
  }

  #smx-header .smx-side-title {
    grid-column: auto;
  }
}

/* RESPECT REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  #smx-header .smx-top-btn.smx-highlight,
  #smx-header .smx-top-btn.smx-highlight::after {
    animation: none !important;
  }

  #smx-header *,
  #smx-header *::before,
  #smx-header *::after {
    transition-duration: .01ms !important;
  }
}

#inner-wrap { margin-top: 0 !important; }

#smx-header button.smx-link:hover,
#smx-header button.smx-link:focus {
  background: #f1f8e9;
  border-color: #e3efd5;
}
