/* =========================================================================
   Sklep — archiwum produktów. Karty jak na stronie głównej + rail filtrów.
   Zbudowane wyłącznie na tokenach motywu (--brand, --graphite, --paper …).
   ========================================================================= */

.shop {
  padding-top: 40px;
  padding-bottom: 80px;
}

/* --- Nagłówek archiwum ------------------------------------------------- */
.shop-breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.shop-breadcrumb a {
  color: var(--steel);
  transition: color 0.2s var(--ease);
}
.shop-breadcrumb a:hover {
  color: var(--brand);
}
.shop-breadcrumb .sep {
  margin: 0 0.5rem;
  color: #c8c6c0;
}

.shop-hero__row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}
.shop-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--graphite);
  position: relative;
  padding-left: 0.9em;
}
.shop-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.14em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 999px;
  background: var(--brand);
}
.shop-count {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}
.shop-count span {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--graphite);
}
.shop-hero__desc {
  margin-top: 1rem;
  width: 100%;
  max-width: none;
  color: var(--steel);
  line-height: 1.65;
}
.shop-hero__desc p + p {
  margin-top: 0.7rem;
}

/* Wyszukiwanie produktów — formularz do doprecyzowania frazy. */
.shop-search-form {
  display: none;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 760px);
  margin-top: 1.5rem;
  padding: 6px 6px 6px 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.shop-search-form:focus-within {
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--brand-tint);
}
.shop-search-form__icon {
  display: grid;
  flex: none;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--muted);
}
.shop-search-form__icon svg {
  width: 20px;
  height: 20px;
}
.shop-search-form input[type="search"] {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.shop-search-form input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}
.shop-search-form .btn {
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  white-space: nowrap;
}

/* --- Układ dwukolumnowy ------------------------------------------------ */
.shop-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 2.6rem;
  align-items: start;
  margin-top: 2.2rem;
}

/* --- Rail filtrów ------------------------------------------------------ */
.shop-sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
}
.shop-sidebar__head {
  display: none;
}
.shop-sidebar__scroll {
  display: flex;
  flex-direction: column;
}

.shop-facet {
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.shop-facet:first-child {
  border-top: 0;
  padding-top: 0;
}
.shop-facet__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 0.95rem;
}

/* Kategorie */
.shop-cats {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.shop-cats--sub {
  margin: 0.25rem 0 0.4rem 0.55rem;
  padding-left: 0.7rem;
  border-left: 1.5px solid var(--line);
  gap: 0;
}
.shop-cat > a,
.shop-cat.shop-cat--all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-s);
  color: var(--steel);
  font-size: 0.92rem;
  line-height: 1.3;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}
.shop-cat > a:hover,
.shop-cat.shop-cat--all:hover {
  background: var(--paper);
  color: var(--graphite);
}
.shop-cat--all {
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.shop-cat__count {
  flex: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9a988f;
  background: var(--paper);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  min-width: 1.9em;
  text-align: center;
}
.shop-cat.is-current > a,
.shop-cat--all.is-current {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 700;
}
.shop-cat.is-current > a .shop-cat__count {
  background: var(--brand);
  color: #fff;
}
.shop-cat__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filtry wyboru (atrybuty) */
.shop-checks {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
}
.shop-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-s);
  color: var(--steel);
  font-size: 0.92rem;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}
