#products,
#enquiryForm {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.catalog-toolbar,
.product-detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.catalog-toolbar {
  justify-content: space-between;
  margin-bottom: 20px;
}

.catalog-toolbar h2,
#catalogCount {
  margin: 0;
}

#catalogCount {
  color: var(--muted);
}

#catalogClearSearch {
  text-decoration: underline;
}

.catalog-search {
  display: none;
}

.shop__side {
  max-height: calc(100vh - var(--header-h) - 52px);
  overflow: auto;
}

.shop__side-title a[aria-current] {
  color: var(--green);
}

.shop .pcard__media > img:first-child {
  object-fit: contain;
  object-position: center;
}

.catalog-pages {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-pages[hidden] {
  display: none;
}

.catalog-pages a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  color: var(--ink-strong);
}

.catalog-pages a:hover,
.catalog-pages a[aria-current] {
  border-color: var(--green);
  color: var(--green);
}

.product-detail__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 5vw, 70px);
}

.product-detail h1 {
  margin: 12px 0 22px;
  font: 600 clamp(24px, 3.3vw, 42px) / 1.16 "Outfit", sans-serif;
  overflow-wrap: anywhere;
}

.product-detail .crumbs {
  margin-bottom: 26px;
}

.product-gallery__preview,
.product-gallery__thumb {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.product-gallery__preview {
  aspect-ratio: 1;
}

.product-gallery__preview img,
.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.product-gallery__thumb {
  width: 64px;
  aspect-ratio: 1;
}

.product-gallery__thumb[aria-current] {
  border-color: var(--green);
  outline: 1px solid var(--green);
}

.product-detail__body {
  max-width: 850px;
  margin: 56px auto 0;
  overflow-wrap: anywhere;
}

.product-detail__body img {
  margin: 18px auto;
  max-width: 100%;
  height: auto;
}

.product-detail__table {
  margin: 20px 0;
  overflow-x: auto;
}

.product-detail__table table {
  width: 100%;
  border-collapse: collapse;
}

.product-detail__table td,
.product-detail__table th {
  padding: 9px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.product-detail__table tr:nth-child(even),
.product-detail__table th {
  background: var(--paper, #f7f4ef);
}

.product-detail__related {
  margin-top: 56px;
}

@media (max-width: 920px) {
  .shop__side {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .catalog-search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
  }

  .catalog-search input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
  }

  .catalog-search .btn {
    padding-inline: 16px;
  }
}

@media (max-width: 650px) {
  .product-detail__summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-detail__intro {
    grid-row: 1;
  }
}

/* RTL support for catalog / product pages */
html[dir="rtl"] .product-card__body,
html[dir="rtl"] .product-detail__intro,
html[dir="rtl"] .product-detail__summary {
  text-align: right;
}
html[dir="rtl"] .filter-bar,
html[dir="rtl"] .pagination {
  direction: rtl;
}
