/* STORE APP Patch 564: mobile single-column product listing + compact category navigation.
   Loaded AFTER P522, P523 and the legacy catalog styles. */
@media (max-width: 900px) {
  body.site-masterpalm #site-main .mpb2b-catalog-layout,
  body.site-masterpalm #site-main .mp-category-layout,
  body.masterpalm-theme #site-main .mp-category-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    min-width: 0 !important;
  }
  body.site-masterpalm #site-main .mpb2b-filter-panel,
  body.site-masterpalm #site-main .mp-category-sidebar {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    order: 0 !important;
    margin: 0 0 10px !important;
    float: none !important;
    height: auto !important;
  }
  body.site-masterpalm #site-main .mpb2b-catalog-results,
  body.site-masterpalm #site-main .mp-category-main,
  body.site-masterpalm #site-main .mp-product-catalog-main {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    order: 1 !important;
  }
  #site-main .mp-564-category-toggle {
    display: flex !important;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 12px 15px;
    background: #151b24;
    border: 1px solid #aab3bf;
    border-left: 4px solid #cf1734;
    border-radius: 4px;
    color: #fff !important;
    font-family: inherit;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
  }
  #site-main .mp-564-category-toggle .mp-564-category-selected { color: #cbd5e1; font-size: 12px; font-weight: 600; }
  #site-main .mp-564-category-toggle i { flex: 0 0 auto; transition: transform .2s ease; }
  #site-main .mp-564-category-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
  #site-main [data-mp-564-category="1"] > .mp-564-filter-content { display: none !important; }
  #site-main [data-mp-564-category="1"][data-mp-564-expanded="1"] > .mp-564-filter-content {
    display: block !important;
    max-height: min(60vh, 540px);
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #site-main [data-mp-564-category="1"] .mp-category-nav,
  #site-main [data-mp-564-category="1"] .mpb2b-category-tree-list {
    min-width: 0 !important;
    width: 100% !important;
  }
}
@media (min-width: 901px) {
  #site-main .mp-564-category-toggle { display: none !important; }
  #site-main [data-mp-564-category="1"] > .mp-564-filter-content { display: block !important; max-height: none !important; overflow: visible !important; }
}
@media (max-width: 767.98px) {
  body.site-masterpalm #site-main .mpb2b-product-grid,
  body.site-masterpalm #site-main .mpb2b-product-grid-catalog,
  body.site-masterpalm #site-main .mp-product-catalog-grid,
  body.site-masterpalm #site-main .mp-category-products-grid,
  body.site-masterpalm #site-main .mp-category-grid-list,
  body.masterpalm-theme #site-main .mpb2b-product-grid,
  body.masterpalm-theme #site-main .mp-product-catalog-grid,
  body.masterpalm-theme #site-main .mp-category-products-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.site-masterpalm #site-main .mpb2b-product-grid > .mpb2b-product-card,
  body.site-masterpalm #site-main .mp-category-products-grid > .mp-product-list-card,
  body.site-masterpalm #site-main .mp-category-grid-list > .mp-product-list-card,
  body.masterpalm-theme #site-main .mpb2b-product-grid > .mpb2b-product-card {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  body.site-masterpalm #site-main .mpb2b-product-card .mpb2b-product-media,
  body.site-masterpalm #site-main .mp-product-list-card .mp-product-list-media {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 200px !important;
    max-height: 330px !important;
    aspect-ratio: 4 / 3 !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    flex-shrink: 0 !important;
  }
  body.site-masterpalm #site-main .mpb2b-product-body,
  body.site-masterpalm #site-main .mp-product-list-body { min-width: 0 !important; overflow-wrap: anywhere; }
  body.site-masterpalm #site-main .mpb2b-card-actions,
  body.site-masterpalm #site-main .mp-product-list-actions { min-width: 0 !important; max-width: 100% !important; }
  body.site-masterpalm #site-main .mpb2b-container,
  body.site-masterpalm #site-main .mp-header-container { max-width: 100% !important; min-width: 0 !important; }
  body.site-masterpalm #site-main .mpb2b-catalog-search { grid-template-columns: minmax(0,1fr) 52px !important; min-width: 0 !important; }
  body.site-masterpalm #site-main .mpb2b-section-title { flex-wrap: wrap !important; }
}
