/* Lock scroll when modal is open */
.ts-lock { overflow: hidden !important; }

/* ---------- Buttons / utilities ---------- */
.ts-muted { opacity: .72; font-size: 13px; }
.ts-link { color: #2b5cff; text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; }
.ts-link:hover { text-decoration: underline; }

.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 11px 14px;
  border: 1px solid #e6e8ee;
  background: #fff;
  color: #111;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}
.ts-btn:active { transform: translateY(1px); }
.ts-btn--primary { background: #111; color: #fff; border-color: #111; }
.ts-btn--ghost { background: #fff; color: #111; }
.ts-btn--full { width: 100%; }

.ts-iconbtn{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid #e6e8ee;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display:flex;align-items:center;justify-content:center;
}
.ts-iconbtn--close { width: 44px; height: 44px; font-size: 26px; }

/* ---------- Badges ---------- */
.ts-badge{
  display:inline-flex;align-items:center;justify-content:center;
  font-size: 12px; font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e6e8ee;
  background:#fff;
}
.ts-badge--in { color:#0b6b2b; background:#ebfff2; border-color:#c7f2d3; }
.ts-badge--out { color:#9b1c1c; background:#fff0f0; border-color:#ffd0d0; }

/* ---------- Modal ---------- */
.ts-modal-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.45);
  z-index: 99998;
  display:none;
}

.ts-modal{
  position:fixed;
  left:0; right:0; top:0;
  height: 100vh;
  background:#fff;
  z-index: 99999;
  transform: translateY(-18px);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
  display:block;
}

.ts-modal.is-open{
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ts-modal__top{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f4;
}

.ts-modal__brand{
  display:flex; align-items:center; gap:10px;
}
.ts-modal__logo{
  height: 28px; width: auto;
  display:block;
}

.ts-modal__search{
  flex:1;
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  padding: 10px 12px;
  background:#fff;
}
.ts-modal__search input{
  flex:1;
  border:0;
  outline:0;
  font-size: 16px;
  padding: 2px 0;
}

.ts-ic{ opacity:.55; font-size: 14px; }

/* chips row */
.ts-modal__chips{
  padding: 10px 18px;
  border-bottom: 1px solid #eef0f4;
}
.ts-chipbar{
  display:flex; align-items:center; gap:10px;
  flex-wrap: wrap;
}
.ts-chipbar__label{
  font-weight: 800;
  color:#111;
  margin-right: 6px;
}
.ts-chipbar__chips{ display:flex; gap:8px; flex-wrap: wrap; }

.ts-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e6e8ee;
  background:#fff;
  cursor:pointer;
}
.ts-pill__x{ opacity:.6; font-weight: 900; }

/* body split */
.ts-modal__body{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 14px 18px 18px;
  height: calc(100vh - 120px);
  overflow:hidden;
}

.ts-modal__side{
  border-right: 1px solid #eef0f4;
  padding-right: 14px;
  overflow:auto;
}

.ts-side__block{ margin-bottom: 18px; }
.ts-side__title{ font-weight: 900; margin: 12px 0; font-size: 14px; }
.ts-side__list{ display:flex; flex-direction: column; gap:8px; }

.ts-pop{
  text-align:left;
  border: 1px solid #e6e8ee;
  background:#fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 700;
}

.ts-reco{ display:flex; flex-direction: column; gap:12px; }
.ts-reco__item{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  background:#fff;
}
.ts-reco__img{ display:block; width:64px; height:64px; border-radius: 12px; overflow:hidden; border:1px solid #eef0f4; background:#fff; }
.ts-reco__img img{ width:100%; height:100%; object-fit: contain; }
.ts-reco__name{ font-weight: 900; font-size: 13px; line-height: 1.2; }
.ts-reco__name a{ color:#111; text-decoration:none; }
.ts-reco__row{ display:flex; align-items:center; justify-content: space-between; margin: 6px 0; }
.ts-reco__price{ font-weight: 900; }

/* main */
.ts-modal__main{
  overflow:auto;
  padding-right: 4px;
}
.ts-modal__meta{
  display:flex; align-items:center; justify-content: space-between;
  margin-bottom: 12px;
}

/* grids */
.ts-grid{
  display:grid;
  gap: 14px;
}
.ts-grid--modal{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ts-grid--page{ grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ts-empty{
  padding: 22px;
  border: 1px dashed #e6e8ee;
  border-radius: 16px;
  color:#666;
  background:#fafbfc;
}

/* card */
.ts-card{
  border: 1px solid #eef0f4;
  border-radius: 18px;
  background:#fff;
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.ts-card__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}
.ts-brandlogo{
  height: 18px; width:auto; max-width: 90px;
  opacity: .95;
}
.ts-card__img{
  display:block;
  border-radius: 14px;
  border: 1px solid #eef0f4;
  background:#fff;
  overflow:hidden;
}
.ts-card__img img{
  width:100%;
  height: 160px;
  object-fit: contain;
  display:block;
}
.ts-card__title{
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  color:#111;
}
.ts-card__meta{ font-size: 12px; opacity: .72; }
.ts-card__price{ font-size: 16px; font-weight: 900; padding-top: 4px; }
.ts-card__actions{
  margin-top: auto;
  display:flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Full page layout ---------- */
.ts-wrap{
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 12px;
}

.ts-topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ts-searchbar{
  flex:1;
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  padding: 10px 12px;
  background:#fff;
}
.ts-searchbar input{
  flex:1;
  border:0;
  outline:0;
  font-size: 16px;
}

.ts-layout{
  display:grid;
  grid-template-columns: 320px 1fr; /* filters left, products right */
  gap: 16px;
  align-items: start;
}

.ts-filters{
  border: 1px solid #eef0f4;
  border-radius: 18px;
  background:#fff;
  padding: 14px;
  position: sticky;
  top: 90px;
}
.ts-filters__title{ font-weight: 900; margin-bottom: 10px; }

.ts-filterblock{ margin: 12px 0; }
.ts-filterblock__label{ font-weight: 800; font-size: 13px; opacity: .75; margin-bottom: 8px; }

.ts-facet{ display:flex; flex-wrap: wrap; gap: 8px; }
.ts-chip{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid #e6e8ee;
  background:#fff;
  padding: 8px 12px;
  cursor:pointer;
  font-weight: 800;
}
.ts-chip__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background:#f2f4f8;
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
}
.ts-chip.active{
  background:#111;
  color:#fff;
  border-color:#111;
}
.ts-chip.active .ts-chip__count{
  background: rgba(255,255,255,.16);
  color:#fff;
}

.ts-row{ display:flex; gap: 10px; margin-bottom: 10px; }
.ts-row input{
  width: 100%;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.ts-main{ min-width: 0; }
.ts-summary{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin: 6px 0 12px;
}

.ts-pagination{
  display:flex;
  justify-content: space-between;
  margin-top: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px){
  .ts-grid--modal, .ts-grid--page{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px){
  .ts-modal__body{ grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .ts-modal__side{ border-right:0; border-bottom:1px solid #eef0f4; padding-right:0; padding-bottom: 14px; }
  .ts-layout{ grid-template-columns: 1fr; }
  .ts-filters{ position: relative; top:auto; }
  .ts-grid--modal, .ts-grid--page{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 540px){
  .ts-grid--modal, .ts-grid--page{ grid-template-columns: 1fr; }
}
/* Modal results paging */
.ts-pagination--modal {
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

/* Better scrolling inside modal */
.ts-modal__main {
  overflow: auto;
  padding-right: 4px;
}

.ts-modal__side {
  overflow: auto;
}

/* Show filters nicely in modal left side */
#tsSideFilters .ts-filterblock {
  margin-bottom: 14px;
}

#tsSideFilters .ts-facet {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Modal card actions stacked */
.ts-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.ts-card__actions .ts-btn {
  width: 100%;
}

/* Recommended card button full width */
.ts-reco__info .ts-btn {
  width: 100%;
  margin-top: 6px;
}

/* Slightly taller modal body for more results */
.ts-modal__body {
  height: calc(100vh - 118px);
}
/* ------------------------------
   MOBILE-ONLY SEARCH TWEAKS
------------------------------ */
@media (max-width: 767px) {
  /* Put logo + close on first row, search full width underneath */
  .ts-modal__top {
    display: grid;
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "brand close"
      "search search";
    gap: 10px;
    align-items: center;
  }

  .ts-modal__brand {
    grid-area: brand;
  }

  .ts-iconbtn--close {
    grid-area: close;
    justify-self: end;
  }

  .ts-modal__searchwrap {
    grid-area: search;
    width: 100%;
  }

  .ts-modal__search {
    width: 100%;
  }

  /* Latest searches horizontal scroll */
  .ts-chipbar--latest {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ts-chipbar--latest::-webkit-scrollbar {
    display: none;
  }

  .ts-chipbar__label {
    flex: 0 0 auto;
  }

  .ts-chipbar__chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow: visible;
    flex: 0 0 auto;
  }

  .ts-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #tsLatestClear {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Popular searches horizontal scroll */
  .ts-side__list--popular {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .ts-side__list--popular::-webkit-scrollbar {
    display: none;
  }

  .ts-side__list--popular .ts-pop {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    white-space: nowrap;
  }

  /* Mobile modal side should not stack above results anymore */
  .ts-modal__body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ts-modal__side {
    border-right: 0;
    border-bottom: 0;
    padding-right: 0;
    padding-bottom: 0;
    overflow: visible;
  }

  /* Default side content visible normally */
  #tsSideDefault {
    display: block;
  }

  /* Filters become a dropdown/popup panel on mobile */
  #tsSideFilters {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    top: 132px;
    max-height: 60vh;
    overflow: auto;
    z-index: 100001;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
    padding: 14px;
  }

  #tsSideFilters.ts-mobile-open {
    display: block !important;
  }

  .ts-mobile-filters-btn {
    display: inline-flex;
    white-space: nowrap;
  }

  .ts-modal__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ts-modal__meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }

  /* Keep modal results grid clean on mobile */
  .ts-grid--modal {
    grid-template-columns: 1fr;
  }

  .ts-pagination--modal {
    justify-content: space-between;
  }
}
.ts-main{
  min-height: 900px;
}

.ts-grid--page{
  min-height: 700px;
}

.ts-mobile-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ts-iconbtn--sm {
  width: 34px;
  height: 34px;
  font-size: 20px;
  border-radius: 10px;
}

.ts-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
}

.ts-card__brandwrap {
  flex: 1 1 auto;
  min-width: 0;
}

.ts-card__badgewrap {
  flex: 0 0 auto;
}

.ts-brandlogo {
  display: block;
  max-width: 90px;
  width: auto;
  height: 18px;
  object-fit: contain;
}
/* Stronger layout lock for results page */
.ts-layout {
  align-items: start;
}

.ts-main {
  width: 100%;
  min-width: 0;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
}

.ts-grid--page {
  flex: 1 1 auto;
  min-height: 55vh;
  align-content: start;
}

.ts-summary,
.ts-pagination {
  flex: 0 0 auto;
}

/* Keep modal results area stable too */
.ts-modal__main {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
}

.ts-grid--modal {
  flex: 1 1 auto;
  align-content: start;
  min-height: 45vh;
}
/* Stronger stable layout */
.ts-layout {
  align-items: start;
}

.ts-main {
  width: 100%;
  min-width: 0;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
}

.ts-grid--page {
  flex: 1 1 auto;
  min-height: 55vh;
  align-content: start;
}

.ts-summary,
.ts-pagination {
  flex: 0 0 auto;
}

.ts-modal__main {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
}

.ts-grid--modal {
  flex: 1 1 auto;
  align-content: start;
  min-height: 45vh;
}

/* Brand logo */
.ts-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
}

.ts-card__brandwrap {
  flex: 1 1 auto;
  min-width: 0;
}

.ts-card__badgewrap {
  flex: 0 0 auto;
}

.ts-brandlogo {
  display: block;
  max-width: 100px;
  width: auto;
  height: 24px;
  object-fit: contain;
}

/* Filter heads */
.ts-mobile-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ts-iconbtn--sm {
  width: 34px;
  height: 34px;
  font-size: 20px;
  border-radius: 10px;
}

.ts-summary__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ts-page-filters-btn {
  display: none;
}

/* Mobile-only behaviour */
@media (max-width: 767px) {
  .ts-modal__top {
    display: grid;
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "brand close"
      "search search";
    gap: 10px;
    align-items: center;
  }

  .ts-modal__brand {
    grid-area: brand;
  }

  .ts-iconbtn--close {
    grid-area: close;
    justify-self: end;
  }

  .ts-modal__searchwrap {
    grid-area: search;
    width: 100%;
  }

  .ts-modal__search {
    width: 100%;
  }

  .ts-chipbar--latest {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ts-chipbar--latest::-webkit-scrollbar {
    display: none;
  }

  .ts-chipbar__label,
  #tsLatestClear {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ts-chipbar__chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    flex: 0 0 auto;
  }

  .ts-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ts-side__list--popular {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .ts-side__list--popular::-webkit-scrollbar {
    display: none;
  }

  .ts-side__list--popular .ts-pop {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    white-space: nowrap;
  }

  .ts-modal__body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ts-modal__side {
    border-right: 0;
    border-bottom: 0;
    padding-right: 0;
    padding-bottom: 0;
    overflow: visible;
  }

  #tsSideFilters {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    top: 132px;
    max-height: 60vh;
    overflow: auto;
    z-index: 100001;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
    padding: 14px;
  }

  #tsSideFilters.ts-mobile-open {
    display: block !important;
  }

  .ts-mobile-filters-btn {
    display: inline-flex;
    white-space: nowrap;
  }

  .ts-modal__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ts-modal__meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }

  .ts-grid--modal {
    grid-template-columns: 1fr;
  }

  .ts-pagination--modal {
    justify-content: space-between;
  }

  /* Main search page mobile filters like dropdown */
  .ts-layout {
    grid-template-columns: 1fr;
  }

  .ts-page-filters-btn {
    display: inline-flex;
  }

  .ts-filters {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    top: 120px;
    z-index: 100001;
    max-height: 70vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
    padding: 14px;
  }

  .ts-filters.ts-page-filters-mobile-open {
    display: block !important;
  }

  .ts-filters .ts-facet {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .ts-filters .ts-facet::-webkit-scrollbar {
    display: none;
  }

  .ts-filters .ts-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
/* Strong stable frame */
.ts-wrap {
  width: 100%;
}

.ts-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}

.ts-main {
  width: 100%;
  min-width: 0;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
}

.ts-grid--page,
.ts-grid--modal {
  width: 100%;
  min-width: 0;
}

/* Better loading state */
.ts-loading-wrap {
  width: 100%;
}

.ts-loading-note {
  font-size: 14px;
  opacity: .7;
  margin-bottom: 12px;
}

.ts-loading-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.ts-skel-card {
  border: 1px solid #e6e8ee;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.ts-skel {
  background: linear-gradient(90deg, #f2f4f7 25%, #e9edf2 37%, #f2f4f7 63%);
  background-size: 400% 100%;
  animation: tsShimmer 1.2s ease-in-out infinite;
  border-radius: 12px;
}

.ts-skel--img {
  width: 100%;
  height: 180px;
  margin-bottom: 14px;
}

.ts-skel--line {
  height: 14px;
  margin-bottom: 10px;
}

.ts-skel--title {
  height: 20px;
  width: 85%;
}

.ts-skel--short {
  width: 55%;
}

.ts-skel--btn {
  margin-top: 16px;
  height: 42px;
  width: 100%;
  border-radius: 14px;
}

@keyframes tsShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Desktop page filters close button hidden */
#tsPageFiltersClose {
  display: none;
}

/* Mobile */
@media (max-width: 767px) {
  .ts-layout {
    grid-template-columns: 1fr;
  }

  .ts-main {
    min-height: 70vh;
  }

  .ts-loading-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ts-skel--img {
    height: 150px;
  }

  #tsPageFiltersClose {
    display: inline-flex;
  }
}
/* Force full-width page layout */
.ts-wrap {
  width: 100%;
  max-width: 100%;
}

.ts-layout {
  display: grid !important;
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 18px;
  align-items: start;
  width: 100%;
}

.ts-main {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 75vh !important;
  display: flex;
  flex-direction: column;
}

.ts-grid--page {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 55vh !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px;
  align-content: start;
  flex: 1 1 auto;
}

.ts-summary,
.ts-pagination {
  flex: 0 0 auto;
}

/* Loading must fill the whole results column */
.ts-loading-wrap {
  width: 100%;
}

.ts-loading-note {
  font-size: 14px;
  opacity: .7;
  margin-bottom: 12px;
}

.ts-loading-grid {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px;
}

.ts-skel-card {
  width: 100%;
  min-width: 0;
  border: 1px solid #e6e8ee;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-sizing: border-box;
}

.ts-skel {
  background: linear-gradient(90deg, #f2f4f7 25%, #e9edf2 37%, #f2f4f7 63%);
  background-size: 400% 100%;
  animation: tsShimmer 1.2s ease-in-out infinite;
  border-radius: 12px;
}

.ts-skel--img {
  width: 100%;
  height: 180px;
  margin-bottom: 14px;
}

.ts-skel--line {
  height: 14px;
  margin-bottom: 10px;
}

.ts-skel--title {
  height: 20px;
  width: 85%;
}

.ts-skel--short {
  width: 55%;
}

.ts-skel--btn {
  margin-top: 16px;
  height: 42px;
  width: 100%;
  border-radius: 14px;
}

@keyframes tsShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Desktop: hide page filter close button */
#tsPageFiltersClose {
  display: none;
}

/* Mobile */
@media (max-width: 767px) {
  .ts-layout {
    grid-template-columns: 1fr !important;
  }

  .ts-main {
    min-height: 70vh !important;
  }

  .ts-grid--page {
    grid-template-columns: 1fr !important;
  }

  .ts-loading-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .ts-skel--img {
    height: 150px;
  }

  #tsPageFiltersClose {
    display: inline-flex;
  }
}
/* Force the search results side to take the remaining width */
.ts-wrap {
  width: 100%;
  max-width: 100%;
}

.ts-layout {
  display: grid !important;
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 18px !important;
  width: 100% !important;
  align-items: start !important;
}

.ts-main {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 75vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
}

.ts-summary {
  width: 100% !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px;
  margin-bottom: 14px;
}

.ts-grid--page {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-content: start !important;
}

/* Make loading grid use exactly the same structure */
.ts-loading-wrap {
  width: 100% !important;
}

.ts-loading-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.ts-skel-card {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

/* Keep filters column fixed width */
.ts-filters {
  width: 320px !important;
  max-width: 320px !important;
  min-width: 320px !important;
  box-sizing: border-box;
}

/* Mobile */
@media (max-width: 767px) {
  .ts-layout {
    grid-template-columns: 1fr !important;
  }

  .ts-filters {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .ts-main {
    min-height: 70vh !important;
  }

  .ts-grid--page,
  .ts-loading-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ===== FINAL LAYOUT OVERRIDES ===== */

#ts-search-page,
#ts-search-page .ts-wrap {
  width: 100% !important;
  max-width: 100% !important;
}

#ts-search-page .ts-layout {
  display: grid !important;
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: start !important;
}

#ts-search-page .ts-filters {
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
}

#ts-search-page .ts-main {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 75vh !important;
  box-sizing: border-box !important;
}

#ts-search-page .ts-summary {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  gap: 16px !important;
  margin-bottom: 14px !important;
}

#ts-search-page .ts-summary__left,
#ts-search-page .ts-summary__right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

#ts-search-page #tsResults.ts-grid--page {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  align-content: start !important;
  box-sizing: border-box !important;
}

#ts-search-page #tsResults .ts-card,
#ts-search-page #tsResults .ts-skel-card {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Loading must fill the whole results area */
#ts-search-page #tsResults .ts-loading-wrap {
  width: 100% !important;
}

