/* MusicBox Storefront V2.5 — Proporções compactas do catálogo.
   Só afeta o modelo com [musicbox_filtros] e uma coluna de resultados.
   Mantém o design aprovado, os filtros WooCommerce e os blocos do tema intactos. */
@media (min-width: 782px) {
  /* A classe é acrescentada automaticamente pela V2.5 quando reconhece as duas colunas. */
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact {
    display:flex!important;
    align-items:flex-start!important;
    flex-wrap:nowrap!important;
    gap:clamp(16px,1.3vw,24px)!important;
    width:calc(100% - 64px)!important;
    max-width:1840px!important;
    box-sizing:border-box!important;
    padding:0!important;
    margin:16px auto 0!important;
  }
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact > .wp-block-column.mbx-shop-sidebar {
    flex:0 0 clamp(245px,14vw,278px)!important;
    width:clamp(245px,14vw,278px)!important;
    max-width:278px!important;
    min-width:0!important;
    margin:0!important;
  }
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact > .wp-block-column.mbx-shop-results {
    flex:1 1 0!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
  }
  .mbx-shop-layout--compact .mbx-shop-filters-v24 {
    position:sticky;
    top:12px;
    max-height:calc(100vh - 165px);
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    scrollbar-color:#4b6671 #0a1924;
  }
}
/* Painel mais estreito com controlos legíveis em vez de blocos gigantes. */
.mbx-shop-layout--compact .mbx-shop-filters-v24 {
  padding:13px 13px!important;
  border-radius:12px!important;
  box-shadow:0 4px 14px rgb(0 0 0 / 10%)!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 .mbx-shop-filters-heading {
  padding-bottom:9px!important;
  margin-bottom:3px!important;
  gap:6px!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 .mbx-shop-filters-heading h2 {
  font-size:16px!important;
  letter-spacing:.01em;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 .mbx-filter-symbol {font-size:18px!important}
.mbx-shop-layout--compact .mbx-shop-filters-v24 .mbx-filter-clear {font-size:10px!important}
.mbx-shop-layout--compact .mbx-shop-filters-v24 :is(.wp-block-woocommerce-product-filter-taxonomy,.wp-block-woocommerce-product-filter-price,.wp-block-woocommerce-product-filter-status,.wp-block-woocommerce-product-filter-attribute,.wp-block-woocommerce-product-filter-active) {
  padding:9px 0!important;
  margin:0!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 :is(h2,h3,h4,.wp-block-heading) {
  font-size:12px!important;
  margin:0 0 7px!important;
  line-height:1.3!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 :is(.wc-block-product-filter-checkbox-list,.wc-block-components-checkbox-list) {
  max-height:136px!important;
  overflow:auto!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 :is(.wc-block-components-checkbox,.wc-block-product-filter-checkbox-list li,.wc-block-product-filter-checkbox-list__item) {
  margin:0 0 2px!important;
  padding:0!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 :is(label,span,p,.wc-block-product-filter-checkbox-list__text) {
  font-size:12px!important;
  line-height:1.35!important;
}
.mbx-shop-layout--compact .mbx-shop-filters-v24 input[type=checkbox] {
  accent-color:var(--mbx-filter-accent,#719F41)!important;
  color-scheme:dark;
  width:15px!important;
  height:15px!important;
}
/* Compactar o banner em TODAS as variantes (inclusive se o editor não adicionou classe). */
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner {
  height:auto!important;
  min-height:164px!important;
  max-height:none!important;
  padding:16px clamp(19px,2.2vw,32px)!important;
  margin:0 0 8px!important;
  border-radius:12px!important;
  background:#08131c!important;
}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner::before {
  background-image:linear-gradient(90deg,rgba(4,11,19,.96) 0%,rgba(4,11,19,.84) 34%,rgba(4,11,19,.1) 86%),var(--mbx-shop-hero-image);
  background-size:cover;
  background-position:center center;
}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner-text {max-width:690px!important}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner-overline {font-size:9px!important;letter-spacing:.095em!important}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner h2 {
  font-size:clamp(19px,1.35vw,27px)!important;
  line-height:1.08!important;
  max-width:600px!important;
  margin:6px 0!important;
  font-weight:780!important;
}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner p {
  font-size:11px!important;
  line-height:1.36!important;
  max-width:525px!important;
  margin:2px 0 8px!important;
}
body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner-link {
  font-size:10px!important;
  padding:6px 10px!important;
  border-radius:7px!important;
}
/* Recuperar o espaço vertical excessivo do tema entre o banner, título e grelha. */
.mbx-shop-layout--compact > .mbx-shop-results > * + *,
.mbx-shop-layout--compact > .mbx-shop-results > .wp-block-group > * + *,
.mbx-shop-layout--compact > .mbx-shop-results .wp-block-woocommerce-product-collection > * + * {
  margin-block-start:9px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.woocommerce-breadcrumb,.wp-block-woocommerce-breadcrumbs) {
  margin-block:5px 2px!important;
  font-size:11px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-query-title,.woocommerce-products-header__title,.wp-block-post-title) {
  font-size:clamp(29px,2.2vw,40px)!important;
  line-height:1.07!important;
  margin:2px 0 5px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.woocommerce-result-count,.wc-block-components-product-results-count) {
  margin:0!important;
  line-height:1.3!important;
  font-size:12px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.woocommerce-ordering select,.wc-block-catalog-sorting select,.wp-block-woocommerce-catalog-sorting select,select.orderby) {
  min-height:35px!important;
  min-width:155px!important;
  font-size:12px!important;
  padding:6px 27px 6px 11px!important;
  border-radius:7px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-woocommerce-product-template,.wc-block-product-template,ul.products) {
  gap:10px!important;
  row-gap:12px!important;
  margin-block-start:8px!important;
}
/* Fotografias menores, sem cortar os produtos em formato vertical. */
.mbx-shop-layout--compact .mbx-shop-results :is(.wc-block-product-template li.wc-block-product,.products li.product) {
  min-width:0!important;
  padding:9px!important;
  border-radius:10px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-woocommerce-product-image,.wc-block-product-image) {
  display:flex!important;
  align-items:center;
  justify-content:center;
  height:clamp(132px,10vw,170px)!important;
  min-height:0!important;
  overflow:hidden!important;
  margin:0 0 6px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-woocommerce-product-image,.wc-block-product-image) img,
.mbx-shop-layout--compact .mbx-shop-results .products li.product img {
  display:block!important;
  max-width:100%!important;
  max-height:170px!important;
  width:auto!important;
  height:100%!important;
  object-fit:contain!important;
  margin:0 auto 6px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wc-block-components-product-name,.woocommerce-loop-product__title,.wp-block-post-title) {
  font-size:13px!important;
  line-height:1.33!important;
  margin:2px 0 5px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wc-block-components-product-price,.price) {
  font-size:13px!important;
  line-height:1.3!important;
  margin:2px 0 6px!important;
}
.mbx-shop-layout--compact .mbx-shop-results :is(.wc-block-components-product-button__button,.add_to_cart_button,.button.product_type_simple) {
  padding:7px 12px!important;
  min-height:32px!important;
  font-size:12px!important;
}
/* Quando a largura disponível permite, mostrar até cinco produtos na primeira linha. */
@media (min-width:1600px) {
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) {
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
  }
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) > li {
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    float:none!important;
    margin:0!important;
  }
}
@media (min-width:1180px) and (max-width:1599px) {
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) > li {
    width:auto!important;min-width:0!important;float:none!important;margin:0!important;
  }
}
@media (min-width:782px) and (max-width:1179px) {
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact {width:calc(100% - 38px)!important;gap:14px!important}
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact > .wp-block-column.mbx-shop-sidebar {
    width:230px!important;max-width:230px!important;flex-basis:230px!important;
  }
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) > li {width:auto!important;float:none!important;margin:0!important}
}
@media (max-width:781px) {
  .wp-block-columns.mbx-shop-layout.mbx-shop-layout--compact {display:block!important;width:calc(100% - 24px)!important;margin:10px auto!important;padding:0!important}
  .mbx-shop-layout--compact > .mbx-shop-sidebar {width:100%!important;max-width:none!important;margin:0 0 10px!important}
  .mbx-shop-layout--compact .mbx-shop-filters-v24 {max-height:none;overflow:visible!important;padding:12px!important}
  .mbx-shop-layout--compact > .mbx-shop-results {width:100%!important;margin:0!important}
  body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner {min-height:175px!important;padding:18px!important}
  body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner h2 {font-size:23px!important}
  body:is(.post-type-archive-product,.tax-product_cat,.tax-product_tag,.tax-product_brand) .mbx-shop-banner p {font-size:11px!important}
}
@media (max-width:540px) {
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;
  }
  .mbx-shop-layout--compact > .mbx-shop-results :is(ul.wp-block-woocommerce-product-template,ul.wc-block-product-template,ul.products) > li {width:auto!important;min-width:0!important;margin:0!important;float:none!important}
  .mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-woocommerce-product-image,.wc-block-product-image) {height:130px!important}
  .mbx-shop-layout--compact .mbx-shop-results :is(.wp-block-woocommerce-product-image,.wc-block-product-image) img {max-height:130px!important}
}
@media (prefers-reduced-motion:reduce) {
  .mbx-shop-layout--compact .mbx-shop-filters-v24 {scroll-behavior:auto}
}