.shop-check:hover {
  background: var(--paper);
  color: var(--graphite);
}
.shop-check__box {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #cfccc4;
  background: var(--white);
  display: grid;
  place-items: center;
  color: #fff;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}
.shop-check__box svg {
  width: 13px;
  height: 13px;
}
.shop-check.is-checked {
  color: var(--graphite);
  font-weight: 600;
}
.shop-check.is-checked .shop-check__box {
  background: var(--brand);
  border-color: var(--brand);
}
.shop-check__label {
  flex: 1;
}
.shop-check__count {
  flex: none;
  font-size: 0.74rem;
  color: #9a988f;
}

/* Cena */
.shop-price__inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.shop-price__field {
  flex: 1;
  min-width: 0;
}
.shop-price__field input {
  width: 100%;
  height: 44px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  transition: border-color 0.18s var(--ease);
  -moz-appearance: textfield;
}
.shop-price__field input::-webkit-outer-spin-button,
.shop-price__field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.shop-price__field input:focus {
  outline: none;
  border-color: var(--brand);
}
.shop-price__dash {
  width: 10px;
  height: 1.5px;
  background: #cfccc4;
  flex: none;
}
.shop-price__submit {
  width: 100%;
  margin-top: 0.8rem;
  justify-content: center;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
}

/* Aktywne filtry */
.shop-active {
  padding-bottom: 1.4rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}
.shop-active__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.4rem 0.34rem 0.7rem;
  border-radius: 999px;
  background: var(--graphite);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.18s var(--ease);
}
.shop-chip:hover {
  background: var(--brand);
}
.shop-chip svg {
  width: 14px;
  height: 14px;
}
.shop-active__reset {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s var(--ease);
}
.shop-active__reset:hover {
  border-color: var(--brand);
}

/* --- Treść: pasek narzędzi -------------------------------------------- */
.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.shop-toolbar__filters {
  display: none;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}
.shop-toolbar__filters svg {
  width: 18px;
  height: 18px;
}
.shop-toolbar .woocommerce-result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.shop-toolbar .woocommerce-ordering {
  margin: 0 0 0 auto;
  position: relative;
}
.shop-toolbar .woocommerce-ordering select {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  padding: 0 2.6rem 0 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--graphite);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: border-color 0.18s var(--ease);
}
.shop-toolbar .woocommerce-ordering select:hover {
  border-color: #cfccc4;
}
.shop-toolbar .woocommerce-ordering select:focus {
  outline: none;
  border-color: var(--brand);
}
.shop-toolbar .woocommerce-ordering::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--steel);
  border-bottom: 2px solid var(--steel);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* --- Siatka kart: identyczna z homepage, 3 w rzędzie obok filtrów ------ */
.shop-content .prod-grid.shop-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

/* WooCommerce (body.woocommerce a.button) nadpisuje pozycjonowanie przycisku
   „do koszyka" na archiwach — przywracamy dokładny układ karty ze strony głównej. */
.shop .card .add-cart {
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  top: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 0 !important;
  font-size: 0 !important;
  line-height: 1 !important;
  /* WooCommerce wymusza display:inline-block — przywracamy centrowanie ikony. */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  /* Identycznie jak na stronie głównej: grafit, czerwień dopiero na hover. */
  background: var(--graphite) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--radius-m) !important;
  box-shadow: none !important;
}
.shop .card .add-cart:hover {
  background: var(--brand) !important;
  transform: translateY(-2px);
}
.shop .card .add-cart:active {
  transform: scale(0.96);
}
.shop .card .add-cart::before,
.shop .card .add-cart::after {
  content: none !important;
}
.shop .card .add-cart svg {
  width: 22px;
  height: 22px;
}
/* Rezerwa miejsca na przycisk w wierszu ceny (WooCommerce może zresetować). */
.shop .card .price-row {
  padding-right: 66px;
}

