/******************** FOURCOMMERCE MEGA MENU ********************/

#main-nav {
  overflow: visible;
}

#main-menu-desktop-wrap,
#main-nav .navbar-nav,
#main-nav .fc-mega-item {
  overflow: visible;
}

#main-nav.fc-mega-is-open,
#main-nav.fc-mega-is-open.headroom--unpinned {
  transform: none !important;
}

.fc-mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.fc-mega-item {
  position: static;
  display: flex;
  align-items: center;
}

.fc-mega-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 0 8px;
  color: currentColor;
  cursor: pointer;
  line-height: 1;
  appearance: none;
}

#main-nav.main-navbar--dark .fc-mega-toggle,
#main-nav.navbar-dark .fc-mega-toggle {
  color: #fff;
}

#main-nav.main-navbar--white .fc-mega-toggle,
#main-nav.navbar-light .fc-mega-toggle {
  color: #111;
}

.fc-mega-back {
  display: none;
}

@media (min-width: 1200px) {
  .main-navbar--white .fc-mega-item > .nav-link,
  .main-navbar--dark .fc-mega-item > .nav-link {
    margin-right: 0 !important;
  }

  .main-navbar--white .fc-mega-item,
  .main-navbar--dark .fc-mega-item {
    margin-right: 35px;
  }
}

.fc-mega-caret {
  display: block;
  width: 8px;
  height: 8px;
  margin: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

#main-nav.main-navbar--dark .fc-mega-caret,
#main-nav.navbar-dark .fc-mega-caret {
  border-color: #fff;
}

#main-nav.main-navbar--white .fc-mega-caret,
#main-nav.navbar-light .fc-mega-caret {
  border-color: #111;
}

.fc-mega-item.is-open > .fc-mega-toggle .fc-mega-caret {
  transform: rotate(225deg) translateY(-2px);
}

.main-navbar--white .fc-mega-item.is-open > .fc-mega-trigger {
  color: #274AC0 !important;
}

.main-navbar--dark .fc-mega-item.is-open > .fc-mega-trigger {
  color: #fff !important;
}

/* Panel: pelna szerokosc, biale tlo, animacja zaslony od gory (clip-path). */
.fc-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  color: #080F26;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 16px 28px rgba(8, 15, 38, 0.16));
  transition:
    clip-path 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.48s;
}

.fc-mega-item.is-open > .fc-mega {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  pointer-events: auto;
  transition:
    clip-path 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.fc-mega__panel {
  max-width: 1600px;
  margin: 0 auto;
  padding: 36px 20px 48px;
}

/* Desktop: max 4 kolumny; 5. wezel spada do kolejnego rzedu. */
.fc-mega__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  column-gap: 48px;
  row-gap: 28px;
  align-items: start;
}

.fc-mega__cell,
.fc-mega__node {
  margin: 0;
  padding: 0;
  border: 0;
}

.fc-mega__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: #080F26;
  position: relative;
}

/* Glowny wezel: kreska CI (.line-left) + Archivo uppercase. */
.fc-mega__node > .fc-mega__link {
  padding: 2px 8px 2px 16px;
}

.fc-mega__node > .fc-mega__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #000;
}

.fc-mega__node > .fc-mega__link .fc-mega__title {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #080F26;
  transition: color 0.2s ease;
}

.fc-mega__node > .fc-mega__link:hover .fc-mega__title,
.fc-mega__node > .fc-mega__link:focus .fc-mega__title {
  color: #274AC0;
}

.fc-mega__desc {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.45;
  color: #667085;
  text-transform: none;
  letter-spacing: 0;
}

/* Podwezly: od razu pod matka, wciecie w lewo, bez kreski. */
.fc-mega__sub {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 20px;
}

.fc-mega__subnode {
  margin: 0 0 6px;
  padding: 0;
}

.fc-mega__subnode .fc-mega__link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2px 0;
  width: auto;
  max-width: 100%;
}

.fc-mega__subnode .fc-mega__title {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: #080F26;
  position: relative;
  display: inline-block;
}

.fc-mega__subnode .fc-mega__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background-color: #274AC0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.fc-mega__subnode .fc-mega__link:hover .fc-mega__title,
.fc-mega__subnode .fc-mega__link:focus .fc-mega__title {
  color: #080F26;
}

@media (hover: hover) and (pointer: fine) {
  .fc-mega__subnode .fc-mega__link:hover .fc-mega__title::after,
  .fc-mega__subnode .fc-mega__link:focus-visible .fc-mega__title::after {
    width: 100%;
  }
}

.fc-mega__subnode .fc-mega__link:active .fc-mega__title::after {
  width: 100%;
}