#ts-search-page #tsResults .ts-loading-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
}

#ts-search-page #tsResults .ts-skel-card {
  border: 1px solid #e6e8ee;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

#ts-search-page #tsResults .ts-skel {
  background: linear-gradient(90deg, #f2f4f7 25%, #e9edf2 37%, #f2f4f7 63%);
  background-size: 400% 100%;
  animation: tsShimmer 1.2s ease-in-out infinite;
  border-radius: 12px;
}

#ts-search-page #tsResults .ts-skel--img {
  width: 100%;
  height: 180px;
  margin-bottom: 14px;
}

#ts-search-page #tsResults .ts-skel--line {
  height: 14px;
  margin-bottom: 10px;
}

#ts-search-page #tsResults .ts-skel--title {
  height: 20px;
  width: 85%;
}

#ts-search-page #tsResults .ts-skel--short {
  width: 55%;
}

#ts-search-page #tsResults .ts-skel--btn {
  margin-top: 16px;
  height: 42px;
  width: 100%;
  border-radius: 14px;
}

@keyframes tsShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Brand logo */
.ts-card__top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-height: 28px !important;
}

.ts-card__brandwrap {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.ts-card__badgewrap {
  flex: 0 0 auto !important;
}

.ts-brandlogo {
  display: block !important;
  max-width: 100px !important;
  width: auto !important;
  height: 24px !important;
  object-fit: contain !important;
}

/* Page filter close button hidden on desktop */
#tsPageFiltersClose {
  display: none !important;
}

