/* MSP 5.1.5: jeden identyczny navbar na starych i nowych podstronach. */

.msp-v2-global-header-shell,
.msp-v2-global-header-shell *,
.msp-v2-global-header-shell *::before,
.msp-v2-global-header-shell *::after {
  box-sizing: border-box;
}

.msp-v2-global-header-shell {
  position: relative;
  z-index: 1000;
  width: 100%;
  font-family: var(--msp-sans);
  line-height: 1.45;
}

.msp-v2-global-header-shell a {
  color: inherit;
  text-decoration: none !important;
  box-shadow: none !important;
}

.msp-v2-global-header-shell img {
  display: block;
  max-width: 100%;
  height: auto;
}

.msp-v2-global-header-shell button {
  font: inherit;
}

.msp-v2-global-header-shell .msp-v2-container {
  width: min(calc(100% - 48px), 1480px) !important;
  max-width: none !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.msp-v2-global-header-shell .msp-v2-announcement,
.msp-v2-global-header-shell .msp-v2-header {
  width: 100%;
}

.msp-v2-global-header-shell .msp-v2-announcement {
  color: rgba(255,255,255,.9);
}

.msp-v2-global-header-shell .msp-v2-announcement a {
  color: rgba(255,255,255,.92) !important;
}

.msp-v2-global-header-shell .msp-v2-announcement a:hover {
  color: #fff !important;
}

.msp-v2-global-header-shell .msp-v2-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.msp-v2-global-header-shell .msp-v2-cart-link {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--msp-line);
  color: var(--msp-navy) !important;
  background: #fff;
}

.msp-v2-global-header-shell .msp-v2-cart-link svg {
  width: 21px;
  height: 21px;
}

.msp-v2-global-header-shell .msp-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--msp-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.msp-v2-global-header-shell .msp-v2-header-cta {
  white-space: nowrap;
}

/* Stare strony Avady nie mogą renderować drugiego, niezależnego nagłówka. */
body.msp-v2-legacy-unified-header .fusion-tb-header,
body.msp-v2-legacy-unified-header .fusion-header-wrapper,
body.msp-v2-legacy-unified-header .fusion-header,
body.msp-v2-legacy-unified-header .fusion-secondary-header,
body.msp-v2-legacy-unified-header #side-header,
body.msp-v2-legacy-unified-header .fusion-mobile-menu-icons,
body.msp-v2-legacy-unified-header .fusion-sticky-spacer {
  display: none !important;
}

body.msp-v2-legacy-unified-header #wrapper,
body.msp-v2-legacy-unified-header .fusion-wrapper {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Nagłówek jest zawsze w normalnym przepływie i ma identyczne wymiary. */
.msp-v2-global-header-shell .msp-v2-header,
.msp-v2-global-header-shell .msp-v2-header.is-sticky,
.admin-bar .msp-v2-global-header-shell .msp-v2-header,
.admin-bar .msp-v2-global-header-shell .msp-v2-header.is-sticky {
  position: relative !important;
  top: auto !important;
  transform: none !important;
}

@media (max-width: 1180px) {
  .msp-v2-global-header-shell .msp-v2-container {
    width: min(calc(100% - 36px), 1480px) !important;
  }
}

@media (max-width: 980px) {
  .msp-v2-global-header-shell .msp-v2-container {
    width: min(calc(100% - 28px), 1480px) !important;
  }

  .msp-v2-global-header-shell .msp-v2-announcement__inner {
    min-height: 34px;
  }

  .msp-v2-global-header-shell .msp-v2-announcement__inner > span {
    display: none;
  }

  .msp-v2-global-header-shell .msp-v2-announcement__inner > div {
    width: 100%;
    justify-content: center;
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .msp-v2-global-header-shell .msp-v2-container {
    width: min(calc(100% - 22px), 1480px) !important;
  }

  .msp-v2-global-header-shell .msp-v2-announcement {
    font-size: .66rem;
  }

  .msp-v2-global-header-shell .msp-v2-announcement__inner > div {
    justify-content: space-between;
    gap: 10px;
  }

  .msp-v2-global-header-shell .msp-v2-announcement__inner a:last-child {
    overflow: hidden;
    max-width: 57vw;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* MSP 5.1.8: rzeczywiście identyczny, jednowierszowy navbar na starych i nowych stronach. */
.msp-v2-skip {
  display: none !important;
}

@media (min-width: 981px) {
  .msp-v2-global-header-shell .msp-v2-container {
    width: min(calc(100% - 48px), 1760px) !important;
  }

  .msp-v2-global-header-shell .msp-v2-header__inner {
    display: grid !important;
    grid-template-columns: 185px minmax(0, 1fr) auto !important;
    min-height: 92px !important;
    align-items: center !important;
    gap: 24px !important;
  }

  .msp-v2-global-header-shell .msp-v2-brand {
    display: inline-flex !important;
    min-width: 0 !important;
    align-items: center !important;
  }

  .msp-v2-global-header-shell .msp-v2-brand__logo {
    width: auto !important;
    max-width: 165px !important;
    max-height: 72px !important;
    object-fit: contain !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav {
    min-width: 0 !important;
    width: 100% !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: stretch !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: clamp(11px, .85vw, 18px) !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list > li {
    display: flex !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    align-items: stretch !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list > li > a,
  .msp-v2-global-header-shell .msp-v2-nav__list > li.menu-item-has-children > a {
    display: flex !important;
    min-width: 0 !important;
    min-height: 92px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 0 !important;
    color: var(--msp-navy) !important;
    font-size: .67rem !important;
    font-weight: 800 !important;
    letter-spacing: .035em !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list > li > a::after {
    bottom: 21px !important;
  }

  .msp-v2-global-header-shell .msp-v2-submenu-toggle {
    display: none !important;
  }

  .msp-v2-global-header-shell .msp-v2-header__actions {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    white-space: nowrap !important;
  }

  .msp-v2-global-header-shell .msp-v2-header-cta {
    min-height: 44px !important;
    padding: 0 18px !important;
    font-size: .68rem !important;
  }
}

@media (min-width: 981px) and (max-width: 1380px) {
  .msp-v2-global-header-shell .msp-v2-container {
    width: min(calc(100% - 30px), 1360px) !important;
  }

  .msp-v2-global-header-shell .msp-v2-header__inner {
    grid-template-columns: 145px minmax(0, 1fr) auto !important;
    gap: 14px !important;
  }

  .msp-v2-global-header-shell .msp-v2-brand__logo {
    max-width: 135px !important;
    max-height: 62px !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list {
    gap: 9px !important;
  }

  .msp-v2-global-header-shell .msp-v2-nav__list > li > a,
  .msp-v2-global-header-shell .msp-v2-nav__list > li.menu-item-has-children > a {
    font-size: .59rem !important;
    letter-spacing: .015em !important;
  }

  .msp-v2-global-header-shell .msp-v2-header-cta {
    padding: 0 12px !important;
    font-size: .61rem !important;
  }
}
