/* Catalogue, laid out like large Israeli retail catalogues: breadcrumb,
   centred category title, toolbar (filter button, result count, sort) and a
   full-width product grid. Filters stay hidden until "סינון" is pressed:
   a side panel on desktop, a bottom sheet on phones. */

.catalogue { padding-block: 1.5rem clamp(2.5rem, 5vw, 4rem); scroll-margin-top: 5rem; }

.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--text-small); color: var(--ink-soft); }
.breadcrumb li + li::before { content: '‹'; margin-inline-end: 0.4rem; color: var(--stainless-dark); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.catalogue-title { margin-top: 0.75rem; font-size: var(--text-h2); text-align: center; }

.catalogue-layout { margin-top: 1.75rem; }

/* Filter panel: off-screen until opened. Desktop = panel sliding in from the
   right (the reading side in RTL), full height. The huge spread shadow doubles
   as a dim backdrop over the page. */
.filter-panel {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 20;
  width: min(22rem, 100%);
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--white);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.25s ease-out, visibility 0s 0.25s;
}

.filter-panel.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease-out;
  box-shadow: 0 0 0 100vmax rgb(12 36 66 / 0.55);
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--stainless);
  border-radius: 50%;
  background: var(--white);
  font-size: 1rem;
  cursor: pointer;
}

.sheet-foot { position: sticky; bottom: -1.25rem; margin: 1rem -1.25rem -1.25rem; padding: 0.75rem 1.25rem; background: var(--white); border-top: 1px solid var(--stainless); }
.sheet-foot .button { width: 100%; }

.filter-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.5rem; border-bottom: 1px solid var(--stainless); }
.filter-head h3 { font-size: var(--text-large); }

.filter-group { border-bottom: 1px solid var(--stainless); padding-block: 0.6rem; }

.filter-group summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 0.3rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: '⌄'; font-size: 1.1rem; line-height: 1; transition: transform 0.15s; }
.filter-group[open] summary::after { transform: rotate(180deg); }

.filter-options { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.1rem; }

.filter-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.35;
}
.filter-option:hover { background: var(--frost); }
.filter-option input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--navy); }
.filter-option-count { font-size: var(--text-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.filter-option.is-empty { color: #707c87; }

.width-filter { display: grid; gap: 0.4rem; padding: 0.5rem 0.25rem 0.25rem; }
.width-filter input { width: 100%; accent-color: var(--navy); }
.width-filter output { font-weight: 600; color: var(--navy); }

.filter-reset {
  margin-top: 0.9rem;
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: var(--steel-blue);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Toolbar */
.results-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stainless);
}

.result-count { flex: 1; font-weight: 600; }

.sort { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); font-size: var(--text-small); }
.sort select {
  min-height: 2.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--stainless-dark);
  border-radius: var(--radius-small);
  background: var(--white);
  font: inherit;
  font-size: var(--text-body);
  color: var(--ink);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--navy);
  font: 600 var(--text-body) / 1 var(--font-body);
  cursor: pointer;
}
.filter-toggle:hover { background: var(--frost); }
.filter-toggle svg { width: 1.1rem; height: 1.1rem; }

/* Grid and cards */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

/* The name button stretches over the whole card (::after), so the whole
   card opens the product; quote/compare controls sit above that layer. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stainless);
  border-radius: var(--radius-small);
  background: var(--white);
  transition: border-color 0.15s;
}
.card:hover, .card:focus-within { border-color: var(--steel-blue); }

.card-photo { aspect-ratio: 1; width: 100%; object-fit: contain; padding: 0.75rem 0.75rem 0; }

.card-body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.6rem 1rem 0.5rem; flex: 1; }

.card-name { margin: 0; font: 600 var(--text-body) / 1.35 var(--font-body); color: var(--ink); }

.card-open { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.card-open::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card-open:focus-visible { outline: none; }
.card-open:focus-visible::after { outline: 3px solid var(--steel-blue); outline-offset: 2px; }

.card-model { font-size: var(--text-small); color: var(--ink-soft); }

.card-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin-top: auto; padding-top: 0.5rem; }
.card-size { font-size: var(--text-small); color: var(--ink-soft); }

.card-actions {
  position: relative; /* above the stretched open button */
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0.8rem;
  border-top: 1px dashed var(--stainless);
}

.card-quote {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--navy);
  font: 600 var(--text-small) / 1.2 var(--font-body);
  cursor: pointer;
}
.card-quote:hover { background: var(--frost); }
.card-quote[aria-pressed='true'] { background: var(--navy); color: var(--white); }

.card-compare { display: flex; align-items: center; gap: 0.35rem; font-size: var(--text-small); color: var(--ink-soft); cursor: pointer; }
.card-compare input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--navy); }

/* Temperature tag: colour = what the unit does (see --mode-* tokens). */
.temperature-tag {
  --tag: var(--mode-machine);
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag) 12%, var(--white));
  color: var(--tag);
  font-size: var(--text-small);
  font-weight: 600;
}
[data-mode='cool'] .temperature-tag { --tag: var(--mode-cool); }
[data-mode='freeze'] .temperature-tag { --tag: var(--mode-freeze); }
[data-mode='heat'] .temperature-tag { --tag: var(--mode-heat); }

.empty { display: grid; justify-items: start; gap: 1rem; padding: 2rem 0; }
.empty[hidden] { display: none; }

/* Phones: the filter panel is a bottom sheet instead of a side panel. */
@media (max-width: 52rem) {
  .catalogue-title { text-align: start; }
  .catalogue-layout { margin-top: 1rem; }

  .filter-panel {
    inset: auto 0 0;
    width: 100%;
    max-height: 85dvh;
    border-radius: var(--radius-large) var(--radius-large) 0 0;
    transform: translateY(105%);
  }

  .results-toolbar { flex-wrap: wrap; gap: 0.6rem; }
  .result-count { order: 3; flex-basis: 100%; font-size: var(--text-small); }
  .sort { margin-inline-start: auto; }
  /* Hidden visually only: it is still the dropdown's accessible name. */
  .sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .card-body { padding: 0.5rem 0.7rem 0.4rem; }
  .card-name { font-size: 0.95rem; }
  .card-actions { flex-direction: column; align-items: stretch; padding: 0.5rem 0.7rem 0.7rem; }
  .card-quote { min-height: 2.5rem; }
  .card-compare { min-height: 2rem; justify-content: center; }
}