/* Mobile */
@media (max-width: 767px) {
  #ts-search-page .ts-layout {
    grid-template-columns: 1fr !important;
  }

  #ts-search-page .ts-filters {
    display: none;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 120px !important;
    z-index: 100001 !important;
    max-height: 70vh !important;
    overflow: auto !important;
    background: #fff !important;
    border: 1px solid #e6e8ee !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,.16) !important;
    padding: 14px !important;
  }

  #ts-search-page .ts-filters.ts-page-filters-mobile-open {
    display: block !important;
  }

  #ts-search-page .ts-main {
    min-height: 70vh !important;
  }

  #ts-search-page #tsResults.ts-grid--page,
  #ts-search-page #tsResults .ts-loading-grid {
    grid-template-columns: 1fr !important;
  }

  #tsPageFiltersClose {
    display: inline-flex !important;
  }

  .ts-page-filters-btn {
    display: inline-flex !important;
  }

  .ts-filters .ts-facet {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .ts-filters .ts-facet::-webkit-scrollbar {
    display: none !important;
  }

  .ts-filters .ts-chip {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}
/* Keep results area stable */
#ts-search-page .ts-main {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 75vh !important;
  display: flex !important;
  flex-direction: column !important;
}

#ts-search-page #tsResults.ts-grid--page {
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 55vh !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-content: start !important;
}

