/* Nagłówek i działy — według koncepcji (komputer + telefon). */

/* ---------- Nagłówek ---------- */
.xs-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 243, 241, 0.92);
  backdrop-filter: blur(12px);
}

.xs-header__bar {
  display: flex;
  align-items: center;
  gap: 16px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.xs-header__logo {
  flex: 1 1 0;
  display: flex;
  align-items: center;
}

.xs-header__logo img {
  display: block;
  height: 44px;
  width: auto;
}

.xs-header__logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.xs-header__logo-text span,
.xs-footer__logo span {
  color: var(--xs-brand);
}

.xs-header__actions {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.xs-icon-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: var(--xs-radius);
  background: transparent;
  color: var(--xs-text);
}

.xs-icon-btn:hover {
  background: var(--xs-surface);
  color: var(--xs-text);
}

.xs-header__burger,
.xs-header__search-toggle {
  display: none;
}

.xs-cart {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 14px;
  border-radius: var(--xs-radius);
  background: var(--xs-brand);
  color: var(--xs-text);
  font-size: 15px;
  font-weight: 700;
}

.xs-cart__badge {
  display: none;
}

/* ---------- Działy ---------- */
.xs-departments__head {
  display: none;
}

.xs-departments__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0 auto;
  padding-bottom: 14px;
  list-style: none;
}

.xs-department {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--xs-surface);
  border: 1px solid var(--xs-line);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.xs-department.is-current {
  background: var(--xs-peach);
  border-color: var(--xs-peach);
  font-weight: 700;
}

.xs-department__icon {
  display: grid;
  place-items: center;
}

/* ---------- Telefon ---------- */
@media (max-width: 900px) {
  .xs-header__bar {
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .xs-header__burger,
  .xs-header__search-toggle {
    display: grid;
    width: 44px;
    height: 44px;
  }

  .xs-header__burger {
    border: 1px solid var(--xs-line);
    background: var(--xs-surface);
  }

  .xs-header__logo img {
    height: 28px;
  }

  .xs-header__actions .xs-icon-btn {
    width: 44px;
    height: 44px;
  }

  .xs-cart {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  .xs-cart__total {
    display: none;
  }

  .xs-cart__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--xs-dark);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
  }

  /* Działy jako panel na cały ekran z hamburgera */
  .xs-departments {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--xs-bg);
    overflow-y: auto;
    display: none;
  }

  body.xs-menu-open .xs-departments {
    display: block;
  }

  body.xs-menu-open {
    overflow: hidden;
  }

  /* Rozmycie tła nagłówka zamyka panel w nagłówku — przy otwartym menu je wyłączamy. */
  body.xs-menu-open .xs-header {
    backdrop-filter: none;
  }

  .xs-departments__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 800;
  }

  .xs-departments__head .xs-icon-btn {
    border: 1px solid var(--xs-line);
    background: var(--xs-surface);
  }

  .xs-departments__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .xs-department {
    height: 54px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 14px;
    border-radius: 16px;
  }

  .xs-department__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--xs-bg);
  }
}
