/* Header Styles */
.site-header {
  width: 100%;
  background: #e5dece;
}

.site-header .header-inner {
  height: 90px;
  padding: 0 32px;
}

.header-desktop {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 48px;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #282826;
  text-transform: uppercase;
  letter-spacing: 0;
  text-decoration: none;
  flex-shrink: 0;
}


.header-intermediaries {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration-color: #282826;
    flex-shrink: 0;
    text-align: center;
    font-family: "Inter-Bold";
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}


.header-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.21;
}

.header-nav a {
display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
    color: #282826;
    text-align: left;
    font-family: "Inter-Bold";
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.header-nav a.is-active {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: rgba(40, 40, 38, 0.4);
}

.header-cta {
display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 195px;
    padding: 0 24px;
    background: #282826;
    white-space: nowrap;
    border: 0;
    flex-shrink: 0;
    color: #FFF;
    text-align: center;
    font-family: "Inter-SemiBold";
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.caret {
  height: 7px;
  width: 11px;
  transition: transform 0.25s ease;
  transform-origin: center;
}

.js-header-dropdown[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.header-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 20px);
  left: -27px;
  min-width: 200px;
  background: #e5dece;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 12px 28px rgba(40, 40, 38, 0.12);
}

.header-dropdown-menu[hidden] {
  display: none;
}

.header-nav a.header-dropdown-item,
a.header-dropdown-item {
  display: block;
  width: 100%;
  padding: 16px 24px;
  color: #282826;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.15s ease, font-weight 0.15s ease;
}

.header-nav a.header-dropdown-item.is-active,
.header-nav a.header-dropdown-item:hover,
a.header-dropdown-item.is-active,
a.header-dropdown-item:hover {
  font-weight: 700;
  background-color: #d9d1bc;
}

.header-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #282826;
}

/* Mobile/tablet slide-in panel */
.header-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header-mobile-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.header-mobile-panel {
  position: fixed;
  top: 90px;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  background: #282826;
  color: #fff;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
  padding: 32px 33px;
  box-sizing: border-box;
}

.header-mobile-panel.is-open {
  transform: translateX(0);
}

.header-mobile-close {
    position: absolute;
    top: 45px;
    right: 33px;
    width: 68px;
    height: 68px;
    color: #282826;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F2EFEC;
}

.header-mobile-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 115px;
}

.header-mobile-btn {
display: flex;
    align-items: center;
    justify-content: left;
    position: relative;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    margin-bottom: 12px;
    background: #fff;
    text-decoration: none;
    border: 0;
    box-sizing: border-box;
    color: #282826;
    text-align: center;
    font-family: "Inter-Bold";
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

button#loginRes, a#ContctRes {
    justify-content: center;
}

.header-mobile-toggle.header-mobile-btn .hm-caret {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.25s ease;
}

.header-mobile-toggle.header-mobile-btn[aria-expanded="true"] .hm-caret {
  transform: translateY(-50%) rotate(180deg);
}
.header-mobile-submenu.is-open a.header-dropdown-item {
    color: #FFF;
    font-family: "Inter-SemiBold";
    font-size: 28px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    padding-top: 0;
}

