/* ==========================================================
   HEADER
   ========================================================== */

.cs-header {
  background: var(--white);
  border-bottom: 1px solid var(--black--03);
}

.cs-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 80px;
  padding: 16px 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.cs-header__left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.cs-header__nav {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.cs-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex: 0 0 auto;
}

/* Logo wycentrowane */
.cs-header__center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  margin-left: -90px;
  pointer-events: none;
}

.cs-logo {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  color: var(--black);
}

.cs-logo__img {
  display: block;
  width: 180px;
  height: 60px;
}

/* Categories button */
.cs-cats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--black);
}

.cs-cats__icon {
  font-size: 20px;
  line-height: 1;
}

.cs-cats__label {
  color: var(--main--02);
  font-family: var(--font-family-body);
  font-size: var(--font-size-13);
  font-weight: var(--font-weight-300);
  text-decoration: none;
}

/* Header menu */
.cs-menu {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.cs-menu a {
  text-decoration: none;
  color: var(--black);
  font-size: var(--font-size-13);
  font-weight: var(--font-weight-300);
}

.cs-menu a:hover {
  opacity: 0.75 !important;
}

/* Icons */
.cs-icon,
.cs-icon-sm {
  display: block;
}

.cs-icon {
  width: 20px;
  height: 20px;
}

.cs-icon-sm {
  width: 16px;
  height: 16px;
}

.cs-iconlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cs-cartcount {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--main--02);
  color: var(--white);
  font-size: 12px;
  line-height: 18px;
}

/* ==========================================================
   HEADER — MOBILE
   ========================================================== */

@media (max-width: 768px) {
  .cs-header__inner {
    height: 64px;
    justify-content: space-between;
  }

  .cs-header__nav {
    display: none;
  }

  .cs-logo__img {
    width: 120px;
    height: 60px;
  }

  .cs-header__center {
    width: 120px;
    margin-left: -60px;
  }

  .cs-cats__label {
    display: none;
  }

  .cs-cats {
    gap: 0;
  }

  .cs-icon {
    width: 22px;
    height: 22px;
  }

  .cs-header__right {
    gap: 16px;
  }

  .cs-search {
    display: none;
  }
}

/* ==========================================================
   MEGAMENU — BASE
   ========================================================== */

.cs-megamenu[hidden] {
  display: none !important;
}

.cs-megamenu {
  z-index: 9999;
}

.cs-no-scroll {
  overflow: hidden;
}

/* Top bar (mobile only) */
.cs-megamenu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 16px 16px;
  height: 65px;
  border-bottom: 1px solid var(--black--03);
}

@media (min-width: 769px) {
  .cs-megamenu__top {
    display: none;
  }
}

.cs-megamenu__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  justify-content: flex-end;
  width: stretch;
}

.cs-megamenu__title {
  font-weight: var(--font-weight-600);
}

/* Sections */
.cs-megamenu__sections {
  padding: 48px 24px;
  overflow: hidden;
  display: grid;
}

.cs-megamenu__heading {
  margin: 0 0 10px;
  font-size: var(--font-size-14);
}

.cs-megamenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cs-megamenu a {
  text-decoration: none !important;
  font-size: var(--font-size-14);
}

.cs-megamenu a:hover {
  color: var(--main--04);
}

/* Back button – tylko mobile i tylko level2 */
.cs-megamenu__back {
  display: none;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .cs-megamenu.cs-level2 .cs-megamenu__back {
    display: inline-flex;
    width: 100%;
  }
}

/* ==========================================================
   MEGAMENU — MOBILE (OFFCANVAS)
   ========================================================== */

@media (max-width: 768px) {
  .cs-megamenu {
    position: fixed;
    inset: 0;
  }

  .cs-megamenu__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
  }

  .cs-megamenu__panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(420px, 90vw);
    background: var(--white);
    border-right: 1px solid var(--black--03);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
  }

  .cs-megamenu.is-open .cs-megamenu__panel {
    transform: translateX(0);
  }

  /* wewnątrz panelu: top + content */
  .cs-megamenu__top {
    flex: 0 0 auto;
  }

  .cs-megamenu__sections {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0 24px;
  }

  .cs-megamenu__section {
    height: 100%;
    width: 100%;
  }

  #menu-header-1 {
    gap: 24px;
  }
}

