/* CIBC custom header - full-width backgrounds, centred constrained content */
#header .header-wrapper { background: #343c74 !important; }
#header .cibc-custom-header, #header .cibc-custom-header * { box-sizing: border-box; }
#header .cibc-custom-header { font-family: 'Work Sans', sans-serif; color: #fff; }
#header .cibc-head-container { width: min(100% - 36px, 1280px); margin-inline: auto; }
#header .cibc-head-top { background: #242c59; }
#header .cibc-head-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 35px; }
#header .cibc-contact-items { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; }
#header .cibc-contact-item { color: #fff !important; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 400; line-height: 1.4; text-decoration: none; white-space: nowrap; }
#header .cibc-contact-item svg { width: 13px; height: 13px; color: #E9BB4F; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
#header .cibc-contact-item:hover { color: #E9BB4F !important; }
#header .cibc-facebook { color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
#header .cibc-facebook:hover { color: #E9BB4F; }
#header .cibc-facebook svg { width: 19px; height: 19px; fill: currentColor; }
#header .cibc-head-main { background: #343c74; border-bottom: 3px solid #E9BB4F; }
#header .cibc-head-main-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
#header .cibc-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; min-width: 0; color: #fff; text-decoration: none; }
#header .cibc-brand:hover { color: #fff; }
#header .cibc-brand-logo { display: block; width: 64px; height: 64px; object-fit: contain; }
#header .cibc-brand-copy { display: flex; flex-direction: column; gap: 3px; line-height: 1.2; }
#header .cibc-brand-title { font: 700 17px/1.16 'Nunito', sans-serif; white-space: nowrap; color: #fff; }
#header .cibc-brand-since { font: 400 10px/1.4 'Work Sans', sans-serif; color: #f3f3f8; }
#header .cibc-nav { margin-left: auto; min-width: 0; }
#header .cibc-nav-list, #header .cibc-nav-list ul { list-style: none; padding: 0; margin: 0; }
#header .cibc-nav-list { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: clamp(8px, 1.15vw, 19px); }
#header .cibc-nav-list > li { position: relative; flex: none; margin: 0; }
#header .cibc-nav-list a { text-decoration: none; font: 500 12px/1.35 'Work Sans', sans-serif; color: #fff; display: block; white-space: nowrap; padding: 11px 0; }
#header .cibc-nav-list a:hover, #header .cibc-nav-list .current-menu-item > a, #header .cibc-nav-list .current-menu-ancestor > a { color: #E9BB4F; }
#header .cibc-nav-list > li.cibc-try-bowls > a { background: #E9BB4F; border-radius: 4px; padding: 12px 18px; color: #242c59; font-weight: 700; }
#header .cibc-nav-list > li.cibc-try-bowls > a:hover { background: #f3ce75; color: #242c59; }
#header .cibc-nav-list .sub-menu { display: none; position: absolute; min-width: 190px; top: 100%; left: 0; padding: 8px 0; z-index: 1000; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.17); border-top: 3px solid #E9BB4F; }
#header .cibc-nav-list .sub-menu .sub-menu { top: 0; left: 100%; }
#header .cibc-nav-list li:hover > .sub-menu, #header .cibc-nav-list li:focus-within > .sub-menu { display: block; }
#header .cibc-nav-list .sub-menu a { color: #343c74; padding: 10px 17px; white-space: normal; }
#header .cibc-nav-list .sub-menu a:hover { color: #343c74; background: #f3f3f8; }
#header .cibc-menu-toggle { display: none; background: none; border: 0; padding: 10px; margin: 0; min-width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; cursor: pointer; }
#header .cibc-menu-toggle span { display: block; width: 23px; height: 2px; background: #fff; border-radius: 1px; }
#header .cibc-menu-toggle:focus-visible, #header .cibc-nav-list a:focus-visible { outline: 2px solid #E9BB4F; outline-offset: 3px; }
@media (max-width: 1199px) {
 #header .cibc-brand-logo { width: 54px; height: 54px; }
 #header .cibc-brand-title { font-size: 15px; }
 #header .cibc-head-main-inner { gap: 13px; }
 #header .cibc-nav-list { gap: 10px; }
 #header .cibc-nav-list a { font-size: 11px; }
}
@media (max-width: 1050px) {
 #header .cibc-head-main-inner { min-height: 75px; flex-wrap: wrap; }
 #header .cibc-menu-toggle { display: flex; margin-left: auto; }
 #header .cibc-nav { display: none; width: 100%; flex-basis: 100%; margin-left: 0; padding-bottom: 15px; }
 #header .cibc-custom-header.cibc-nav-open .cibc-nav { display: block; }
 #header .cibc-nav-list { display: block; }
 #header .cibc-nav-list > li { border-top: 1px solid rgba(255,255,255,.15); }
 #header .cibc-nav-list a { font-size: 14px; white-space: normal; padding: 12px 8px; }
 #header .cibc-nav-list .sub-menu { position: static; display: block; background: transparent; box-shadow: none; border: 0; min-width: auto; padding: 0 0 4px 17px; }
 #header .cibc-nav-list .sub-menu .sub-menu { position: static; }
 #header .cibc-nav-list .sub-menu a { color: #fff; font-size: 13px; padding: 8px; }
 #header .cibc-nav-list .sub-menu a:hover { color: #E9BB4F; background: transparent; }
 #header .cibc-nav-list > li.cibc-try-bowls { border-top: none; margin-top: 12px; }
 #header .cibc-nav-list > li.cibc-try-bowls > a { display: inline-block; padding: 12px 22px; }
}
@media (max-width: 700px) {
 #header .cibc-head-top-inner { padding: 7px 0; }
 #header .cibc-contact-items { gap: 5px 15px; }
 #header .cibc-contact-item { font-size: 10px; white-space: normal; overflow-wrap: anywhere; }
 #header .cibc-brand-title { font-size: 13px; white-space: normal; }
 #header .cibc-brand-logo { width: 50px; height: 50px; }
 #header .cibc-brand-since { font-size: 9px; }
}

