// ============================================================================
// Header with booking  (.header-with-booking)  +  Menu with booking (.menu-with-booking)
//
// New Drayton Manor header: slim top bar, full-width main bar, "Book Now" dropdown
// with the two booking buttons, accordion menu on mobile.
// Markup: Partials/Page/Header/HeaderType6.html (skin override) + Partials/Page/Navigations/MenuWithBooking.html
// Behaviour: "Header with booking" section in Public/Javascript/park-custom.js
//
// Everything is scoped to the two root classes (hwb-* / mwb-* class names), plus the base wrapper
// <header id="header-type-6" class="header-main"> that Default.html renders around the partial.
// Reference: client PDF + PSD files.
//
// Sizing: the desktop PSDs are 1920px wide and the mobile PSDs 600px wide.
//   hwb-fluid($px)  desktop value, 1:1 at 1920px, scales down proportionally to the 1200px breakpoint
//   hwb-m($px)      mobile value, PSD px / 1.6  (600px PSD -> 375px device)
// ============================================================================

$hwb-bar-bg: $drayton-blue !default; // #41448e  main bar / menu
$hwb-topbar-bg: $dark-drayton-blue !default; // #272f7e  top bar / booking dropdown
$hwb-park: #e41f13 !default; // Book Now / Book Park Tickets
$hwb-stay: #00a5b5 !default; // Book Stay & Play
$hwb-white: #ffffff !default;

// $min: optional floor (px) for values that would get too small to read at 1200px
@function hwb-fluid($px, $min: $px * 0.625) {
  @return clamp(#{$min}px, #{$px * 0.0520833333}vw, #{$px}px);
}

// The desktop main bar is drawn smaller than the 1920 PSD (at PSD size it felt too big on real screens).
// hwb-d() takes PSD px and scales them by this factor, so all bar parts stay in proportion.
$hwb-desktop-scale: 0.65 !default;

@function hwb-d($px) {
  @return hwb-fluid($px * $hwb-desktop-scale);
}

@function hwb-m($px) {
  @return #{$px * 0.625}px;
}

// The opening-times widget renders the shared ".btn-bx.date.status-icon" pill, which global rules
// turn into a 20px-wide icon box below 1024px. Flatten it to plain text wherever it is used here.
@mixin hwb-status-text {
  a {
    color: $hwb-white;
  }

  .btn-bx {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    float: none;
    overflow: visible;
    border: 0;
    border-radius: 0 !important;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-transform: none;
    white-space: nowrap;
    word-break: normal;
  }

  // open/closed status dot (_weatherinfo.scss: 14px + 6px margin) is not in the design; on open days it
  // left a gap in front of the text
  .icon {
    display: none !important;
  }
}

// logo.svg (viewBox 438.4 x 300.1) has transparent padding around the artwork (artwork box x52.2 y50.85,
// 333.75 x 196.59), so the image is scaled up and trimmed with negative margins: the logo box then
// holds exactly the visible logo. Margins are % of the box width = padding / artwork width.
@mixin hwb-logo-artwork {
  img {
    display: block;
    width: 131.36% !important; // 438.4 / 333.75
    max-width: none;
    height: auto !important;
    margin: -15.24% 0 -15.78% -15.64%; // 50.85, 52.66 and 52.2 / 333.75
  }
}

// White icons (inline SVG so no extra assets are needed)
$hwb-icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 53 43' fill='none' stroke='%23fff' stroke-width='9'%3E%3Cpath d='M4 9l22.5 23L49 9'/%3E%3C/svg%3E");
$hwb-icon-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 43 53' fill='none' stroke='%23fff' stroke-width='9'%3E%3Cpath d='M9 4l23 22.5L9 49'/%3E%3C/svg%3E");
$hwb-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M6 6l18 18M24 6L6 24'/%3E%3C/svg%3E");
$hwb-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 30' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Ccircle cx='13' cy='12' r='9.5'/%3E%3Cpath d='M20 19.5L31 28'/%3E%3C/svg%3E");

// ---------------------------------------------------------------------------
// Base wrapper (Templates/Page/Default.html): <header id="header-type-6" class="header-main"><div class="container-fluid">
// Base makes .header-main absolute (and fixed via park-scripts.js .fixed on scroll), overlaying the banner.
// The new header sits in normal flow and sticks, so the sticky positioning lives on this wrapper: a sticky
// element whose parent is exactly as tall as itself has no room to stick.
// ---------------------------------------------------------------------------
#header-type-6.header-main {
  --hwb-topbar-h: 0px;
  --hwb-bar-h: #{hwb-m(122)};

  position: sticky;
  top: 0;
  float: none;
  z-index: 1030;

  &.fixed {
    position: sticky;
  }

  > .container-fluid {
    padding: 0;
  }
}