/* ==========================================================
   MEGAMENU — DESKTOP (DROPDOWN)
   ========================================================== */

@media (min-width: 769px) {
  .cs-megamenu {
    position: absolute;
  }

  div#cs-megamenu {
    width: stretch;
  }

  .cs-megamenu__overlay {
    display: none;
  }

  .cs-megamenu__panel {
    position: relative;
    width: 100%;
    height: auto;
    background: var(--white);
    border-bottom: 1px solid var(--black--03);
    transform: none;
    transition: none;
  }

  .cs-megamenu__sections {
    grid-template-columns: 1fr 1fr;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ==========================================================
   MEGAKATEGORIE
   ========================================================== */

.cs-megacats {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.cs-megacats__parents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.cs-megacats__parentBtn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: pointer;

  font-family: var(--font-family-heading);
  font-size: var(--font-size-h4) !important;
  font-weight: var(--font-weight-500);
  line-height: var(--line-height-h4);
  color: var(--main--03);
}

.cs-megacats__parentBtn[aria-expanded="true"],
.cs-megacats__parentBtn:hover {
  color: var(--main--04);
}

.cs-megacats__panels {
  min-width: 0;
  border-left: 1px solid var(--black--03);
  padding-left: 64px;
}

.cs-megacats__panel[hidden] {
  display: none !important;
}

.cs-megacats__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
  width: max-content;
}

.cs-megacats__col {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cs-megacats__childHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cs-megacats__childTitle {
  display: inline-block;
}

.cs-megacats__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.cs-megacats__chev svg {
  display: block;
}

.cs-megacats__col.has-grand .cs-megacats__drop {
  display: none;
}

@media (min-width: 769px) {
  .cs-megacats__col.has-grand:hover .cs-megacats__drop,
  .cs-megacats__col.has-grand:focus-within .cs-megacats__drop {
    display: block;
    padding: 8px 0 0 16px;
  }

  .cs-megacats__col.has-grand:hover .cs-megacats__chev,
  .cs-megacats__col.has-grand:focus-within .cs-megacats__chev {
    transform: rotate(180deg);
  }

  .cs-megamenu .cs-megacats__grandItem a:hover,
  .cs-megamenu .cs-megacats__grandItem a:focus-visible {
    color: var(--main--03);
  }
}

.cs-megacats__grand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  font-weight: var(--font-weight-300);
}

/* Sekcja menu (druga kolumna) */
.cs-megamenu__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

/* ==========================================================
   MOBILE DRILLDOWN (2 strony)
   - sterowane klasą .cs-level2 na #cs-megamenu
   ========================================================== */

@media (max-width: 768px) {
  .cs-megacats {
    position: relative;
    overflow: hidden;
    height: 100%;
  }

  .cs-megacats__parents,
  .cs-megacats__panels {
    width: 100%;
  }

  .cs-megacats__parents {
    margin-top: 24px;
    transform: translateX(0);
    transition: transform 0.25s ease;
  }

  .cs-megacats__panels {
    position: absolute;
    inset: 0;
    border-left: 0;
    padding-left: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    background: var(--white);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-megamenu.cs-level2 .cs-megacats__parents {
    transform: translateX(-100%);
  }

  .cs-megamenu.cs-level2 .cs-megacats__panels {
    transform: translateX(0);
  }

  .cs-megacats__panel {
    margin-top: 24px;
    padding-bottom: 48px;
  }

  .cs-megacats__cols {
    grid-template-columns: 1fr;
  }

  .cs-megamenu.cs-level2 .cs-megacats__col.has-grand .cs-megacats__drop {
    display: block;
    padding: 8px 0 0 16px;
  }

  .cs-megamenu ul {
    margin-top: 24px;
  }
}

@media (min-width: 769px) {
  #cs-megamenu .cs-megamenu__section--mobile-menu {
    display: none !important;
  }
}

@media (max-width: 768px) {
  #cs-megamenu .cs-megamenu__section--mobile-menu {
    display: block;
  }

  #cs-megamenu.cs-level2 .cs-megamenu__section--mobile-menu,
  #cs-megamenu.cs-hide-header-menu .cs-megamenu__section--mobile-menu {
    display: none;
  }
}