#ts-search-page #tsResults.ts-is-loading {
  pointer-events: none;
}

#ts-search-page #tsResults .ts-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 12px;
}

#ts-search-page #tsResults .ts-loading-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#ts-search-page #tsResults .ts-loading-spinner {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid #d9dee7;
  border-top-color: #111;
  animation: tsSpin 0.8s linear infinite;
}

#ts-search-page #tsResults .ts-loading-note {
  font-size: 14px;
  opacity: .8;
}

@keyframes tsSpin {
  to { transform: rotate(360deg); }
}

/* Modal too */
.ts-grid--modal {
  position: relative !important;
  min-height: 45vh !important;
}

.ts-grid--modal.ts-is-loading {
  pointer-events: none;
}

.ts-grid--modal .ts-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 12px;
}

.ts-grid--modal .ts-loading-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ts-grid--modal .ts-loading-spinner {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid #d9dee7;
  border-top-color: #111;
  animation: tsSpin 0.8s linear infinite;
}

@media (max-width: 767px) {
  #ts-search-page #tsResults.ts-grid--page {
    grid-template-columns: 1fr !important;
    min-height: 50vh !important;
  }
}

/* ===== 1.4.1 UI fixes ===== */
.ts-modal__top{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) auto !important;
  align-items:center !important;
  column-gap:16px !important;
}

