// stylelint-disable declaration-no-important
// stylelint-disable selector-no-qualifying-type
.sticky {
  transition: $transition-sticky;
}

.is-sticky {
  position: fixed !important;
  top: 0;
  right: 0;
  left: 0;
  z-index: $zindex-fixed !important;
  box-shadow: $masthead-box-shadow;
}

.is-sticky:has(~ .sections--main .sticky.is-sticky) {
  box-shadow: none;
}

[data-is-sticky-hide="init"] {

  &:not(.is-sticky) {
    position: fixed;
    transform: translateY(-100%);
  }

  + .sticky-placeholder {
    height: 0 !important;
    min-height: 0 !important;
    margin-top: 0 !important;
  }
}

.sticky-placeholder {
  position: relative;
  z-index: -1;
  min-height: var(--lx-placeholder-h);
  visibility: hidden;

  > div {
    height: var(--lx-placeholder-h);
  }

  .sticky.is-sticky + & {
    margin-top: 0 !important;
  }

  .position-fixed + &,
  .position-absolute + & {
    height: 0 !important;
    min-height: 0 !important;
    margin-top: 0 !important;
  }
}

.is-sticky-shadow-none.is-sticky {

  .shadow-sm,
  .shadow,
  .shadow-lg {
    box-shadow: none !important;
  }
}

.if-is-sticky-border-opacity-1.is-sticky {
  > .bg,
  > .section-bg > .bg {
    --#{$prefix}border-opacity: 1;
  }
}

.if-is-sticky-bg-opacity-1.is-sticky {

  > .bg,
  > .section-bg > .bg {
    --#{$prefix}bg-opacity: 1;
  }
}

.if-not-sticky--hidden {

  &.sticky:not(.is-sticky) {
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
    z-index: $zindex-fixed !important;
    transform: translateY(-100%) !important;
  }

  + .sticky-placeholder {
    --lx-placeholder-h: 0;

    height: 0 !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
  }
}