.cs-megacats__parentLinkMobile {
  display: none;
}

@media (max-width: 768px) {
  .cs-megacats__parentLinkMobile {
    border-bottom: 1px solid var(--black--03);
    padding: 16px 0;
    margin-bottom: 24px;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-20) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .cs-megacats__parentLinkMobile svg {
    stroke-width: 2 !important;
  }
}

/* ==========================================================
   FIBOSEARCH
   ========================================================== */

span.dgwt-wcas-si {
  width: 72px !important;
  min-width: 72px !important;
}

span.dgwt-wcas-si img {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain;
}

.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
  display: none !important;
}

.dgwt-wcas-style-pirx .dgwt-wcas-preloader {
  margin-right: 0 !important;
}

.dgwt-wcas-suggestions-wrapp.woocommerce.dgwt-wcas-has-img.dgwt-wcas-has-price.dgwt-wcas-has-headings.js-dgwt-wcas-initialized {
  min-width: 400px;
  margin-left: -180px;
  margin-top: 8px;
  border: 1px solid var(--black--04);
  border-radius: var(--b--sm);
  padding: 12px;
}

a.dgwt-wcas-suggestion.js-dgwt-wcas-suggestion-headline.dgwt-wcas-suggestion-headline {
  font-family: var(--font-family-body-basic);
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
  font-weight: var(--font-weight-300);
  margin: 16px 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--black--02);
  color: var(--black--06);
}

.dgwt-wcas-has-headings .dgwt-wcas-suggestion-headline .dgwt-wcas-st {
  all: unset !important;
}

a.dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax.dgwt-wcas-suggestion-cat,
a.dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
  border-radius: var(--b--xsm);
  padding: 4px !important;
}

.dgwt-wcas-suggestion.dgwt-wcas-suggestion-product:hover {
  background: var(--main--bg--light);
  border-radius: var(--b--xsm);
  padding: 4px !important;
}

.dgwt-wcas-suggestion-selected {
  background-color: transparent !important;
}

.dgwt-wcas-si {
  width: 64px !important;
}

.dgwt-wcas-si img {
  border: 1px solid var(--black--03) !important;
  border-radius: var(--b--xsm) !important;
  padding: 0 !important;
}

.dgwt-wcas-st {
  display: block;
  color: var(--black);
  font-size: var(--font-size-16) !important;
  line-height: var(--line-height-16) !important;
  font-weight: var(--font-weight-400) !important;
}

.dgwt-wcas-st-more {
  font-family: var(--font-family-body-basic);
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
  font-weight: var(--font-weight-300);
  text-transform: lowercase !important;
}

.dgwt-wcas-meta {
  display: flex;
}

.dgwt-wcas-suggestions-wrapp span.woocommerce-Price-amount.amount {
  color: var(--black--06);
  font-size: var(--font-size-14) !important;
  line-height: var(--line-height-14) !important;
  font-weight: var(--font-weight-400) !important;
}

/* ==========================================================
   BELKA TOP
   ========================================================== */
.cs-announcement-bar {
  display: block;
}

html.cs-belka-top-closed .cs-announcement-bar {
  display: none !important;
}

.cs-announcement-bar {
  background: var(--additional---pomaranczowy-light);
  padding: 12px 24px;
}

.cs-announcement-bar__inner {
  display: flex;
  justify-content: center;
  max-width: 1400px;
  margin: auto;
  position: relative;
}

.cs-announcement-bar__text {
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
  font-family: var(--font-family-heading);
  color: var(--additional---pomaranczowy);
  text-align: center;
}

button.cs-announcement-bar__close {
  background: none;
  position: absolute;
  right: 0;
  padding: 0 !important;
}

.cs-announcement-bar__close path {
  stroke: var(--additional---pomaranczowy);
}

@media (max-width: 768px) {
  .cs-announcement-bar {
    padding: 8px 16px;
  }

  button.cs-announcement-bar__close {
    position: static;
  }

  .cs-announcement-bar__inner {
    gap: 8px;
    justify-content: flex-end;
  }

  .cs-announcement-bar__text {
    max-width: 90%;
  }
}