.ts-modal__brand{
  min-width:max-content !important;
}

.ts-modal__searchwrap{
  width:100% !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}

.ts-modal__search{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  box-sizing:border-box !important;
}

.ts-modal__search input{
  width:100% !important;
  min-width:0 !important;
}

.ts-modal__body{
  align-items:start !important;
}

.ts-modal__main{
  min-width:0 !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

.ts-modal__meta{
  flex:0 0 auto !important;
}

#tsQuick.ts-grid--modal{
  flex:1 1 auto !important;
  align-content:start !important;
  overflow:auto !important;
  min-height:0 !important;
  padding-bottom:12px !important;
}

.ts-pagination.ts-pagination--modal{
  position:sticky !important;
  bottom:0 !important;
  left:0 !important;
  right:0 !important;
  z-index:20 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:12px !important;
  margin-top:12px !important;
  padding:14px 0 0 !important;
  background:#fff !important;
  border-top:1px solid #eef0f4 !important;
}

#tsQuickPage{
  min-width:120px !important;
  text-align:center !important;
  margin:0 !important;
  position:static !important;
}

@media (max-width: 991px){
  .ts-modal__top{
    grid-template-columns:1fr auto !important;
    grid-template-areas:
      "brand close"
      "search search" !important;
    row-gap:12px !important;
  }

  .ts-modal__brand{ grid-area:brand !important; }
  .ts-modal__searchwrap{ grid-area:search !important; }
  .ts-iconbtn--close{ grid-area:close !important; justify-self:end !important; }
}

@media (max-width: 767px){
  .ts-pagination.ts-pagination--modal{
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 14px 0 0 0 !important;
    padding: 0 12px 24px 12px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border-top: 0 !important;
    box-shadow: none !important;
  }

  .ts-modal__main{
    padding-bottom: 24px !important;
  }

  #tsQuickPrev,
  #tsQuickNext{
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
  }

  #tsQuickPage{
    grid-column: 1 / -1 !important;
    text-align: center !important;
    margin-top: 4px !important;
  }
}


