/* Mobile product tag filters use an overlay sheet so the catalog never shifts. */
body.mobile-page[data-page="products"].filter-sheet-open {
  overflow: hidden !important;
}

body.mobile-page[data-page="products"] .mobile-filter-scrim {
  position: fixed;
  inset: 0;
  z-index: 1190;
  display: none;
  width: var(--mobile-product-sheet-width, 100dvw);
  right: auto;
  background: rgba(25, 46, 74, .24);
}

body.mobile-page[data-page="products"].filter-sheet-open .mobile-filter-scrim {
  display: block;
}

body.mobile-page[data-page="products"] .filter-panel {
  display: none !important;
}

body.mobile-page[data-page="products"] .filter-panel.open {
  position: fixed;
  bottom: 0;
  left: 0;
  right: auto;
  z-index: 1200;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: var(--mobile-product-sheet-width, 100dvw);
  max-height: min(82dvh, 720px);
  min-height: min(570px, 82dvh);
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(184, 207, 235, .78) !important;
  border-bottom: 0 !important;
  border-radius: 22px 22px 0 0 !important;
  background: #f7fcfe !important;
  box-shadow: 0 -18px 42px rgba(24, 48, 80, .18) !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .block-title {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 58px;
  margin: 0 !important;
  padding: 11px 16px 9px !important;
  border-bottom: 1px solid rgba(216, 229, 243, .94);
  background: rgba(255, 255, 255, .98);
}

body.mobile-page[data-page="products"] .filter-panel.open .block-title h3 {
  margin: 0 !important;
  color: #172b44;
  font-size: 18px !important;
}

body.mobile-page[data-page="products"] .mobile-filter-head-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

body.mobile-page[data-page="products"] .filter-panel.open #filter-reset-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #4c77ae !important;
  font-size: 13px;
  text-decoration: none;
}

body.mobile-page[data-page="products"] .mobile-filter-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f5fb;
  color: #4c617a;
  font-size: 20px;
  line-height: 1;
  place-items: center;
}

body.mobile-page[data-page="products"] .mobile-filter-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 22px;
}

body.mobile-page[data-page="products"] .mobile-filter-selection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #d6e6fa;
  border-radius: 8px;
  background: #f4f9ff;
}

body.mobile-page[data-page="products"] .mobile-filter-selection[hidden] {
  display: none !important;
}

body.mobile-page[data-page="products"] .mobile-filter-selection > span,
body.mobile-page[data-page="products"] .mobile-filter-selection > small {
  color: #708198;
  font-size: 12px;
  white-space: nowrap;
}

body.mobile-page[data-page="products"] .mobile-filter-selected-chips {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

body.mobile-page[data-page="products"] .mobile-filter-selected-chips::-webkit-scrollbar {
  display: none;
}

body.mobile-page[data-page="products"] .mobile-selected-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 7px 0 9px;
  border: 1px solid #b8d4ff;
  border-radius: 999px;
  background: #fff;
  color: #2e6dd3;
  font-size: 12px;
  font-weight: 700;
}

