.search-page { min-width: 0; }

.search-page { --search-header-height:104px; }
@media (max-width:992px) { .search-page { --search-header-height:92px; } }
@media (max-width:760px) { .search-page { --search-header-height:var(--mobile-header-height,78px); } }
.search-page .search-page__main {
  height:calc(100dvh - var(--search-header-height)); min-height:0;
  display:grid; grid-template-rows:auto auto minmax(0,1fr);
  overflow:hidden;
}
.search-page .search-result-columns {
  min-height:0; height:100%; align-items:stretch; overflow:hidden;
}
.search-page :is(.search-news-column,.search-products-column) {
  min-height:0; height:100%; overflow-x:hidden; overflow-y:auto;
  overscroll-behavior-y:auto; scrollbar-width:none;
}
.search-page :is(.search-news-column,.search-products-column)::-webkit-scrollbar { display:none; }

.search-page__main {
  min-height: calc(100vh - 104px);
  margin-top: 0;
  background: var(--background);
}

.search-query-row,
.search-counts,
.search-result-columns {
  display: grid;
  grid-template-columns: var(--layout-rail) minmax(0, 1fr);
  direction: ltr;
}

.search-query-row {
  min-height: clamp(32px, 4.4444vw, 85.312px);
  border-bottom: 1px solid var(--black);
}

.search-query-row__news-spacer {
  min-width: 0;
}

.search-query-row__text {
  min-width: 0;
  padding: clamp(8px, 1.1111vw, 21.328px);
  border-left: 1px solid var(--black);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  direction: rtl;
  color: var(--black);
  font-family: 'Adapter Arabic Text Tooltip', 'Adapter Arabic Text', sans-serif;
  font-size: clamp(7px, .9722vw, 18.662px);
  font-weight: 300;
  line-height: 1.4;
  text-align: right;
}

.search-query-row__text strong {
  font-weight: inherit;
}

.search-query-row__slash {
  flex: 0 0 auto;
  margin-inline: .35em;
}

.search-counts__number { display: inline-block; direction: ltr; unicode-bidi: isolate; margin-right: .25em; }

.search-counts {
  position: relative;
  height: clamp(32px, 4.4444vw, 85.312px);
  border-bottom: 1px solid var(--black);
}

.search-counts::after {
  content: '';
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: clamp(2px, .2083vw, 4px);
  left: 0;
  height: clamp(1px, .1389vw, 2.666px);
  background: var(--black);
  pointer-events: none;
}

.search-counts__news,
.search-counts__products {
  min-width: 0;
  padding-inline: clamp(8px, 1.1111vw, 21.328px);
  display: flex;
  align-items: center;
  color: var(--black);
  font-size: clamp(17px, 2.3611vw, 45.322px);
  font-weight: 800;
  line-height: 1;
}

.search-counts__news {
  justify-content: flex-start;
  direction: rtl;
}

.search-counts__products {
  justify-content: flex-start;
  border-left: 1px solid var(--black);
  direction: rtl;
}

.search-result-columns {
  align-items: start;
  position: relative;
  min-height: calc(100vh - 104px - clamp(32px, 4.4444vw, 85.312px) - clamp(32px, 4.4444vw, 85.312px));
}

.search-result-columns::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: var(--layout-rail);
  width: 1px;
  background: var(--black);
  pointer-events: none;
}

.search-news-column,
.search-products-column {
  min-width: 0;
}

.search-news-list {
  direction: ltr;
}

.search-news-card {
  height: clamp(80px, 11.1111vw, 213.28px);
  min-height: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--black);
  color: inherit;
  text-decoration: none;
}

.search-news-card:hover {
  background: var(--black);
  color: var(--background);
}

.search-news-card:hover .search-news-card__title,
.search-news-card:hover .search-news-card__excerpt {
  color: var(--background);
}

.search-news-card__title,
.search-news-card__excerpt {
  min-width: 0;
  padding: clamp(8px, 1.1111vw, 21.328px);
  display: flex;
}

