/* ============================================================
   Ethical Clothing — Redesign PLP
   ============================================================ */

/* -------------------- brand header (SEO-critical brand landing) -------------------- */
.brand-header { margin-bottom: 40px; }
.brand-header-top { display: flex; align-items: center; gap: 24px; margin-bottom: 22px; }
.brand-header-logo {
  flex-shrink: 0; width: 84px; height: 84px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  display: grid; place-items: center; overflow: hidden;
}
.brand-header-logo img { width: 64%; height: auto; display: block; }
.brand-header-logo .fallback {
  font-family: var(--font-sans); font-weight: 600;
  font-size: 26px; color: var(--ink);
}
.brand-header-titles { flex: 1; min-width: 0; }
.brand-header-h1 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: 34px; line-height: 1.12; letter-spacing: -0.03em;
  color: var(--ink); margin: 0 0 6px;
}
.brand-header-sub { font-size: 16px; color: var(--ink-2); margin: 0; line-height: 1.4; }
.brand-header-desc { max-width: 82ch; position: relative; }
.brand-header-desc p {
  font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.brand-header-desc.expanded p { -webkit-line-clamp: unset; overflow: visible; }
.brand-header-toggle {
  margin-top: 8px; background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--sage); border-bottom: 1px solid var(--sage); line-height: 1.3;
}
.brand-header-toggle:hover { color: var(--sage-deep); border-color: var(--sage-deep); }
@media (max-width: 640px) {
  .brand-header-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .brand-header-h1 { font-size: 26px; }
}

.plp-crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: var(--space-7) 0 var(--space-4);
}
.plp-crumbs a { color: var(--ink-3); }
.plp-crumbs a:hover { color: var(--ink); }
.plp-crumbs .cur { color: var(--ink); }

.plp-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-8);
  padding-bottom: var(--space-10);
}

