/* ==========================================================================
   Desktop header
   ========================================================================== */

.site-header .container {
  padding: 1rem 0;
}

.site-header .container .header-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/*
 * Modern navigation is hidden on desktop by default.
 */
.mobile-site-header,
.mobile-workshop-drawer,
.mobile-workshop-backdrop {
  display: none;
}

/* ==========================================================================
   Tablet and mobile header: 0–991.98px
   ========================================================================== */

@media (max-width: 991.98px) {
  /*
   * Hide the original desktop header/navigation.
   *
   * Keep only selectors that exist in header.php.
   * If the desktop header itself has class="site-header-desktop",
   * this selector is sufficient.
   */
  .site-header-desktop {
    display: none !important;
  }

  /*
   * Do not use the obsolete map-layout selector:
   * .workshops-map-sidebar__navigation
   *
   * The universal layout now uses .page-grid__menu.
   */
  .page-grid__menu {
    display: none !important;
  }

  /* ==========================================================
     Compact top header
     ========================================================== */

  .mobile-site-header {
    position: sticky;
    z-index: 900;
    top: 0;

    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;

    min-height: 72px;
    padding: 10px 14px;

    border-bottom: 1px solid #e6e8eb;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 3px 14px rgba(17, 24, 39, 0.07);
    backdrop-filter: blur(10px);
  }

  .mobile-site-header__menu {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    width: 42px;
    height: 42px;
    padding: 0;

    border: none;
    border-radius: 0;
    background: #ffffff;
    

    cursor: pointer;
  }

  .mobile-site-header__menu span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #262b31;
  }

  .mobile-site-header__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
  }

  .mobile-site-header__logo img {
    display: block;
    width: 112px;
    max-height: 42px;
    object-fit: contain;
  }

  .mobile-site-header__languages {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }

  .mobile-site-header__languages a {
    color: #656d76;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
  }

  .mobile-site-header__languages a + a::before {
    margin-right: 5px;
    color: #a2a7ad;
  }

  /* ==========================================================
     Drawer backdrop
     ========================================================== */

  .mobile-workshop-backdrop {
    position: fixed;
    z-index: 1998;
    inset: 0;

    display: block;

    background: rgba(17, 24, 39, 0.52);
    opacity: 0;
    visibility: hidden;

    transition:
      opacity 220ms ease,
      visibility 220ms ease;
  }

  .mobile-workshop-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* ==========================================================
     Workshop drawer
     ========================================================== */

  .mobile-workshop-drawer {
    position: fixed;
    z-index: 1999;
    top: 0;
    bottom: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    width: min(86vw, 360px);
    overflow: hidden;

    background: #ffffff;
    box-shadow: 14px 0 40px rgba(17, 24, 39, 0.24);

    transform: translateX(-105%);
    transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .mobile-workshop-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-workshop-drawer__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 68px;
    padding: 14px 18px;

    border-bottom: 1px solid #eceef1;
  }

  .mobile-workshop-drawer__header h2 {
    margin: 0;
    color: #22272d;
    font-size: 18px;
    font-weight: 700;
  }

  .mobile-workshop-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    padding: 0;

    border: 1px solid #e2e5e9;
    border-radius: 50%;
    background: #ffffff;

    color: #505862;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-workshop-drawer__languages {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 15px 18px;
    border-bottom: 1px solid #eceef1;

    color: #9aa0a7;
    font-size: 12px;
  }

  .mobile-workshop-drawer__languages a {
    color: #626a74;
    font-weight: 500;
    text-decoration: none;
  }

  .mobile-workshop-drawer__navigation {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 0 24px;

    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-workshop-group {
    padding: 14px 18px 5px;
  }

  .mobile-workshop-group + .mobile-workshop-group {
    border-top: 1px solid #f0f1f3;
  }

  .mobile-workshop-group h3 {
    margin: 0 0 8px;

    color: #9a9fa6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .mobile-workshop-group a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;

    min-height: 48px;
    padding: 9px 9px;

    border-bottom: 1px solid #f1f2f4;

    color: #3d444c;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
  }

  .mobile-workshop-group a:last-child {
    border-bottom: 0;
  }

  .mobile-workshop-link__arrow {
    color: #f78d1f;
    font-size: 24px;
    font-weight: 300;
    text-align: right;
  }

  .mobile-workshop-drawer__footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));

    border-top: 1px solid #eceef1;
    background: linear-gradient(to top, #ffffff 75%, rgba(255, 255, 255, 0.92));
  }

  .mobile-workshop-register {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 10px 16px;

    border-radius: 8px;
    background: #f78d1f;
    box-shadow: 0 5px 14px rgba(247, 141, 31, 0.27);

    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
  }

  .mobile-workshop-register:hover,
  .mobile-workshop-register:focus {
    background: #e07e00;
    color: #ffffff;
  }

  body.mobile-workshop-menu-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* Hidden by default on desktop */
.mobile-register-bar {
  display: none;
}

@media (max-width: 767.98px) {
  /*
   * Reserve room so the fixed button does not cover the bottom
   * of the page content.
   */
.page-grid__register{
  display: none !important;
}

  body:has(.mobile-register-bar[data-visible="true"]) {
    padding-bottom:
      calc(92px + env(safe-area-inset-bottom));
  }

  .mobile-register-bar {
    position: fixed;
    z-index: 1100;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;

    display: block;

    opacity: 1;
    visibility: visible;
    transform: translateY(0);

    transition:
      transform 260ms cubic-bezier(.22, .61, .36, 1),
      opacity 220ms ease,
      visibility 220ms ease;
  }

  .mobile-register-bar__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 56px;
    padding: 12px 20px;

    border-radius: 12px;
    background: #f78d1f;
    box-shadow:
      0 10px 28px rgba(17, 24, 39, 0.22),
      0 4px 10px rgba(247, 141, 31, 0.25);

    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
  }

  .mobile-register-bar__link:hover,
  .mobile-register-bar__link:focus-visible {
    background: #e97f0c;
    color: #ffffff;
  }

  .mobile-register-bar__arrow {
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
  }

  /*
   * Slides the bar below the viewport.
   */
  .mobile-register-bar.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(
      calc(100% + 30px + env(safe-area-inset-bottom))
    );
  }
}

@media (min-width: 768px) {
  .mobile-register-bar {
    display: none !important;
  }
}

