.up-search-page-body {
  overflow-anchor: none;
}

.up-search-page {
  --up-search-blue: #0b2a68;
  --up-search-red: #ef1b27;
  --up-search-border: #d9e2f1;
  box-sizing: border-box;
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid var(--up-search-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(11, 42, 104, 0.07);
  color: var(--up-search-blue);
  font-family: "Golos Text", Arial, sans-serif;
}

.up-search-page *,
.up-search-page *::before,
.up-search-page *::after {
  box-sizing: border-box;
}

.up-search-page h2 {
  margin: 0 0 18px;
  color: var(--up-search-blue);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.up-search-page__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  margin: 0 0 16px;
}

.up-search-page__input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 17px;
  border: 1px solid var(--up-search-border);
  border-radius: 8px;
  background: #f8faff;
  color: var(--up-search-blue);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.up-search-page__input::placeholder {
  color: #7b879c;
  opacity: 1;
}

.up-search-page__input:focus {
  border-color: #2d65d5;
  box-shadow: 0 0 0 3px rgba(45, 101, 213, 0.12);
}

.up-search-page__submit {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--up-search-red);
  color: #fff !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.up-search-page__submit:hover,
.up-search-page__submit:focus-visible {
  background: #cf1520;
  box-shadow: 0 8px 18px rgba(239, 27, 39, 0.2);
}

.up-search-page__summary {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #e4eaf4;
  border-radius: 8px;
  background: #f8faff;
  color: #66748c;
  font-size: 16px;
  line-height: 1.45;
}

.up-search-page__summary strong {
  color: var(--up-search-blue);
  font-weight: 700;
}

.up-search-page__correction {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.up-search-catalog-results {
  margin-top: 8px;
}

.up-search-item-context {
  display: contents;
}

.up-search-page__empty {
  padding: 42px 24px;
  border: 1px solid var(--up-search-border);
  border-radius: 8px;
  background: #f7f9fc;
  color: #66748c;
  text-align: center;
}

.up-search-page__empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--up-search-blue);
  font-size: 22px;
}

.up-search-page__limit {
  margin: 18px 0 0;
  color: #748198;
  font-size: 13px;
}

/* Search results live beside the shared left catalogue, so they need their
   own compact horizontal-card geometry rather than the wide catalogue grid. */
body.up-search-page-body .up-category-seo--top:has(.up-search-page) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.up-search-page-body .up-category-seo--top:has(.up-search-page) .up-category-seo__body,
body.up-search-page-body .up-search-page {
  padding: 0;
}

body.up-search-page-body .up-search-page {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.up-search-page-body .up-search-catalog-products > .up-search-catalog-results,
body.up-search-page-body .up-search-catalog-results > .up-search-item-context {
  display: contents;
}

@media screen and (min-width: 961px) {
  body.up-search-page-body .up-search-catalog-results .product.cms_catalog_item {
    grid-template-columns: 220px minmax(0, 1fr) 340px !important;
    gap: 20px !important;
    padding: 20px !important;
  }

  body.up-search-page-body .up-search-catalog-results .product__price-container {
    width: 100% !important;
    min-width: 0;
    margin-left: 0 !important;
  }

  body.up-search-page-body .up-search-catalog-results .product__price-container .product__quick-buy,
  body.up-search-page-body .up-search-catalog-results .product__price-container .product__compare {
    min-width: 0 !important;
  }

  body.up-search-page-body .up-search-catalog-results .product__spec__select-container.up-card-select--color {
    grid-template-columns: max-content minmax(8px, 1fr) minmax(0, 152px) !important;
  }

  body.up-search-page-body .up-search-catalog-results .up-card-color-choices {
    grid-column: 3 !important;
    width: 152px !important;
    max-width: 100% !important;
    justify-content: flex-end;
  }
}

@media screen and (min-width: 881px) and (max-width: 960px) {
  body.up-search-page-body .up-search-catalog-results .product__spec__select-container.up-card-select--color {
    grid-template-columns: max-content minmax(8px, 1fr) minmax(0, 160px) !important;
  }

  body.up-search-page-body .up-search-catalog-results .up-card-color-choices {
    grid-column: 3 !important;
    width: 160px !important;
    max-width: 100% !important;
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .up-search-page {
    padding: 16px;
  }

  .up-search-page h2 {
    margin-bottom: 14px;
    font-size: 23px;
  }

  .up-search-page__form {
    grid-template-columns: minmax(0, 1fr);
  }

  .up-search-page__submit {
    width: 100%;
  }
}
