/* Search shell only: keep all sections reachable while the desktop bar expands. */
@media (min-width: 1025px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (min-width: 821px) and (max-width: 960px) and (hover: hover) and (pointer: fine) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel {
    right: auto;
    left: 50%;
    width: calc(100% - 32px);
    max-width: none;
    transform: translateX(-50%);
  }
}

@media (min-width: 1025px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky {
    right: auto;
    left: 50%;
    max-width: 1800px;
    min-width: 0;
    transform: translateX(-50%);
    border-radius: 0 0 24px 24px;
  }
}

/* The fixed search remains a card with gutters, like the hero above it. */
@media (min-width: 1025px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel:is(.is-marketplace-search-morphing, .is-marketplace-search-sticky) :is(.marketplace-search-tabs, .marketplace-search-form) {
    width: min(var(--marketplace-search-content-width), calc(100% - 36px));
  }
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel:not(.is-marketplace-search-sticky) :is(.marketplace-sticky-brand, .marketplace-sticky-tools) {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }
}
@media (min-width: 1280px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky :is(.marketplace-search-tabs, .marketplace-search-form) {
    width: min(var(--marketplace-search-content-width), calc(100% - 184px));
  }
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky .marketplace-sticky-brand {
    left: 24px;
    transform: translateY(-50%);
  }
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky .marketplace-sticky-tools {
    right: 24px;
    transform: translateY(-50%);
  }
}
@media (min-width: 1440px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky :is(.marketplace-search-tabs, .marketplace-search-form) {
    width: min(var(--marketplace-search-content-width), calc(100% - 420px));
  }
}

@media (min-width: 1025px) and (max-width: 1100px) {
  .marketplace-public-shell:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-submit { min-width: 0; }
}

/* Desktop navigation refinement, after immutable prepared content is verified. */
@media (min-width: 1025px) {
  .desktop-catalog-refine > .marketplace-public-header { display: none; }
  .desktop-catalog-refine :is(.directions-index-heading, .methods-index-heading) > a { display: none; }
  .desktop-catalog-refine :is(.directions-shelf-actions, .methods-shelf-actions) > a { order: -1; }
  .marketplace-public-shell.desktop-catalog-refine:is(.catalog-home, .directions-page, .methods-page) .marketplace-search-panel.is-marketplace-search-sticky :is(.marketplace-search-tabs, .marketplace-search-form) { width: min(var(--marketplace-search-content-width), calc(100% - 400px)); }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-sticky-brand {
    display:flex; position:absolute; left:24px; top:50%; transform:translateY(-50%); width:174px; min-height:52px; gap:10px; overflow:visible; justify-content:flex-start; font-size:18px; font-weight:780; line-height:1.15; color:#fff; padding:0;
  }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-sticky-brand .marketplace-sticky-brand-name { display:block; white-space:pre-line; overflow-wrap:normal; background:transparent; }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel .marketplace-sticky-brand::before { content:""; width:48px; height:48px; flex:0 0 48px; background:url("/assets/brand-mark.svg") center / contain no-repeat; }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-sticky-tools { display:flex; position:absolute; right:20px; top:50%; transform:translateY(-50%); }
  .desktop-catalog-refine .marketplace-sticky-tools .marketplace-header-tool { display:flex; width:auto; gap:8px; padding:8px; color:#fff; font-size:14px; white-space:nowrap; }
  .desktop-catalog-refine .marketplace-sticky-tools img { filter:brightness(0) invert(1); }
  .desktop-catalog-refine .marketplace-sticky-tools [data-marketplace-favorite-count] { position:static; min-width:24px; height:24px; padding:0 5px; border-radius:999px; background:#cbd97a; color:#173f36; display:inline-flex; align-items:center; justify-content:center; }
  .desktop-catalog-refine .marketplace-sticky-tools [data-marketplace-favorite-count][hidden] { display:none; }
}

@media (min-width:1025px) {
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-search-form { grid-template-columns:minmax(0,1.3fr) repeat(3,minmax(0,1fr)) 100px; }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-search-field { min-width:0; }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-search-field select { min-width:0; width:100%; text-overflow:ellipsis; }
  .marketplace-public-shell.desktop-catalog-refine .marketplace-search-panel.is-marketplace-search-sticky .marketplace-search-submit { min-width:0; }
}