body.mobile-page[data-page="products"] .mobile-selected-chip i {
  color: #7188aa;
  font-size: 16px;
  font-style: normal;
  line-height: 1;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 22px !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-heading {
  gap: 7px !important;
  margin-bottom: 9px !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-heading strong {
  color: #1c3049;
  font-size: 15px !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-heading span,
body.mobile-page[data-page="products"] .mobile-filter-quick-label {
  color: #718199 !important;
  font-size: 12px !important;
}

body.mobile-page[data-page="products"] .installation-filter-subgroups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

body.mobile-page[data-page="products"] .installation-filter-subgroup {
  display: grid;
  gap: 6px;
}

body.mobile-page[data-page="products"] .installation-filter-subheading {
  color: #718199;
  font-size: 12px;
  line-height: 1.35;
}

body.mobile-page[data-page="products"] .mobile-filter-quick-label {
  margin: 0 0 8px;
}

body.mobile-page[data-page="products"] .mobile-brand-search {
  display: none;
  width: 100%;
  height: 40px;
  margin: 0 0 10px;
  padding: 0 11px;
  border: 1px solid #d3e0ef;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #1c3049;
  font-size: 13px;
}

body.mobile-page[data-page="products"] .filter-panel.open .chip-list {
  gap: 8px !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-chip {
  min-height: 44px !important;
  padding: 0 12px !important;
  border-color: #d1dfef !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #53667e !important;
  box-shadow: none !important;
  font-size: 13px !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-chip.active {
  border-color: #9ec4ff !important;
  background: #e6f7fd !important;
  color: #256bd6 !important;
  font-weight: 800 !important;
}

body.mobile-page[data-page="products"] .filter-panel:not(.brands-expanded) #brand-filters .filter-chip:nth-child(n+7),
body.mobile-page[data-page="products"] .filter-panel:not(.features-expanded) #feature-filters .filter-chip:nth-child(n+7) {
  display: none !important;
}

body.mobile-page[data-page="products"] .filter-panel.brands-expanded .mobile-brand-search {
  display: block;
}

body.mobile-page[data-page="products"] .filter-panel.brands-expanded .mobile-filter-quick-label {
  display: none;
}

body.mobile-page[data-page="products"] .mobile-filter-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-top: 4px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: #397ef0 !important;
  font-size: 13px;
  font-weight: 800;
}

body.mobile-page[data-page="products"] .mobile-filter-more span {
  font-size: 18px;
  line-height: 1;
}

body.mobile-page[data-page="products"] .filter-panel.brands-expanded #mobile-brand-more,
body.mobile-page[data-page="products"] .filter-panel.features-expanded #mobile-feature-more {
  display: none;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-done-bar {
  position: static !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) !important;
  border: 0 !important;
  border-top: 1px solid rgba(216, 229, 243, .94) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: none !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-done-bar .filter-done-status > span {
  align-self: center;
  color: #1c3049 !important;
  font-size: 13px !important;
  font-weight: 800;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-done-bar > div {
  display: block !important;
}
body.mobile-page[data-page="products"] .filter-panel.open .filter-done-bar > .filter-done-status {
  display: flex !important; align-items: center; justify-content: space-between; gap: 8px;
}
body.mobile-page[data-page="products"] .filter-panel.open .filter-compare-clear {
  width: auto; flex: none; white-space: nowrap; height: 32px !important;
  border: 0 !important; background: transparent !important; padding: 0 4px !important; font-weight: 500;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-done-ghost {
  display: none !important;
}

body.mobile-page[data-page="products"] .filter-panel.open .filter-done-primary {
  width: 100%;
  height: 44px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
}

body.mobile-page[data-page="products"] .filter-toggle {
  min-height: 44px !important;
}

body.mobile-page[data-page="products"] .filter-panel :is(button, a, input):focus-visible {
  outline: 2px solid rgba(0,172,235,.42);
  outline-offset: 2px;
}

@media (max-height: 680px) {
  body.mobile-page[data-page="products"] .filter-panel.open {
    min-height: min(500px, 82dvh);
  }

  body.mobile-page[data-page="products"] .mobile-filter-scroll {
    padding-top: 10px;
  }

  body.mobile-page[data-page="products"] .filter-panel.open .filter-row {
    gap: 16px !important;
  }
}

/* ==========================================================================
   Mobile Products — final implementation (mobile-only, products-scoped)
   A) real product count + filter entry
   B) 2-column grid with vertical cards (image → name ≤2 lines → real tags ≤2)
   C) action row: 查看参数 (left) + 对比 (right)
   D) filter panel slides in from the RIGHT (near full-screen), not a bottom sheet
   E) contextual compare tray only when 2+ products are selected
   ========================================================================== */

/* A) Top controls. Higher specificity than the shared injected styles and
   mobile-functional-layout.css so these win without touching shared files. */
html body.mobile-page[data-page="products"] #catalog-panel .section-head {
  display: block !important;
  margin: 14px 0 10px !important;
}
html body.mobile-page[data-page="products"] #catalog-panel .section-head > div:first-child {
  display: none !important;
}
html body.mobile-page[data-page="products"] #catalog-panel .section-head .list-tools {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin: 0 !important;
  gap: 10px !important;
}
html body.mobile-page[data-page="products"] .result-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #4a5c6e !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
}
html body.mobile-page[data-page="products"] .filter-toggle {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(0, 172, 235, .32) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .72) !important;
  color: #2b72c7 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="products"] header.nav .logo-copy > span {
  font-size: 12px !important;
}

