/* ==========================================================================
   View pets: the case search (place and distance, more filters, sort),
   the compact list and "Show more". Builds on lost.css (cards, filter pills).
   ========================================================================== */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.view-switch { margin-left: auto; display: inline-flex; gap: 4px; }

/* The search bar does not follow the page down while the extra filters are open */
.listing-bar:has(.cs-more[open]) { position: static; }

/* ── Place, distance, my location ─────────────────────────────────── */

.cs-place { position: relative; }

.cs-place__radius {
  border: none;
  border-left: 1px solid #eee;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  color: #555;
  padding: 7px 6px 7px 10px;
  max-width: 160px;
  outline: none;
  cursor: pointer;
}

.cs-place__me {
  border: none;
  background: transparent;
  color: #999;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: color .12s;
}

.cs-place__me:hover, .cs-place__me:focus-visible { color: #DD7878; }

.cs-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  max-height: 280px;
  overflow-y: auto;
}

.cs-suggest[hidden] { display: none; }

.cs-suggest li {
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.cs-suggest li:hover, .cs-suggest li[aria-selected="true"] { background: #fdf0f0; color: #111; }

/* ── More filters ─────────────────────────────────────────────────── */

.cs-more { margin-top: 10px; }

.cs-more__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #f5f5f5;
  color: #555;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.cs-more__toggle::-webkit-details-marker { display: none; }
.cs-more__toggle:hover { background: #ebebeb; color: #333; }
.cs-more[open] .cs-more__toggle { background: #fdf0f0; color: #b25c5a; }

.cs-more__count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #DD7878;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.cs-more__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 22px;
  padding: 14px 0 10px;
}

.cs-field { border: 0; margin: 0; padding: 0; min-width: 0; }

.cs-field legend {
  padding: 0;
  margin-bottom: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #444;
}

.cs-select {
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  padding: 5px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  color: #444;
  cursor: pointer;
}

.cs-select:focus { border-color: #DD7878; outline: none; }

.cs-dates { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cs-dates[hidden] { display: none; }

.cs-dates label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.cs-dates input {
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-family: 'Roboto', sans-serif;
  color: #333;
}

.cs-dates input:focus { border-color: #DD7878; outline: none; }

.cs-checks { display: flex; flex-wrap: wrap; gap: 6px; }

.cs-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 9px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}

.cs-check input { margin: 0; accent-color: #DD7878; }
.cs-check:hover { border-color: #DD7878; }
.cs-check:has(input:checked) { border-color: #DD7878; background: #fdf0f0; color: #b25c5a; }
.cs-check:has(input:focus-visible) { outline: 2px solid #DD7878; outline-offset: 1px; }

.cs-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18);
  flex-shrink: 0;
}

.cs-swatch--black { background: #222; }
.cs-swatch--brown { background: #7b4a2a; }
.cs-swatch--ginger { background: #e1813f; }
.cs-swatch--grey { background: #8d8b8e; }
.cs-swatch--white { background: #fff; }

.cs-more__actions { display: flex; align-items: center; gap: 16px; padding-bottom: 4px; }
.cs-apply { border-radius: 999px; }

.cs-clear {
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #DD7878;
}

/* ── Summary, sort, filters in use ────────────────────────────────── */

.cs-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.cs-summary__text { margin: 0; font-size: 14px; color: #555; }
.cs-summary__text strong { color: #111; font-weight: 600; }
.cs-summary__page { color: #999; font-size: 13px; }

.cs-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #777;
}

.cs-note {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 14px;
  padding: 9px 13px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #ffe0a0;
  color: #7a5a00;
  font-size: 13px;
}

.cs-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  background: #fdf0f0;
  color: #b25c5a;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.cs-chip i { font-size: 10px; }
.cs-chip:hover { background: #f8dede; color: #9c4847; text-decoration: none; }

/* Distance on a card */
.case-card__meta .case-card__distance { color: #b25c5a; font-weight: 500; }

/* ── Compact list ─────────────────────────────────────────────────── */

.case-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.case-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 2fr) minmax(0, 2fr) 118px 92px;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 8px 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
  color: inherit;
  text-decoration: none;
  transition: box-shadow .15s;
}

.case-row:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .09); color: inherit; text-decoration: none; }

.case-row__img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 20px;
}

.case-row__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

.case-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.case-row__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.case-badge--inline { position: static; font-size: 9.5px; padding: 2px 8px; }

.case-row__what { font-size: 12px; color: #888; }

.case-row__where, .case-row__when {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  color: #666;
}

.case-row__where em { font-style: normal; color: #b25c5a; white-space: nowrap; }
.case-row__where i, .case-row__when i { color: #DD7878; font-size: 11px; }

.case-row__ref {
  text-align: right;
  font-family: 'Poppins', sans-serif;
  font-size: 10.5px;
  color: #bbb;
  letter-spacing: .03em;
}

/* ── Show more ────────────────────────────────────────────────────── */

.cs-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 30px;
}

.cs-pager__more { border-radius: 999px; padding: 10px 26px; }
.cs-pager__prev { font-family: 'Poppins', sans-serif; font-size: 13px; color: #DD7878; }
.cs-pager__info { font-size: 12px; color: #999; }

/* ── Phones ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .case-row { grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 1.6fr) 104px; }
  .case-row__ref { display: none; }
}

@media (max-width: 640px) {
  .view-switch { margin-left: 0; }
  .cs-place { width: 100%; }

  /* place on the first line, distance and Search on the second */
  .cs-place__box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; border-radius: 16px; }
  .cs-place__box > i { grid-column: 1; grid-row: 1; }
  .cs-place__box .filter-search__input { grid-column: 2; grid-row: 1; width: 100%; font-size: 16px; padding: 9px 4px; } /* 16 px stops iOS zooming in */
  .cs-place__me { grid-column: 3; grid-row: 1; padding: 9px 14px; }
  .cs-place__radius { grid-column: 1 / 3; grid-row: 2; max-width: none; border-left: 0; border-top: 1px solid #eee; padding: 9px 14px; font-size: 13px; }
  .cs-place__box .filter-search__btn { grid-column: 3; grid-row: 2; padding: 9px 16px; }

  .cs-more__grid { grid-template-columns: 1fr; gap: 14px; }
  .cs-more__actions .cs-apply { flex: 1; padding: 10px; }
  .cs-dates label { flex: 1 1 140px; }
  .cs-dates input { flex: 1; min-width: 0; font-size: 16px; }

  .cs-summary { flex-direction: column; align-items: flex-start; }
  .cs-summary__text { font-size: 13.5px; }

  .case-row { grid-template-columns: 56px minmax(0, 1fr); gap: 3px 12px; padding: 8px 12px 8px 8px; }
  .case-row__img { grid-row: 1 / span 3; width: 56px; height: 56px; align-self: start; }
  .case-row__where, .case-row__when { font-size: 12px; }
  .case-row__name { font-size: 14px; }
}
