/* Proper Filter — theme-agnostic collection UI (pf-*) */

.pf {
  --pf-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pf-text: #1a1a1a;
  --pf-muted: #6d7175;
  --pf-border: #e1e3e5;
  --pf-bg: #ffffff;
  --pf-accent: #1a1a1a;
  --pf-accent-soft: #e3f1df;
  --pf-accent-text: #108043;
  --pf-radius: 8px;
  --pf-max: 1280px;
  --pf-sidebar: 260px;
  --pf-gap: 1.25rem;
  --pf-card-gap: 1rem;

  box-sizing: border-box;
  font-family: var(--pf-font);
  color: var(--pf-text);
  line-height: 1.45;
  width: 100%;
}

.pf *,
.pf *::before,
.pf *::after {
  box-sizing: border-box;
}

.pf-shell {
  width: 100%;
}

.pf.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.pf__inner {
  max-width: var(--pf-max);
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.pf__badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--pf-accent-soft);
  color: var(--pf-accent-text);
  border-radius: 999px;
}

.pf__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pf-gap);
  align-items: start;
}

@media (min-width: 990px) {
  .pf__layout {
    grid-template-columns: var(--pf-sidebar) 1fr;
  }
}

.pf__sidebar {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  padding: 1rem;
  background: var(--pf-bg);
}

.pf__sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.pf__facet {
  border-bottom: 1px solid var(--pf-border);
  padding: 0.65rem 0;
}

.pf__facet:last-child {
  border-bottom: 0;
}

.pf__facet summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
}

.pf__facet summary::-webkit-details-marker {
  display: none;
}

.pf__facet-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  overflow: auto;
}

.pf__facet-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.pf__facet-count {
  color: var(--pf-muted);
}

.pf__price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pf__price-label {
  grid-column: span 1;
  font-size: 0.75rem;
  color: var(--pf-muted);
}

.pf__price-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  font: inherit;
}

.pf__price-apply {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pf__price-apply:hover {
  border-color: var(--pf-accent);
}

.pf__active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: #fafbfb;
}

.pf__active-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pf-muted);
  margin-right: 0.25rem;
}

.pf__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
}

.pf__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--pf-border);
  border-radius: 999px;
  background: var(--pf-bg);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.pf__chip:hover {
  border-color: var(--pf-accent);
}

.pf__chip-label {
  font-weight: 600;
}

.pf__chip-remove {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
}

.pf__clear {
  padding: 0.25rem 0.5rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  color: var(--pf-text);
}

.pf__main {
  min-width: 0;
}

.pf__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pf__sort label {
  font-size: 0.875rem;
  margin-right: 0.5rem;
}

.pf__sort select {
  min-width: 11rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  font: inherit;
  background: var(--pf-bg);
}

.pf__count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pf-muted);
}

.pf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pf-card-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 750px) {
  .pf__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 990px) {
  .pf__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pf__card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  overflow: hidden;
  background: var(--pf-bg);
  height: 100%;
}

.pf__card-media {
  position: relative;
  aspect-ratio: 1;
  background: #f4f4f4;
  overflow: hidden;
}

.pf__sale-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: #202223;
  border-radius: 4px;
}

.pf__card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  color: var(--pf-muted);
  font-size: 0.85rem;
}

.pf__card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf__card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.pf__card-vendor {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pf-muted);
}

.pf__card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
}

.pf__card-title a {
  color: inherit;
  text-decoration: none;
}

.pf__card-title a:hover {
  text-decoration: underline;
}

.pf__card-price {
  margin-top: auto;
  font-size: 0.95rem;
  font-weight: 600;
}

.pf__empty,
.pf__error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--pf-muted);
}

.pf__error {
  color: #d72c0d;
}

.pf__pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 2rem;
}

.pf__page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-bg);
  font: inherit;
  cursor: pointer;
}

.pf__page-btn.is-active {
  background: var(--pf-accent);
  color: #fff;
  border-color: var(--pf-accent);
}

.pf__page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Hide native theme collection UI when Proper Filter has taken over the shell */
.pf-shell .facets-vertical-sort,
.pf-shell .facets-wrapper,
.pf-shell > .product-grid-container {
  display: none !important;
}