/* === 1.4.2 modal scroll + full-width layout fixes === */
.ts-modal{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.ts-modal__top,
.ts-modal__chips{
  flex:0 0 auto;
}

.ts-modal__top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
}

.ts-modal__searchwrap{
  width:100%;
  min-width:0;
}

.ts-modal__search{
  width:100%;
}

.ts-modal__body{
  flex:1 1 auto;
  min-height:0;
  height:auto;
  align-items:stretch;
}

.ts-modal__side,
.ts-modal__main{
  min-height:0;
}

.ts-modal__main{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.ts-modal__meta,
.ts-pagination--modal{
  flex:0 0 auto;
}

#tsQuick{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  align-content:start;
  padding-right:4px;
}

.ts-pagination--modal{
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:12px;
  padding:12px 0 4px;
  background:#fff;
  border-top:1px solid #eef0f4;
}

.ts-pagination--modal #tsQuickPage{
  min-width:110px;
  text-align:center;
}

@media (max-width: 980px){
  .ts-modal__body{
    grid-template-columns:1fr;
  }

  .ts-modal__main{
    overflow:hidden;
  }

  #tsQuick{
    overflow:auto;
  }
}


/* --- 1.4.5 modal scroll fix --- */
.ts-modal{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.ts-modal__top,
.ts-modal__chips{
  flex:0 0 auto;
}
.ts-modal__body{
  flex:1 1 auto;
  height:auto;
  min-height:0;
  overflow:hidden;
}
.ts-modal__side,
.ts-modal__main{
  min-height:0;
  max-height:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
.ts-modal__main{
  display:flex;
  flex-direction:column;
}
#tsQuick{
  flex:0 0 auto;
  padding-bottom:12px;
}
.ts-pagination--modal{
  position:sticky;
  bottom:0;
  z-index:3;
  background:#fff;
  padding:12px 0 8px;
  margin-top:auto;
}
@media (max-width: 980px){
  .ts-modal__body{
    grid-template-columns:1fr;
  }
  .ts-modal__side{
    max-height:none;
  }
}


/* v1.4.6 mobile dropdown filters button hard-fix */
@media (max-width: 767px) {
  .ts-modal__meta {
    align-items: center;
  }

  .ts-modal__meta-right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .ts-mobile-filters-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    flex: 0 0 auto;
    visibility: visible;
  }

  .ts-mobile-filters-btn[style*="display: none"] {
    display: none !important;
  }

  .ts-mobile-filters-btn:not([style*="display: none"]) {
    display: inline-flex !important;
  }

  #tsSearchAll {
    flex: 0 0 auto;
    margin-left: auto;
  }
}



/* Facet list limiting / more button / scroll */
.ts-facet--scrollable{
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.ts-facet-more-wrap{
  display: flex;
  width: 100%;
  margin-top: 8px;
}

.ts-facet-more-btn{
  width: 100%;
  justify-content: center;
}

.ts-facet--scrollable::-webkit-scrollbar{
  width: 8px;
}

.ts-facet--scrollable::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}



/* ===== 1.4.17 Mobile polish without breaking layout ===== */

/* Cleaner single search box */
.ts-modal__search{
  border-radius: 18px;
  padding: 12px 14px;
  min-height: 56px;
  box-shadow: 0 4px 18px rgba(15,23,42,.04);
}
.ts-modal__search input{
  font-size: 18px;
}
.ts-modal__searchwrap{
  min-width: 0;
}

/* Proper text close button */
.ts-iconbtn--close{
  width: auto;
  min-width: 92px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
}

/* Keep latest chips tidy on mobile */
@media (max-width: 767px) {
  .ts-modal__top {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand close"
      "search search";
    gap: 10px;
    padding: 12px;
  }

  .ts-modal__logo{
    height: 32px;
  }

  .ts-iconbtn--close{
    min-width: 78px;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    border-radius: 14px;
  }

  .ts-modal__search{
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 16px;
  }

  .ts-modal__search input{
    font-size: 16px;
  }

  .ts-modal__chips{
    padding: 10px 12px;
  }

  .ts-chipbar__label{
    margin-right: 0;
  }

  /* Keep result cards compact but intact */
  .ts-grid--modal{
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ts-card{
    border-radius: 16px;
  }

  .ts-card__body{
    padding: 12px;
  }

  .ts-card__title{
    font-size: 15px;
    line-height: 1.22;
  }

  /* Pagination stays on-screen */
  .ts-pagination--modal,
  .ts-pagination{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    padding: 14px 12px 20px;
    box-sizing: border-box;
  }

  #tsQuickPage,
  #tsPage{
    grid-column: 1 / -1;
    order: 3;
    text-align: center;
    width: 100%;
    margin-top: 2px;
  }

  #tsQuickPrev,
  #tsQuickNext,
  #tsPrev,
  #tsNext{
    width: 100%;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ts-modal__meta{
    padding: 0 12px;
  }
}