/* Stagger wejsciowy kolumn. */
.fc-mega-item.is-open .fc-mega__cell {
  animation: fcMegaItemIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fc-mega-item.is-open .fc-mega__cell:nth-child(1) { animation-delay: 0.05s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(2) { animation-delay: 0.08s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(3) { animation-delay: 0.11s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(4) { animation-delay: 0.14s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(5) { animation-delay: 0.17s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(6) { animation-delay: 0.20s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(7) { animation-delay: 0.23s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(8) { animation-delay: 0.26s; }
.fc-mega-item.is-open .fc-mega__cell:nth-child(n+9) { animation-delay: 0.29s; }

@keyframes fcMegaItemIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-mega,
  .fc-mega-item.is-open > .fc-mega,
  .fc-mega-caret,
  .fc-mega-back__arrow,
  .fc-mega-back__icon,
  .fc-mega-item.is-open .fc-mega__cell {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1199.98px) {
  .fc-mega__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 36px;
  }
}

@media (max-width: 991.98px) {
  .fc-mega__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 24px;
  }

  .fc-mega__node > .fc-mega__link {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .fc-mega__subnode .fc-mega__link {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/******************** MOBILE / OFFCANVAS ********************/

@media (max-width: 767.98px) {
  .offcanvas {
    overflow: hidden;
  }

  .offcanvas .offcanvas-header {
    position: relative;
    z-index: 1060;
  }

  #navbarNavOffcanvas.offcanvas .offcanvas-body {
    margin: 4.5rem 1.25rem 1.5rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .offcanvas.fc-mega-drill,
  .offcanvas.fc-mega-drill .offcanvas-body {
    overflow: hidden;
  }

  .offcanvas.fc-mega-drill .btn-close-white {
    filter: none;
  }

  .offcanvas .navbar-nav {
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .offcanvas .nav-link {
    font-size: 1.35rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 12px 0;
  }

  .offcanvas .fc-mega-item {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .offcanvas .fc-mega-item > .nav-link {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0 !important;
  }

  .offcanvas .fc-mega-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    color: inherit;
  }

  .custom-offcanvas-dark .fc-mega-toggle,
  .custom-offcanvas-dark .fc-mega-caret {
    color: #fff;
    border-color: #fff;
  }

  .custom-offcanvas-white .nav-link,
  .custom-offcanvas-white .fc-mega-toggle,
  .custom-offcanvas-white .fc-mega-caret {
    color: #080F26;
    border-color: #080F26;
  }

  .offcanvas .fc-mega-caret {
    width: 9px;
    height: 9px;
  }

  /* Pelnoekranowy bialy panel z ta sama animacja clip-path. */
  .offcanvas .fc-mega {
    position: fixed;
    inset: 0;
    z-index: 1055;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 56px) 20px 28px;
    background: #ffffff;
    color: #080F26;
    filter: none;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .offcanvas .fc-mega-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 8px 0 22px;
    min-height: 44px;
    margin: 0;
    color: #274AC0;
    cursor: pointer;
    appearance: none;
    font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow: visible;
    transition: color 0.2s ease;
  }

  .offcanvas .fc-mega-back__icon {
    display: block;
    box-sizing: content-box;
    height: 1em;
    width: 1.333em;
    flex: 0 0 1.333em;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .offcanvas .fc-mega-back__arrow {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .offcanvas .fc-mega-back:hover,
  .offcanvas .fc-mega-back:focus-visible,
  .offcanvas .fc-mega-back:active,
  .offcanvas .fc-mega-back.is-leaving {
    color: #274AC0;
  }

  .offcanvas .fc-mega-back:hover .fc-mega-back__icon,
  .offcanvas .fc-mega-back:focus-visible .fc-mega-back__icon,
  .offcanvas .fc-mega-back:active .fc-mega-back__icon {
    transform: translateX(-2px);
  }

  .offcanvas .fc-mega-back.is-leaving {
    pointer-events: none;
  }

  .offcanvas .fc-mega-back.is-leaving .fc-mega-back__icon {
    animation: fcMegaBackGo 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  @keyframes fcMegaBackGo {
    0% {
      transform: translateX(-2px);
    }
    100% {
      transform: translateX(-5px);
    }
  }

  .offcanvas .fc-mega__panel {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 8px 4px 12px 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  .offcanvas .fc-mega__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    column-gap: 0;
    row-gap: 24px;
  }

  .offcanvas .fc-mega__cell,
  .offcanvas .fc-mega__node {
    min-width: 0;
  }

  .offcanvas .fc-mega__title {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .offcanvas .fc-mega__node > .fc-mega__link {
    min-height: 0;
    padding: 2px 8px 2px 16px;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .offcanvas .fc-mega__node > .fc-mega__link::before {
    background-color: #000;
  }

  .offcanvas .fc-mega__node > .fc-mega__link .fc-mega__title {
    color: #080F26;
    font-size: 14px;
  }

  .offcanvas .fc-mega__sub {
    margin-top: 8px;
    padding-left: 20px;
  }

  .offcanvas .fc-mega__subnode {
    margin: 0 0 6px;
  }

  .offcanvas .fc-mega__subnode .fc-mega__link {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-height: 0;
    padding: 2px 0;
    align-items: flex-start;
  }

  .offcanvas .fc-mega__subnode .fc-mega__title {
    color: #080F26;
    font-size: 14px;
  }

  .offcanvas .fc-mega__desc {
    color: #667085;
    opacity: 1;
  }

  .offcanvas.custom-offcanvas-dark .fc-mega-item.is-open > .nav-link,
  .offcanvas.custom-offcanvas-white .fc-mega-item.is-open > .nav-link {
    color: inherit !important;
  }
}
