.catalog-masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff4e7;
  background: linear-gradient(112deg, #322822 12%, #4b382e 67%, #3c3028);
  border-block-end: 1px solid #746053;
}

.catalog-masthead::before,
.catalog-masthead::after {
  position: absolute;
  z-index: -1;
  inset-block-start: -70%;
  inset-inline-end: -9%;
  width: clamp(260px, 45vw, 650px);
  aspect-ratio: 1;
  border: 1px solid #c8a38d38;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.catalog-masthead::after {
  inset-block-start: -54%;
  inset-inline-end: -13%;
}

.catalog-masthead-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-block: clamp(25px, 3.25vw, 44px);
}

.catalog-masthead h1 {
  max-width: 20ch;
  margin-block-end: 11px;
  font-size: clamp(2.45rem, 4.85vw, 4.55rem);
  font-weight: 400;
  text-wrap: balance;
}

.catalog-masthead h1:lang(ar) {
  max-width: none;
  font-size: clamp(2.35rem, 4.25vw, 4.2rem);
}

.catalog-masthead p {
  max-width: 61ch;
  margin: 0;
  color: #eadbcc;
  font-size: clamp(.9rem, 1.6vw, 1.05rem);
}

.catalog-download {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 7px 11px;
  border-block-end: 1px solid #cfac96;
  color: #f6e3d1;
  font-size: .89rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.catalog-download:hover { background: #f3d7be19; }
.catalog-download:focus-visible { outline-color: #f5d9bc; }
.catalog-download span { font-size: 1.15rem; }

main:has(.catalog-masthead) {
  background: radial-gradient(ellipse at 17% 38%, #eee7dc, transparent 67%),
    linear-gradient(160deg, #e6dbce 0%, #eae2d7 48%, #e1d5c6);
}

#browse {
  padding-block-start: clamp(20px, 3vw, 34px);
}

#browse .searchbar { max-width: 700px; }

#browse .searchbar input {
  background: #f4ede4;
  border-color: #a59586;
  border-radius: 2px;
}

#browse .searchbar .button {
  align-self: stretch;
  border-color: #a59586;
  padding-inline: 16px;
}

#browse .filters {
  margin-block-end: 12px;
  padding-block-end: 14px;
  border-color: #b9a997;
}

#browse .filters button {
  min-height: 42px;
  padding-inline: 13px;
  border-color: #b3a391;
  background: #eee5db;
}

#browse .filters button:hover { background: #dccdbd; }
#browse .filters button[aria-pressed=true] {
  color: #fff5e9;
  background: #413229;
  border-color: #413229;
}

#browse .meta {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  margin-block-end: 17px;
}

#result-count {
  color: #4f443b;
  font-size: .88rem;
  font-weight: 650;
}

.catalog-filter-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 18px;
}

.catalog-filter-options .catalog-check,
.catalog-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  margin: 0;
  color: #3d3229;
  font-size: .83rem;
}

.catalog-filter-options .catalog-check { cursor: pointer; }
.catalog-check input { inline-size: 16px; block-size: 16px; }
.catalog-sort select { max-width: none; min-height: 34px; border-color: #a59586; }

#product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  columns: auto;
  gap: clamp(10px, 1.65vw, 24px);
}

#product-grid .tile-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0 0 11px;
  border: 1px solid #c5b5a4;
  border-radius: 4px;
  background: #eee4d8;
}

#product-grid .tile { flex: 1; }

#product-grid .media {
  aspect-ratio: 1.21;
  border-radius: 3px 3px 0 0;
  background: radial-gradient(ellipse at 44% 32%, #f3eadf, #e1d4c6 78%, #d8c7b6);
  border-block-end: 1px solid #d2c3b3;
}

#product-grid .media img { padding: 6%; }
#product-grid .tile h2 { margin: 11px 12px 0; color: #332920; }
#product-grid .tile-tools { margin: 0 12px; }
#product-grid .tile-tools button { min-height: 40px; }

.tile-spin {
  position: absolute;
  z-index: 1;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 7px;
  border-radius: 2px;
  background: #44352c;
  color: #fff4e8;
  font-size: .72rem;
  line-height: 1.35;
}

.catalog-index-link { margin: 24px 0 0; }
.catalog-index-link a { text-underline-offset: 4px; }

@media (max-width: 1100px) {
  #product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-masthead-inner { display: block; }
  .catalog-download { margin-block-start: 9px; padding-inline-start: 0; }
  #browse .filters button { padding-inline: 10px; }
}

@media (max-width: 360px) {
  #product-grid .tile h2 { margin-inline: 8px; }
  #product-grid .tile-tools { margin-inline: 8px; }
  .catalog-filter-options { gap: 3px 10px; }
  .catalog-filter-options .catalog-check, .catalog-sort { font-size: .77rem; }
}
