/* PHASE 3.3.4.1 — make filtered products the first mobile Shop destination. */
.shop-mobile-heading,
.shop-mobile-controls,
.shop-mobile-filter-actions { display: none; }

@media (max-width: 767px) {
  body[data-page="shop"] .header-main {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-block: 8px;
  }
  body[data-page="shop"] .brand-logo-header { height: 36px; max-width: 142px; }
  body[data-page="shop"] .header-actions { gap: 6px; }
  body[data-page="shop"] .header-actions > a:first-child { display: grid; }
  body[data-page="shop"] .header-actions a { min-width: 30px; font-size: .61rem; }
  body[data-page="shop"] .header-main > .global-search { display: none; }
  body[data-page="shop"] .page-hero { display: none; }

  body[data-page="shop"] .shop-mobile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding-block: 7px 4px;
  }
  body[data-page="shop"] .shop-mobile-heading h1 {
    margin: 0;
    font-size: clamp(1.2rem, 5vw, 1.55rem);
    line-height: 1.22;
    overflow-wrap: anywhere;
  }
  body[data-page="shop"] .shop-mobile-heading [data-shop-mobile-count]:not([hidden]) {
    display: block;
    color: var(--text-secondary);
    font-size: .72rem;
    line-height: 1.3;
  }
  body[data-page="shop"] .active-category-chip:not([hidden]) {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    min-height: 30px;
    place-items: center;
    border: 1px solid rgba(37,99,235,.28);
    border-radius: 999px;
    background: #ebf7ff;
    color: var(--future-blue);
    font-size: 1.15rem;
    font-weight: 800;
  }

  body[data-page="shop"] #main-content > .section { padding-block: 4px 22px; }
  body[data-page="shop"] .shop-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body[data-page="shop"] .filters-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body[data-page="shop"] .shop-mobile-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  body[data-page="shop"] .mobile-filter-toggle,
  body[data-page="shop"] .mobile-sort-control {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 40px;
    padding: 5px 10px;
    border: 1px solid rgba(151,169,204,.45);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.25;
  }
  body[data-page="shop"] .mobile-filter-toggle { cursor: pointer; }
  body[data-page="shop"] .mobile-filter-toggle[aria-expanded="true"] { border-color: var(--future-cyan); color: var(--future-blue); }
  body[data-page="shop"] .mobile-sort-control { gap: 4px; }
  body[data-page="shop"] .mobile-sort-control > span { flex: 0 0 auto; }
  body[data-page="shop"] .mobile-sort-control select {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    padding: 0;
  }
  body[data-page="shop"] .filters-panel form[data-shop-filters] { display: none; }
  body[data-page="shop"] .filters-panel.filters-open form[data-shop-filters] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  body[data-page="shop"] .filter-heading,
  body[data-page="shop"] .filters-panel fieldset:first-of-type,
  body[data-page="shop"] .shop-mobile-filter-actions { grid-column: 1 / -1; }
  body[data-page="shop"] .filters-panel fieldset { min-width: 0; padding-block: 10px; }
  body[data-page="shop"] .shop-mobile-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body[data-page="shop"] .shop-mobile-filter-actions button {
    min-height: 40px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #f5f8ff;
    color: var(--future-blue);
    font-weight: 800;
  }
  body[data-page="shop"] .shop-mobile-filter-actions [data-filter-apply] {
    border-color: transparent;
    background: linear-gradient(135deg, var(--commerce-gold), var(--commerce-orange));
    color: #211834;
  }
  body[data-page="shop"] .shop-toolbar { display: block; margin-bottom: 8px; }
  body[data-page="shop"] .shop-toolbar > [data-result-count],
  body[data-page="shop"] .shop-toolbar > .sort-control { display: none; }
  body[data-page="shop"][data-shop-category="true"] .shop-toolbar { display: none; }
  body[data-page="shop"] .shop-search input { min-height: 40px; }
  body[data-page="shop"] .shop-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="shop"] .shop-product-grid .empty-state { min-height: 160px; padding: 20px; }
}

@media (max-width: 375px) {
  body[data-page="shop"] .mobile-filter-toggle,
  body[data-page="shop"] .mobile-sort-control { font-size: .76rem; padding-inline: 6px; }
}
