/* ==========================================================
 * SP Header 2026 – Mobile menu
 * Breakpoint 1024px: uskladi sa breakpointom na kom ti se
 * pojavljuje .header__mobile-toggle (i u JS resize handleru).
 * ========================================================== */

.header__mobile-menu {
  display: none;
}

/* Hamburger <-> X icon swap */
.header__mobile-icon-close {
  display: none;
}
.header__mobile-toggle.is-open .header__mobile-icon-open {
  display: none;
}
.header__mobile-toggle.is-open .header__mobile-icon-close {
  display: block;
}

@media (max-width: 1024px) {
  .header__mobile-menu {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--sp-header-h, 72px);
    height: calc(100vh - var(--sp-header-h, 72px));
    height: calc(100dvh - var(--sp-header-h, 72px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    padding: 16px 20px 32px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }

  .header__mobile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s ease, transform .25s ease;
  }

  /* Close (X) button at the top of the menu, stays visible while scrolling */
  .header__mobile-top {
    position: sticky;
    top: -16px;
    display: flex;
    justify-content: flex-end;
    margin: -16px -20px 0;
    padding: 12px 12px 4px;
    background: #fff;
    z-index: 2;
  }

  .header__mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .05);
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .header__mobile-nav {
    display: flex;
    flex-direction: column;
  }

  .header__mobile-link,
  .header__mobile-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .header__mobile-group-toggle svg {
    flex-shrink: 0;
    transition: transform .2s ease;
  }

  .header__mobile-group.open .header__mobile-group-toggle svg {
    transform: rotate(180deg);
  }

  .header__mobile-sub {
    display: none;
    flex-direction: column;
    padding: 6px 0 12px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  .header__mobile-group.open .header__mobile-sub {
    display: flex;
  }

  .header__mobile-group.open .header__mobile-group-toggle {
    border-bottom-color: transparent;
  }

  /* ---- Mega menu content inside mobile submenu (same HTML as desktop) ---- */
  .header__mobile-sub {
    padding: 8px 0 20px;
  }

  .header__mobile-overview {
    display: block;
    padding: 6px 0 14px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
  }

  .header__mobile-sub .mega-menu__grid {
    display: flex !important;
    flex-direction: column;
    gap: 24px;
    grid-template-columns: none !important;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .header__mobile-sub .mega-menu__col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .header__mobile-sub .mega-menu__column-title {
    margin-bottom: 10px;
  }

  .header__mobile-sub .mega-menu__items {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .header__mobile-sub .mega-menu__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    text-decoration: none;
    color: inherit;
  }

  .header__mobile-sub .mega-menu__item-text h4,
  .header__mobile-sub .mega-menu__item-text p {
    margin: 0;
  }

  .header__mobile-sub .mega-menu-aw__thumb,
  .header__mobile-sub .mega-menu__item-icon {
    flex-shrink: 0;
  }

  .header__mobile-sub img {
    max-width: 100%;
    height: auto;
  }

  .header__mobile-sub .mega-menu__featured-image img,
  .header__mobile-sub .mega-menu__col-image img {
    width: 100%;
    display: block;
    border-radius: 8px;
  }

  .header__mobile-sub .mega-menu__featured-link,
  .header__mobile-sub .mega-menu__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
  }

  .header__mobile-sub .mega-menu__featured-link svg,
  .header__mobile-sub .mega-menu__footer-link svg {
    width: 16px;
    height: 16px;
  }

  /* Teams icon in the demo button: same height as the text */
  .header__mobile-sub .mega-menu-aw__demo-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .5em;
    line-height: 1.2;
  }

  .header__mobile-sub .mega-menu-aw__demo-btn svg {
    width: auto !important;
    height: 1.1em !important;
    max-width: none;
    flex-shrink: 0;
  }

  .header__mobile-sub .mega-menu-aw__demo {
    padding: 20px;
    border-radius: 12px;
  }

  .header__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
  }

  .header__mobile-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .header__mobile-menu .lang-switcher {
    display: flex;
    gap: 16px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
  }

  .header__mobile-menu .lang-switcher .current a {
    font-weight: 700;
    text-decoration: underline;
  }
}