@media (max-width: 900px) {
  .plp-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Search with no results: no filter rail. */
.plp-layout--full { grid-template-columns: minmax(0, 1fr); }
.no-results { padding: var(--space-8) 0; max-width: 640px; }
.no-results .eyebrow { margin-bottom: 12px; }
.no-results p { margin-top: 12px; color: var(--ink-2); }
.no-results-links { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.no-results-links a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.no-results-links a:hover { border-color: var(--ink); }

/* -------------------- filter rail -------------------- */
/* Colour swatches in the Colour filter. */
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; vertical-align: -1px; border: 1px solid rgba(31, 36, 25, 0.25); }
.swatch--white { background: #fff; } .swatch--black { background: #1f1f1f; } .swatch--gray { background: #9a9a95; }
.swatch--brown { background: #7a5236; } .swatch--blue { background: #2f5d9e; } .swatch--green { background: #4f7a46; }
.swatch--red { background: #b8352f; } .swatch--pink { background: #e59bb5; } .swatch--purple { background: #74508f; }
.swatch--yellow { background: #e8c547; } .swatch--orange { background: #e0802f; }
/* The rail scrolls with the page: no sticky, no height cap. Nested
   scroll areas hid most of the options, so long groups are capped
   by count instead ("Show all N", see results_v2.html). */
.filters-col { align-self: start; }
.filters-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.filters-head .count { color: var(--ink); }
.filter-group {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
}
.filter-group:last-child { border-bottom: 1px solid var(--line); }
.filter-group .filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.filter-group .filter-title .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.filter-group.collapsed .filter-options { display: none; }
.brand-search { margin-bottom: 8px; }
.brand-search input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  outline: none;
  border-radius: var(--radius);
}
.brand-search input:focus { border-color: var(--ink); }
.brand-row.hidden { display: none !important; }
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Options past the first few are hidden until "Show all" is clicked,
   or while the brand search has a query. */
.filter-options .filter-option.capped { display: none; }
.filter-options.show-all .filter-option.capped,
.filter-options.searching .filter-option.capped { display: flex; }
.filter-more {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.filter-more:hover { color: var(--ink); border-bottom-color: var(--ink); }
.filter-options.searching .filter-more { display: none; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.filter-option.is-empty { cursor: default; color: var(--ink-3); }
.filter-option.is-empty .filter-check { opacity: .5; }
.filter-option .filter-check {
  display: inline-block;
  width: 14px; height: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
}
.filter-option .filter-check[checked] {
  background: var(--ink);
  border-color: var(--ink);
}
.filter-option .filter-check[checked]::after {
  content: '';
  position: absolute;
  left: 3px; top: 0px;
  width: 5px; height: 9px;
  border: solid var(--bg);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

/* Radio variant — used on single-select groups (Gender, Category,
   Material, Brand, Made in). Classic radio glyph: dark ring on
   light surface, dark inner dot with a visible gap between them.
   Checked state does NOT fill the outer (that would read as a
   checkbox); the ring stays hollow and only the inner disk fills. */
.filter-group--radio .filter-option .filter-check {
  border-radius: 50%;
  border-width: 1.5px;
  border-color: var(--ink);
}
.filter-group--radio .filter-option .filter-check[checked] {
  background: var(--surface);
  border-color: var(--ink);
}
.filter-group--radio .filter-option .filter-check[checked]::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  border: none;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.filter-option .filter-check + span { flex: 1; }
.filter-option .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* -------------------- PLP head -------------------- */
.plp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.plp-title h1,
.plp-title-h {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: var(--space-3) 0;
}
.plp-title p {
  color: var(--ink-3);
  font-size: 13px;
}
.plp-title .plp-tagline {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.45;
  max-width: 60ch;
  margin: 0 0 var(--space-3);
  /* Preserve the classic template's whitespace so runs of tokens
     ("women's clothing", "cotton clothes", etc.) look like a
     natural sentence instead of a run-together phrase. */
}
.plp-title .plp-tagline::first-letter { text-transform: uppercase; }
.plp-title .plp-tagline { max-width: 72ch; }
.plp-brand-link { display: inline-block; margin-left: 4px; color: var(--ink); border-bottom: 1px solid var(--line); }
.plp-title .plp-count { color: var(--ink-3); font-size: 13px; }
.plp-title .search-note { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.plp-controls {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}
.plp-controls .sort-label {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.sort-select {
  padding: 4px 22px 4px 0;
  border: none;
  border-bottom: 1px solid var(--ink);
  background-color: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%231f2419' stroke-width='1.6'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  transition: border-color var(--transition-fast);
}
.sort-select:hover,
.sort-select:focus { border-bottom-color: var(--sage-deep); outline: none; }

.applied-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-5);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--sage-tint);
  border: 1px solid var(--sage);
  color: var(--sage-deep);
  font-size: 12px;
  border-radius: 999px;
}
.chip a {
  color: var(--sage-deep);
  font-family: var(--font-mono);
  line-height: 1;
}
.clear-all {
  color: var(--ink-3);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  cursor: pointer;
}
.clear-all:hover { color: var(--ink); border-color: var(--ink); }

.plp-disclosure-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
  margin-bottom: var(--space-5);
}

/* -------------------- pagination -------------------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid var(--line);
}
.pg-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
}
.pg-arrow:hover { border-color: var(--ink); }
.pg-arrow[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.pg-pages { display: flex; align-items: center; gap: 4px; }
.pg-page {
  min-width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--ink);
}
.pg-page:hover { border-color: var(--line); }
.pg-page.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  cursor: default;
}
.pg-gap { color: var(--ink-3); padding: 0 4px; }

/* -------------------- Category description (editorial) --------------------
   Long-form SEO/editorial block that sits inside the results (middle)
   column, below the product grid + pagination, on fabric-only and
   gender+fabric/product_type category pages. Placeholder styling —
   designer to iterate on typography, side rule, and any layout accents
   once the block is approved for the redesign. */
.category-desc {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--line);
  text-transform: none;
}
.category-desc-h {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--space-4);
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.category-desc-body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Kept last: overrides the .plp-head / .plp-controls rules above. */
/* Filters drawer (phones). Desktop never shows these parts. */
.filters-toggle,
.filters-drawer-head,
.filters-drawer-foot { display: none; }
@media (max-width: 900px) {
  /* Title full width; the controls row sticks under the header. */
  .plp-head { display: contents; }
  .plp-title { margin-bottom: var(--space-4); }
  .plp-controls {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    justify-content: space-between;
    align-items: center;
    margin: 0 calc(-1 * var(--gutter)) var(--space-4);
    padding: 10px var(--gutter);
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .plp-controls .sort-label { margin-left: auto; }
  .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
  }
  .filters-col { display: none; }
  body[data-filters="open"] { overflow: hidden; }
  body[data-filters="open"] .filters-col {
    display: block;
    position: fixed;
    inset: 0;
    /* Undo the desktop align-self: start, which shrinks a fixed box to
       its content height (taller than the screen, so it can't scroll). */
    align-self: stretch;
    z-index: calc(var(--z-header) + 10);
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--gutter) 96px;
  }
  .filters-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 calc(-1 * var(--gutter)) var(--space-4);
    padding: 14px var(--gutter);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .filters-drawer-title { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 0; }
  .filters-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
  .filters-drawer-foot {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px var(--gutter);
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .filters-done { width: 100%; justify-content: center; }
}

/* Phones: bigger page buttons; on the narrowest screens Prev/Next show
   only their arrows (the words stay for screen readers) so "Weiter"
   fits at 320px. */
@media (max-width: 720px) {
  .pg-page { min-width: 40px; height: 40px; }
  .pg-arrow { min-height: 40px; }
}
@media (max-width: 400px) {
  .filters-toggle { white-space: nowrap; padding: 8px 12px; }
  .filters-toggle svg { flex-shrink: 0; }
  .pg-arrow { padding: 8px 13px; }
  .pg-arrow span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
}