/* B) 2-column grid + vertical cards. */
html body.mobile-page[data-page="products"] .result-product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 0 !important;
  padding: 9px !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  /* B1C: radius-card（16→18 +2px，与 PC/mobile tile 族一致） */
  border-radius: var(--radius-card) !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-card-main {
  display: block !important;
  padding: 0 !important;
  cursor: default !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-visual-wrap {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-visual {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  border: 1px solid rgba(226, 232, 240, .9) !important;
  border-radius: 12px !important;
  background: #f6fbff !important;
  overflow: hidden !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-photo-frame {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
}
/* B1A3: 上述 product-name / product-name a 排版与几何规则已整体移交
   css/pages/mobile-products-p1.css（页面 owner）——筛选抽屉文件不再持有主产品卡排版。 */
  overflow-wrap: anywhere !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-summary {
  display: none !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-tags {
  margin: 6px 0 0 !important;
  gap: 5px !important;
  max-height: none !important;
  overflow: hidden !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-tags span {
  height: 22px !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  background: rgba(0, 172, 235, .08) !important;
  color: #0f7ac7 !important;
  font-size: 11px !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-tags span:nth-child(n+3) {
  display: none !important;
}

/* C) Action row: 查看参数 (left) + 对比 (right). The shared renderer labels the
   detail action "查看"; the ::after completes it to "查看参数" (which is also the
   accessible name). The favourite action is not part of the frozen card design. */
html body.mobile-page[data-page="products"] .result-product-grid .product-actions.compare-inline-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(148, 163, 184, .14) !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions.compare-inline-actions > [data-action] {
  flex: 1 1 0 !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions [data-action="favorite"] {
  display: none !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions [data-action="detail"]::after {
  content: "参数";
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions .primary-btn,
html body.mobile-page[data-page="products"] .result-product-grid .product-actions .compare-inline-btn {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 6px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions .compare-inline-btn {
  border: 1px solid rgba(0, 172, 235, .24) !important;
  background: #f2faff !important;
  color: #0f7ac7 !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions .compare-inline-btn.active {
  border-color: rgba(0, 172, 235, .55) !important;
  background: #e2f5ff !important;
  color: #00698f !important;
}
html body.mobile-page[data-page="products"] .result-product-grid .product-actions .compare-inline-btn:disabled {
  opacity: .5 !important;
}

/* D) Filter panel: right-side near-full-screen sheet. */
html body.mobile-page[data-page="products"] .mobile-filter-scrim {
  right: 0 !important;
  left: 0 !important;
  width: 100vw !important;
}
html body.mobile-page[data-page="products"] .filter-panel.open {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: min(92vw, 400px) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  border-left: 1px solid rgba(184, 207, 235, .78) !important;
  border-bottom: 1px solid rgba(184, 207, 235, .78) !important;
  border-radius: var(--radius-drawer) 0 0 var(--radius-drawer) !important;
  animation: mprod-filter-in .26s ease both;
}
@keyframes mprod-filter-in {
  from { transform: translateX(20px); opacity: .55; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html body.mobile-page[data-page="products"] .filter-panel.open { animation: none !important; }
}

/* E) Contextual compare tray: present only when 2+ products are selected, and
   clear of the frozen "更多功能" FAB. It is not a navigation bar. */
html body.mobile-page[data-page="products"] .compare-dock {
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  border-radius: 14px !important;
}
html body.mobile-page[data-page="products"]:not(:has(#compare-selection .compare-chip:nth-child(2))) .compare-dock {
  display: none !important;
}

/* F) Empty state clear action (mobile-only). */
html body.mobile-page[data-page="products"] #catalog-groups .empty-state .empty-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 10px 8px 0;
  padding: 0 16px;
  border: 1px solid rgba(0, 172, 235, .34);
  border-radius: 12px;
  background: #fff;
  color: #0f7ac7;
  font-size: 13px;
  font-weight: 800;
}

/* G) Keep the frozen FAB out of the way while a modal surface is open. */
html body.mobile-page[data-page="products"].filter-sheet-open .mobile-more-fab,
html body.mobile-page[data-page="products"]:has(#detail-modal.open) .mobile-more-fab {
  display: none !important;
}

/* H) Light footer on Mobile Products, aligned with the frozen Mobile Home
   footer: site name + agreement/copyright/ICP/police only. The heavy Pro intro
   and the two QR blocks are hidden visually; shared footer data is untouched. */
html body.mobile-page[data-page="products"] .site-compliance-footer {
  margin-top: 18px !important;
  padding: 16px 20px 14px !important;
}
html body.mobile-page[data-page="products"] .site-compliance-footer__main {
  display: none !important;
}
html body.mobile-page[data-page="products"] .site-compliance-footer__qr,
html body.mobile-page[data-page="products"] .site-compliance-footer__brand {
  display: none !important;
}
html body.mobile-page[data-page="products"] .site-compliance-footer::before {
  content: "智能锁产业信息平台";
  display: block;
  margin-bottom: 8px;
  color: #1d3349;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
html body.mobile-page[data-page="products"] .site-compliance-footer__legal {
  padding-top: 0 !important;
  border-top: 0 !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
  text-align: center !important;
}

/* I) Lightweight contextual compare tray: "已选 N 款" + "开始对比".
   The shared pill ("N/4"), the long summary line and the clear button are not
   part of the frozen tray design; the 4-item limit still applies in the shared
   compare model. */
html body.mobile-page[data-page="products"] #compare-count-pill {
  display: none !important;
}
html body.mobile-page[data-page="products"] .compare-dock .compare-head-copy span,
html body.mobile-page[data-page="products"] #compare-clear-btn {
  display: none !important;
}
html body.mobile-page[data-page="products"] .compare-dock {
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
  bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  border-radius: 14px !important;
}
html body.mobile-page[data-page="products"] .compare-dock .compare-head {
  min-height: 52px !important;
  padding: 8px 12px !important;
  gap: 10px !important;
}
html body.mobile-page[data-page="products"] .compare-dock .compare-head-main {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}
html body.mobile-page[data-page="products"] .compare-dock #compare-title {
  font-size: 14px !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="products"] .compare-dock #compare-toggle-btn {
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
}
/* Tray only when 2+ products are selected. */
html body.mobile-page[data-page="products"]:not(:has(#compare-selection .compare-chip:nth-child(2))) .compare-dock {
  display: none !important;
}
/* Raise the frozen FAB above the tray while the tray is visible (Products only). */
html body.mobile-page[data-page="products"]:has(#compare-selection .compare-chip:nth-child(2)) .mobile-more-fab {
  bottom: calc(80px + env(safe-area-inset-bottom)) !important;
}
html body.mobile-page[data-page="products"]:not(:has(#compare-selection .compare-chip:nth-child(2))) .mobile-more-fab {
  bottom: calc(44px + var(--mobile-safe-bottom, 0px));
}
html body.mobile-page[data-page="products"]:has(#compare-selection .compare-chip:nth-child(2)) .catalog-pagination {
  margin-bottom: 92px !important;
}
/* When the tray is expanded it becomes a full sheet; keep the FAB out of it. */
html body.mobile-page[data-page="products"]:has(.compare-dock:not(.collapsed)) .mobile-more-fab {
  display: none !important;
}
