/* Compact phone layout. Desktop controls return to their original positions. */
.mobile-secondary-tools { display: none; }
@media (max-width: 650px) {
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .market-header.header { position: relative; }
  .market-header .topline {
    position: absolute; top: 4px; right: 8px; z-index: 2;
    min-height: 44px; padding: 0; gap: 0; background: transparent;
  }
  .market-header .topline > span { display: none; }
  .market-header [hidden] { display: none !important; }
  .market-header .toplinks { gap: 0; margin: 0; }
  /* General navigation is available through the footer and account on phones. */
  .market-header .toplinks > a,
  .market-header #cmsEditWebsite,
  .market-header #openNotifications { display: none; }
  .market-header #languageToggle { min-width: 38px; min-height: 44px; font-size: 12px; color: var(--muted); }
  .market-utility-actions { gap: 0; }
  .market-header .header-account-tools { gap: 0; }
  .market-header .favorites-link, .market-header .header-post { display: inline-flex !important; }
  .market-header .favorites-link,
  .market-header .profile-button,
  .market-header .header-post {
    display: inline-flex; position: relative; align-items: center; justify-content: center;
    width: 40px; height: 44px; min-height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  }
  .market-header .favorites-link .heart { color: inherit; }
  .market-header .favorites-link .ui-icon, .market-header .profile-button .ui-icon { width: 23px; height: 23px; }
  .market-header .favorites-link > [data-i18n], .market-header .header-post > [data-i18n] {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  .market-header .favorites-link .count { position: absolute; right: 0; top: 0; font-size: 9px; background: var(--orange); }
  .market-header .favorites-link .count:empty { display: none; }
  .market-header .header-post { order: -1; color: var(--orange); }
  .market-header .header-post > span:first-child { font-size: 30px; }
  .market-search-row {
    display: grid; grid-template-columns: 44px minmax(0,1fr);
    grid-template-rows: 44px 44px; gap: 4px 0; padding: 4px 12px 10px;
  }
  .market-search-row .brand { grid-row: 1; grid-column: 1 / -1; width: fit-content; }
  .market-search-row .brand-lockup { width: 108px; }
  #marketCatalogue.market-catalogue-button {
    display: inline-flex; grid-row: 2; grid-column: 1; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 1px solid var(--line);
    border-right: 0; border-radius: 8px 0 0 8px; background: #f5f7f8; color: var(--ink);
  }
  #marketCatalogue > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #marketCatalogue .ui-icon { width: 21px; height: 21px; }
  .market-header .search, .market-header .search.mobile-open {
    grid-row: 2; grid-column: 2; height: 44px; padding: 3px 3px 3px 9px;
    border: 1px solid var(--line); border-radius: 0 8px 8px 0; background: #f5f7f8;
  }
  .market-header .search:focus-within { border-color: var(--orange); }
  .market-header .search .search-icon { display: none; }
  .market-header .search input { font-size: 16px; }
  .market-header .search button { height: 36px; min-height: 36px; font-size: 12px; padding-inline: 9px; }
  .market-header .market-header-region, .mobile-nav { display: none; }
  .market-home { padding-top: 8px; }
  .market-discovery { margin-bottom: 10px; }
  .market-discovery-head {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%);
  }
  .market-discovery-head button { display: none; }
  .market-categories {
    display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity; padding-bottom: 4px;
  }
  .market-categories button, .market-categories button:nth-child(n+9) {
    display: flex; flex: 0 0 72px; height: 64px; min-height: 64px; padding: 4px;
    font-size: 11px; scroll-snap-align: start;
  }
  .market-categories .market-category-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .market-home .listings-heading { margin-bottom: 5px; }
  .market-home .listings-heading h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.3px; }
  .market-controls { position: relative; padding: 0; gap: 4px; border: 0; border-radius: 0; background: transparent; }
  .market-home .filter-row { display: contents; }
  .market-toolbar { display: contents; }
  .market-home .filter-row button, .market-home .sort-button, button#marketMore {
    min-height: 44px; padding: 6px 8px; font-size: 12px; background: #f5f7f8; border-color: #e6eaee;
  }
  .market-home #regionFilter { display: inline-flex; flex: 1 1 60px; min-width: 0; max-width: none; }
  #regionFilter > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #sortButton b { display: none; }
  .market-quick-filters {
    display: flex; overflow-x: auto; gap: 5px; overscroll-behavior-x: contain;
    scrollbar-width: thin; padding-bottom: 4px;
  }
  .market-quick-filters button { flex: 0 0 auto; max-width: 160px; min-height: 44px; padding: 5px 9px; font-size: 12px; }
  .market-quick-filters button > span { overflow-wrap: normal; }
  .market-quick-filters small { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .market-toolbar > #ocListingTools:not([hidden]) {
    position: static; width: 100%; max-width: none; flex: 1 0 100%;
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px;
    padding: 10px; margin-top: 5px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: none;
  }
  #ocListingTools > #marketMoreClose { grid-column: 1 / -1; justify-self: end; }
  #ocListingTools .mobile-secondary-tools { display: contents; }
  #ocListingTools .market-part-actions { display: contents; }
  #ocListingTools :is(button,a) {
    display: inline-flex; align-items: center; justify-content: flex-start;
    gap: 6px; min-width: 0; min-height: 44px; margin: 0; padding: 8px;
    border: 1px solid var(--line); border-radius: 7px; background: #fff;
    color: var(--ink); font-size: 12px; line-height: 1.3; white-space: normal;
    overflow-wrap: anywhere; text-align: left;
  }
  #ocListingTools [hidden] { display: none !important; }
  #ocListingTools [aria-pressed="true"] { color: var(--storefront-accent-ink); background: var(--storefront-accent-soft); border-color: var(--orange); }
  #ocListingTools #marketViews { display: flex; grid-column: 1 / -1; gap: 5px; padding: 0; background: none; }
  #ocListingTools #marketViews button { flex: 1; justify-content: center; }
  .market-home .listing-grid:not(.list-view) { margin-top: 8px; gap: 14px 8px; }
  .market-home .listing-grid:not(.list-view) .listing-image { height: auto; aspect-ratio: 4 / 3; border-radius: 8px; }
  .market-home .listing-grid:not(.list-view) .listing-info { padding: 5px 0 0; }
  .market-home .listing-price { margin-top: 0; font-size: 17px; line-height: 1.3; }
  .market-home .listing-title { margin-top: 3px; min-height: 0; font-size: 13px; line-height: 1.35; }
  .market-facts { gap: 2px 0; margin-top: 4px; }
  .market-facts span { padding: 0; border-radius: 0; background: none; color: var(--muted); font-size: 11px; line-height: 1.45; }
  .market-facts span:not(:last-child)::after { content: ' · '; white-space: pre; color: #a2aab2; }
  .market-home .listing-meta { margin-top: 4px; padding-top: 0; border: 0; font-size: 10px; }
  .market-home .empty-state:not(.hidden) { margin-top: 10px; padding: 12px; border-radius: 9px; }
  .market-home .market-empty-actions button { min-height: 44px; }
  main > [data-market-block]:not([data-market-block="listings"]) { display: none; }
  footer { margin-top: 24px; padding: 12px 12px 20px; gap: 10px; flex-wrap: wrap; font-size: 11px; }
  footer .footer-brand { display: none; }
  footer > div { flex-wrap: wrap; gap: 8px 14px; }
  footer a { min-height: 32px; display: inline-flex; align-items: center; }
  .catalog-compare-dock { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  :is(button,a):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
}
@media (max-width: 370px) {
  .market-search-row .brand-lockup { width: 94px; }
  .market-header .favorites-link, .market-header .profile-button, .market-header .header-post { width: 36px; }
  .market-header #languageToggle { min-width: 32px; }
  .market-home .filter-row button, .market-home .sort-button, button#marketMore { padding-inline: 6px; font-size: 11px; }
  #regionFilter { max-width: 110px; }
}

/* Catalogue-first browsing: quiet surfaces, stable controls and readable results. */
#browseNavigation { margin: 0 0 14px; scroll-margin-top: 16px; }
#browseNavigation[hidden] { display: none; }
.browse-path { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.browse-path button { display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:0; border:0; background:none; color:var(--muted); font-size:12px; text-align:left; }
.browse-path .browse-back { color:var(--ink); }
.browse-back > span { font-size:27px; line-height:1; }
.browse-children { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid var(--line); }
.browse-children > button { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:10px 12px; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; font-size:13px; line-height:1.35; color:var(--ink); }
.browse-children > button:hover,.browse-sheet-list button:hover { background:#edf3f8; }
.browse-children > button > span:last-child { color:#8b96a5; font-size:19px; }
.browse-children .browse-extra { display:none; }
.browse-children.is-expanded .browse-extra { display:flex; }
.browse-expand { min-height:40px; padding:5px 12px; border:0; background:none; color:var(--storefront-accent-ink); font-size:12px; }
.browse-expand > span:first-child { color:var(--muted); }
#marketResults { flex-wrap:wrap; align-items:center; gap:4px 12px; }
#marketResults h2 { flex:1 1 auto; }
#browseStatus { flex:1 1 auto; font-size:12px; color:var(--muted); margin:0; }
#browseStatus.is-loading { color:var(--storefront-accent-ink); }
#marketResults #marketViews { display:flex; flex:0 0 auto; gap:2px; margin:0; padding:0; border:0; background:none; }
#marketResults #marketViews button { display:flex; align-items:center; justify-content:center; width:40px; height:40px; padding:9px; border:0; border-radius:7px; background:transparent; color:#8793a1; }
#marketResults #marketViews button[aria-pressed="true"] { color:var(--storefront-accent-ink); background:#eaf1f8; }
#marketViews .ui-icon { width:20px; height:20px; }
.market-home .browse-loading { opacity:.22; pointer-events:none; min-height:140px; }
.market-home .listing-grid { transition:opacity 110ms ease; }
.browse-sheet-heading { display:flex; align-items:center; gap:12px; margin:2px 0 12px; }
.browse-sheet-heading h3 { margin:0; font-size:17px; line-height:1.4; }
.browse-sheet-heading > button { width:40px; height:40px; border:1px solid var(--line); background:#fff; border-radius:8px; font-size:26px; }
.browse-sheet-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.browse-sheet-list button { display:flex; align-items:center; justify-content:space-between; min-height:48px; gap:12px; padding:12px; border:0; border-bottom:1px solid var(--line); background:transparent; font-size:14px; text-align:left; color:var(--ink); }
.browse-sheet-list button span:last-child { color:#8b96a5; }
.browse-show-all { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:46px; padding:10px 12px; margin-bottom:8px; border:0; border-radius:8px; background:#edf3f9; color:var(--storefront-accent-ink); font-size:13px; text-align:left; }
.browse-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media (min-width:651px) {
 #marketResults h2 { flex-basis:100%; }
 #marketCategories [data-browse-all] { display:none; }
 .browse-category main > [data-market-block="categories"] { display:none; }
}
@media (max-width:650px) {
 body { background:#f6f7f9; }
 .market-header.header { background:#fff; border-bottom:1px solid #e6e9ef; box-shadow:none; }
 .market-home { padding-top:8px; }
 .market-search-row { padding-bottom:9px; }
 .market-header .search,.market-header .search.mobile-open,#marketCatalogue.market-catalogue-button { background:#fff; border-color:#cbd4df; }
 .market-header .search button { border-radius:6px; }
 .market-discovery { margin-bottom:14px; }
 .market-categories { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; overflow:visible; padding:0; }
 .market-categories button,.market-categories button:nth-child(n+9) { display:flex; flex-direction:row; justify-content:flex-start; align-items:center; gap:5px; min-width:0; min-height:48px; height:48px; padding:5px 7px; border:1px solid #e5e9ef; border-radius:8px; background:#fff; color:#344054; box-shadow:none; }
 .market-categories button:nth-child(n+8):not([data-browse-all]) { display:none; }
 .market-categories .market-category-art { flex:0 0 23px; width:23px; height:25px; margin:0; padding:0; background:none; border:0; }
 .market-categories .market-category-art svg { width:23px; height:25px; }
 .market-categories .market-category-label { font-size:11px; font-weight:600; line-height:1.2; white-space:normal; overflow-wrap:normal; }
 .market-categories .market-category-label-full { display:none; }
 #browseNavigation { margin-bottom:10px; }
 .browse-path { gap:10px; margin:0 0 5px; }
 .browse-path button { min-height:38px; font-size:11px; }
 .browse-path button:last-child { flex-shrink:0; }
 .browse-path .browse-back { max-width:58%; }
 .browse-children { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:12px; }
 .browse-children > button { min-height:43px; padding:8px 2px; font-size:12px; gap:5px; }
 .browse-expand { padding-left:2px; min-height:36px; }
 .market-home #marketResults { margin:0 0 8px; gap:2px 8px; }
 .market-home #marketResults h2 { flex-basis:100%; font-size:19px; line-height:1.3; letter-spacing:-.3px; margin:0; }
 #marketResults #marketViews button { width:36px; height:36px; padding:8px; }
 #browseStatus { font-size:11px; }
 .market-controls { gap:6px; margin-bottom:12px; }
 .market-home .filter-row button,.market-home .sort-button,button#marketMore { min-height:40px; font-size:12px; padding:6px 9px; border:1px solid #dce2e9; background:#fff; border-radius:8px; }
 .market-home #regionFilter { flex:1 1 75px; }
 #moreFilters { order:-1; }
 .market-home #moreFilters { background:#edf3f9; border-color:#d4e0ed; color:#244d80; }
 .market-home .market-quick-filters { flex-basis:100%; padding-bottom:3px; }
 .market-home .market-quick-filters button { background:#fff; min-height:40px; }
 .market-home .listing-grid.list-view { display:flex; gap:9px; border:0; border-radius:0; background:transparent; overflow:visible; margin-top:8px; }
 .market-home .listing-grid.list-view .listing-card { grid-template-columns:minmax(105px,37%) minmax(0,1fr); padding:0; gap:0; min-height:132px; border:1px solid #e8ecf1; border-radius:10px; background:#fff; overflow:hidden; transform:none; }
 .market-home .listing-grid.list-view .listing-image { width:100%; min-width:0; height:100%; min-height:132px; border-radius:0; }
 .market-home .listing-grid.list-view .listing-image > img,.market-home .listing-grid.list-view .market-gallery { height:100%; min-height:132px; }
 .market-home .listing-grid.list-view .listing-image img { object-fit:cover; }
 .market-home .listing-grid.list-view .listing-info { padding:10px 11px; min-width:0; display:flex; flex-direction:column; align-items:stretch; }
 .market-home .listing-grid.list-view .listing-title { order:0; font-size:13px; line-height:1.35; margin:0 0 5px; min-height:0; text-align:left; }
 .market-home .listing-grid.list-view .listing-price { order:1; margin:0 0 4px; font-size:18px; font-weight:750; color:#24558a; }
 .market-home .listing-grid.list-view .market-facts { order:2; margin:0 0 5px; }
 .market-home .listing-grid.list-view .listing-meta { order:3; display:flex; flex-wrap:wrap; font-size:10px; line-height:1.5; margin-top:auto; gap:2px 8px; }
 .market-home .listing-grid.list-view .compare-toggle { order:4; align-self:flex-start; margin-top:6px; min-height:26px; padding:3px 7px; font-size:10px; border-color:#e9edf2; }
 .market-home .listing-grid:not(.list-view) .listing-card { background:transparent; }
 .market-home .listing-grid:not(.list-view) .listing-price { color:#24558a; }
 .market-home .favorite-button { width:34px; height:34px; min-height:34px; top:6px; right:6px; font-size:23px; }
 .market-home .empty-state:not(.hidden) { background:#fff; border:1px solid #e3e8ef; padding:20px 14px; }
 .market-home .market-empty-icon { color:#93a4b8; }
 .modal:has(.browse-sheet) { width:100%; max-height:calc(100dvh - 20px); padding:20px 14px; border-radius:14px; }
 .browse-sheet-list { grid-template-columns:1fr; }
 .browse-sheet-list button { min-height:48px; padding:11px 2px; font-size:14px; }
 .browse-sheet .form-field input { min-height:46px; background:#f6f8fa; border-color:#dae1ea; }
 .browse-sheet-heading { margin-top:6px; }
 .browse-sheet-heading h3 { font-size:16px; }
 .browse-sheet #modalTitle { font-size:22px; padding-right:32px; }
}
@media (max-width:370px) {
 .market-categories { gap:5px; }
 .market-categories button { padding:4px; gap:3px; }
 .market-categories .market-category-art,.market-categories .market-category-art svg { width:19px; flex-basis:19px; }
 .market-categories .market-category-label { font-size:10px; }
 .market-home .filter-row button,.market-home .sort-button,button#marketMore { font-size:11px; padding:6px; }
}
@media (prefers-reduced-motion:reduce) {
 .market-home .listing-grid { transition:none; }
 html { scroll-behavior:auto !important; }
}
.browse-current { margin:4px 0 12px; font-size:23px; line-height:1.3; letter-spacing:-.4px; }
.browse-category #marketResults h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:650px){.browse-current{font-size:21px;margin-bottom:9px;}}
@media(max-width:650px){
 .market-categories button,.market-categories button:nth-child(n+9){flex-direction:column;justify-content:center;height:56px;min-height:56px;gap:2px;padding:4px;}
 .market-categories button:nth-child(n+8):not([data-browse-all]){display:none;}
 .market-categories button .market-category-label-short,.market-categories button[data-browse-all] .market-category-label{display:block;white-space:nowrap;max-width:100%;font-size:11px;overflow:visible;text-overflow:clip;}
 .market-categories .market-category-art,.market-categories .market-category-art svg{width:25px;height:24px;flex-basis:24px;}
 .market-home .filter-row button,.market-home .sort-button,button#marketMore{white-space:nowrap;}
 .market-home #regionFilter{flex-basis:60px;}
}
@media(max-width:370px){
 .market-categories button .market-category-label-short{font-size:10px;}
 .market-home #sortButton{width:36px;min-width:36px;padding:6px;justify-content:center;}
 #sortButton span:nth-child(2){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
}
