.gsm-wrap {
  position: relative;
  width: 100%;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gsm-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  font-weight: 600;
  text-align: left;
  align-items: center;
  justify-content: space-between;
}

.gsm-nav {
  width: 100%;
}

.gsm-top {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
  margin: 0;
  padding: 0;
}

.gsm-item {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  justify-content: center;
}

.gsm-link,
.gsm-child-link {
  display: block;
  text-decoration: none;
}

.gsm-link {
  width: 100%;
  padding: 14px 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gsm-subtoggle {
  display: none;
  padding: 14px 12px 14px 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.gsm-subtoggle-close {
  display: none;
}

.gsm-item.is-open > .gsm-subtoggle .gsm-subtoggle-open {
  display: none;
}

.gsm-item.is-open > .gsm-subtoggle .gsm-subtoggle-close {
  display: inline;
}

.gsm-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 260px;
  max-width: min(1240px, calc(100vw - 30px));
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-height: min(70vh, 760px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 100;
}

.gsm-item:hover > .gsm-dropdown,
.gsm-item:focus-within > .gsm-dropdown,
.gsm-item.is-open > .gsm-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gsm-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  padding: 10px;
}

.gsm-child-link {
  padding: 10px 12px;
  border-radius: 6px;
}

.gsm-link:hover,
.gsm-link:focus,
.gsm-child-link:hover,
.gsm-child-link:focus {
  text-decoration: none;
  background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 991.98px) {
  .gsm-wrap {
    z-index: 10000;
    background: transparent;
    border: 0;
    pointer-events: none;
  }

  .gsm-toggle {
    display: flex;
    min-height: 48px;
    position: relative;
    z-index: 3;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none !important;
  }

  .gsm-toggle > * {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    padding: 0 10px;
    margin: 0 -10px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
  }

  .gsm-nav {
    display: none;
  }

  .gsm-wrap.is-open .gsm-nav {
    display: block;
    position: relative;
    z-index: 2;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    pointer-events: auto;
  }

  .gsm-top {
    display: block;
  }

  .gsm-item {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .gsm-link {
    flex: 1 1 auto;
    width: auto;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding: 14px 16px;
    min-height: 48px;
  }

  .gsm-subtoggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .gsm-dropdown {
    position: static;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .gsm-item.is-open > .gsm-dropdown {
    display: block;
  }

  .gsm-dropdown-grid {
    padding: 0 10px 10px;
    grid-template-columns: 1fr;
  }

  .gsm-child-link {
    display: flex;
    align-items: center;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsm-dropdown {
    transition: none;
  }
}
