/* Category filters: this layer does not change catalog or homepage order. */
.catalog-toolbar > .catalog-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.catalog-actions:has(#filter-open[hidden]):has(#sort-control[hidden]) { display: none; }
.filter-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid #c9d7e9;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 7px #124f9e08;
}
.filter-open:hover, .filter-open[aria-expanded="true"] { background: #eef4fc; border-color: var(--navy); }
.filter-open-count {
  display: grid;
  place-items: center;
  min-width: 21px;
  min-height: 21px;
  padding: 0 5px;
  border-radius: 20px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.active-filters, .filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.active-filters { margin: -2px 0 20px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  max-width: 100%;
  padding: 8px 12px;
  background: #eaf1fb;
  border: 1px solid #cfddf0;
  border-radius: 24px;
  color: var(--navy);
  font-size: 13px;
  text-align: left;
}
.filter-chip span:first-child { overflow-wrap: anywhere; }
.filter-chip span:last-child { font-size: 20px; line-height: 1; flex-shrink: 0; }
.filter-chip:hover { background: #dce9fb; border-color: #93b2db; }
.filter-clear {
  min-height: 44px;
  border: 0;
  padding: 8px 6px;
  background: transparent;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.filter-clear:disabled { opacity: .5; cursor: default; }
.filter-panel {
  width: 500px;
  max-width: calc(100vw - 32px);
  max-height: min(800px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5f1;
  border-radius: 22px;
  background: #fff;
}
.filter-panel[open] { display: flex; flex-direction: column; }
.filter-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e4ebf5;
  background: linear-gradient(120deg, #f1f6fe, #fff);
}
.filter-eyebrow { margin: 0 0 8px; color: var(--navy); font-size: 10px; letter-spacing: .13em; font-weight: 700; }
.filter-panel-head h2 { margin: 0; color: #193456; font-size: 25px; line-height: 1.2; letter-spacing: -.04em; }
#filter-context { margin: 7px 0 0; color: #52647d; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.filter-panel-head .close { margin-top: 0; }
.filter-panel-body { min-height: 0; padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.filter-group { min-width: 0; margin: 0; padding: 0 0 24px; border: 0; }
.filter-group + .filter-group { padding-top: 2px; }
.filter-group legend { padding: 0; font-size: 16px; font-weight: 700; color: #193456; }
.filter-hint { margin: 6px 0 12px; color: #536680; font-size: 12px; line-height: 1.5; }
.filter-brands { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 9px;
  color: #263b58;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}
.filter-check:hover { background: #f0f5fc; }
.filter-check:has(input:checked) { background: #edf3fc; color: var(--navy); }
.filter-check input { width: 19px; height: 19px; margin: 0; flex-shrink: 0; accent-color: var(--navy); cursor: pointer; }
.filter-check > span { min-width: 0; overflow-wrap: anywhere; }
.filter-check .filter-brand-count { margin-left: 3px; color: #647389; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filter-price-range { position: relative; height: 132px; margin: 0 18px; }
.filter-price-track { position: absolute; top: 33px; right: 0; left: 0; height: 6px; border-radius: 10px; background: #dce6f3; }
.filter-price-track > span { position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: inherit; background: var(--navy); }
.filter-price-handle { position: absolute; z-index: 2; top: 14px; left: -16px; width: calc(100% + 32px); height: 44px; padding: 0; margin: 0; border: 0; outline: 0; background: transparent; appearance: none; -webkit-appearance: none; pointer-events: none; }
.filter-price-handle::-webkit-slider-runnable-track { height: 6px; background: transparent; border: 0; }
.filter-price-handle::-moz-range-track { height: 6px; background: transparent; border: 0; }
.filter-price-handle::-moz-range-progress { background: transparent; }
.filter-price-handle::-webkit-slider-thumb { box-sizing: border-box; width: 32px; height: 32px; margin-top: -13px; border: 3px solid #fff; border-radius: 50%; background: var(--navy) var(--price-chevron) center / 15px 15px no-repeat; box-shadow: 0 1px 5px #124f9e4d; appearance: none; -webkit-appearance: none; pointer-events: auto; cursor: ew-resize; touch-action: pan-y; }
.filter-price-handle::-moz-range-thumb { box-sizing: border-box; width: 32px; height: 32px; border: 3px solid #fff; border-radius: 50%; background: var(--navy) var(--price-chevron) center / 15px 15px no-repeat; box-shadow: 0 1px 5px #124f9e4d; pointer-events: auto; cursor: ew-resize; touch-action: pan-y; }
.filter-price-min { --price-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m6 3 5 5-5 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.filter-price-max { --price-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m10 3-5 5 5 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.filter-price-handle:focus-visible { outline: 0; }
.filter-price-handle:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--navy); outline-offset: 4px; }
.filter-price-handle:focus-visible::-moz-range-thumb { outline: 3px solid var(--navy); outline-offset: 4px; }
.filter-price-range[data-focus="min"] .filter-price-min, .filter-price-range[data-focus="max"] .filter-price-max { z-index: 3; }
/* Close thumbs get distinct vertical hit targets, retaining one shared bar. */
.filter-price-range[data-crowded="true"] .filter-price-min { transform: translateY(-19px); }
.filter-price-range[data-crowded="true"] .filter-price-max { transform: translateY(19px); }
.filter-price-label { position: absolute; top: 76px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; gap: 4px; padding: 4px 3px; border: 0; border-radius: 9px; background: #eef4fc; color: var(--navy); white-space: nowrap; cursor: pointer; }
.filter-price-label > span { color: #536680; font-size: 11px; font-weight: 500; }
.filter-price-label > strong { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.filter-price-label:not(:disabled):hover { background: #dfeafb; }
.filter-price-range[data-stacked="true"] { height: 184px; }
.filter-price-range[data-stacked="true"] #filter-max-label { top: 129px; }
.filter-price-range[data-disabled="true"] .filter-price-track { background: #dce6f3; }
.filter-price-range[data-disabled="true"] .filter-price-track > span { background: #91a5be; }
.filter-price-handle:disabled::-webkit-slider-thumb { background-color: #8296b1; cursor: default; pointer-events: none; }
.filter-price-handle:disabled::-moz-range-thumb { background-color: #8296b1; cursor: default; pointer-events: none; }
.filter-price-label:disabled { cursor: default; background: #f2f5f9; color: #536680; }
.filter-price-message { margin-bottom: 0; }
.filter-price-error { margin: 10px 0 0; color: #a91924; font-size: 12px; line-height: 1.5; }
.filter-gluten-group { padding-bottom: 0; }
.filter-gluten-group .filter-check { margin-top: 9px; }
.filter-gluten-group .filter-hint { margin-left: 9px; margin-bottom: 0; }
.filter-panel-footer {
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  padding: 15px 24px 20px;
  border-top: 1px solid #e4ebf5;
  background: #fff;
  box-shadow: 0 -5px 18px #124f9e05;
}
#filter-panel-count { margin: 0 0 10px; color: #52647d; font-size: 13px; font-variant-numeric: tabular-nums; }
.filter-panel-footer-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.filter-panel-footer .primary { flex: 1; max-width: 255px; }
.filter-panel-footer .primary:disabled { background: #d6dae2; color: #525e70; box-shadow: none; cursor: not-allowed; }
.filter-open:focus-visible, .filter-chip:focus-visible, .filter-clear:focus-visible, .filter-panel button:focus-visible, .filter-panel input[type="checkbox"]:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
#filter-open[hidden], #filter-open-count[hidden], #active-filters[hidden], #filter-price-error[hidden], #filter-price-message[hidden] { display: none; }
@media (max-width: 900px) {
  .catalog-toolbar { flex-wrap: wrap; }
  .catalog-toolbar > .catalog-actions { margin-left: auto; }
}
@media (max-width: 760px) {
  .catalog-toolbar > div:first-child { flex-basis: 100%; }
  .catalog-toolbar > .catalog-actions { flex-basis: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
  .catalog-actions .sort { margin: 0; min-width: 0; }
  .catalog-actions .sort select { min-width: 0; max-width: 180px; }
  .filter-open { padding: 10px 12px; }
  .active-filters { margin-bottom: 16px; }
  .filter-chip { min-height: 44px; }
  .filter-panel { width: 100%; max-width: 100%; max-height: calc(100dvh - 18px); margin: auto 0 0; border-radius: 22px 22px 0 0; border-width: 1px 0 0; }
  .filter-panel[open] { animation: amore-filter-rise .2s ease-out; }
  .filter-panel-head { padding: 20px 20px 16px; }
  .filter-panel-head h2 { font-size: 24px; }
  .filter-panel-body { padding: 22px 20px; }
  .filter-panel-footer { padding: 14px 20px max(20px, env(safe-area-inset-bottom)); }
  .filter-panel-footer .primary { max-width: none; }
}
@media (max-width: 380px) {
  .filter-brands { grid-template-columns: 1fr; }
  .filter-panel-footer-actions { gap: 10px; }
  .filter-panel-footer .primary { padding-left: 12px; padding-right: 12px; }
  .filter-open { gap: 6px; padding: 10px; }
  .filter-open svg { width: 17px; height: 17px; }
  .catalog-actions .sort select { max-width: 155px; }
}
@keyframes amore-filter-rise { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .filter-panel[open] { animation: none; } }
