/*!
 * Getlink Customs Services, mobiel menu (CSS)
 * Hoort bij glg-mobile-menu.js
 *
 * Plaatsing: Divi > Theme Options > Custom CSS, of in je child theme.
 * WP Rocket: voeg deze selector toe aan de CSS safelist van Remove Unused CSS:
 *   .glg-mm  en  .glg-burger  (en de patronen .glg-mm__*)
 *
 * Kleuren komen uit de Divi 5 globale variabelen (--gcid-primary-color en
 * --gcid-secondary-color), met de merkkleuren als fallback.
 *
 * Breakpoint: 1100px (en dezelfde waarde in glg-mobile-menu.js, CFG.breakpoint).
 * Divi schakelt zelf pas om bij 980px, maar de desktop navigatie past tussen
 * 981px en ongeveer 1090px niet meer: het logo wordt dan platgedrukt tot 60px
 * (iPad liggend). Daarom neemt dit menu het over tot en met 1100px.
 */

/* Variabelen ------------------------------------------------------------- */
.glg-mm,
.glg-burger {
  --glg-navy: var(--gcid-secondary-color, #000050);
  --glg-orange: var(--gcid-primary-color, #ff8b00);
  --glg-line: rgba(255, 255, 255, 0.14);
  --glg-muted: rgba(255, 255, 255, 0.78);
  --glg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Burger knop in de header ------------------------------------------------ */
.glg-burger {
  display: none;
  position: absolute;
  top: 50%;
  right: -6px;
  z-index: 3;
  width: 44px;
  height: 44px;
  margin: -22px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--glg-navy);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
}

.glg-burger__bars {
  position: relative;
  display: block;
  width: 24px;
  height: 18px;
}

.glg-burger__bars i {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: width 0.2s var(--glg-ease);
}

.glg-burger__bars i:nth-child(1) { top: 0; }
.glg-burger__bars i:nth-child(2) { top: 8px; }
.glg-burger__bars i:nth-child(3) { top: 16px; }

.glg-burger:hover .glg-burger__bars i:nth-child(2) { width: 70%; }

.glg-burger:focus-visible,
.glg-mm__close:focus-visible,
.glg-mm a:focus-visible,
.glg-mm button:focus-visible {
  outline: 3px solid var(--glg-orange);
  outline-offset: 2px;
}

.glg-mm-host {
  position: relative;
}

/* Divi navigatie vervangen, alleen als de nieuwe versie actief is --------- */
@media (max-width: 1100px) {
  html.glg-mm-ready .hoofd-menu .et_pb_menu__menu,
  html.glg-mm-ready .hoofd-menu .et_mobile_nav_menu,
  html.glg-mm-ready .hoofd-menu .mobile_nav,
  html.glg-mm-ready .hoofd-menu .et_mobile_menu {
    display: none !important;
  }

  html.glg-mm-ready .glg-burger {
    display: flex;
  }
}

@media (min-width: 1101px) {
  .glg-mm,
  .glg-burger {
    display: none !important;
  }
}

/* Scroll lock ------------------------------------------------------------- */
html.glg-mm-lock,
html.glg-mm-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Paneel ------------------------------------------------------------------ */
.glg-mm {
  --glg-bar-h: 52px;
  --glg-gutter: 15px;
  --glg-logo-w: 119px;
  /* Op een tablet blijft de inhoud op leesbare breedte (560px) */
  --glg-pad: max(var(--glg-gutter), calc((100vw - 560px) / 2));
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--glg-navy);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition:
    opacity 0.26s ease,
    transform 0.34s var(--glg-ease),
    visibility 0s linear 0.34s;
}

.glg-mm.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

.glg-mm *,
.glg-mm *::before,
.glg-mm *::after {
  box-sizing: border-box;
}

.glg-mm ul,
.glg-mm li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.glg-mm a {
  text-decoration: none;
}

.glg-mm button {
  margin: 0;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* Bovenbalk, gelijk aan de header zodat het menu vloeiend overgaat -------- */
.glg-mm__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--glg-bar-h);
  padding: 0 calc(var(--glg-gutter) - 6px) 0 var(--glg-gutter);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.glg-mm__logo {
  display: block;
  line-height: 0;
}

.glg-mm__logo img {
  display: block;
  width: var(--glg-logo-w);
  max-width: none;
  height: auto;
}

.glg-mm__close {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--glg-navy);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.glg-mm__close i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 24px;
  height: 2px;
  margin: -1px 0 0 -12px;
  border-radius: 2px;
  background: currentColor;
}

.glg-mm__close i:nth-child(1) { transform: rotate(45deg); }
.glg-mm__close i:nth-child(2) { transform: rotate(-45deg); }

/* Scrollgebied ------------------------------------------------------------ */
.glg-mm__scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px var(--glg-pad) 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.glg-mm__nav {
  flex: none;
}

