/*
 * Site search — mobile polish only (overlay + results page)
 * Source: html_maket/neweditsandmobile/jby-search
 * Desktop stays in jby-search.css; header/footer not restyled here.
 * Breakpoints: 1100 / 980 / 680 / 560 (template).
 */

/* Short labels: hidden on desktop, shown ≤980 */
#jb_body.page-search .lbl-short {
  display: none;
}

/* ---------- Overlay ≤980 ---------- */
@media (max-width: 980px) {
  #jbs .jbs-shell {
    padding: var(--jbs-top, 24px) 24px 0;
    max-height: 100svh;
  }

  #jbs .jbs-bar {
    height: 72px;
    padding: 0 20px;
    gap: 14px;
  }

  #jbs .jbs-bar input {
    font-size: 17px;
    line-height: 24px;
  }

  #jbs .jbs-drop {
    padding: 26px 20px 30px;
  }

  #jbs .jbs-quick {
    grid-template-columns: repeat(2, 1fr);
  }

  #jbs .jbs-quick a {
    padding: 18px;
  }

  #jbs .jbs-res {
    grid-template-columns: 42px 1fr;
    gap: 14px;
  }

  #jbs .jbs-res.has-tail {
    grid-template-columns: 42px 1fr auto;
  }

  #jbs .jbs-res.bare {
    grid-template-columns: 1fr;
  }

  #jbs .jbs-res.bare.has-tail {
    grid-template-columns: 1fr auto;
  }

  #jbs .jbs-res .thumb {
    width: 42px;
    height: 42px;
  }

  #jbs .jbs-res .t {
    font-size: 16px;
    line-height: 22px;
  }

  #jbs .jbs-none h3 {
    font-size: 18px;
    line-height: 26px;
  }

  #jbs .jbs-seeall {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Overlay ≤560 ---------- */
@media (max-width: 560px) {
  #jbs .jbs-quick {
    grid-template-columns: 1fr;
  }

  #jbs .jbs-chips {
    gap: 8px;
  }

  #jbs .jbs-chip {
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }

  #jbs .jbs-sec {
    margin: 0 0 28px;
  }
}

/* ---------- Results ≤1100 ---------- */
@media (max-width: 1100px) {
  #jb_body.page-search .sr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Results ≤980 ---------- */
@media (max-width: 980px) {
  html:has(#jb_body.page-search),
  html:has(#jb_body.page-search) body {
    overflow-x: hidden;
  }

  #jb_body.page-search .sr-wrap {
    padding: 0 24px 64px;
  }

  /* Space under fixed header-v2 (template uses ~120px) */
  #jb_body.page-search .sr-head {
    padding: 120px 0 30px;
  }

  /* Heading + × stay on one line; long query truncates */
  #jb_body.page-search .sr-title {
    flex-wrap: nowrap;
    gap: 14px;
  }

  #jb_body.page-search .sr-title h1 {
    font-size: 19px;
    line-height: 28px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #jb_body.page-search .sr-clear {
    flex: 0 0 auto;
  }

  #jb_body.page-search .lbl-full {
    display: none;
  }

  #jb_body.page-search .lbl-short {
    display: inline;
  }

  #jb_body.page-search .sr-secline {
    gap: 16px;
  }

  #jb_body.page-search .sr-secline h2 {
    font-size: 17px;
    line-height: 26px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #jb_body.page-search .sr-secline .s-link {
    flex: 0 0 auto;
    padding: 0 16px;
    height: 36px;
    font-size: 14px;
  }

  #jb_body.page-search .sr-block {
    padding: 0 0 44px;
  }

  #jb_body.page-search .sr-block + .sr-block {
    padding-top: 44px;
  }

  #jb_body.page-search .sr-empty h2 {
    font-size: 26px;
    line-height: 36px;
  }
}

/* ---------- Results ≤680 ---------- */
@media (max-width: 680px) {
  #jb_body.page-search .sr-grid {
    grid-template-columns: 1fr;
  }

  #jb_body.page-search .sr-card .cimg.logo {
    padding: 28px;
  }

  #jb_body.page-search .sr-card .cbody {
    padding: 18px 18px 20px;
  }

  #jb_body.page-search .sr-card .ctitle {
    font-size: 18px;
    line-height: 26px;
  }
}

/* ---------- Results ≤560 ---------- */
@media (max-width: 560px) {
  #jb_body.page-search .sr-head {
    padding: 108px 0 24px;
  }

  #jb_body.page-search .sr-count {
    font-size: 14px;
    line-height: 20px;
  }

  #jb_body.page-search .btn-solid {
    width: 100%;
    justify-content: center;
  }
}