/* ===== 1.4.22 targeted mobile cleanup ===== */
@media (max-width: 767px){
  /* search box: one clean thin square box */
  .ts-modal__searchwrap{
    width:100% !important;
    min-width:0 !important;
  }

  .ts-modal__search{
    width:100% !important;
    min-height:52px !important;
    padding:0 12px !important;
    gap:8px !important;
    border:1px solid #d9dde5 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    background:#fff !important;
  }

  .ts-modal__search input{
    width:100% !important;
    min-width:0 !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    outline:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    font-size:16px !important;
  }

  .ts-modal__search .ts-ic,
  .ts-modal__search svg,
  .ts-modal__search .dashicons-search,
  .ts-modal__search .ts-icon,
  .ts-modal__search .ts-searchicon,
  .ts-modal__search .ts-iconbtn--search{
    display:none !important;
  }

  .ts-modal__search .ts-iconbtn,
  .ts-modal__search .ts-clear{
    width:42px !important;
    min-width:42px !important;
    height:42px !important;
    margin-left:8px !important;
    border-radius:10px !important;
  }

  .ts-iconbtn--close,
  #tsClose{
    min-width:78px !important;
    width:auto !important;
    height:44px !important;
    padding:0 14px !important;
    border-radius:14px !important;
    font-size:14px !important;
  }

  /* pagination visible on-screen */
  .ts-mobile-pagination-422,
  .ts-pagination--modal,
  .ts-pagination{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    padding:14px 12px 20px !important;
    margin:0 !important;
    box-sizing:border-box !important;
    overflow:visible !important;
  }

  #tsQuickPrev,
  #tsQuickNext,
  #tsPrev,
  #tsNext{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:42px !important;
    padding:0 8px !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  #tsQuickPage,
  #tsPage{
    grid-column:1 / -1 !important;
    order:3 !important;
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
  }
}



/* ===== 1.4.30 clean mobile quick-search layout ===== */
@media (max-width: 767px){
  .ts-modal__top{
    padding: 12px !important;
    gap: 10px !important;
  }

  .ts-modal__logo{
    max-width: 185px !important;
    height: auto !important;
  }

  .ts-modal__search{
    width: 100% !important;
    min-height: 52px !important;
    padding: 0 12px !important;
    border: 1px solid #d9dde5 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    gap: 8px !important;
  }

  .ts-modal__search .ts-ic,
  .ts-modal__search svg,
  .ts-modal__search .dashicons-search,
  .ts-modal__search .ts-icon,
  .ts-modal__search .ts-searchicon,
  .ts-modal__search .ts-iconbtn--search{
    display:none !important;
  }

  .ts-modal__search input{
    width:100% !important;
    min-width:0 !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    outline:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    font-size:16px !important;
  }

  .ts-modal__search .ts-iconbtn,
  .ts-modal__search .ts-clear{
    width:42px !important;
    min-width:42px !important;
    height:42px !important;
    margin-left:8px !important;
    border-radius:10px !important;
  }

  .ts-iconbtn--close,
  #tsClose{
    min-width:78px !important;
    width:auto !important;
    height:44px !important;
    padding:0 14px !important;
    border-radius:14px !important;
    font-size:14px !important;
  }

  .ts-modal__chips{
    padding: 10px 12px !important;
  }

  .ts-modal__body{
    display:block !important;
    height: calc(100vh - 138px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px 0 34px !important;
  }

  .ts-modal__side,
  .ts-modal__main{
    width:100% !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    overflow:visible !important;
  }

  .ts-modal.ts-no-query .ts-modal__main{
    display:none !important;
  }

  .ts-modal.ts-no-query #tsSideDefault{
    display:block !important;
    padding: 0 12px !important;
  }

  .ts-modal.ts-has-query #tsSideDefault{
    display:none !important;
  }

  .ts-modal.ts-has-query .ts-modal__main{
    display:block !important;
  }

  .ts-modal__meta{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    margin:0 0 12px 0 !important;
    padding:0 12px !important;
    background:transparent !important;
  }

  .ts-modal__meta-right{
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
    margin-left:auto !important;
  }

  #tsMobileFiltersBtn,
  #tsSearchAll{
    position:static !important;
    margin:0 !important;
  }

  .ts-grid--modal,
  #tsQuick{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    padding:0 12px !important;
    overflow:visible !important;
  }

  .ts-card{
    border-radius:16px !important;
    overflow:hidden !important;
  }

  .ts-card__body{
    padding:12px !important;
  }

  .ts-pagination--modal{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    margin:14px 0 0 0 !important;
    padding:0 12px calc(env(safe-area-inset-bottom, 0px) + 24px) 12px !important;
    background:transparent !important;
    box-shadow:none !important;
    border-top:0 !important;
    position:static !important;
  }

  #tsQuickPrev,
  #tsQuickNext{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:44px !important;
    padding:0 8px !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  #tsQuickPage{
    grid-column:1 / -1 !important;
    order:3 !important;
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
    padding-top:4px !important;
    line-height:1.2 !important;
  }
}



