.category-product-list {
  container: category-list / inline-size;
}

.category-product-list .list-card-collection-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

.category-product-list .list-card-heading :is(.product-label, .product-meta) {
  overflow-wrap: anywhere;
}

.category-product-list .gallery-controls [data-photo-index] {
  white-space: nowrap;
}

.category-product-list .card-specs {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.35;
}

.category-product-list .card-specs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(56%);
  align-items: baseline;
  gap: 8px;
  padding-block: 3px;
}

.category-product-list .card-specs li > span {
  text-wrap: balance;
}

.category-product-list .card-specs strong {
  max-inline-size: none;
  text-align: end;
  text-wrap: balance;
}

.category-product-list .card-spec-colon {
  display: none;
}

.category-product-list .list-card .card-purchase {
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
}

.category-product-list .card-purchase-inquiry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'price action' 'stock action';
  align-items: center;
  gap: 4px 12px;
}

.category-product-list .card-purchase-inquiry > :is(.price, .catalog-vat-price) {
  grid-area: price;
}

.category-product-list .card-purchase-inquiry > .list-availability {
  grid-area: stock;
}

.category-product-list .card-purchase-inquiry > :is(.stock-inquiry-button, .order-request-button) {
  grid-area: action;
}

@media (min-width: 736px) {
  .category-product-list > .list-card {
    grid-template-columns: minmax(0, min(29%, 230px)) minmax(0, 1fr);
    column-gap: clamp(16px, 3cqi, 24px);
  }

  @container category-list (width < 640px) {
    .category-product-list > .list-card {
      grid-template-columns: clamp(140px, 32cqi, 180px) minmax(0, 1fr);
      align-items: start;
      row-gap: 12px;
    }

    .category-product-list .product-copy {
      display: contents;
    }

    .category-product-list .gallery-image,
    .category-product-list .gallery-image img {
      height: clamp(128px, 30cqi, 176px);
      max-height: 176px;
    }

    .category-product-list .list-card-expanded > .gallery {
      grid-column: 1;
      grid-row: 1 / span 2;
    }

    .category-product-list .list-card-expanded .list-card-heading {
      grid-area: 1 / 2;
    }

    .category-product-list .product-brief {
      grid-area: 3 / 1 / auto / -1;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    .category-product-list .list-card .card-purchase {
      grid-area: 2 / 2;
      margin-block-start: 0;
      padding-block-start: 0;
      border-block-start: 0;
    }

    .category-product-list .card-purchase-inquiry {
      grid-template-areas: 'price action' 'stock stock';
    }
  }
}

@media (max-width: 735px) {
  .category-product-list > .list-card {
    grid-template-columns: minmax(0, min(41%, 208px)) minmax(0, 1fr);
    gap: 10px 11px;
    padding: 12px;
  }

  .category-product-list .list-card-heading h2 {
    text-wrap: pretty;
  }

  .category-product-list {
    --catalog-photo-height: clamp(138px, 43cqi, 184px);
  }

  .category-product-list :is(.gallery-image, .gallery-image img) {
    height: var(--catalog-photo-height);
    max-height: none;
  }

  .category-product-list .gallery-controls {
    margin-inline: auto;
  }

  .category-product-list .gallery-controls button {
    position: relative;
    isolation: isolate;
    border: 0;
    background: none;
    font-size: 14px;
  }

  .category-product-list .gallery-controls button::before {
    position: absolute;
    z-index: -1;
    inset: 7px 0;
    width: min(28px, 100% - 6px);
    margin-inline: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    content: '';
  }

  .category-product-list--side-arrows {
    --catalog-arrow-column: 16px;
  }

  .category-product-list--side-arrows > .list-card:has(> .gallery > .gallery-controls) {
    grid-template-columns: minmax(0, min(51%, 240px)) minmax(0, 1fr);
    column-gap: 12px;
  }

  .category-product-list--side-arrows .list-card > .gallery:has(> .gallery-controls) {
    position: relative;
  }

  .category-product-list--side-arrows .gallery:has(> .gallery-controls) > .gallery-image {
    margin-inline: var(--catalog-arrow-column);
  }

  .category-product-list--side-arrows .gallery-controls {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: var(--catalog-photo-height);
    display: block;
    margin: 0;
    pointer-events: none;
  }

  .category-product-list--side-arrows .gallery-controls [data-photo-index] {
    display: none;
  }

  .category-product-list--side-arrows .gallery-controls button {
    position: absolute;
    inset-block: 0;
    width: 44px;
    height: 100%;
    pointer-events: auto;
    touch-action: pan-y;
  }

  .category-product-list--side-arrows .gallery-controls [data-photo-step='-1'] {
    inset-inline-start: 0;
  }

  .category-product-list--side-arrows .gallery-controls [data-photo-step='1'] {
    inset-inline-end: 0;
  }

  .category-product-list--side-arrows .gallery-controls .gallery-chevron {
    position: absolute;
    inset-block-start: 50%;
    width: var(--catalog-arrow-column);
    translate: 0 -50%;
    text-align: center;
    font: 600 16px/1 Montserrat, Arial, sans-serif;
  }

  .category-product-list--side-arrows .gallery-controls button::before {
    content: none;
  }

  .category-product-list--side-arrows .gallery-controls [data-photo-step='-1'] .gallery-chevron {
    inset-inline-start: 0;
  }

  .category-product-list--side-arrows .gallery-controls [data-photo-step='1'] .gallery-chevron {
    inset-inline-end: 0;
  }

  .category-product-list--side-arrows .gallery-controls button:is(:focus-visible, :active) .gallery-chevron {
    color: var(--copy);
  }

  .category-product-list--side-arrows .gallery-controls button:focus-visible {
    outline-offset: -4px;
  }

  .category-product-list .list-card .card-purchase:has(> .list-cart-button) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .category-product-list .card-purchase > .list-cart-button {
    justify-self: end;
    width: min(100%, 176px);
    margin-inline-start: 0;
  }

  .category-product-list .card-purchase-inquiry {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'price' 'stock' 'action';
  }

  .category-product-list .card-purchase-inquiry > :is(.stock-inquiry-button, .order-request-button) {
    margin-block-start: 4px;
  }
  .category-product-list .card-purchase-inquiry > .stock-inquiry-button { min-height: 44px; }
}
