/* ==========================================================================
   Site search: the dialog (components/search-popup.php + assets/js/mhs-search.js)
   and the results page (search.php). Classes: mhs-srch* (dialog), mhs-srp*
   (results page). The theme repaints buttons and links on hover, hence the
   `html body ... !important` overrides.
   ========================================================================== */

/* ---- dialog ---------------------------------------------------------------- */
.mhs-srch { position: fixed; inset: 0; z-index: 2147482000; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.mhs-srch[hidden] { display: none !important; }
.mhs-srch__scrim { position: absolute; inset: 0; background: rgba(34, 29, 26, .52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s ease; }
.mhs-srch__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: 84vh;
  overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  opacity: 0; transform: translateY(-12px); transition: opacity .2s ease, transform .2s ease;
}
.mhs-srch.is-open .mhs-srch__scrim { opacity: 1; }
.mhs-srch.is-open .mhs-srch__panel { opacity: 1; transform: none; }

.mhs-srch__form { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px 10px 18px; border-bottom: 1px solid #f0ebe7; }
.mhs-srch__icon { flex: none; color: #c27266; }
html body .mhs-srch__input {
  flex: 1; min-width: 0; height: 48px; margin: 0; padding: 0 4px; border: 0 !important; border-radius: 0; outline: 0;
  background: none !important; box-shadow: none !important; font-size: 17px; color: #2c2825; -webkit-appearance: none; appearance: none;
}
.mhs-srch__input::-webkit-search-cancel-button, .mhs-srch__input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.mhs-srch__input::placeholder { color: #a39a94; opacity: 1; }
.mhs-srch__clear, .mhs-srch__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0; border: 0;
  border-radius: 17px; background: #f6f0ee; color: #6b635d; cursor: pointer;
}
.mhs-srch__clear { width: 34px; }
.mhs-srch__clear[hidden] { display: none; }
.mhs-srch__close { padding: 0 12px; font-size: 12.5px; font-weight: 600; }
.mhs-srch__close-t { display: none; }
.mhs-srch__go { flex: none; height: 40px; padding: 0 20px; border: 0; border-radius: 20px; background: #c27266; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
html body .mhs-srch__go:hover, html body .mhs-srch__go:focus-visible { background: #a95c51 !important; color: #fff !important; }
html body .mhs-srch__clear:hover, html body .mhs-srch__close:hover,
html body .mhs-srch__clear:focus-visible, html body .mhs-srch__close:focus-visible { background: #efe2de !important; color: #a95c51 !important; }

/* loading: a thin bar under the input instead of replacing what is shown */
.mhs-srch__bar { position: relative; height: 2px; overflow: hidden; }
.mhs-srch.is-loading .mhs-srch__bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: #c27266; animation: mhs-srch-bar 1s ease-in-out infinite; }
@keyframes mhs-srch-bar { from { transform: translateX(-100%); } to { transform: translateX(400%); } }

.mhs-srch__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 14px; }
.mhs-srch__sec { padding: 12px 18px 2px; }
.mhs-srch__h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #9a928c; }
.mhs-srch__textbtn { padding: 0; border: 0; background: none; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #a95c51; text-decoration: underline; cursor: pointer; }
html body .mhs-srch__textbtn:hover, html body .mhs-srch__textbtn:focus { background: none !important; color: #7e4037 !important; }

.mhs-srch__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mhs-srch__chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 7px 13px; border: 1px solid #ece5e0; border-radius: 18px;
  background: #fff; font-size: 13.5px; line-height: 1.3; color: #2c2825; text-decoration: none;
}
.mhs-srch__chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhs-srch__chip svg { flex: none; color: #b3a89f; }
.mhs-srch__chip small { flex: none; font-size: 12px; color: #9a928c; }
html body .mhs-srch__chip:hover, html body .mhs-srch__chip.is-active { border-color: #c27266; background: #fdf8f6 !important; color: #a95c51 !important; }

.mhs-srch__cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.mhs-srch__cat { display: block; margin: 0 -8px; padding: 8px; border-radius: 8px; color: #2c2825; text-decoration: none; }
.mhs-srch__cat b { display: block; font-size: 14px; font-weight: 600; }
.mhs-srch__cat span { display: block; font-size: 12px; color: #9a928c; }
html body .mhs-srch__cat:hover, html body .mhs-srch__cat.is-active { background: #f9f4f2 !important; color: #a95c51 !important; }

/* minmax(0, 1fr): an auto column grew to the longest (unwrapped) title and pushed prices off phones */
.mhs-srch__rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.mhs-srch__row { display: flex; align-items: center; gap: 12px; margin: 0 -10px; padding: 8px 10px; border-radius: 10px; color: #2c2825; text-decoration: none; }
html body .mhs-srch__row:hover, html body .mhs-srch__row.is-active { background: #f9f4f2 !important; color: #2c2825 !important; }
.mhs-srch__thumb { flex: none; width: 56px; height: 56px; border: 1px solid #efe9e5; border-radius: 8px; background: #f5f1ee; object-fit: cover; }
.mhs-srch__txt { flex: 1; min-width: 0; }
.mhs-srch__title, .mhs-srch__meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhs-srch__title { font-size: 14.5px; font-weight: 600; color: #2c2825; }
.mhs-srch__meta { margin-top: 2px; font-size: 12.5px; color: #8f867f; }
.mhs-srch__price { flex: none; text-align: right; font-size: 14px; font-weight: 700; color: #2c2825; white-space: nowrap; }
.mhs-srch__price small { font-size: 11.5px; font-weight: 500; color: #8f867f; }
.mhs-srch__price s { display: block; font-size: 12px; font-weight: 400; color: #a39a94; }
.mhs-srch__price.is-req { max-width: 70px; font-size: 12px; font-weight: 500; line-height: 1.3; color: #9a928c; white-space: normal; }
.mhs-srch mark { padding: 0 1px; border-radius: 2px; background: #fbe3dd; color: inherit; }

.mhs-srch__all {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 18px 0; padding: 12px;
  border-radius: 10px; background: #f9f4f2; font-size: 14px; font-weight: 600; color: #a95c51; text-decoration: none;
}
html body .mhs-srch__all:hover, html body .mhs-srch__all.is-active { background: #f3e6e1 !important; color: #8c4a40 !important; }

.mhs-srch__none { padding: 26px 18px 8px; text-align: center; }
.mhs-srch__none p { margin: 0 0 6px; font-size: 14px; line-height: 1.6; color: #6b635d; }
.mhs-srch__none-h { font-size: 16px !important; font-weight: 700; color: #2c2825 !important; }
.mhs-srch__wa { display: inline-flex; margin-top: 8px; padding: 9px 18px; border: 1px solid #e2dcd7; border-radius: 20px; font-size: 13.5px; font-weight: 600; color: #1c7c54; text-decoration: none; }
html body .mhs-srch__wa:hover { border-color: #25a35a; background: #fff !important; color: #1c7c54 !important; }
.mhs-srch__skel { height: 30px; margin-bottom: 10px; border-radius: 15px; background: linear-gradient(90deg, #f5f1ee 25%, #faf7f5 50%, #f5f1ee 75%); background-size: 200% 100%; animation: mhs-srch-skel 1.2s linear infinite; }
.mhs-srch__skel.is-short { width: 60%; }
@keyframes mhs-srch-skel { to { background-position: -200% 0; } }

.mhs-srch__status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mhs-srch__foot { display: flex; gap: 18px; padding: 9px 18px; border-top: 1px solid #f0ebe7; font-size: 12px; color: #a39a94; }
.mhs-srch__foot kbd, .mhs-srch__close-k {
  display: inline-block; min-width: 20px; margin-right: 3px; padding: 1px 5px; border: 1px solid #e2dcd7; border-radius: 4px;
  background: #fff; box-shadow: none; font-family: inherit; font-size: 11px; font-weight: 600; color: #6b635d; text-align: center;
}
.mhs-srch__close .mhs-srch__close-k { margin: 0; border: 0; background: none; font-size: 12.5px; }

@media (hover: none), (max-width: 767px) { .mhs-srch__foot { display: none; } }
@media (max-width: 767px) {
  .mhs-srch { padding: 0; }
  .mhs-srch__panel { max-width: none; max-height: none; height: 100%; border-radius: 0; transform: translateY(16px); }
  .mhs-srch__form { padding: 8px 10px 8px 14px; }
  .mhs-srch__go, .mhs-srch__close-k { display: none; }
  .mhs-srch__close-t { display: inline; }
  .mhs-srch__close { background: none; font-size: 14px; color: #a95c51; }
  .mhs-srch__sec { padding: 12px 14px 2px; }
  .mhs-srch__all { margin: 12px 14px 0; }
  .mhs-srch__cats { grid-template-columns: 1fr; }
  .mhs-srch__thumb { width: 50px; height: 50px; }
}

/* ---- results page (search.php) ------------------------------------------------ */
.mhs-srp { padding: 6px 0 70px; }
.mhs-srp__form { position: relative; display: flex; gap: 10px; max-width: 720px; margin: 0 0 22px; }
.mhs-srp__form svg { position: absolute; top: 50%; left: 18px; transform: translateY(-50%); color: #c27266; pointer-events: none; }
html body .mhs-srp__form input {
  flex: 1; min-width: 0; height: 52px; margin: 0; padding: 0 20px 0 48px; border: 1px solid #e2dcd7 !important; border-radius: 26px;
  background: #fff !important; box-shadow: none !important; font-size: 16px; color: #2c2825; outline: 0;
}
html body .mhs-srp__form input:focus { border-color: #c27266 !important; }
.mhs-srp__form button { flex: none; height: 52px; padding: 0 26px; border: 0; border-radius: 26px; background: #c27266; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
html body .mhs-srp__form button:hover { background: #a95c51 !important; color: #fff !important; }
.mhs-srp__h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; line-height: 1.25; color: #2c2825; overflow-wrap: anywhere; }
.mhs-srp__count { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: #6b635d; }
.mhs-srp__note { margin: -6px 0 16px; padding: 10px 14px; border-radius: 8px; background: #fbf4e8; font-size: 13.5px; color: #7a5a1e; }
.mhs-srp__cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.mhs-srp__label { margin-right: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9a928c; }

.mhs-srp__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin: 0 0 24px; padding: 12px 0; border-top: 1px solid #eee7e2; border-bottom: 1px solid #eee7e2; }
.mhs-srp__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.mhs-srp__tab { padding: 7px 14px; border: 1px solid #ece5e0; border-radius: 18px; font-size: 13.5px; font-weight: 500; color: #4a4542; text-decoration: none; white-space: nowrap; }
.mhs-srp__tab small { margin-left: 4px; font-size: 12px; color: #9a928c; }
.mhs-srp__tab.is-on { border-color: #c27266; background: #c27266; color: #fff; }
.mhs-srp__tab.is-on small { color: #f6dcd6; }
html body .mhs-srp__tab:hover { border-color: #c27266; color: #a95c51 !important; background: #fdf8f6 !important; }
html body .mhs-srp__tab.is-on:hover { background: #a95c51 !important; color: #fff !important; }
.mhs-srp__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
html body .mhs-srp__filters select {
  height: 38px; margin: 0; padding: 0 30px 0 12px; border: 1px solid #e2dcd7; border-radius: 19px; background-color: #fff;
  font-size: 13.5px; color: #2c2825; cursor: pointer;
}
.mhs-srp__check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 500; color: #4a4542; cursor: pointer; }
.mhs-srp__check input { width: 16px; height: 16px; margin: 0; accent-color: #c27266; }

.mhs-srp__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.mhs-srp__grid .pc-card-wrap { min-width: 0; }
.mhs-srp__pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 36px; }
.mhs-srp__pager a, .mhs-srp__pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid #ece5e0; border-radius: 20px; font-size: 14px; font-weight: 600; color: #4a4542; text-decoration: none;
}
.mhs-srp__pager span[aria-current] { border-color: #c27266; background: #c27266; color: #fff; }
html body .mhs-srp__pager a:hover { border-color: #c27266; background: #fdf8f6 !important; color: #a95c51 !important; }

.mhs-srp__empty { max-width: 640px; margin: 10px auto 0; text-align: center; }
.mhs-srp__empty h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: #2c2825; }
.mhs-srp__empty p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; color: #6b635d; }
.mhs-srp__empty .mhs-srch__chips, .mhs-srp__popular .mhs-srch__chips { justify-content: center; }
.mhs-srp__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 26px; }
.mhs-srp__btn { display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border: 1px solid #e2dcd7; border-radius: 21px; font-size: 14px; font-weight: 600; color: #2c2825; text-decoration: none; }
html body .mhs-srp__btn:hover { border-color: #c27266; background: #fff !important; color: #a95c51 !important; }
.mhs-srp__popular { margin-top: 10px; }
.mhs-srp__popular h2 { margin: 26px 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9a928c; text-align: center; }
.mhs-srp__catgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mhs-srp__catgrid a { display: block; padding: 14px 16px; border: 1px solid #ece5e0; border-radius: 12px; background: #fff; color: #2c2825; text-decoration: none; }
.mhs-srp__catgrid b { display: block; font-size: 14.5px; }
.mhs-srp__catgrid span { display: block; margin-top: 2px; font-size: 12.5px; color: #9a928c; }
html body .mhs-srp__catgrid a:hover { border-color: #c27266; background: #fff !important; color: #a95c51 !important; }

@media (max-width: 1199px) { .mhs-srp__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mhs-srp__catgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .mhs-srp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* two cards a row: the theme's large capitalised titles ran to five lines */
  html body .mhs-srp__grid .pc-card__title { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  html body .mhs-srp__grid .pc-card__subtitle { font-size: 12px; }
  .mhs-srp__catgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mhs-srp__h1 { font-size: 22px; }
  .mhs-srp__form button { padding: 0 18px; }
  .mhs-srp__tools { flex-direction: column; align-items: stretch; }
  .mhs-srp__tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .mhs-srp__tabs::-webkit-scrollbar { display: none; }
  .mhs-srp__filters select { flex: 1; min-width: 0; }
}