/* ===== 1.4.31 mobile quick-search state fix ===== */
@media (max-width: 767px){
  .ts-modal__body{
    display:block !important;
    height: calc(100vh - 138px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding:12px 0 34px !important;
  }

  .ts-modal__side,
  .ts-modal__main{
    width:100% !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
  }

  /* Before typing: show only popular/recommended */
  .ts-modal.ts-no-query .ts-modal__main{
    display:none !important;
  }
  .ts-modal.ts-no-query #tsSideDefault{
    display:block !important;
    padding:0 12px !important;
  }
  .ts-modal.ts-no-query #tsSideFilters{
    display:none !important;
  }

  /* After typing: show only results area by default */
  .ts-modal.ts-has-query #tsSideDefault{
    display:none !important;
  }
  .ts-modal.ts-has-query .ts-modal__main{
    display:block !important;
  }
  .ts-modal.ts-has-query #tsSideFilters{
    display:none;
  }
  .ts-modal.ts-has-query #tsSideFilters.ts-mobile-open{
    display:block !important;
    padding:0 12px 12px !important;
  }

  .ts-modal__meta{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    margin:0 0 12px 0 !important;
    padding:0 12px !important;
    background:transparent !important;
    position:static !important;
  }

  .ts-modal__meta-right{
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
    margin-left:auto !important;
  }

  #tsMobileFiltersBtn,
  #tsSearchAll{
    position:static !important;
    margin:0 !important;
  }

  #tsQuick,
  #tsQuick.ts-grid--modal{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    padding:0 12px !important;
    overflow:visible !important;
  }

  .ts-pagination--modal{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    margin:14px 0 0 0 !important;
    padding:0 12px calc(env(safe-area-inset-bottom, 0px) + 24px) 12px !important;
    background:transparent !important;
    box-shadow:none !important;
    border-top:0 !important;
    position:static !important;
  }

  #tsQuickPrev,
  #tsQuickNext{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:44px !important;
    padding:0 8px !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  #tsQuickPage{
    grid-column:1 / -1 !important;
    order:3 !important;
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
    padding-top:4px !important;
    line-height:1.2 !important;
  }
}



/* ===== 1.4.32 mobile state visibility safeguard ===== */
@media (max-width: 767px){
  .ts-modal.ts-no-query #tsSideDefault{ display:block !important; }
  .ts-modal.ts-no-query .ts-modal__main{ display:none !important; }
  .ts-modal.ts-has-query #tsSideDefault{ display:none !important; }
  .ts-modal.ts-has-query .ts-modal__main{ display:block !important; }
}



/* ===== 1.4.39 mobile sticky pager inside modal ===== */
@media (max-width: 767px){
  .ts-modal__body{
    display:block !important;
    height: calc(100dvh - 138px) !important;
    overflow:hidden !important;
    padding:12px 0 0 !important;
  }

  .ts-modal__main{
    display:block !important;
    height:100% !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    padding:0 0 0 0 !important;
  }

  #tsQuick,
  #tsQuick.ts-grid--modal{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    padding:0 12px 12px !important;
    overflow:visible !important;
  }

  .ts-pagination--modal{
    position: sticky !important;
    bottom: 0 !important;
    left: auto !important;
    right: auto !important;
    z-index: 20 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    margin:12px 0 0 0 !important;
    padding:10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px) 12px !important;
    background:#fff !important;
    border-top:1px solid #e9edf3 !important;
    box-shadow:0 -6px 18px rgba(15,23,42,.06) !important;
    box-sizing:border-box !important;
  }

  #tsQuickPrev,
  #tsQuickNext{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:44px !important;
    padding:0 8px !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  #tsQuickPage{
    grid-column:1 / -1 !important;
    order:3 !important;
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
    padding-top:4px !important;
    line-height:1.2 !important;
  }
}



/* ===== 1.4.40 phone-safe fixed pager using visual viewport ===== */
@media (max-width: 767px){
  .ts-modal{
    --tsvv-bottom: 12px;
    --ts-pager-h: 88px;
  }

  .ts-modal__body{
    display:block !important;
    height: calc(100dvh - 138px) !important;
    overflow:hidden !important;
    padding:12px 0 0 !important;
  }

  .ts-modal__main{
    display:block !important;
    height:100% !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    padding:0 0 calc(var(--ts-pager-h) + var(--tsvv-bottom) + 18px) 0 !important;
  }

  #tsQuick,
  #tsQuick.ts-grid--modal{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    padding:0 12px 12px !important;
    overflow:visible !important;
  }

  .ts-pagination--modal{
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: var(--tsvv-bottom) !important;
    z-index: 999999 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    width:auto !important;
    max-width:none !important;
    margin:0 !important;
    padding:10px 10px calc(env(safe-area-inset-bottom, 0px) + 8px) 10px !important;
    background:rgba(255,255,255,.98) !important;
    border:1px solid #e9edf3 !important;
    border-radius:16px !important;
    box-shadow:0 -8px 24px rgba(15,23,42,.10) !important;
    box-sizing:border-box !important;
    backdrop-filter: blur(2px) !important;
  }

  #tsQuickPrev,
  #tsQuickNext{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    height:44px !important;
    padding:0 8px !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }

  #tsQuickPage{
    grid-column:1 / -1 !important;
    order:3 !important;
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
    padding-top:2px !important;
    line-height:1.2 !important;
  }
}


/* ===== 1.4.42 faster dropdown feel ===== */
.ts-modal__search input{caret-color:auto;}


/* ===== 1.4.43 instant open feel ===== */
.ts-modal{
  transition: transform .06s ease, opacity .06s ease !important;
}
.ts-modal-backdrop{
  transition: opacity .06s ease !important;
}


/* ===== 1.4.45 faster open + save-on-real-action ===== */
.ts-modal{
  transition: transform .06s ease, opacity .06s ease !important;
}
.ts-modal-backdrop{
  transition: opacity .06s ease !important;
}