/* Hoofditems -------------------------------------------------------------- */
.glg-mm__item {
  border-bottom: 1px solid var(--glg-line);
}

.glg-mm__row {
  display: flex;
  align-items: stretch;
}

.glg-mm__link {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 4px;
  border: 0;
  background: none;
  color: #fff;
  font-size: clamp(1.25rem, 5.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}

.glg-mm__item.is-current > .glg-mm__link,
.glg-mm__item.is-current > .glg-mm__row > .glg-mm__link,
.glg-mm__item.is-branch > .glg-mm__link,
.glg-mm__item.is-branch > .glg-mm__row > .glg-mm__link {
  color: var(--glg-orange);
}

/* Actieve pagina krijgt een oranje streep aan de schermrand */
.glg-mm__item.is-current > .glg-mm__link::before,
.glg-mm__item.is-current > .glg-mm__row > .glg-mm__link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--glg-pad) * -1);
  width: 4px;
  height: 28px;
  margin-top: -14px;
  border-radius: 0 3px 3px 0;
  background: var(--glg-orange);
}

/* Chevron cirkel, gelijk aan de bestaande oranje chevron in de site */
.glg-mm__chev {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glg-orange);
  color: var(--glg-navy);
  transition: transform 0.3s var(--glg-ease);
}

.glg-mm__item.is-expanded .glg-mm__chev {
  transform: rotate(180deg);
}

/* Aparte chevron knop naast een link die zelf ook een pagina is */
.glg-mm__split {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* Submenu met vloeiende hoogte animatie ----------------------------------- */
.glg-mm__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--glg-ease);
}

.glg-mm__item.is-expanded > .glg-mm__sub {
  grid-template-rows: 1fr;
}

.glg-mm__sub > ul {
  min-height: 0;
  padding: 0 0 0 16px;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 0.32s;
}

.glg-mm__item.is-expanded > .glg-mm__sub > ul {
  visibility: visible;
  transition-delay: 0s;
}

.glg-mm__sub li:last-child {
  padding-bottom: 8px;
}

.glg-mm__sublink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 8px 4px;
  color: var(--glg-muted);
  font-size: 1.0625rem;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}

.glg-mm__sublink::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glg-orange);
}

.glg-mm__sublink:hover,
.glg-mm__sublink[aria-current="page"] {
  color: #fff;
}

.glg-mm__sublink[aria-current="page"] {
  font-weight: 600;
}

/* Onderkant: acties binnen duimbereik ------------------------------------- */
/* De actieknoppen blijven altijd onderin beeld, ook als het submenu openstaat */
.glg-mm__foot {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 12px;
  margin: auto calc(var(--glg-pad) * -1) 0;
  padding: 20px var(--glg-pad) max(24px, env(safe-area-inset-bottom));
  background: var(--glg-navy);
}

.glg-mm__foot::before {
  content: "";
  position: absolute;
  top: -24px;
  right: 0;
  left: 0;
  height: 24px;
  background: linear-gradient(to top, var(--glg-navy), rgba(0, 0, 80, 0));
  pointer-events: none;
}

.glg-mm__cta,
.glg-mm__tel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, filter 0.2s ease, background-color 0.2s ease;
}

.glg-mm__cta {
  background: var(--glg-orange);
  color: var(--glg-navy);
}

.glg-mm__cta:hover {
  filter: brightness(1.06);
}

.glg-mm__tel {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 500;
}

.glg-mm__tel svg {
  color: var(--glg-orange);
}

.glg-mm__tel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.glg-mm__cta:active,
.glg-mm__tel:active {
  transform: scale(0.98);
}

.glg-mm__lang {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}

.glg-mm__lang-label {
  margin-right: auto;
  color: var(--glg-muted);
  font-size: 0.9375rem;
}

.glg-mm__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.glg-mm__chip img {
  display: block;
  width: 20px;
  height: auto;
  border-radius: 2px;
}

.glg-mm__chip[aria-current="true"] {
  border-color: var(--glg-orange);
  background: rgba(255, 139, 0, 0.14);
}

/* Items verschijnen na elkaar --------------------------------------------- */
.glg-mm__item,
.glg-mm__foot > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.glg-mm.is-open .glg-mm__item,
.glg-mm.is-open .glg-mm__foot > * {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.35s ease calc(var(--i, 0) * 45ms + 90ms),
    transform 0.45s var(--glg-ease) calc(var(--i, 0) * 45ms + 90ms);
}

/* Minder beweging op verzoek ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .glg-mm,
  .glg-mm *,
  .glg-burger,
  .glg-burger * {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation: none !important;
  }

  .glg-mm {
    transform: none;
  }
}

/* Lage schermen, zoals een telefoon in landschap: alles scrolt mee -------- */
@media (max-height: 520px) {
  .glg-mm__link {
    min-height: 52px;
  }

  .glg-mm__foot {
    position: static;
  }

  .glg-mm__foot::before {
    display: none;
  }
}
