/* ===========================================
   Qwiek Child Theme — Match webshop header
   webshop.qwiek.eu reference
   =========================================== */

/* -----------------------------------------------
   1. GLOBAL HEADER STYLES
   ----------------------------------------------- */

/* Subtle shadow on header (matches webshop) */
.header {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

/* -----------------------------------------------
   2. DESKTOP LAYOUT (≥ 768px)
   3-column grid: [logo/nav module] [center nav] [lang switcher]
   The mega-menu module renders both logo and nav,
   so we use CSS to split them visually.
   ----------------------------------------------- */

@media (min-width: 768px) {

  /* Main header container — full width, logo flush left, lang flush right */
  .inner-header.container {
    display: flex;
    align-items: center;
    padding: calc(8px * 2.25) 2rem calc(8px * 2) !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Hamburger is mobile-only */
  .header__block-toggle {
    display: none;
  }

  /* Logo — fixed left, does not shrink. Now a direct child of .inner-header
     (sibling of .header__block) so it stays in the bar on all breakpoints. */
  .header__logo {
    flex-shrink: 0;
    order: 0;
  }

  /* Block holds nav + lang and fills the remaining space next to the logo */
  .header__block {
    order: 1;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    width: auto;
    gap: 1rem;
  }

  .header__logo img,
  .header__logo .hs-image-widget {
    max-width: 120px !important;
    width: auto !important;
    height: auto !important;
    display: block;
  }

  /* Navigation area — grows to fill center */
  .header__nav {
    display: flex;
    flex-grow: 1;
    justify-content: center;
  }

  /* -----------------------------------------------
     3. NAVIGATION FONT MATCHING
     Match webshop: Source Sans Pro, 18px, normal
     ----------------------------------------------- */

  /* Main nav links and dropdown triggers */
  .main-nav-list .main-nav__item>a,
  .main-nav-list .main-nav__item>.drop-trigger {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 18px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #1a1a1a;
    transition: color 0.2s ease;
  }

  .main-nav-list .main-nav__item>a:hover,
  .main-nav-list .main-nav__item>.drop-trigger:hover {
    color: #67257a;
  }

  /* Dropdown trigger buttons (items with submenus) */
  .header__nav button,
  .main-nav-list .main-nav__item>.drop-trigger {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 18px;
    font-weight: 400;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  /* Dropdown labels match same style */
  .main-nav-list .main-nav__item .main-nav__item-label {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 18px;
    font-weight: 400;
    text-transform: none;
  }

  /* -----------------------------------------------
     4. DROPDOWN CHEVRON STYLING
     Small subtle chevron matching Shopify
     ----------------------------------------------- */

  /* Gebruik de originele HubSpot chevron container, maar verberg de originele inhoud */
  .main-nav__item-icon * {
    display: none !important;
  }

  /* Voeg de Shopify chevron toe via een CSS mask op de bestaande container */
  .main-nav__item-icon {
    display: inline-block !important;
    width: 14px;
    height: 14px;
    margin-left: 3px;
    vertical-align: middle;
    opacity: 0.6;
    transition: transform 0.2s ease;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72'%3E%3Cg transform='rotate(-90 -0.00000157361 72)'%3E%3Cpath d='m48.688,81.162l0.876,0.876a1.487,1.487 0 0 1 0,2.1l-24.222,24.225l24.223,24.223a1.487,1.487 0 0 1 0,2.1l-0.876,0.876a1.487,1.487 0 0 1 -2.1,0l-26.154,-26.148a1.487,1.487 0 0 1 0,-2.1l26.151,-26.153a1.487,1.487 0 0 1 2.1,0l0.002,0.001z'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72'%3E%3Cg transform='rotate(-90 -0.00000157361 72)'%3E%3Cpath d='m48.688,81.162l0.876,0.876a1.487,1.487 0 0 1 0,2.1l-24.222,24.225l24.223,24.223a1.487,1.487 0 0 1 0,2.1l-0.876,0.876a1.487,1.487 0 0 1 -2.1,0l-26.154,-26.148a1.487,1.487 0 0 1 0,-2.1l26.151,-26.153a1.487,1.487 0 0 1 2.1,0l0.002,0.001z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
  }

  .main-nav__item.menu-drop:hover > .drop-trigger .main-nav__item-icon {
    transform: rotate(180deg);
  }

  /* -----------------------------------------------
     5. DROPDOWN MENU STYLING
     Hover-triggered, matching Shopify behavior
     ----------------------------------------------- */

  /* Underline effect on hover (matches Shopify's wt-page-nav-mega__link__text::after) */
  .main-nav-list .main-nav__item>a .main-nav__item-label,
  .main-nav-list .main-nav__item>.drop-trigger .main-nav__item-label {
    position: relative;
    display: inline-block;
  }

  .main-nav-list .main-nav__item>a .main-nav__item-label::after,
  .main-nav-list .main-nav__item>.drop-trigger .main-nav__item-label::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s ease;
  }

  .main-nav-list .main-nav__item:hover>a .main-nav__item-label::after,
  .main-nav-list .main-nav__item:hover>.drop-trigger .main-nav__item-label::after {
    transform: scaleX(1);
  }

  /* Open dropdown on hover (desktop) — parent theme uses height:0 + overflow:hidden + visibility:hidden */
  .main-nav__item.menu-drop:hover>.menu-drop-panel.sub-menu-drop {
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
  }

  /* Schakel klik-gedrag uit op desktop zodat het menu niet geforceerd open blijft staan */
  @media screen and (min-width: 768px) {
    .main-nav__item.menu-drop > .drop-trigger {
      pointer-events: none;
    }
  }

  /* Dropdown panel */
  .menu-drop-panel.sub-menu-drop {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #f0f0f0;
  }

  @media screen and (min-width: 768px) {
    .menu-drop-panel.sub-menu-drop {
      top: unset !important;
    }
  }

  /* Submenu item labels */
  .sub-menu__item {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 18px;
    font-weight: 400;
  }

  /* Submenu links */
  .sub-menu__item a {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #333;
    padding: 8px 0;
    display: block;
    transition: color 0.2s ease;
  }

  .sub-menu__item a:hover {
    color: #67257a;
  }

  /* -----------------------------------------------
     6. LANGUAGE SWITCHER
     Custom "NL ∨" style matching webshop
     ----------------------------------------------- */

  .header__lang {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .lang-switcher {
    position: relative;
  }

  /* Trigger button — "NL ∨" */
  .lang-switcher__trigger {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    line-height: 1;
    transition: color 0.2s ease;
  }

  .lang-switcher__trigger:hover {
    color: #67257a;
  }

  /* Chevron arrow — Shopify's svg-icon--arrow-down scaled to match */
  .lang-switcher__chevron {
    width: 10px;
    height: 10px;
    margin-left: 2px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .lang-switcher[data-open="true"] .lang-switcher__chevron,
  .lang-switcher:hover .lang-switcher__chevron,
  .lang-switcher:focus-within .lang-switcher__chevron {
    transform: rotate(180deg);
  }

  /* Dropdown list — controlled via visibility/opacity (not display) so we can
     add a small close-delay. Kept always display:block on desktop; the [hidden]
     attribute is overridden here so hover/focus can reveal it calmly. */
  .lang-switcher__list {
    position: absolute;
    top: 100%;
    right: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.3s;
    margin-top: 6px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    min-width: 90px;
    z-index: 100;
    padding: 6px 0;
    list-style: none;
  }

  /* Invisible hover bridge over the gap between trigger and dropdown, so the
     pointer stays "inside" the switcher while travelling down to the list. */
  .lang-switcher::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    min-width: 90px;
    height: 0;
  }

  /* Reveal on hover, keyboard focus, or the JS click toggle. The show has no
     delay; hiding waits 0.3s (see transition above) so it doesn't snap shut. */
  .lang-switcher:hover .lang-switcher__list,
  .lang-switcher:focus-within .lang-switcher__list,
  .lang-switcher[data-open="true"] .lang-switcher__list {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }

  .lang-switcher:hover::after,
  .lang-switcher:focus-within::after {
    height: 12px;
  }

  /* Language links in dropdown */
  .lang-switcher__link {
    display: block;
    padding: 6px 16px;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .lang-switcher__link:hover {
    background: #f5f5f5;
    color: #67257a;
  }

  /* Active language — highlighted */
  .lang-switcher__link--active {
    font-weight: 600;
    color: #67257a;
  }

  /* -----------------------------------------------
     7. LOGO SIZING
     Match webshop: ~150px desktop width
     ----------------------------------------------- */

  .header__logo img,
  .header__logo a img,
  .logo img {
    max-width: 150px;
    height: auto;
  }
}

/* -----------------------------------------------
   8. MOBILE STYLES (< 768px)
   Match the webshop mobile header:
   - closed bar: hamburger left, logo centered
   - open drawer: full-width list, label left + "+" right,
     divider lines, accordion sub-menus
   ----------------------------------------------- */

@media (max-width: 767px) {

  /* --- Bar: hamburger (left) + centered logo --- */
  /* Let the absolute drawer escape the header box and sit on top of the page */
  .header {
    position: relative;
    height: auto;
    overflow: visible;
    z-index: 100;
  }

  /* Collapsed bar 70.5px to match webshop.qwiek.eu
     (logo 42.5px + 2×14px padding). min-height carries the height because the
     logo is absolutely positioned and doesn't drive the flex row. */
  .inner-header.container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    min-height: 70.5px;
    padding: 14px 16px !important;
    position: relative;
  }

  .header__block-toggle {
    order: 1;
    margin: 0;
    position: relative;
    z-index: 30;
  }

  /* Logo centered in the bar regardless of the hamburger width */
  .header__logo {
    order: 2;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }

  /* Logo 42.5px tall to match the webshop. !important overrides the inline
     width/height the HubSpot logo module prints on the <img>. */
  .header__logo img,
  .header__logo a img,
  .logo img {
    height: 42.5px !important;
    width: auto !important;
    max-width: none !important;
    display: block;
  }

  /* While the drawer is open: hide the logo and move the close (×) to the right,
     matching the webshop. The logo is hidden and the drawer is absolute, so the
     toggle is the only flex child — flex-end pushes it to the right edge. */
  .header.js-launch .header__logo {
    display: none;
  }

  .header.js-launch .inner-header.container {
    justify-content: flex-end;
  }

  /* --- Drawer: sits directly under the bar, height driven by .js-launch --- */
  .header__block {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    display: block;
    height: 0;
    overflow: hidden;
    opacity: 0;
    background: #ffffff;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.06);
    z-index: 20;
  }

  .header.js-launch .header__block {
    height: auto;
    max-height: calc(100vh - 70.5px);
    overflow-y: auto;
    opacity: 1;
  }

  .header__nav {
    width: 100%;
    display: block;
  }

  .header__nav > .hs_cos_wrapper,
  .header__nav nav {
    width: 100%;
    display: block;
  }

  /* --- Top-level list --- */
  .main-nav-list {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
  }

  /* Item rhythm matches the webshop: 12px item padding + 8px/24lh link = ~64px rows */
  .main-nav__item {
    display: block;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid #ececec;
  }

  .main-nav__item > a,
  .main-nav__item > .drop-trigger {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 32px;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #151515;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
  }

  .main-nav__item .main-nav__item-label {
    order: 0;
    margin-right: auto;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #151515;
    text-transform: none;
    text-align: left;
  }

  /* Chevron icon → "+" on the right; rotates to "×" when the item is open */
  .main-nav__item .main-nav__item-icon {
    order: 9;
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin: 0 0 0 12px;
    background-color: #151515;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.2s ease;
  }

  .main-nav__item .main-nav__item-icon * {
    display: none;
  }

  .main-nav__item.is-active > .drop-trigger .main-nav__item-icon {
    transform: rotate(45deg);
  }

  /* --- Accordion sub-menus --- */
  .menu-drop-panel.sub-menu-drop {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fafafa;
  }

  .main-nav__item.is-active > .menu-drop-panel.sub-menu-drop {
    height: auto;
    overflow: visible;
    visibility: visible;
    padding: 4px 0 10px;
  }

  .sub-menu__item {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
  }

  .sub-menu__item a {
    display: block;
    padding: 8px 32px 8px 44px;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #151515;
    text-decoration: none;
  }

  /* --- Language switcher as a bottom row --- */
  .header__lang {
    display: block;
    margin: 0;
    border-top: 1px solid #ececec;
  }

  .lang-switcher {
    padding: 14px 20px;
  }

  .lang-switcher__trigger {
    display: inline-flex;
    align-items: center;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
    background: none;
    border: none;
    padding: 0;
  }

  .lang-switcher__chevron {
    width: 12px;
    height: 12px;
    margin-left: 6px;
  }

  .lang-switcher__list {
    position: static;
    box-shadow: none;
    margin: 0;
    padding: 6px 0 0;
    list-style: none;
  }

  .lang-switcher__link {
    display: block;
    padding: 8px 0;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #151515;
    text-decoration: none;
  }

  .lang-switcher__link--active {
    font-weight: 600;
  }
}
.lang-switcher__link--active {
    font-weight: 600;
  }
}
/* --- MYQWIEK KNOP HUBSPOT (GEEN ONDERLIJN MOBIEL) --- */
.main-nav-list > li:has(> a[href*="my.qwiek.eu"]) {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-left: 15px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.main-nav-list > li > a[href*="my.qwiek.eu"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: fit-content !important;
  background-color: #FFD000 !important;
  color: #000000 !important;
  padding: 10px 28px !important;
  border-radius: 50px !important;
  font-weight: normal !important;
  text-decoration: none !important;
  border-bottom: none !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transition: none !important;
}

.main-nav-list > li > a[href*="my.qwiek.eu"] span {
  background: transparent !important;
  color: #000000 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline !important;
  font-size: inherit !important;
}

.main-nav-list > li > a[href*="my.qwiek.eu"]:hover {
  background-color: #e6bc00 !important;
  color: #000000 !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

/* Submenu herstellen */
.sub-menu-drop a[href*="my.qwiek.eu"] {
  background: transparent !important;
  color: #333333 !important;
  padding: 8px 0 !important;
  border-radius: 0 !important;
  display: block !important;
  transform: none !important;
  transition: none !important;
}

.sub-menu-drop a[href*="my.qwiek.eu"]:hover {
  background: transparent !important;
  color: #67257a !important;
  transform: none !important;
}

/* Mobiel instellingen */
@media (max-width: 767px) {
  .main-nav-list > li {
    margin-left: 0 !important;
  }

  .main-nav-list > li:has(> a[href*="my.qwiek.eu"]) {
    margin-left: 32px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    display: block !important;
    border-bottom: none !important; /* Haalt het grijze lijntje onder de knop weg */
  }

  .main-nav-list > li > a[href*="my.qwiek.eu"] {
    width: auto !important;
    display: inline-flex !important;
  }
}
/* --- FIX RANDJE BIJ SLUITEN DROPDOWN --- */
.menu-drop-panel.sub-menu-drop {
  border-top: none !important; /* Verwijder de rand die doorsnijdt */
  transition: opacity 0.15s ease, visibility 0.15s ease !important;
}

/* Verberg rand/schaduw direct als de muis het menu verlaat */
.main-nav__item.menu-drop:not(:hover) > .menu-drop-panel.sub-menu-drop {
  opacity: 0 !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
}