// ---------------------------------------------------------------------------
// Root (mobile first)
// ---------------------------------------------------------------------------
.header-with-booking {
  position: relative;
  background: $hwb-bar-bg;
  color: $hwb-white;
  font-family: museo-sans, sans-serif;
  letter-spacing: -0.035em;
  line-height: 1.2;

  ul,
  li {
    list-style: none;
    margin: 0;
    padding: 0;

    &::before {
      content: none;
    }
  }

  a {
    text-decoration: none;
  }

  button {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 3px solid $hwb-white;
    outline-offset: 2px;
  }
}

// ---------------------------------------------------------------------------
// Top bar (desktop only)
// ---------------------------------------------------------------------------
.header-with-booking .hwb-topbar {
  display: none;
}

// ---------------------------------------------------------------------------
// Main bar: logo | menu | Book Now | burger
// ---------------------------------------------------------------------------
.header-with-booking .hwb-bar {
  position: relative;
  z-index: 2; // above the booking dropdown (its pointer tucks under Book Now)
  height: var(--hwb-bar-h);
  background: $hwb-bar-bg;
  border-bottom: 1px solid $hwb-topbar-bg;
}

.header-with-booking .hwb-bar__inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 hwb-m(34) 0 hwb-m(30);
}

.header-with-booking .hwb-logo {
  flex: none;
  width: hwb-m(129);

  // The logo markup comes from the shared TypoScript object (a.navbar-brand > .brand-nav > img.h-100)
  .navbar-brand {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    height: auto !important;
  }

  .brand-nav {
    height: auto !important;
  }

  @include hwb-logo-artwork;
}

// Book Now
.header-with-booking .hwb-book-now {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: hwb-m(39);
  width: hwb-m(132);
  height: hwb-m(79);
  border-radius: hwb-m(27);
  background: $hwb-park;
  color: $hwb-white;
  font-size: hwb-m(25);
  font-weight: 900;
  line-height: hwb-m(27);
  text-align: center;
  transition: background-color 0.2s ease;

  &:hover,
  &[aria-expanded="true"] {
    background: darken($hwb-park, 6%);
  }

  .hwb-book-now__word {
    display: block; // mobile: "Book" / "Now" on two lines
  }
}