.search-news-card__title {
  align-items: flex-end;
  color: var(--black);
  font-family: var(--font-main);
  font-size: clamp(20px, 2.7778vw, 40px);
  font-weight: 700;
  line-height: 90%;
  text-decoration: none;
  white-space: pre-line;
}

.search-news-card__excerpt {
  align-items: flex-start;
  justify-content: flex-end;
  direction: rtl;
  font-size: clamp(7px, .9722vw, 18.662px);
  font-weight: 300;
  line-height: 1.45;
  text-align: right;
}

.search-news-empty {
  height: clamp(80px, 11.1111vw, 213.28px);
  min-height: 80px;
  padding: clamp(8px, 1.1111vw, 21.328px);
  border-bottom: 1px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
}

.search-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  direction: rtl;
}

.search-products-grid .product-card {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 480 / 608;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--black);
  border-left: 1px solid var(--black);
  overflow: hidden;
}

.search-products-grid .product-card:nth-child(-n + 3) {
  border-top: 0;
}

.search-products-grid .product-card::after {
  content: '';
  position: absolute;
  z-index: 5;
  inset: 0;
  border: 0;
  box-shadow: inset 0 0 0 0 var(--black);
  pointer-events: none;
  transition: box-shadow 280ms cubic-bezier(.22, 1, .36, 1);
}

.search-products-grid .product-card:hover::after {
  box-shadow: inset 0 0 0 2px var(--black);
}

.search-products-grid .product-card__image-wrap {
  flex: 1 0 0;
  aspect-ratio: auto;
  padding: 0;
  gap: 0;
}

.search-products-grid .product-card__image {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 1;
  flex: 1 0 0;
}

.search-products-grid .product-card__price { line-height: 1; }
.search-products-grid .product-card__title-row { margin-top: 0; }

.search-products-grid .product-card__body {
  gap: 4px;
  padding: 4px 16px 0;
}
.search-products-grid .product-card__price {
  font-size: clamp(9px, 1.25vw, 23.994px);
  letter-spacing: clamp(-1.066px, -.0556vw, -.4px);
}
.search-products-grid .product-card__title {
  font-size: clamp(11px, 1.5278vw, 29.326px);
}
.search-products-grid .color-dot {
  width: clamp(6px, .8333vw, 15.996px);
  height: clamp(6px, .8333vw, 15.996px);
  min-width: 6px;
  min-height: 6px;
}
.search-products-grid .wishlist-btn {
  top: -2px;
  width: clamp(22px, 3.0556vw, 58.652px);
  height: clamp(22px, 3.0556vw, 58.652px);
  min-width: 22px;
  min-height: 22px;
}
.search-products-grid .wishlist-btn__heart {
  width: clamp(11px, 1.5278vw, 29.326px);
  height: clamp(11px, 1.5278vw, 29.326px);
}
.search-products-grid .wishlist-btn__vector--right {
  width: clamp(3px, .4167vw, 8px);
  height: clamp(23.5px, 3.2639vw, 62.666px);
  right: clamp(-5.866px, -.3056vw, -2.2px);
}
.search-products-grid .wishlist-btn__vector--bottom {
  width: clamp(3px, .4167vw, 8px);
  height: clamp(23.5px, 3.2639vw, 62.666px);
  top: clamp(20px, 2.7778vw, 53.332px);
}

.search-products-grid .product-card__discount {
  top: clamp(8px, 1.1111vw, 21.328px);
  width: clamp(34px, 4.7222vw, 90.664px);
  height: clamp(21px, 2.9167vw, 55.992px);
  font-size: clamp(10px, 1.3889vw, 26.664px);
  letter-spacing: -.7px;
}

.search-products-empty {
  grid-column: 1 / -1;
  min-height: clamp(200px, 27.7778vw, 533.2px);
  padding: clamp(12px, 1.6667vw, 31.992px);
  border-left: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  display: grid;
  place-items: center;
  direction: rtl;
  font-size: clamp(11px, 1.5278vw, 29.326px);
}