.header-mobile-link {
display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0 0px 0;
    background: transparent;
    border: 0;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
    color: #F2EFEC;
    font-family: "Inter-SemiBold";
    font-size: 36px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.header-mobile-toggle.header-mobile-link .hm-caret {
  transition: transform 0.25s ease;
}

.header-mobile-toggle.header-mobile-link[aria-expanded="true"] .hm-caret {
  transform: rotate(180deg);
}

.header-mobile-submenu {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.header-mobile-submenu.is-open {
  max-height: 500px;
}

.header-mobile-submenu--light {
  background: #fff;
  margin-top: -12px;
  margin-bottom: 12px;
}

.header-mobile-submenu--light.is-open {
  padding: 0;
}

.header-mobile-submenu.header-mobile-submenu--light.is-open > a {
    color: #282826;
    font-family: "Inter-Bold";
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.header-mobile-submenu--light .header-mobile-sublink {
  color: #282826;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
}

.header-mobile-sublink {
  display: block;
  padding: 12px 0 12px 24px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

/* Tablet Responsive Styles - 768px to 1024px */
@media (max-width: 1024px) and (min-width: 768px) {
  .site-header .header-inner {
    height: 90px;
    padding: 0 24px;
  }

  .header-desktop {
    gap: 32px;
  }

  .header-logo {
    font-size: 26px;
  }

  .header-intermediaries {
    font-size: 16px;
  }

  .header-nav {
    display: none;
  }

  .header-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-cta {
    min-width: auto;
    height: 44px;
    font-size: 16px;
    padding: 0 20px;
  }
}

/* Mobile Styles - placeholder, will be updated when mobile design is shared */
@media (max-width: 767px) {
  .site-header .header-inner {
    height: 70px;
    padding: 0 16px;
  }

  .header-logo {
    font-size: 22px;
  }

  .header-intermediaries,
  .header-nav {
    display: none;
  }

  .header-menu-toggle {
    display: inline-flex;
    margin-left: auto;
    width: 40px;
    height: 40px;
  }

  .header-menu-toggle svg {
    width: 32px;
    height: 24px;
  }

  .header-cta {
    margin-left: 8px;
    min-width: auto;
    height: 40px;
    font-size: 13px;
    padding: 0 14px;
  }

  .header-mobile-backdrop,
  .header-mobile-panel {
    top: 70px;
  }

  .header-mobile-panel {
    max-width: none;
  }
}


.header-nav a:hover, .header-intermediaries:hover {
    color: #282826b3;
}

@media (max-width: 1200px) and (min-width: 1024px) {
  .site-header .header-inner {
    height: 90px;
    padding: 0 24px;
  }

  .header-desktop {
    gap: 32px;
  }

  .header-logo {
    font-size: 26px;
  }

  .header-intermediaries {
    font-size: 16px;
  }

  .header-nav {
    display: none;
  }

  .header-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-cta {
    min-width: auto;
    height: 44px;
    font-size: 16px;
    padding: 0 20px;
  }
}

/* Customers link (sits between Intermediaries and the CMS-driven nav) */
.header-customers-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  color: #282826;
  opacity: 0.6;
  font-family: "Inter-Medium", "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
}

.header-customers-link:hover {
  opacity: 0.85;
}

@media (max-width: 1024px) {
  .header-customers-link {
    display: none;
  }
}

/* Intermediaries mega menu (#headerSectionIC, Views/master.cshtml) */
#headerSectionIC {
  position: relative;
}

.ic-mega-menu {
  min-width: 220px;
  padding: 0;
  background: #fff;
  box-shadow: 0 12px 28px rgba(40, 40, 38, 0.16);
}

.ic-mega-menu__inner {
  display: flex;
  align-items: stretch;
}

.ic-mega-menu__col {
  padding: 24px;
  box-sizing: border-box;
}

.ic-mega-menu__col--links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 260px;
  background: #fff;
}

.ic-mega-menu__illustration {
    margin-top: 16px;
    opacity: 1;
    margin-left: 20px;
}

.ic-mega-menu__illustration[hidden] {
  display: none;
}

.ic-mega-menu__link {
display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 8px 10px 25px;
    color: #000;
    font-family: "Inter-Regular";
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
    transition: font-weight 0.15s ease, color 0.15s ease;
}

.ic-mega-menu__link.is-active,
.ic-mega-menu__link:hover {
    font-weight: 500;
    font-family: "Inter-Medium";
}

/* While any item (category or plain link, e.g. Fees and Charges) is hovered,
   fade its siblings so that one item stands out. Driven purely by :hover
   (not .is-active) so a stale active category never dims a sibling that's
   actually being hovered right now. */
.ic-mega-menu__col--links:has(.ic-mega-menu__link:hover) .ic-mega-menu__link:not(:hover) {
  color: #6b6b68;
}

.ic-mega-menu__chevron {
  flex-shrink: 0;
  fill: currentColor;
}

.ic-mega-menu__col--tiles {
  display: grid;
  grid-template-columns: repeat(2, 127px);
  align-content: start;
  gap: 30px;
  background: #fff;
  min-width: 330px;
  padding-left: 0;
}

.ic-mega-menu__col--tiles[hidden],
.ic-mega-menu__col--flyout[hidden] {
  display: none;
}

.ic-mega-menu__tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    width: 127px;
    height: 127px;
    padding: 8px 8px 8px 19px;
    box-sizing: border-box;
    text-align: left;
    font-family: "Inter-Medium";
    font-size: 16px !important;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-decoration: none !important;
}

a.ic-mega-menu__tile {
  background: #F2EFEC;
}

a.ic-mega-menu__tile:hover span {
text-align: left;
    color: #000;
    font-family: "Inter-Medium";
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.ic-mega-menu__tile-icon svg {
  width: 36px;
  height: 36px;
}

.ic-mega-menu__tile-label {
text-align: left;
    color: #282826;
    font-family: "Inter-Medium";
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.ic-mega-menu__col--flyout {
display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 190px;
    background: #fff;
    padding-left: 0;
    margin-left: -6px;
    padding-right: 94px;
}

.ic-mega-menu__flyout-item {
padding: 10px 8px;
    text-decoration: none;
    white-space: nowrap;
    color: #282826 !important;
    font-family: "Inter-Regular";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.ic-mega-menu__flyout-item:hover {
  text-decoration: underline;
}

/* Below 1200px the Intermediaries trigger opens the tablet drawer
   (.navic-drawer, nav.css) instead of this desktop dropdown. */
@media (max-width: 1200px) {
  .ic-mega-menu {
    display: none !important;
  }
}


/*.ic-mega-menu__col.ic-mega-menu__col--tiles[data-ic-panel="help-support"], .ic-mega-menu__col[data-ic-panel="submitting-business"] {
    display: block;
    width: 100%;
}

.ic-mega-menu__col.ic-mega-menu__col--tiles[data-ic-panel="help-support"] a.ic-mega-menu__tile, .ic-mega-menu__col[data-ic-panel="submitting-business"] a.ic-mega-menu__tile{
    height: auto;
    background: no-repeat;
    width: 100%;
    display: block;
    text-align: left;
}

.navic-drawer__panel[data-navic-panel="help-support"] .navic-drawer__tiles, .ic-mega-menu__col[data-ic-panel="submitting-business"] .navic-drawer__tiles {
    display: block;
    height: auto;
}

.navic-drawer__panel[data-navic-panel="help-support"] a.navic-drawer__tile, .ic-mega-menu__col[data-ic-panel="submitting-business"] a.navic-drawer__tile{
    height: auto;
    display: block;
    background: no-repeat;
    aspect-ratio: auto;
}*/

.ic-mega-menu__tile[href="/intermediaries/conveyancing/"], .ic-mega-menu__tile[href="/intermediaries/legal-information/"] {
    padding: 10px;
}

.ic-mega-menu__flyout-item:hover {
    text-decoration: none;
    font-weight: 700;
}