.catalog-page {
  background: var(--white);
}

.catalog-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
}

.catalog-hero {
  padding: 84px 0 34px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.catalog-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(50px, 8vw, 110px);
  align-items: end;
}

.catalog-hero h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(58px, 7vw, 96px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.catalog-hero h1 em {
  color: var(--terracotta);
  font-weight: 500;
}

.catalog-hero-copy > p {
  max-width: 530px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.catalog-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 36px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.catalog-totals div {
  padding: 0 18px;
  border-left: 1px solid var(--line);
}

.catalog-totals div:first-child {
  padding-left: 0;
  border-left: 0;
}

.catalog-totals dt {
  font-family: "Newsreader", serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.catalog-totals dd {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 64px;
}

.quick-category {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.quick-category:hover,
.quick-category.is-active {
  background: var(--forest);
  color: var(--white);
  transform: translateY(-2px);
}

.quick-category strong {
  display: block;
  font-family: "Newsreader", serif;
  font-size: 20px;
  font-weight: 600;
}

.quick-category small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-category:hover small,
.quick-category.is-active small {
  color: #cad7d0;
}

.quick-category > span {
  font-size: 20px;
}

.catalog-browser {
  padding: 54px 0 112px;
}

.catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.catalog-search {
  width: min(540px, 100%);
}

.catalog-search > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-search input {
  width: 100%;
  height: 50px;
  padding: 0 0 0 32px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background-color: transparent;
  background-image: radial-gradient(circle at 8px 21px, transparent 7px, var(--ink) 7.5px, var(--ink) 8.5px, transparent 9px), linear-gradient(45deg, transparent 48%, var(--ink) 49%, var(--ink) 54%, transparent 55%);
  background-position: 0 0, 15px 29px;
  background-repeat: no-repeat;
  background-size: 22px 44px, 8px 8px;
  outline: 0;
  font-size: 16px;
}

.filter-toggle {
  display: none;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 54px;
  padding-top: 42px;
}

.catalog-filters {
  align-self: start;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.filter-heading p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-heading button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
}

.category-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tree li {
  margin: 2px 0;
}

.category-filter {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px calc(8px + (var(--depth) * 13px));
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.category-filter:hover {
  background: var(--paper);
  color: var(--ink);
}

.category-filter.is-active {
  background: var(--forest);
  color: var(--white);
  font-weight: 700;
}

.category-filter[data-depth="0"] {
  margin-top: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.category-filter[data-depth="0"].is-active {
  color: var(--white);
}

.category-filter span:last-child {
  flex: 0 0 auto;
  color: inherit;
  font-size: 10px;
  opacity: 0.68;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.catalog-breadcrumb {
  margin: 0 0 7px;
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.results-heading h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.result-count {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 18px;
}

.catalog-product {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.catalog-product-image {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1 / 0.86;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f4f1eb;
}

.catalog-product-image img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.catalog-product:hover .catalog-product-image img {
  transform: scale(1.035);
}

.catalog-product-meta {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 2px 0;
}

.catalog-product-copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.catalog-product-meta strong {
  display: block;
  font-family: "Newsreader", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  transition: color 150ms ease;
}

.catalog-product-meta small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.catalog-product-action {
  display: grid;
  width: auto;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 150ms ease, color 150ms ease;
}

.catalog-product:hover .catalog-product-meta strong {
  color: var(--terracotta);
}

.catalog-product:hover .catalog-product-action {
  background: var(--forest);
  color: var(--white);
}

.load-more {
  display: flex;
  width: 100%;
  height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease;
}

.load-more[hidden] {
  display: none;
}

.load-more:hover {
  background: var(--forest);
  color: var(--white);
}

.catalog-empty {
  padding: 90px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.catalog-empty h3 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 34px;
}

.catalog-empty p {
  margin: 8px 0 24px;
  color: var(--ink-soft);
}

.product-dialog {
  width: min(920px, calc(100% - 32px));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 120px rgba(8, 23, 17, 0.38);
}

.product-dialog::backdrop {
  background: rgba(10, 27, 21, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.92);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 540px;
}

.dialog-image-wrap {
  overflow: hidden;
  min-width: 0;
  border-radius: 24px 0 0 24px;
  background: #efeae0;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dialog-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 44px;
}

.dialog-category {
  margin: 0 0 14px;
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dialog-copy h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.dialog-copy > p:not(.dialog-category) {
  margin: 22px 0 30px;
  color: var(--ink-soft);
}

.dialog-copy small {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.catalog-footer {
  margin-top: 0;
}

@media (max-width: 980px) {
  .catalog-hero-grid {
    grid-template-columns: 1fr;
  }

  .catalog-hero-copy {
    max-width: 720px;
  }

  .catalog-quick-links {
    margin-top: 42px;
  }

  .catalog-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 30px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .catalog-nav > a:first-child {
    display: none;
  }

  .catalog-nav .nav-cta {
    padding: 10px 14px;
  }

  .catalog-hero {
    padding-top: 56px;
  }

  .catalog-hero h1 {
    font-size: clamp(52px, 16vw, 70px);
  }

  .catalog-totals div {
    padding: 0 10px;
  }

  .catalog-totals dt {
    font-size: 23px;
  }

  .catalog-quick-links {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .quick-category {
    min-width: 230px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .catalog-browser {
    padding-top: 34px;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-toggle {
    display: flex;
    height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .catalog-layout {
    display: block;
    padding-top: 24px;
  }

  .catalog-filters {
    display: none;
    margin-bottom: 30px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
  }

  .catalog-filters.is-open {
    display: block;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .result-count {
    margin: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 10px;
  }

  .catalog-product-meta strong {
    font-size: 16px;
  }

  .catalog-product-meta small {
    max-width: 120px;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .dialog-image-wrap {
    height: 360px;
    border-radius: 24px 24px 0 0;
  }

  .dialog-copy {
    padding: 34px 26px;
  }

  .dialog-copy h2 {
    font-size: 38px;
  }
}

@media (max-width: 440px) {
  .catalog-nav .nav-cta {
    font-size: 0;
  }

  .catalog-nav .nav-cta span {
    font-size: 18px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .catalog-product-image {
    aspect-ratio: 1 / 0.78;
  }
}