@media (max-width: 992px) {
  .search-page__main { min-height: calc(100vh - 92px); }
  .search-result-columns { min-height: calc(100vh - 92px - clamp(32px, 4.4444vw, 85.312px) - clamp(32px, 4.4444vw, 85.312px)); }
}

@media (max-width: 760px) {
  .search-page {
    --layout-rail: 40vw;
  }

  .search-page__main { min-height: calc(100vh - 78px); }
  .search-result-columns { min-height: calc(100vh - 78px - clamp(32px, 4.4444vw, 85.312px) - clamp(32px, 4.4444vw, 85.312px)); }

  .search-products-grid,
  .search-news-card {
    grid-template-columns: 1fr;
  }

  .search-news-card__excerpt {
    display: none;
  }
}

/* Optical centering without moving row borders. */
.search-query-row__text > * { translate: 0 -4px; }
.search-query-row__text > .search-query-row__intro { translate: 0 -5px; }
.search-counts__news,
.search-counts__products { position: relative; top: -4px; }
.search-counts__products { border-left: 0; }
@media (min-width: 761px) {
  .search-counts { background: linear-gradient(var(--black), var(--black)) var(--layout-rail) 0 / 1px 100% no-repeat; }

  /* Keep the shop card's 480px design proportions at the smaller column width. */
  .search-products-grid .product-card { container-type: inline-size; aspect-ratio: auto; }
  .search-products-grid .product-card__image-wrap { flex: none; aspect-ratio: 1; padding: 8.3333cqw; }
  .search-products-grid .product-card__image { width: 100%; height: auto; }
  .search-products-grid .product-card__body { height: 23.9583cqw; min-height: 23.9583cqw; flex: 0 0 23.9583cqw; padding: 3.3333cqw; gap: 2.5cqw; }
  .search-products-grid .product-card__row { height: 4.7917cqw; flex: 0 0 4.7917cqw; }
  .search-products-grid .product-card__title-row { height: 10cqw; flex: 0 0 10cqw; }
  .search-products-grid .product-card__title { font-size: 8.3333cqw; line-height: 10cqw; left: -.4167cqw; }
  .search-products-grid .product-card__price { font-size: 5cqw; line-height: 1; letter-spacing: -.25cqw; }
  .search-products-grid .product-card__colors { gap: .8333cqw; }
  .search-products-grid .color-dot { width: 3.3333cqw; height: 3.3333cqw; min-width: 0; min-height: 0; }
  .search-products-grid .wishlist-btn { top: auto; width: 10cqw; height: 10cqw; min-width: 0; min-height: 0; padding: 0; border-color: transparent; scale: 1; }
  .search-products-grid .wishlist-btn::before { content: ''; position: absolute; inset: 0; background: inherit; z-index: 0; pointer-events: none; }
  .search-products-grid .wishlist-btn__heart { width: 5.8333cqw; height: 5.2083cqw; }
  .search-products-grid .wishlist-btn:not(.is-liked) .wishlist-btn__heart { content: url('../svg/icons/WishlistHeartRed.svg'); filter: brightness(0); }
  .search-products-grid .wishlist-btn:not(.is-liked):hover .wishlist-btn__heart { filter: brightness(0) invert(1); }
  .search-products-grid .wishlist-btn__vector { width: 1.25cqw; height: 10.625cqw; z-index: -1; }
  .search-products-grid .wishlist-btn__vector--right { right: -.8333cqw; top: -1px; }
  .search-products-grid .wishlist-btn__vector--bottom { left: -1px; top: calc(100% - 2px); }
  .search-products-grid .product-card__discount { top: 5cqw; width: 19.1667cqw; height: 12.0833cqw; font-size: 5.8333cqw; letter-spacing: -.2917cqw; }
}