// Direct CTA in place of "Book Now" + dropdown (Meetings & Events: lib.drayton.headerBookingMode = direct).
.header-with-booking .hwb-cta {
  flex: none;
  display: flex;
  margin-left: auto;
  margin-right: hwb-m(39);

  .frame,
  .btn-booking {
    display: contents;
  }

  a[id^="c"]:empty {
    display: none;
  }

  .btn-booking .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: hwb-m(132);
    height: hwb-m(79);
    margin: 0;
    padding: 0 hwb-m(16);
    border: 0;
    border-radius: hwb-m(27);
    box-shadow: none;
    filter: none;
    // record colours (skin Button/Layout_1 writes them as --btn-* on the link), design colours as fallback
    background: var(--btn-bg, #{$hwb-park}) !important;
    color: var(--btn-color, #{$hwb-white});
    font-family: inherit;
    font-size: hwb-m(25);
    font-weight: 900;
    letter-spacing: inherit;
    line-height: hwb-m(27);
    text-align: center;
    text-transform: none;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;

    &:hover,
    &:focus-visible {
      background: var(--btn-bg-hover, var(--btn-bg, #{darken($hwb-park, 6%)})) !important;
      color: var(--btn-color-hover, var(--btn-color, #{$hwb-white}));
    }

    .icon {
      display: none;
    }

    .txt {
      margin: 0;
      color: inherit !important;
      font: inherit;
      letter-spacing: inherit;
      text-transform: none;
    }
  }
}

// Burger (3 bars -> X while the menu is open)
.header-with-booking .hwb-burger {
  position: relative;
  flex: none;
  width: hwb-m(58);
  height: hwb-m(44);

  .hwb-burger__bar,
  .hwb-burger__bar::before,
  .hwb-burger__bar::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: hwb-m(6);
    background: $hwb-white;
    transition:
      transform 0.25s ease,
      background-color 0.25s ease;
  }

  .hwb-burger__bar {
    top: 50%;
    margin-top: hwb-m(-3);

    &::before,
    &::after {
      content: "";
    }

    &::before {
      top: hwb-m(-19);
    }

    &::after {
      top: hwb-m(19);
    }
  }

  &[aria-expanded="true"] .hwb-burger__bar {
    background: transparent;

    &::before {
      transform: translateY(hwb-m(19)) rotate(45deg);
    }

    &::after {
      transform: translateY(hwb-m(-19)) rotate(-45deg);
    }
  }
}

// ---------------------------------------------------------------------------
// Booking dropdown: sits in normal flow so the page content is pushed down
// ---------------------------------------------------------------------------
.header-with-booking .hwb-booking {
  position: relative;
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  background: $hwb-topbar-bg;
  transition:
    grid-template-rows 0.3s ease,
    visibility 0s linear 0.3s;

  &.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    transition:
      grid-template-rows 0.3s ease,
      visibility 0s;
  }

  // pointer under the Book Now button
  &::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: hwb-m(131);
    width: hwb-m(133);
    height: hwb-m(27);
    background: $hwb-topbar-bg;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }

  .hwb-booking__panel {
    min-height: 0;
    overflow: hidden;
  }

  // mobile order: park tickets, then stay & play
  .hwb-booking__inner {
    display: flex;
    flex-direction: column;
    gap: hwb-m(14);
    padding: hwb-m(27) 11% hwb-m(22);
  }

  // Both buttons are ticket button plugin records (Layout_2), wrapped by the header in .hwb-booking__item--park / --stay:
  //   .hwb-booking__item > [a#c<uid>] > div.btn-booking > a.btn > div.icon + p.txt
  // Flatten the wrappers so the a.btn links themselves are the flex items (display: contents still passes
  // inherited properties on, e.g. the line-height that .header-main .btn-booking sets), and hide the empty
  // "#c<uid>" jump anchor that fluid_styled_content renders in front of a record.
  .hwb-booking__inner {
    .hwb-booking__item,
    .frame,
    .btn-booking {
      display: contents;
    }

    a[id^="c"]:empty {
      display: none;
    }
  }

  // Overrides the plugin's / older header styles: .header-main .btn-booking .btn (padding, radius), the skin's
  // global .btn (_button.scss: padding, secondary font, brightness filter on hover) and the page-wide colour CSS
  // Layout_2 injects (".btn-booking a { background-color: ... !important }", one record's colour for all buttons).
  // Colours come from each record instead: the skin's Layout_2 copies (Partials/Ext/WabsTicketButton/Button/)
  // put them on the link as --btn-bg / --btn-bg-hover / --btn-color / --btn-color-hover; the design colours
  // are the fallback for empty fields.
  .btn-booking .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: hwb-m(75);
    margin: 0;
    padding: 0 hwb-m(20);
    border: 0;
    border-radius: hwb-m(27);
    box-shadow: none;
    filter: none;
    color: var(--btn-color, #{$hwb-white});
    font-family: inherit;
    font-size: hwb-m(30);
    font-weight: 900;
    letter-spacing: inherit;
    line-height: 1.1;
    text-align: center;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;

    &:hover,
    &:focus-visible {
      color: var(--btn-color-hover, var(--btn-color, #{$hwb-white}));
    }

    // icon is not part of the design
    .icon {
      display: none;
    }

    // label: follows the link colour above (the template's inline "color: <text colour>" on .txt would block the hover colour)
    .txt {
      margin: 0;
      color: inherit !important;
      font: inherit;
      letter-spacing: inherit;
    }
  }

  // record colour if set, otherwise the design colour (hover: record hover colour > record colour > darker design colour)
  .hwb-booking__item--park .btn-booking .btn {
    background: var(--btn-bg, #{$hwb-park}) !important;

    &:hover {
      background: var(--btn-bg-hover, var(--btn-bg, #{darken($hwb-park, 6%)})) !important;
    }
  }

  .hwb-booking__item--stay .btn-booking .btn {
    background: var(--btn-bg, #{$hwb-stay}) !important;

    &:hover {
      background: var(--btn-bg-hover, var(--btn-bg, #{darken($hwb-stay, 6%)})) !important;
    }
  }
}

// Alert bar / weather widget
.header-with-booking .hwb-extras {
  position: relative;
}

// ---------------------------------------------------------------------------
// Menu: mobile / tablet = full-width accordion panel under the header bar
// ---------------------------------------------------------------------------
.menu-with-booking {
  display: none;
  position: fixed;
  top: var(--hwb-bar-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: $hwb-bar-bg;
  color: $hwb-white;

  .mwb-list {
    display: block;
  }

  // one row = label/link + (optional) arrow cell
  .mwb-row {
    display: flex;
    align-items: stretch;
    min-height: hwb-m(99);
    border-bottom: 1px solid $hwb-topbar-bg;
  }

  .mwb-link,
  .mwb-status {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    padding: 0 hwb-m(22);
    color: $hwb-white;
    font-size: hwb-m(35);
    font-weight: 700;
    line-height: 1.2;
  }

  .mwb-link:hover,
  .mwb-link.is-active {
    color: $hwb-white;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  // opening times: "Today open 10:30 - 16:00" row, same size and left edge as the menu links (client feedback)
  .mwb-status {
    min-width: 0;

    @include hwb-status-text;
  }

  // arrow cells (toggle buttons, search, link-out)
  .mwb-toggle,
  .mwb-search-toggle,
  .mwb-arrow-out {
    position: relative;
    flex: none;
    width: hwb-m(104);
    border-left: 1px solid $hwb-topbar-bg;

    &::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: hwb-m(53);
      height: hwb-m(43);
      background-image: $hwb-icon-chevron-down;
      background-position: center;
      background-size: contain;
      background-repeat: no-repeat;
      transform: translate(-50%, -50%);
      transition: transform 0.25s ease;
    }
  }

  .mwb-toggle[aria-expanded="true"]::before {
    transform: translate(-50%, -50%) rotate(180deg); // arrow flips while the section is open
  }

  .mwb-search-toggle::before {
    width: hwb-m(59);
    height: hwb-m(51);
    background-image: $hwb-icon-search;
  }

  // while the search is open the icon becomes a close cross
  .mwb-search-toggle[aria-expanded="true"]::before {
    width: hwb-m(44);
    height: hwb-m(44);
    background-image: $hwb-icon-close;
  }

  // Meetings & Events leaves the theme-park section -> arrow points right
  .mwb-arrow-out::before {
    width: hwb-m(43);
    height: hwb-m(53);
    background-image: $hwb-icon-chevron-right;
  }

  // search form (toggled from the search buttons): white pill with a round submit button inside it
  .mwb-search {
    padding: hwb-m(18) hwb-m(19);
    border-bottom: 1px solid $hwb-topbar-bg;

    &[hidden] {
      display: none;
    }

    .search-box {
      position: relative;
      width: 100%;
      margin: 0;
      padding: 0;
      background: none;
    }

    form {
      position: relative;
      display: flex;
      align-items: center;
      gap: hwb-m(10);
      height: hwb-m(80);
      margin: 0;
      padding: 0 hwb-m(7) 0 hwb-m(30);
      border-radius: 999px;
      background: $hwb-white;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
      transition: box-shadow 0.2s ease;
      animation: hwb-search-in 0.2s ease-out;

      &:focus-within {
        box-shadow:
          0 0 0 3px rgba(255, 255, 255, 0.45),
          0 2px 10px rgba(0, 0, 0, 0.18);
      }
    }

    input[type="text"] {
      flex: 1 1 auto;
      width: auto;
      min-width: 0;
      height: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      outline: none;
      box-shadow: none;
      background: transparent;
      color: $hwb-topbar-bg;
      font-size: hwb-m(28);
      font-weight: 500;
      letter-spacing: 0;

      &::placeholder {
        color: #8a8cb5;
        opacity: 1;
      }
    }

    // keeps its "Search" value as the accessible name, shows a magnifier
    input[type="submit"] {
      flex: none;
      width: hwb-m(66);
      min-width: 0; // the global button style sets min-width: 210px on every submit
      height: hwb-m(66);
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background-color: $hwb-bar-bg;
      background-image: $hwb-icon-search;
      background-position: 55% 50%;
      background-size: 48%;
      background-repeat: no-repeat;
      color: transparent;
      font-size: 0;
      cursor: pointer;
      transition: background-color 0.2s ease;

      &:hover,
      &:focus-visible {
        background-color: $hwb-park;
      }

      &:focus-visible {
        outline: 3px solid $hwb-bar-bg;
        outline-offset: 2px;
      }
    }
  }

  // accordion panel (grid-rows trick = animated height, closed content not focusable)
  .mwb-panel {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition:
      grid-template-rows 0.25s ease,
      visibility 0s linear 0.25s;
  }

  .mwb-item.is-open > .mwb-panel {
    grid-template-rows: 1fr;
    visibility: visible;
    transition:
      grid-template-rows 0.25s ease,
      visibility 0s;
  }

  .mwb-panel__inner {
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid $hwb-topbar-bg;
  }

  .mwb-groups,
  .mwb-sublist {
    padding: 0;
  }

  .mwb-item.is-open .mwb-panel__inner > .mwb-sublist,
  .mwb-item.is-open .mwb-groups {
    padding: hwb-m(26) 0 hwb-m(24);
  }

  .mwb-group + .mwb-group {
    margin-top: hwb-m(16);
  }

  .mwb-group__title {
    margin: 0;
    padding: 0 hwb-m(22) 0 hwb-m(35);
    color: $hwb-white;
    font-size: hwb-m(35);
    font-weight: 700;
    line-height: hwb-m(50);
    letter-spacing: inherit;
    text-transform: none;
  }

  .mwb-sublist__item {
    position: relative;
    padding-left: hwb-m(68);

    &::before {
      content: "";
      position: absolute;
      top: 50%;
      left: hwb-m(40);
      width: hwb-m(9);
      height: hwb-m(9);
      margin-top: hwb-m(-4.5);
      border-radius: 50%;
      background: $hwb-white;
    }
  }

  // smaller than the group titles (hierarchy) with ~40px tall rows as finger targets (client feedback)
  .mwb-sublink {
    display: block;
    padding: hwb-m(13) hwb-m(22) hwb-m(13) 0;
    color: $hwb-white;
    font-size: hwb-m(30);
    font-weight: 700;
    line-height: 1.25;

    &:hover,
    &.is-active {
      color: $hwb-white;
      text-decoration: underline;
      text-underline-offset: 0.2em;
    }
  }

  // HTML block that editors can add to a mega menu: desktop only
  .mwb-extra {
    display: none;
  }

  // search / external rows only exist for mobile
  .mwb-row--status {
    min-height: hwb-m(100);
  }
}

.header-with-booking.is-menu-open .menu-with-booking {
  display: block;
}

// the open mobile menu replaces the booking dropdown
.header-with-booking.is-menu-open .hwb-booking {
  display: none;
}

// ---------------------------------------------------------------------------
// Desktop (>= 1200px)
// ---------------------------------------------------------------------------
@include media-breakpoint-up(xl) {
  #header-type-6.header-main {
    --hwb-topbar-h: #{hwb-fluid(40, 30)};
    --hwb-bar-h: #{hwb-d(172)};

    // the top bar scrolls away, the main bar stays stuck to the top
    top: calc(var(--hwb-topbar-h) * -1);
  }

  // ---- top bar -----------------------------------------------------------
  .header-with-booking .hwb-topbar {
    display: block;
    position: relative;
    height: var(--hwb-topbar-h);
    background: $hwb-topbar-bg;
  }

  .header-with-booking .hwb-topbar__inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 hwb-fluid(34) 0 hwb-fluid(28);
    font-size: hwb-fluid(18, 13);
    font-weight: 700;
    line-height: 1;
  }

  .header-with-booking .hwb-status {
    margin-right: auto;

    @include hwb-status-text;
  }

  // meta links (Jobs / Weddings / Meetings & Events) come from a content element
  .header-with-booking .hwb-topbar__links {
    .top-nav-wrapper {
      display: flex !important;
      align-items: center;
      gap: hwb-fluid(22);
      flex: none;
      width: auto;
      max-width: none;
      margin: 0;
      padding: 0;
    }

    .top-nav-item {
      margin: 0 !important;
      padding: 0;
      color: $hwb-white;
    }

    .brand-nav p {
      margin: 0;
    }

    .brand-nav span,
    a {
      color: $hwb-white;
      font-size: hwb-fluid(18, 13);
      font-weight: 700;
      line-height: 1;
      text-transform: none;
    }

    a:hover span {
      text-decoration: underline;
      text-underline-offset: 0.2em;
    }
  }

  .header-with-booking .hwb-search-toggle {
    flex: none;
    width: hwb-fluid(24, 18);
    height: hwb-fluid(21, 16);
    margin-left: hwb-fluid(18);
    background-image: $hwb-icon-search;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    transition: opacity 0.2s ease;

    &:hover {
      opacity: 0.8;
    }

    &[aria-expanded="true"] {
      background-image: $hwb-icon-close;
      background-size: 80%;
    }
  }

  // ---- main bar ----------------------------------------------------------
  .header-with-booking .hwb-bar__inner {
    padding: 0 hwb-d(48) 0 hwb-d(72);
  }

  .header-with-booking .hwb-bar {
    border-bottom: 0;
  }

  .header-with-booking .hwb-logo {
    width: hwb-d(180);
  }

  .header-with-booking .hwb-burger {
    display: none;
  }

  .header-with-booking .hwb-book-now {
    margin: 0 0 0 auto;
    width: hwb-d(319);
    height: hwb-d(95);
    border-radius: hwb-d(27);
    font-size: hwb-d(40);
    line-height: 1;

    .hwb-book-now__word {
      display: inline;
    }
  }

  .header-with-booking .hwb-cta {
    margin: 0 0 0 auto;

    .btn-booking .btn {
      min-width: hwb-d(319);
      height: hwb-d(95);
      padding: 0 hwb-d(32);
      border-radius: hwb-d(27);
      font-size: hwb-d(40);
      line-height: 1;
      white-space: nowrap;
    }
  }

  // ---- booking dropdown --------------------------------------------------
  .header-with-booking .hwb-booking {
    &::before {
      right: hwb-d(71);
      width: hwb-d(273);
      height: hwb-d(33);
    }

    // visual order stay & play | park tickets, right aligned
    .hwb-booking__inner {
      flex-direction: row-reverse;
      justify-content: flex-start;
      gap: hwb-d(20);
      padding: hwb-d(33) hwb-d(48) hwb-d(29);
    }

    .btn-booking .btn {
      flex: none;
      width: hwb-d(423);
      height: hwb-d(88);
      border-radius: hwb-d(27);
      font-size: hwb-d(35);
    }
  }

  // ---- menu: inline in the bar --------------------------------------------
  .menu-with-booking {
    display: flex;
    position: static;
    align-self: stretch;
    flex: 1 1 auto;
    margin: 0 hwb-d(60);
    overflow: visible;
    background: none;

    // the list fills the space between logo and Book Now (dropdown panels take its width),
    // the items are centred in it
    .mwb-list {
      flex: 1 1 auto;
      display: flex;
      align-items: stretch;
      justify-content: center;
      gap: hwb-d(60);
    }

    .mwb-item {
      display: flex;
      align-items: center;
    }

    .mwb-row {
      min-height: 0;
      border: 0;
    }

    .mwb-link {
      flex: none;
      padding: 0;
      font-size: hwb-d(40);
      font-weight: 900;
      line-height: 1;
      white-space: nowrap;
    }

    .mwb-item:hover > .mwb-row .mwb-link,
    .mwb-item:focus-within > .mwb-row .mwb-link {
      text-decoration: underline;
      text-decoration-thickness: 0.08em;
      text-underline-offset: 0.25em;
    }

    // mobile-only rows / controls
    .mwb-row--status,
    .mwb-toggle,
    .mwb-item--external {
      display: none;
    }

    // search form: overlays the top bar up to the search icon (the icon stays clickable to close it).
    // Positioned from the menu list, which ends at Book Now (bar padding 48 + Book Now 319, scaled) and
    // stops ~12px before the search icon (top bar padding 34 + icon 24 + 12).
    .mwb-search {
      position: absolute;
      top: calc(var(--hwb-topbar-h) * -1);
      left: 0;
      right: calc(#{hwb-fluid(70)} - #{hwb-d(367)});
      z-index: 3;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      height: var(--hwb-topbar-h);
      padding: 0;
      border: 0;
      background: $hwb-topbar-bg;

      &[hidden] {
        display: none;
      }

      .search-box {
        width: auto;
      }

      // pill sized to the slim top bar, right-aligned next to the (now close) icon
      form {
        gap: hwb-fluid(10);
        width: hwb-fluid(460, 340);
        height: hwb-fluid(30, 24);
        padding: 0 hwb-fluid(3) 0 hwb-fluid(16);
      }

      input[type="text"] {
        font-size: hwb-fluid(16, 13);
      }

      input[type="submit"] {
        width: hwb-fluid(24, 20);
        height: hwb-fluid(24, 20);
      }
    }

    // Desktop dropdowns are the current header's mega-menu (ul.dropdown-menu.mega-menu-custom, styled by the
    // shared mega-menu styles and opened on hover). It spans the width of the menu list, as before.
    .mwb-list {
      position: relative;
    }

    .mwb-panel {
      display: none !important; // mobile accordion panel
    }

    // keyboard: open the dropdown while focus is inside it (hover already opens it)
    .dropdown.has-mega-menu:focus-within .mega-menu-custom {
      transform: translateX(-50%) scaleY(1);
    }

    // Simple (non mega-menu) dropdowns, e.g. the Meetings & Events section menu: a white strip with the links
    // in a row (skin _mega-menu.scss: display flex; base _dropdown.scss: dots, padding), as in the old header.
    // Bootstrap normally places .dropdown-menu with Popper (JS), which this menu does not use, so anchor it
    // under its menu item here.
    .mwb-item--has-sub:not(.mwb-item--mega) {
      position: relative;

      > .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: auto;
        margin: 0;
        padding: hwb-fluid(16) hwb-fluid(10) hwb-fluid(6);
        column-gap: hwb-fluid(20);
        white-space: nowrap;
      }
    }
  }
}

// the desktop dropdown markup is not used by the mobile accordion
@include media-breakpoint-down(xl) {
  .menu-with-booking .dropdown-menu {
    display: none !important;
  }
}

// ---------------------------------------------------------------------------
// Header banner (existing header-banner content element) on pages that use this header.
// Scoped with the sibling combinator: the base <header id="header-type-6"> wrapper is rendered right
// before <main class="content-main"> (.header-with-booking itself is nested inside it, so it is not a sibling).
//
// - image starts directly under the navigation, full device width, never cropped
// - side gradient over ~1/3 of the image (desktop) / bottom gradient on a square image (mobile);
//   colour is editable through the --hwb-hero-gradient custom property (default #41448e)
// - heading (h1, 75px) above subheading (h2, 40px), plain white text, no boxes, no banner button
// - slider dots bottom-left under the text, no arrows
// The desktop/mobile banner switch follows the existing .desktop-view / .mobile-view split (992px).
// ---------------------------------------------------------------------------

// Banner nested in a grid container at the top of the page (e.g. search results / news list pages:
// Gridelements 1_100 > .py-4 > .row > .col-sm-12 > .hero-main). The container's Bootstrap "py-4" top padding
// showed as a white strip between the header and the banner (it used to be hidden under the old overlaying header).
#header-type-6 ~ .content-main > :first-child > .py-4:has(.hero-main) {
  padding-top: 0 !important;
}

#header-type-6 ~ .content-main .hero-main {
  --hwb-hero-gradient: #{$hwb-bar-bg};

  margin-top: 0;

  // no carousel arrows
  .owl-nav {
    display: none !important;
  }

  // image keeps its own ratio (no 75vh box, no cover-cropping)
  .slide-item {
    display: block;
    height: auto !important;

    &::before {
      display: none !important; // the current white top fade under the old header
    }
  }

  .figure {
    position: relative;
    float: none;
    height: auto;

    &::before {
      display: none !important; // dark bottom gradient of the old banner
    }

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      // extended past the PSD (18.5% / 37.5%) so the text stays readable on images with white in them (client feedback)
      background: linear-gradient(90deg, var(--hwb-hero-gradient) 0%, var(--hwb-hero-gradient) 25%, rgba(65, 68, 142, 0) 50%);
    }

    img {
      position: static;
      display: block;
      width: 100%;
      height: auto !important;
      min-width: 0;
      min-height: 0;
      max-height: none !important;
      object-fit: initial;
      transform: none;
    }
  }

  // text block sits on the gradient, bottom-anchored above the dots
  .hero-cont,
  .hero-cont.hero-more-cont {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: hwb-fluid(184);
    z-index: 2;
    transform: none; // the shared slider centres it with top:50% + translateY(-50%)
    width: auto;
    margin: 0;
    padding: 0;
    text-align: left;

    &::before {
      display: none !important;
    }

    .container {
      width: auto;
      max-width: none;
      margin: 0;
      padding: 0 0 0 hwb-fluid(101);
    }

    .inner:empty {
      display: none;
    }
  }

  .hero-cont .content-header-container {
    position: static;
    bottom: auto;
    float: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: hwb-fluid(700);
    margin: 0;
    padding: 0;
    text-align: left;

    // heading first, subheading below it (DOM order is subheading, heading, button)
    .header-title,
    .header-subtitle {
      width: auto;
      margin: 0 !important;
      padding: 0;
      border-radius: 0 !important;
      background: transparent !important;
    }

    .header-title {
      order: 1;
    }

    .header-subtitle {
      order: 2;
      margin-top: hwb-fluid(44) !important;
    }

    .header-title h1,
    .header-subtitle h2 {
      margin: 0;
      padding: 0;
      color: $hwb-white;
      font-family: museo-sans, sans-serif;
      font-weight: 900;
      letter-spacing: -0.035em;
      text-transform: none;
      text-shadow: none;
    }

    // heading: 75px / 900
    .header-title h1 {
      font-size: hwb-fluid(75) !important;
      line-height: 1.1;
    }

    // subheading: 40px / 900
    .header-subtitle h2 {
      font-size: hwb-fluid(40) !important;
      line-height: 1.2;
    }

    // the design has no button in the banner (booking is in the header now)
    .header-button {
      display: none !important;
    }
  }

  // dots: same dots as today, moved to the left under the text
  .owl-carousel .owl-dots {
    position: absolute;
    left: hwb-fluid(99);
    right: auto;
    bottom: hwb-fluid(145) !important;
    z-index: 3;
    display: flex;
    gap: hwb-fluid(10);
    width: auto;
    margin: 0;
    text-align: left;
    transform: none;

    &.disabled {
      display: none;
    }

    button.owl-dot {
      margin: 0;
    }
  }
}

// Tickets bar under the banner: hero search element with the "Hero Search Over Hero" layout (layout 1) only.
// The base pulls it up a fixed 125px (_hero-search.scss), which covered the dots / text once the banner got
// smaller. As in the desktop PSD, it overlaps the banner by 128px - 17px under the dots, which sit 145px above
// the banner bottom - on the same fluid scale as the dots, so it stays under them at every width.
// Mobile: below the banner (see the mobile banner block).
#header-type-6 ~ .content-main .frame-type-sitepackage_herosearch.frame-layout-1 {
  margin-top: calc(-1 * #{hwb-fluid(128)});
}

// mobile banner: square image, gradient at the bottom, text + dots on the gradient
@include media-breakpoint-down(lg) {
  // tickets bar below the banner, 34px gap in the 600px mobile PSD
  #header-type-6 ~ .content-main .frame-type-sitepackage_herosearch.frame-layout-1 {
    margin-top: hwb-m(34);
  }

  #header-type-6 ~ .content-main .hero-main {
    .figure {
      &::after {
        background: linear-gradient(180deg, rgba(65, 68, 142, 0) 40%, var(--hwb-hero-gradient) 72%);
      }

      img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
      }
    }

    .hero-cont,
    .hero-cont.hero-more-cont {
      bottom: hwb-m(70);

      .container {
        padding: 0 hwb-m(36) 0 hwb-m(29);
      }
    }

    .hero-cont .content-header-container {
      max-width: none;

      .header-subtitle {
        margin-top: hwb-m(14) !important;
      }

      // heading 45px, subheading 25px (PSD / 1.6)
      .header-title h1 {
        font-size: hwb-m(45) !important;
      }

      .header-subtitle h2 {
        font-size: hwb-m(25) !important;
      }
    }

    .owl-carousel .owl-dots {
      left: hwb-m(28);
      bottom: hwb-m(28) !important;
      gap: hwb-m(10);

      // white dots on the blue gradient (the current mobile dots are blue-on-white)
      button.owl-dot,
      button.owl-dot.active {
        width: hwb-m(19);
        height: hwb-m(19);
        background: rgba(255, 255, 255, 0.6);
      }

      button.owl-dot.active {
        background: $hwb-white;
        box-shadow: $hwb-white 0 0 0 3px;
      }
    }
  }
}

@keyframes hwb-search-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-with-booking,
  .header-with-booking * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
