/* Bwoof Market 1.9.0 — persistent sidebar, compact accordion category tree. */
.bwoof-category-heading { margin-block: 0 24px; padding-block: 8px 18px; border-bottom: 1px solid var(--boof-border, #e2e8f0); }
.bwoof-category-title { margin: 0; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.5; font-weight: 750; color: var(--boof-ink, #172033); overflow-wrap: anywhere; }
.bwoof-category-children { display: none; }
.bwoof-category-products-title { margin: 0 0 18px; font-size: 18px; line-height: 1.8; color: var(--boof-ink, #172033); }
@media (max-width: 1024px) {
  .bwoof-category-children { display: block; min-width: 0; max-width: 100%; margin-top: 16px; }
  .bwoof-category-children-track {
    display: flex; gap: 10px; max-width: 100%; margin: 0; padding: 4px 2px 10px;
    list-style: none; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-padding-inline: 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    scrollbar-color: #c8d9ed transparent;
  }
  .bwoof-category-children-track > li { flex: 0 0 auto; max-width: 85%; margin: 0; scroll-snap-align: start; }
  .bwoof-category-child-title { margin: 0; font-size: 13px; line-height: 1.8; font-weight: 600; }
  .bwoof-category-child-title > a {
    display: flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 10px 18px; border: 1px solid #d6e5f7; border-radius: 12px;
    background: #f0f6ff; color: #0A6AD1; text-decoration: none; overflow-wrap: anywhere;
  }
  .bwoof-category-child-title > a:hover { background: #0A6AD1; color: #fff; border-color: #0A6AD1; }
  .bwoof-category-child-title > a:focus-visible { outline: 2px solid #0A6AD1; outline-offset: 2px; }
}
.bwoof-desktop-sidebar-slot { min-width: 0; align-self: start; }
.bwoof-desktop-sidebar-slot [hidden] { display: none !important; }
@media (min-width: 1025px) {
  .bwoof-desktop-sidebar-slot { position: sticky; top: max(16px, var(--boof-scroll-offset, 96px)); }
  .bwoof-desktop-sidebar-slot > .boof-archive-sidebar { position: static; }
}
@media (max-width: 1024px) {
  .bwoof-desktop-sidebar-slot { display: none !important; }
  .bwoof-category-heading { margin-block-end: 18px; padding-block-end: 14px; }
}
.boof-archive-layout {
  display: grid; grid-template-columns: minmax(220px, 272px) minmax(0, 1fr);
  align-items: start; gap: clamp(20px, 2.2vw, 30px); width: 100%; min-width: 0;
  grid-column: 1 / -1;
}
.boof-archive-products, .boof-archive-products > .site-content { min-width: 0; width: 100%; }
.boof-archive-sidebar {
  min-width: 0; margin-block-start: 0;
  background: rgba(255,255,255,.82); border: 1px solid rgba(226,232,240,.86); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(28,44,69,.07); overflow: visible; overflow-wrap: anywhere;
  backdrop-filter: blur(16px) saturate(145%); -webkit-backdrop-filter: blur(16px) saturate(145%);
}
@media (min-width: 1025px) {
  .boof-archive-sidebar {
    position: sticky;
    top: max(16px, var(--boof-scroll-offset, 96px));
    align-self: start;
    z-index: 3;
  }
}
.boof-archive-filters { margin: 0; }
/* The filter shell itself is intentionally always open. Category branches below are collapsible. */
.boof-archive-filters > summary { display: none !important; }
.boof-archive-filter-content { display: block !important; padding: 20px; }
.boof-archive-sidebar .widget { margin: 0; padding: 0 0 22px; border: 0; }
.boof-archive-sidebar .widget + .widget { padding-top: 22px; border-top: 1px solid var(--boof-border); }
.boof-archive-sidebar .widget:last-child { padding-bottom: 0; }
.boof-archive-sidebar .widget-title { margin: 0 0 14px; font-size: 15px; line-height: 1.8; color: var(--boof-ink); }
.boof-archive-sidebar ul { padding-inline-start: 0; list-style: none; margin: 0; }
.boof-archive-sidebar .boof-sidebar-menu,
.boof-archive-sidebar .boof-sidebar-menu :is(ul, .sub-menu, .children) {
  position: static !important; width: auto !important; box-shadow: none; background: transparent;
}
.boof-archive-sidebar .boof-sidebar-menu :is(.sub-menu, .children) {
  padding-inline-start: 12px; margin-block: 4px; margin-inline-start: 9px; border-inline-start: 1px solid var(--boof-border);
}
/* Progressive enhancement: no JS = full tree; JS-ready = collapse inactive branches. */
.boof-archive-sidebar.boof-accordion-ready .boof-sidebar-menu .boof-has-submenu > :is(.sub-menu, .children) {
  display: none !important;
}
.boof-archive-sidebar.boof-accordion-ready .boof-sidebar-menu .boof-has-submenu.boof-submenu-open > :is(.sub-menu, .children) {
  display: block !important;
}
.boof-archive-sidebar li { position: relative; margin-block: 2px; line-height: 1.8; }
.boof-archive-sidebar .boof-sidebar-menu a {
  display: block; padding-block: 8px; padding-inline: 10px 38px; max-width: 100%; border-radius: 10px;
  color: var(--boof-muted); font-size: 13px; transition: color .2s ease, background-color .2s ease, transform .2s ease;
}
.boof-archive-sidebar .boof-sidebar-menu a:hover { color: var(--boof-accent); background-color: rgba(255,255,255,.68); transform: translateX(-2px); }
.boof-submenu-toggle {
  position: absolute; inset-inline-end: 4px; top: 5px; width: 30px; height: 30px; min-height: 0; padding: 0;
  display: grid; place-items: center; border: 1px solid rgba(203,213,225,.7); border-radius: 9px;
  background: rgba(255,255,255,.68); color: var(--boof-muted); box-shadow: 0 4px 12px rgba(15,23,42,.04);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.boof-submenu-toggle span::before { content: '+'; display: block; font-size: 18px; line-height: 1; }
.boof-submenu-open > .boof-submenu-toggle span::before { content: '−'; }
.boof-submenu-toggle:hover, .boof-submenu-toggle:focus-visible { color: var(--boof-accent); border-color: color-mix(in srgb, var(--boof-accent) 34%, #cbd5e1); }
.boof-archive-sidebar :is(.current-cat, .current-menu-item) > a {
  background: #edf8f9; color: var(--boof-accent); font-weight: 700;
}
.boof-archive-sidebar :is(.current-cat-parent, .current-cat-ancestor, .current-menu-ancestor, .current-menu-parent) > a { color: var(--boof-ink); font-weight: 600; }
.boof-archive-sidebar :is(input, select) { min-width: 0; max-width: 100%; border-radius: 12px; }
.boof-archive-sidebar .price_slider_amount { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.boof-archive-sidebar .price_slider_amount .clear { display: none; }
.boof-archive-sidebar .price_label { font-size: 12px; line-height: 1.9; }
.boof-price-empty { margin: 0; font-size: 12px; line-height: 1.9; color: var(--boof-muted); }
.boof-archive-sidebar .price_slider { margin-block: 24px; }
.boof-archive-sidebar .boof-stock-filter a {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--boof-ink); padding: 8px 0; font-size: 13px;
}
.boof-stock-filter a::before { display: none !important; }
.boof-filter-check {
  flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid #bdc9d5; border-radius: 6px;
  position: relative; background: var(--boof-surface);
  transition: background-color .2s ease, border-color .2s ease;
}
.boof-stock-filter [aria-checked='true'] .boof-filter-check { background: var(--boof-accent); border-color: var(--boof-accent); }
.boof-stock-filter [aria-checked='true'] .boof-filter-check::after {
  content: ''; position: absolute; width: 5px; height: 9px; border: solid white;
  border-width: 0 2px 2px 0; left: 6px; top: 3px; transform: rotate(45deg);
}
.boof-stock-filter [aria-checked='true'] { font-weight: 600; }
.boof-archive-layout .products { margin-top: 0; }
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .shop-loop-head,
.boof-archive-products .shop-loop-head { flex-wrap: wrap; gap: 12px; }
.wd-shop-tools { flex-wrap: wrap; min-width: 0; gap: 10px; }
.woocommerce-ordering, .woocommerce-ordering select { max-width: 100%; }
/* The custom sidebar owns catalog filtering; never show the legacy floating/off-canvas yellow opener beside it. */
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) :is(.wd-sidebar-opener, .wd-show-sidebar-btn, .wd-toolbar-sidebar) { display: none !important; }
@media (min-width: 1025px) and (max-width: 1350px) {
  .boof-archive-products .wd-products.wd-grid-g { --wd-col-lg: 3 !important; }
}
@media (max-width: 1024px) {
  .boof-archive-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .boof-archive-sidebar { margin-block-start: 0; }
  .boof-archive-sidebar .boof-sidebar-menu a { padding-block: 11px; }
  .boof-submenu-toggle { top: 7px; }
  .boof-archive-products .wd-products.wd-grid-g { --wd-col-md: 3 !important; }
}
@media (max-width: 600px) {
  .boof-archive-filter-content { padding: 16px; }
  .boof-archive-sidebar input { font-size: 16px; }
  .boof-archive-products .wd-products.wd-grid-g { --wd-col-sm: 2 !important; }
  .shop-loop-head .woocommerce-ordering { width: 100%; }
  .shop-loop-head > .wd-shop-tools { max-width: 100%; }
}
@media (max-width: 359px) {
  .boof-archive-products .wd-products.wd-grid-g { --wd-col-sm: 1 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .boof-archive-sidebar * { transition: none !important; animation: none !important; }
}
@media print {
  .boof-archive-sidebar { display: none; }
  .boof-archive-layout { display: block; }
}

/* Category title and native sorting controls share one responsive row. */
.bwoof-catalog-topbar {
  display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 14px 24px;
  align-items: center; margin-bottom: 24px; padding-bottom: 18px;
  border-bottom: 1px solid var(--boof-border,#e2e8f0); min-width: 0;
}
.bwoof-catalog-topbar > .bwoof-category-heading { display: contents; }
.bwoof-catalog-topbar .bwoof-category-title { grid-column: 1; grid-row: 1; }
.bwoof-catalog-topbar > .shop-loop-head {
  grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end;
  align-items: center; gap: 10px; margin: 0 !important; padding: 0 !important;
  border: 0; min-width: 0; max-width: 100%;
}
.bwoof-catalog-topbar .bwoof-category-children { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
.bwoof-catalog-topbar .woocommerce-ordering { margin: 0; }
/* Keep the H2/H3 outline without moving the first card below the sidebar. */
.boof-archive-products > .bwoof-category-products-title {
  position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
@media (max-width: 767px) {
  .bwoof-catalog-topbar { grid-template-columns: minmax(0,1fr); gap: 14px; margin-bottom: 18px; }
  .bwoof-catalog-topbar > .shop-loop-head { grid-column: 1; grid-row: 3; justify-content: space-between; width: 100%; }
  .bwoof-catalog-topbar .wd-shop-tools { flex-wrap: wrap; max-width: 100%; }
  .bwoof-catalog-topbar .woocommerce-ordering { width: auto; max-width: 100%; }
}
/* A compact catalog toolbar: one primary sort control and an optional view menu. */
.bwoof-catalog-topbar { padding: 22px 24px; border: 1px solid #e5ebf3; border-radius: 20px; background: #fff; box-shadow: 0 6px 24px rgb(24 47 80 / 3%); }
.bwoof-catalog-topbar .bwoof-category-title { font-size: clamp(24px,2.3vw,32px); }
.bwoof-catalog-topbar .wd-shop-tools { gap: 10px; }
.bwoof-ordering { display: flex; align-items: center; gap: 10px; padding: 5px 12px; border: 1px solid #dbe5f0; border-radius: 12px; background: #f8fafd; }
.bwoof-order-label { color: #718096; font-size: 12px; white-space: nowrap; }
body.bwoof-ui-v180 form.bwoof-ordering select.orderby { width: auto !important; min-width: 125px; min-height: 38px !important; height: 38px !important; padding-block: 0 !important; padding-inline: 4px 24px !important; border: 0 !important; border-radius: 6px !important; background-color: transparent !important; box-shadow: none !important; font-size: 13px; font-weight: 650; color: #263449; }
body.bwoof-ui-v180 form.bwoof-ordering select.orderby:focus-visible { outline: 2px solid #0A6AD1 !important; outline-offset: 2px; }
.bwoof-view-menu { position: relative; }
.bwoof-view-menu > summary { display: flex; gap: 14px; align-items: center; justify-content: center; list-style: none; cursor: pointer; min-height: 48px; padding: 10px 14px; border: 1px solid #dbe5f0; border-radius: 12px; background: white; color: #52647b; font-size: 12px; font-weight: 600; }
.bwoof-view-menu > summary::-webkit-details-marker { display: none; }
.bwoof-view-menu[open] > summary { border-color: #0A6AD1; color: #0A6AD1; background: #f0f6ff; }
.bwoof-view-menu-body { position: absolute; z-index: 30; top: calc(100% + 10px); inset-inline-end: 0; width: min(310px,calc(100vw - 48px)); padding: 18px; border: 1px solid #e0e8f1; border-radius: 16px; background: white; box-shadow: 0 15px 40px rgb(24 47 80 / 14%); }
.bwoof-view-menu-body .wd-products-per-page { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #edf1f5; }
.bwoof-view-menu-body .per-page-border { display: none; }
.bwoof-view-menu-body .per-page-title { flex-basis: 100%; font-size: 12px; color: #718096; }
.bwoof-view-menu-body :is(.per-page-variation,.shop-view) { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; border: 1px solid #e1e8f0; border-radius: 10px; color: #68798d; background: #f8fafd; }
.bwoof-view-menu-body .current-variation { background: #eaf3ff; color: #0A6AD1; border-color: #a7c9f1; }
.bwoof-view-menu-body .wd-products-shop-view { display: flex; gap: 8px; }
.bwoof-filter-reset { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.bwoof-filter-reset a { font-size: 12px; color: #64748b; text-decoration: underline; text-underline-offset: 4px; }
.bwoof-filter-open { display: none; }
body.bwoof-filters-open { overflow: hidden; }
.bwoof-mobile-filters { padding: 0; border: 0; width: min(100%,560px); max-width: 100%; max-height: 90vh; max-height: 90dvh; margin: auto auto 0; border-radius: 24px 24px 0 0; background: #fff; color: #263449; font-family: var(--boof-font); box-shadow: 0 -12px 60px rgb(15 23 42 / 15%); }
.bwoof-mobile-filters[open] { display: flex; flex-direction: column; }
.bwoof-mobile-filters::backdrop { background: rgb(15 23 42 / 45%); }
.bwoof-mobile-filter-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 20px; border-bottom: 1px solid #e8edf4; flex-shrink: 0; }
.bwoof-mobile-filter-head h2 { margin: 0 0 5px; font-size: 18px; }
.bwoof-mobile-filter-head p { margin: 0; font-size: 12px; color: #8793a4; }
.bwoof-mobile-filter-head button { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; font-size: 26px; background: #f1f5f9; color: #65768b; border: 0; border-radius: 12px; }
.bwoof-mobile-filter-body { overflow-y: auto; overscroll-behavior-y: contain; min-height: 100px; padding: 4px 20px 20px; }
.bwoof-mobile-filter-body > [role],.bwoof-mobile-filter-body > button { margin-top: 18px; }
.bwoof-mobile-filter-body .boof-archive-sidebar { display: block !important; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; border-radius: 0; }
.bwoof-mobile-filter-body .boof-archive-filter-content { padding: 16px 0 0; }
.bwoof-mobile-filter-body .boof-catalog-menu { padding-bottom: 18px; }
.bwoof-mobile-filter-body .bwoof-filter-reset { margin-bottom: 12px; }
.bwoof-price-unit { color: #718096; font-size: 12px; margin: 0 0 10px; }
.bwoof-price-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.bwoof-price-fields label { font-size: 13px; color: #52647b; }
.bwoof-price-fields input { display: block; direction: ltr; margin-top: 6px !important; }
.bwoof-mobile-price-form button { width: 100%; margin-top: 14px; min-height: 46px; border-radius: 12px; background: #0A6AD1; color: white; border: 0; }
.bwoof-mobile-filters > footer { flex-shrink: 0; padding: 12px 20px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid #e8edf4; }
.bwoof-mobile-filters > footer button { width: 100%; min-height: 46px; border-radius: 12px; background: #f1f5f9; border: 0; color: #435770; font-weight: 600; }
@media(max-width:1024px) {
  .bwoof-filter-open { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 16px; border: 1px solid #c8dcf5; border-radius: 12px; background: #edf5ff; color: #0A6AD1; font-size: 13px; font-weight: 700; }
  .bwoof-filter-open span { font-size: 20px; line-height: 1; }
  .boof-archive-layout > .boof-archive-sidebar { display: none; }
  .bwoof-catalog-topbar { grid-template-columns: minmax(0,1fr); padding: 18px; }
  .bwoof-catalog-topbar > .shop-loop-head { grid-column: 1; grid-row: 3; width: 100%; justify-content: flex-start; }
}
@media(max-width:600px) {
  .bwoof-catalog-topbar { padding: 16px 12px; border-radius: 16px; }
  .bwoof-catalog-topbar > .shop-loop-head > .wd-shop-tools:last-child { display: flex; flex-wrap: wrap; flex: 1; gap: 8px; }
  .bwoof-catalog-topbar .bwoof-ordering { flex: 1 1 175px; justify-content: space-between; }
  .bwoof-catalog-topbar .bwoof-view-menu { order: 3; flex: 1 1 100%; }
  .bwoof-view-menu > summary { min-height: 42px; padding: 7px 12px; }
  .bwoof-view-menu-body { width: 100%; }
}
/* Put the most-used filters first inside the small-screen sheet. */
.bwoof-mobile-filter-body .boof-archive-filter-content { display: flex !important; flex-direction: column; }
.bwoof-mobile-filter-body .widget { order: 1; padding: 18px 0; border-top: 0; border-bottom: 1px solid #edf1f5; }
.bwoof-mobile-filter-body .boof-stock-filter { order: 2; }
.bwoof-mobile-filter-body .boof-catalog-menu { order: 3; border-bottom: 0; }

/* Category default: four desktop columns, including laptops with a sidebar. */
@media (min-width: 1025px) {
  body.bwoof-category-default-grid .boof-archive-products .wd-products.wd-grid-g {
    --wd-col-lg: 4 !important;
  }
}

/* 1.12.18: the sorting SELECT must remain a genuine, visible touch target.
   Do not inherit WoodMart's 30px mobile icon/transparent-select treatment. */
body.bwoof-ui-v180 .shop-loop-head form.bwoof-ordering {
  position:relative; z-index:2; min-width:0; max-width:100%;
}
body.bwoof-ui-v180 .shop-loop-head form.bwoof-ordering select.orderby {
  display:block !important; flex:1 1 auto; min-width:0 !important; width:100% !important;
  min-height:44px !important; height:44px !important; color:#263449 !important;
  font-size:16px !important; line-height:1.5 !important;
  appearance:none !important; -webkit-appearance:none !important;
  padding-inline:10px 30px !important; cursor:pointer; opacity:1 !important;
  pointer-events:auto !important;
}
body.bwoof-ui-v180 .shop-loop-head form.bwoof-ordering::after {
  content:'⌄'; position:absolute; inset-inline-end:16px; top:50%;
  transform:translateY(-54%); color:#125791; font-size:19px;
  pointer-events:none;
}
@media (max-width:600px) {
  body.bwoof-ui-v180 .shop-loop-head > .wd-shop-tools:last-child {
    display:grid; grid-template-columns:minmax(0,1fr); gap:10px; width:100%; min-width:0;
  }
  body.bwoof-ui-v180 .shop-loop-head form.bwoof-ordering {
    display:flex; justify-content:space-between; width:100% !important;
    min-height:52px; margin:0 !important; padding:3px 12px;
    border:1px solid #cbdced; background:#f8fafd;
  }
  body.bwoof-ui-v180 .shop-loop-head .bwoof-filter-open { justify-self:start; }
  body.bwoof-ui-v180 .shop-loop-head .bwoof-view-menu { width:100%; }
  body.bwoof-ui-v180 .shop-loop-head form.bwoof-ordering select.orderby { flex:1 1 auto; }
}

/* 1.12.19 — Mobile catalog: two equal actions, with sorting inside the filter sheet.
   Leave the desktop ordering form and desktop toolbar untouched. */
@media (max-width: 1024px) {
  .shop-loop-head.bwoof-catalog-toolbar {
    display: block !important; width: 100%; min-width: 0;
    margin-block: 0 !important; padding: 0 !important;
  }
  .bwoof-catalog-topbar > .shop-loop-head.bwoof-catalog-toolbar {
    grid-column: 1; grid-row: 3;
  }
  .shop-loop-head.bwoof-catalog-toolbar > .bwoof-catalog-meta {
    display: none !important;
  }
  .shop-loop-head.bwoof-catalog-toolbar > .bwoof-catalog-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px; width: 100%; min-width: 0; margin: 0;
    align-items: stretch; justify-content: stretch;
  }
  .shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering {
    display: none !important;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-filter-open,
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu,
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary {
    box-sizing: border-box;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-filter-open,
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu {
    order: 0; min-width: 0; width: 100% !important; margin: 0 !important;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-filter-open {
    grid-column: 1; display: flex !important;
    justify-content: space-between; min-height: 50px;
    padding: 10px 14px; border-color: #bcd5ef;
    color: #125791; background: #edf5ff;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu {
    grid-column: 2; display: block;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; min-height: 50px; height: 100%;
    padding: 10px 12px; width: 100%;
    font-size: 13px; color: #34465c; line-height: 1.6;
  }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu-body {
    inset-inline-start: auto; inset-inline-end: 0;
    width: min(310px, calc(100vw - 36px));
  }
  .bwoof-catalog-topbar { row-gap: 12px; }
}
@media (max-width: 359px) {
  .shop-loop-head.bwoof-catalog-toolbar > .bwoof-catalog-actions { gap: 8px; }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-filter-open,
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary {
    font-size: 12px; padding-inline: 10px;
  }
}

/* The sorting tiles live within the existing mobile filters dialog. */
.bwoof-mobile-filter-body .bwoof-mobile-sort-widget {
  order: -2 !important; padding: 16px 0 20px !important;
  border-top: 0 !important; border-bottom: 1px solid #edf1f5 !important;
}
.bwoof-mobile-sort-widget .widget-title {
  font-size: 15px; margin: 0 0 12px; color: #243047;
}
.bwoof-mobile-sort-options {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bwoof-mobile-sort-option {
  min-width: 0; display: flex; justify-content: space-between;
  align-items: center; gap: 8px; min-height: 50px;
  padding: 11px 12px; border: 1px solid #dfe7f0;
  border-radius: 12px; background: #fff; color: #43546c;
  text-decoration: none !important; font-size: 13px;
  line-height: 1.65; font-weight: 600;
}
.bwoof-mobile-sort-option:hover,
.bwoof-mobile-sort-option:focus-visible {
  color: #125791; border-color: #a6caed; background: #f6faff;
}
.bwoof-mobile-sort-option.is-active {
  border-color: #125791; background: #eef5fc;
  color: #125791; font-weight: 750;
}
.bwoof-mobile-sort-check {
  flex: 0 0 17px; width: 17px; height: 17px;
  border: 1.5px solid #b8c7d8; border-radius: 50%;
  background: #fff;
}
.bwoof-mobile-sort-option.is-active .bwoof-mobile-sort-check {
  border: 5px solid #125791;
}

/* 1.12.21: the native desktop loop head is not a stable mobile grid.
   WoodMart/plugins can insert their own wrappers, tools and ordering markup.
   The independent server-rendered pair above it is the ONLY mobile toolbar. */
.bwoof-mobile-catalog-actions { display: none; }
@media (max-width: 1024px) {
  .bwoof-mobile-catalog-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    width: 100%;
    min-width: 0;
    margin: 0 0 16px;
    direction: rtl;
  }
  /* Remove the complete legacy sorting/toolbar row, not just a form with a
     particular class.  That form can be substituted in Woo AJAX responses. */
  .shop-loop-head.bwoof-catalog-toolbar {
    display: none !important;
  }
  .bwoof-mobile-catalog-actions > .bwoof-filter-open,
  .bwoof-mobile-catalog-actions > .bwoof-view-menu {
    display: flex !important;
    box-sizing: border-box;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 12px;
  }
  .bwoof-mobile-catalog-actions > .bwoof-filter-open {
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #c4daf1;
    background: #eff6ff;
    color: #125791;
    font-size: 13px;
    font-weight: 750;
  }
  .bwoof-mobile-catalog-actions > .bwoof-view-menu { position: relative; }
  .bwoof-mobile-catalog-actions > .bwoof-view-menu > summary {
    display: flex !important;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #d9e5f1;
    background: #fff;
    color: #34465c;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 750;
  }
  .bwoof-mobile-catalog-actions .bwoof-view-menu-body {
    width: min(310px, calc(100vw - 36px));
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
  .bwoof-mobile-catalog-actions .bwoof-view-menu[open] { z-index: 20; }
}

/* Phase 4: archive controls only. Keep the native sorting, filter and view actions. */
.shop-loop-head.bwoof-catalog-toolbar .bwoof-catalog-actions {
  align-items: center;
  gap: 10px;
}
.shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering,
.shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary {
  min-height: 46px;
  border: 1px solid #cbdbea;
  border-radius: 12px;
  background: #fff;
  color: #125791;
  box-shadow: 0 1px 3px rgb(18 87 145 / 5%);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
}
.shop-loop-head.bwoof-catalog-toolbar .bwoof-order-label {
  color: #526a81;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
body.bwoof-ui-v180 .shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering select.orderby {
  min-height: 44px !important;
  height: 44px !important;
  padding-inline: 7px 27px !important;
  color: #243c55 !important;
  font-size: 14px !important;
  font-weight: 650;
  line-height: 1.5 !important;
  text-align: center;
  text-align-last: center;
}
.shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering::after {
  content: '';
  position: absolute;
  inset-inline-end: 17px;
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-right: 2px solid #125791;
  border-bottom: 2px solid #125791;
  transform: rotate(45deg);
  pointer-events: none;
}
.shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.bwoof-view-menu > summary > span:last-child {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  font-size: 0;
  transform: translateY(-2px) rotate(45deg);
}
.shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering:hover,
.shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary:hover,
.bwoof-mobile-catalog-actions > .bwoof-filter-open:hover,
.bwoof-mobile-catalog-actions > .bwoof-view-menu > summary:hover {
  border-color: #125791;
  background: #f2f7fc;
}
.shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering:focus-within,
.shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu > summary:focus-visible,
.bwoof-mobile-catalog-actions > .bwoof-filter-open:focus-visible,
.bwoof-mobile-catalog-actions > .bwoof-view-menu > summary:focus-visible {
  outline: 2px solid #125791;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(18 87 145 / 12%);
}
.bwoof-view-menu[open] > summary {
  border-color: #125791;
  background: #f2f7fc;
  color: #125791;
}
.bwoof-view-menu-body :is(.per-page-variation,.shop-view) {
  min-width: 42px;
  min-height: 42px;
  border-radius: 10px;
  font-size: 18px;
}
.bwoof-view-menu-body :is(.per-page-variation,.shop-view):is(:hover,:focus-visible) {
  border-color: #125791;
  background: #f2f7fc;
  color: #125791;
}
.bwoof-view-menu-body .current-variation {
  border-color: #125791;
  background: #eaf3fb;
  color: #125791;
}
@media (min-width: 1025px) {
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-catalog-actions { flex-wrap: nowrap; }
  .shop-loop-head.bwoof-catalog-toolbar form.bwoof-ordering { flex: 0 1 auto; }
  .shop-loop-head.bwoof-catalog-toolbar .bwoof-view-menu { flex: 0 0 auto; }
}
@media (max-width: 1024px) {
  .bwoof-mobile-catalog-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 10px;
  }
  .bwoof-mobile-catalog-actions > .bwoof-filter-open,
  .bwoof-mobile-catalog-actions > .bwoof-view-menu > summary {
    min-height: 50px;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid #cbdbea;
    border-radius: 12px;
    background: #fff;
    color: #125791;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 1px 3px rgb(18 87 145 / 5%);
  }
  .bwoof-mobile-catalog-actions > .bwoof-filter-open > span {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    font-size: 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none' stroke='%23125791' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 4h14M2 9h14M2 14h14'/%3E%3Ccircle cx='6' cy='4' r='1.7' fill='white'/%3E%3Ccircle cx='12' cy='9' r='1.7' fill='white'/%3E%3Ccircle cx='7' cy='14' r='1.7' fill='white'/%3E%3C/svg%3E");
  }
  .bwoof-mobile-catalog-actions .bwoof-view-menu[open] { z-index: 20; }
}