/* CIBC - Force Try Bowls button styling */

.cibc-header .cibc-header-cta,
a.cibc-header-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  background-color: #E9BB4F !important;
  color: #202857 !important;

  padding: 12px 22px !important;
  min-height: 42px;
  border-radius: 4px !important;

  font-family: "Work Sans", sans-serif;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;

  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 18px;

  border: none !important;
  box-shadow: none !important;
  transition: background-color 0.2s ease;
}

.cibc-header .cibc-header-cta:hover,
a.cibc-header-cta:hover {
  background-color: #f4ce75 !important;
  color: #202857 !important;
}


/* CIBC - Mobile and tablet Try Bowls button fixes */

@media screen and (max-width: 1050px) {

  /* Hide the separate desktop header button */
  #header a.cibc-header-cta {
    display: none !important;
  }

  /* Keep the WordPress menu's Try Bowls button visible */
  #header .cibc-nav-list > li.cibc-try-bowls {
    display: block !important;
    margin-top: 18px !important;
    margin-bottom: 22px !important;
    padding-left: 8px;
    border-top: none !important;
  }

  /* Style the button inside the hamburger menu */
  #header .cibc-nav-list > li.cibc-try-bowls > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #E9BB4F !important;
    color: #202857 !important;
    padding: 12px 22px !important;
    min-height: 42px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none !important;
    margin: 0 !important;
  }

  /* Additional space at the bottom of expanded menu */
  #header .cibc-custom-header.cibc-nav-open .cibc-nav {
    padding-bottom: 12px !important;
  }

}

/* CIBC - Show WordPress Try Bowls item on mobile only */

/* Desktop: hide duplicate menu item */
@media screen and (min-width: 1051px) {
  #header .cibc-nav-list > li.cibc-try-bowls {
    display: none !important;
  }
}

/* Mobile and tablet */
@media screen and (max-width: 1050px) {

  /* Keep separate desktop CTA hidden */
  #header a.cibc-header-cta {
    display: none !important;
  }

  /* Show Try Bowls inside hamburger menu */
  #header .cibc-nav-list > li.cibc-try-bowls {
    display: block !important;
    margin: 18px 0 22px !important;
    padding-left: 8px;
    border-top: none !important;
  }

  #header .cibc-nav-list > li.cibc-try-bowls > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #E9BB4F !important;
    color: #202857 !important;
    padding: 12px 22px !important;
    border-radius: 4px;
    font-weight: 700;
    min-height: 42px;
  }

}


/* CIBC - Enable scrolling in mobile navigation */

@media screen and (max-width: 1050px) {

  /* Allow the expanded menu to scroll vertically */
  #header .cibc-custom-header.cibc-nav-open .cibc-nav {
    display: block !important;

    max-height: calc(100dvh - 130px);
    overflow-y: auto !important;
    overflow-x: hidden !important;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    padding-bottom: 30px !important;
  }

  /* Fallback for browsers without dvh support */
  @supports not (height: 100dvh) {
    #header .cibc-custom-header.cibc-nav-open .cibc-nav {
      max-height: calc(100vh - 130px);
    }
  }

  /* Ensure Try Bowls remains accessible */
  #header .cibc-nav-list > li.cibc-try-bowls {
    margin-bottom: 20px !important;
  }

}

