#catalog {
  padding: clamp(22px, 3.6vw, 48px) 0 clamp(36px, 5vw, 68px);
  scroll-margin-top: 84px;
}
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(20px, 2.5vw, 34px);
}
.catalog-heading h1 {
  color: var(--ink);
  margin: 0;
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.045em;
}
.catalog-filter {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex: 0 1 auto;
  min-height: 48px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid #a89a8c;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  line-height: 1.35;
}
.catalog-filter[aria-expanded="true"] {
  border-color: var(--berry);
  color: var(--berry);
}
.filter-chevron, .filter-check { flex: none; }
.catalog-filter[aria-expanded="true"] .filter-chevron { transform: rotate(180deg); }
.filter-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: -10px 0 clamp(22px, 2.8vw, 36px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.filter-options[hidden] { display: none; }
.filter-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  text-align: left;
}
.filter-option[aria-pressed="true"] {
  color: var(--berry);
  background: var(--cream);
  font-weight: 600;
}
.filter-check { visibility: hidden; }
.filter-option[aria-pressed="true"] .filter-check { visibility: visible; }
@media (hover: hover) {
  .catalog-filter:hover { border-color: var(--berry); }
  .filter-option:hover { background: var(--cream); }
}
.catalog-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.catalog-grid {
  display: grid;
  gap: clamp(26px, 3.6vw, 46px) clamp(16px, 2.5vw, 32px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fabric-card { min-width: 0; }
.fabric-info { display: contents; }
.fabric-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}
.fabric-link:focus-visible, .catalog-filter:focus-visible, .filter-option:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 4px;
}
.fabric-photo {
  width: 100%;
  aspect-ratio: 1.58;
  overflow: hidden;
  background: var(--cream);
  border-radius: 8px;
}
.fabric-photo picture { display: block; height: 100%; }
.fabric-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fabric-photo.uploaded-photo img { object-fit: contain; }
@media (hover: hover) and (pointer: fine) {
  .fabric-link:hover .fabric-photo {
    box-shadow: 0 0 0 1px rgb(101 13 43 / 14%), 0 3px 12px rgb(53 43 37 / 10%);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .fabric-link { transition: transform 180ms ease-out; }
  .fabric-photo { transition: box-shadow 180ms ease-out; }
  .fabric-link:hover { transform: scale(1.015); }
}
.fabric-link h2 {
  color: var(--ink);
  margin: 12px 0 0;
  font-size: clamp(21px, 2.1vw, 26px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.fabric-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.fabric-facts {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.4;
}
.fabric-facts strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
}
.catalog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 0 24px;
  color: var(--muted);
  font-size: 18px;
}
@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .catalog-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .catalog-filter { width: 100%; }
  .filter-options { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: -12px; padding: 5px; }
  .filter-option { min-height: 48px; }
}
@media (max-width: 540px) {
  #catalog { padding-block: 20px 32px; }
  .catalog-heading { gap: 12px; margin-bottom: 16px; }
  .catalog-heading h1 { font-size: 2rem; }
  .catalog-filter { min-height: 50px; font-size: 1rem; }
  .catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fabric-card + .fabric-card { border-top: 1px solid var(--line); }
  .fabric-link {
    display: grid;
    grid-template-columns: clamp(90px, 28vw, 134px) minmax(0, 1fr);
    gap: clamp(12px, 3.5vw, 18px);
    align-items: center;
    padding-block: 14px;
  }
  .fabric-photo { aspect-ratio: 1; }
  .fabric-info { display: block; min-width: 0; }
  .fabric-link h2 { margin: 0; font-size: 1.19rem; line-height: 1.2; }
  .fabric-subtitle { margin-top: 3px; font-size: .94rem; }
  .fabric-facts { gap: 1px 12px; margin-top: 6px; font-size: .94rem; }
  .fabric-facts strong { font-size: 1rem; }
}
@media (max-width: 540px) and (pointer: coarse) {
  .fabric-link:active { background: var(--cream); }
}
