/* Compact catalog controls shared by the market, categories and sale pages. */
body[data-view] :is(#sortFilter, .catalog-public-sort) {
  position: static;
  inset: auto;
  display: block;
  flex: 0 1 auto;
  field-sizing: content;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0 0 0 auto;
  padding: 10px 30px 10px 4px;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23242530' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6h16M9 12h11M15 18h5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 3px center;
  background-size: 20px;
  color: #242530;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  cursor: pointer;
}
body[data-view] :is(#sortFilter, .catalog-public-sort):hover { color: #6038ef; }
body[data-view] :is(#sortFilter, .catalog-public-sort):focus { box-shadow: none; }
body[data-view] :is(#sortFilter, .catalog-public-sort):focus-visible {
  outline: none;
  text-decoration: none;
}
body[data-view] :is(#sortFilter, .catalog-public-sort) option { color: #242530; background: #fff; }
body[data-view="market"] #best-offers .filters {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  width: auto;
}
body[data-view="market"] #best-offers .market-filter-btn { display: none; }
body[data-view] .sale-catalog-controls { gap: 12px; flex-wrap: wrap; }
body[data-view] .sale-filters { flex: 0 1 auto; width: auto; max-width: 230px; }
body[data-view] .sale-filters .sale-filter-select {
  field-sizing: content;
  width: auto;
  min-width: 105px;
  max-width: 100%;
  min-height: 40px;
  padding: 10px 34px 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background-color: #f3f3f9;
  background-position: right 12px center;
  color: #343443;
  font-size: 14px;
  font-weight: 500;
}
body[data-view] .sale-filters .sale-filter-select:hover { background-color: #ece9f8; }
body[data-view] .sale-filters:has(option:checked:not([value=""])) .sale-filter-select {
  border-color: #d9ccff;
  background-color: #eee8ff;
  color: #6038ef;
}
body[data-view] .sale-filter-select:focus-visible { outline: 2px solid #7955f6; outline-offset: 2px; }
body[data-view="catalog"] .catalog-section-buttons { gap: 8px; margin-bottom: 16px; }
body[data-view="catalog"] .catalog-section-buttons .catalog-section-button,
body[data-view="catalog"] .catalog-public-platforms button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f3f3f9;
  color: #343443;
  font-size: 14px;
  font-weight: 500;
}
body[data-view="catalog"] .catalog-section-buttons .catalog-section-button.active,
body[data-view="catalog"] .catalog-section-buttons .catalog-section-button[aria-current="page"],
body[data-view="catalog"] .catalog-public-platforms button.active {
  background: #6038ef;
  color: #fff;
  border-color: #6038ef;
}
body[data-view="catalog"] .catalog-section-buttons .catalog-section-button:hover,
body[data-view="catalog"] .catalog-public-platforms button:hover { box-shadow: inset 0 0 0 1px #b9a5fa; }
@media (max-width: 768px) {
  body[data-view="market"] #best-offers .section-head { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  body[data-view="market"] #best-offers .section-head .filters {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  body[data-view] :is(#sortFilter, .catalog-public-sort) { min-height: 44px; font-size: 14px; }
  body[data-view] .sale-catalog-controls { gap: 8px; max-width: 100%; }
  body[data-view] .catalog-section-toolbar { gap: 8px; }
  body[data-view="market"] #best-offers .filters .sale-filters { flex: 0 1 auto; max-width: 100%; }
}
@media (max-width: 700px) {
  body[data-view="catalog"] .catalog-public-mobile-sort-wrap { display: block; width: auto; min-width: 0; }
  body[data-view="catalog"] .catalog-public-mobile-sort-button { display: none; }
  body[data-view="catalog"] .catalog-public-mobile-sort { position: static; display: block; }
}
/* Keep the text control compact when the campaign selector is present. */
body[data-view="market"] #best-offers #sortFilter { width: auto; flex: 0 1 auto; }

/* Match the shared select layer so its chevron does not replace the sort icon. */
@layer shared-select-arrows {
 body[data-view] :is(#sortFilter, .catalog-public-sort) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23242530' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6h16M9 12h11M15 18h5'/%3E%3C/svg%3E") !important;
  background-position: right 3px center !important;
  background-size: 20px 20px !important;
  padding-right: 30px !important;
 }
 @media (forced-colors: active) {
  body[data-view] :is(#sortFilter, .catalog-public-sort) { background-image: none !important; }
 }
}
@media (max-width: 768px) {
 body[data-view="market"] #best-offers .section-head { display: grid; }
}

/* Campaigns use a real button and a compact choice panel. */
body[data-view] :is(#sortFilter, .catalog-public-sort):focus { outline: none; }
body[data-view] .sale-filters { position: relative; }
body[data-view] .sale-filter-button {
 display:flex;align-items:center;gap:8px;min-height:40px;max-width:100%;
 padding:9px 14px;border:0;border-radius:10px;background:#6038ef;
 color:#fff;font:inherit;font-size:14px;font-weight:500;cursor:pointer;
}
body[data-view] .sale-filter-button>span:last-child { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
body[data-view] .sale-filter-icon { display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:6px;background:#ffffff24;color:#fff;font-weight:700;font-size:13px; }
body[data-view] .sale-filter-button:hover,body[data-view] .sale-filter-button[aria-expanded="true"] { background:#4f28d9; }
body[data-view] .sale-filter-button.is-active { background:#6038ef;color:#fff; }
body[data-view] .sale-filter-button:focus-visible { outline:none;box-shadow:inset 0 0 0 2px #b9a5fa; }
body[data-view] .sale-filter-menu {
 position:absolute;right:0;top:calc(100% + 8px);z-index:40;display:grid;gap:4px;
 width:max-content;min-width:210px;max-width:min(290px,calc(100vw - 40px));
 padding:6px;border:1px solid #ece9f5;border-radius:12px;background:white;
 box-shadow:0 10px 32px #2820401a;
}
body[data-view] .sale-filter-menu[hidden] { display:none; }
body[data-view] .sale-filter-menu button {
 width:100%;padding:10px 12px;border:0;border-radius:8px;background:transparent;
 color:#343443;font:inherit;font-size:14px;text-align:left;cursor:pointer;overflow-wrap:anywhere;
}
body[data-view] .sale-filter-menu button:hover,body[data-view] .sale-filter-menu button:focus-visible { background:#f3f0fc;outline:none; }
body[data-view] .sale-filter-menu button[aria-pressed="true"] { background:#eee8ff;color:#6038ef; }
@media(max-width:768px) { body[data-view="market"] .sale-filter-menu { left:0;right:auto; } }

body[data-view] .sale-filter-button.is-active:hover,body[data-view] .sale-filter-button.is-active[aria-expanded="true"] { background:#4f28d9; }

/* Text inside controls must not inherit the muted section-counter styling. */
body[data-view] .sale-filters .sale-filter-button > span { color:#fff;font-size:inherit; }
body[data-view] .sale-filters .sale-filter-button > .sale-filter-icon { font-size:13px; }
/* Preserve the original select as the data/event source only. */
body[data-view] select[data-sort-enhanced] { display:none !important; }
body[data-view] .catalog-sort-control { position:relative;flex:0 1 auto;min-width:0;margin-left:auto; }
body[data-view] .catalog-sort-button {
 display:flex;align-items:center;justify-content:flex-end;gap:10px;
 min-height:44px;max-width:100%;padding:10px 3px 10px 4px;
 border:0;border-radius:6px;background:transparent;color:#242530;
 font:inherit;font-size:15px;font-weight:500;line-height:1.4;text-decoration:none;
 box-shadow:none;cursor:pointer;outline:none;
}
body[data-view] .catalog-sort-control .catalog-sort-button > span { color:inherit;font-size:inherit;white-space:nowrap;text-decoration:none; }
body[data-view] .catalog-sort-button svg { flex:none; }
body[data-view] .catalog-sort-button:hover { color:#6038ef; }
body[data-view] .catalog-sort-button:focus,
body[data-view] .catalog-sort-button:focus-visible { outline:none;text-decoration:none;box-shadow:none; }
body[data-view] .catalog-sort-button:focus-visible { background:#f3f0fc; }
body[data-view] .catalog-sort-control .catalog-sort-menu { right:0;left:auto; }
@media(max-width:768px){body[data-view] .catalog-sort-button { font-size:14px; }}

/* Constrain open menus to the space measured above/below their trigger. */
body[data-view] .sale-filter-menu { box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain; }
