
/* V151 — fix desktop overlap on top-right controls and product view controls */

@media (min-width: 721px){
  /* ===== top bar: give the right controls their own stable space ===== */
  body.order-redesign .desktop-topbar,
  body.cart-open.order-redesign .desktop-topbar{
    display:grid!important;
    grid-template-columns:56px minmax(0,1fr) auto!important;
    grid-template-areas:"menu title controls"!important;
    align-items:center!important;
    gap:16px!important;
    min-height:78px!important;
    padding:14px 22px!important;
    overflow:visible!important;
  }

  body.order-redesign .desktop-menu-btn{grid-area:menu!important;}
  body.order-redesign .mobile-store-head{
    grid-area:title!important;
    justify-self:center!important;
    text-align:center!important;
    min-width:0!important;
  }

  /* hide tiny search bubble here to reduce crowding on desktop */
  body.order-redesign .mobile-header-search,
  body.order-redesign .desktop-brand,
  body.order-redesign .desktop-shop-actions{
    display:none!important;
  }

  body.order-redesign .desktop-controls,
  body.cart-open.order-redesign .desktop-controls{
    grid-area:controls!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
    gap:12px!important;
    margin:0!important;
    min-width:max-content!important;
  }

  body.order-redesign .desktop-control-label{display:none!important;}

  body.order-redesign .palette-select,
  body.cart-open.order-redesign .palette-select{
    width:180px!important;
    min-width:180px!important;
    max-width:180px!important;
    height:46px!important;
    min-height:46px!important;
    padding-inline:14px 38px!important;
    font-size:14px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body.order-redesign .theme-toggle-btn,
  body.cart-open.order-redesign .theme-toggle-btn{
    width:96px!important;
    min-width:96px!important;
    max-width:96px!important;
    height:46px!important;
    min-height:46px!important;
    padding:0 14px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }

  body.order-redesign .theme-toggle-btn #themeLabel{
    display:inline!important;
    font-size:14px!important;
    line-height:1!important;
  }

  /* ===== finder panel: keep bottom row from being crowded ===== */
  body.order-redesign #shopFinder .search-toolbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 340px!important;
    align-items:stretch!important;
    gap:14px!important;
  }

  body.order-redesign #shopFinder .quick-filters{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:14px!important;
  }

  body.order-redesign #shopFinder .filter-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:12px!important;
    min-width:0!important;
  }

  body.order-redesign #shopFinder .filter-actions > button{
    min-width:0!important;
    width:100%!important;
    padding-inline:14px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* ===== result header: separate 2/4 toggle from count and from card area ===== */
  body.order-redesign .products-window,
  body.order-redesign .products-window .window-body,
  body.order-redesign #result{
    overflow:visible!important;
  }

  body.order-redesign .result-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:16px!important;
    padding:16px 18px 12px!important;
    margin:0!important;
  }

  body.order-redesign .result-head h2{
    margin:0!important;
    flex:1 1 auto!important;
    min-width:0!important;
  }

  body.order-redesign .result-head-right{
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-end!important;
    justify-content:flex-start!important;
    gap:10px!important;
    flex:0 0 auto!important;
    margin:0 10px 0 0!important;
    min-width:max-content!important;
  }

  body.order-redesign .mobile-view-toggle{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    padding:0!important;
    margin:0!important;
    flex-wrap:nowrap!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  body.order-redesign .view-toggle-btn{
    min-width:68px!important;
    height:34px!important;
    padding:0 14px!important;
    white-space:nowrap!important;
  }

  body.order-redesign #resultCount,
  body.order-redesign .result-head .count{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    min-height:34px!important;
    padding:0 14px!important;
    white-space:nowrap!important;
  }
}

@media (min-width: 721px) and (max-width: 1180px){
  body.order-redesign .desktop-topbar,
  body.cart-open.order-redesign .desktop-topbar{
    gap:12px!important;
    padding:12px 16px!important;
  }

  body.order-redesign .palette-select,
  body.cart-open.order-redesign .palette-select{
    width:162px!important;
    min-width:162px!important;
    max-width:162px!important;
    font-size:13px!important;
  }

  body.order-redesign .theme-toggle-btn,
  body.cart-open.order-redesign .theme-toggle-btn{
    width:86px!important;
    min-width:86px!important;
    max-width:86px!important;
  }

  body.order-redesign #shopFinder .search-toolbar{
    grid-template-columns:1fr!important;
  }

  body.order-redesign #shopFinder .filter-actions{
    grid-template-columns:1fr 1fr!important;
  }
}

@media (min-width: 721px) and (max-width: 960px){
  body.order-redesign .desktop-topbar,
  body.cart-open.order-redesign .desktop-topbar{
    grid-template-columns:48px minmax(0,1fr) auto!important;
  }

  body.order-redesign .palette-select,
  body.cart-open.order-redesign .palette-select{
    width:146px!important;
    min-width:146px!important;
    max-width:146px!important;
  }

  body.order-redesign .theme-toggle-btn,
  body.cart-open.order-redesign .theme-toggle-btn{
    width:50px!important;
    min-width:50px!important;
    max-width:50px!important;
    padding:0!important;
  }

  body.order-redesign .theme-toggle-btn #themeLabel{display:none!important;}
}