/* --- Paginacja -------------------------------------------------------- */
.shop-content .woocommerce-pagination {
  margin-top: 2.8rem;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
  width: fit-content;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li {
  display: block;
  float: none;
  border: 0 !important;
  margin: 0 !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.page-numbers,
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li span.page-numbers {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.65rem !important;
  border-radius: var(--radius-s);
  border: 0 !important;
  background: transparent !important;
  color: var(--steel) !important;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.15s var(--ease);
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.page-numbers svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.page-numbers:not(.prev):not(.next):hover {
  background: var(--brand-tint) !important;
  color: var(--brand) !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li span.current {
  background: var(--brand) !important;
  color: var(--white) !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li span.dots {
  min-width: 24px;
  padding-inline: 0.15rem !important;
  color: var(--muted) !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.prev,
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.next {
  border: 1.5px solid var(--line) !important;
  background: var(--white) !important;
  color: var(--steel) !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.prev:hover,
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.next:hover {
  border-color: var(--brand) !important;
  background: var(--brand-tint) !important;
  color: var(--brand) !important;
}
body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.page-numbers:active {
  transform: scale(0.96);
}

@media (max-width: 575px) {
  .shop-content .woocommerce-pagination {
    margin-top: 2.2rem;
  }
  body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers {
    gap: 0.15rem;
  }
  body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li a.page-numbers,
  body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li span.page-numbers {
    padding-inline: 0.55rem !important;
    font-size: 0.9rem;
  }
  body.woocommerce .shop-content nav.woocommerce-pagination ul.page-numbers li span.dots {
    min-width: 18px;
    padding-inline: 0 !important;
  }
}

/* --- Pusty stan ------------------------------------------------------- */
.shop-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--paper);
  border-radius: var(--radius-l);
}
.shop-empty__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 1.4rem;
  border-radius: 999px;
  background: var(--white);
  display: grid;
  place-items: center;
  color: var(--brand);
  box-shadow: var(--shadow-s);
}
.shop-empty__icon svg {
  width: 26px;
  height: 26px;
}
.shop-empty h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--graphite);
  margin-bottom: 0.5rem;
}
.shop-empty p {
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.shop-search-empty {
  max-width: 820px;
  margin: 3rem auto 0;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 6vw, 4rem);
  border-radius: var(--radius-l);
  background: var(--paper);
  text-align: center;
}
.shop-search-empty h2 {
  max-width: 22ch;
  margin: 0 auto 0.75rem;
  color: var(--graphite);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.shop-search-empty p {
  max-width: 56ch;
  margin: 0 auto 1.75rem;
  color: var(--steel);
  line-height: 1.65;
}

/* --- Zasłona rail-a (mobile) ------------------------------------------ */
.shop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 21, 23, 0.5);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
body.shop-filters-open .shop-backdrop {
  opacity: 1;
}

/* =========================================================================
   Responsywność
   ========================================================================= */
@media (max-width: 1180px) {
  .shop-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 2rem;
  }
  .shop-content .prod-grid.shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .shop-toolbar__filters {
    display: inline-flex;
  }

  /* Rail jako panel wysuwany */
  .shop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: min(360px, 88vw);
    height: 100dvh;
    background: var(--white);
    box-shadow: var(--shadow-l);
    transform: translateX(-100%);
    transition: transform 0.34s var(--ease);
    display: flex;
    flex-direction: column;
  }
  body.shop-filters-open .shop-sidebar {
    transform: none;
  }
  .shop-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--line);
    flex: none;
  }
  .shop-sidebar__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--graphite);
  }
  .shop-sidebar__close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-s);
    display: grid;
    place-items: center;
    color: var(--graphite);
    background: var(--paper);
  }
  .shop-sidebar__close svg {
    width: 20px;
    height: 20px;
  }
  .shop-sidebar__scroll {
    flex: 1;
    overflow: auto;
    padding: 0.4rem 1.4rem 2rem;
  }
}

/* W nagłówku mobilnym nie ma pola wyszukiwania, więc formularz wyników
   staje się tam jedyną wyszukiwarką na stronie. */
@media (max-width: 920px) {
  .shop-search-form {
    display: flex;
  }
}

@media (max-width: 560px) {
	.shop-search-form {
		align-items: stretch;
		flex-wrap: wrap;
		padding: 0.8rem;
	}
	.shop-search-form__icon {
		align-self: center;
	}
	.shop-search-form input[type="search"] {
		min-height: 44px;
	}
	.shop-search-form .btn {
		width: 100%;
		justify-content: center;
	}
  .shop-content .prod-grid.shop-grid {
    grid-template-columns: 1fr;
  }
  .shop-toolbar {
    flex-wrap: wrap;
  }
  .shop-toolbar .woocommerce-ordering {
    margin-left: 0;
    width: 100%;
  }
  .shop-toolbar .woocommerce-ordering select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-sidebar,
  .shop-backdrop {
    transition: none;
  }
}
