/* =========================================================================
   ZQM Product Center & Category Pages Search & Filter Workbench (v1.0)
   Palette: #0f1d30 Navy / #162a44 Deep / #ffbc28 Gold / #f4f7fb Neutral
   Geometry: 6px radius, 3px solid #0f1d30 top rule, WCAG AA, 0 overflow
   ========================================================================= */
.zqm-pf-bar {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 18px 20px 16px;
  background: #ffffff;
  border: 1px solid #dce3ec;
  border-top: 3px solid #0f1d30;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(15, 29, 48, 0.05);
  box-sizing: border-box;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.zqm-pf-bar *, .zqm-pf-results *, .zqm-pf-empty * { box-sizing: border-box; }

.zqm-pf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.zqm-pf-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f1d30 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em;
}
.zqm-pf-status {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.zqm-pf-row1 {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.zqm-pf-search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
}
.zqm-pf-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #64748b;
  pointer-events: none;
}
.zqm-pf-bar input[type="search"],
.zqm-pf-bar input[type="number"],
.zqm-pf-bar select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #0f1d30;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.zqm-pf-bar input[type="search"] {
  padding-left: 38px;
  padding-right: 36px;
}
.zqm-pf-bar input:focus,
.zqm-pf-bar select:focus {
  background: #ffffff;
  border-color: #0f1d30;
  box-shadow: 0 0 0 2px rgba(15, 29, 48, 0.12);
}
.zqm-pf-qclear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.zqm-pf-qclear:hover { background: #e2e8f0; color: #0f1d30; }

.zqm-pf-adv {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.zqm-pf-num-wrap {
  width: 128px;
  flex: 0 0 128px;
}
.zqm-pf-cat-wrap {
  width: 215px;
  flex: 0 0 215px;
}
.zqm-pf-sort-wrap {
  width: 182px;
  flex: 0 0 182px;
}
.zqm-pf-reset {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f1d30;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.zqm-pf-reset:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #0f1d30;
}
.zqm-pf-reset:disabled {
  opacity: 0.45;
  cursor: default;
}

.zqm-pf-mob-toggle {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #0f1d30;
  border-radius: 6px;
  background: #f4f7fb;
  color: #0f1d30;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Row 2: Pill Rails */
.zqm-pf-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf1f6;
}
.zqm-pf-pills[hidden] { display: none !important; }
.zqm-pf-pill-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  margin-right: 4px;
  white-space: nowrap;
}
.zqm-pf-pill-sep {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
  margin: 0 4px;
  flex: 0 0 1px;
}
.zqm-pf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #f4f7fb;
  color: #0f1d30;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.zqm-pf-pill em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
}
.zqm-pf-pill:hover {
  border-color: #0f1d30;
  background: #e9eff7;
}
.zqm-pf-pill.is-active {
  background: #0f1d30;
  border-color: #0f1d30;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 #ffbc28;
}
.zqm-pf-pill.is-active em {
  color: #ffbc28;
}

/* Active Removable Chips */
.zqm-pf-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.zqm-pf-chips[hidden] { display: none !important; }
.zqm-pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #0f1d30;
  border-radius: 6px;
  background: #eef3f9;
  color: #0f1d30;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.zqm-pf-chip:hover { background: #0f1d30; color: #ffffff; }

/* Filtered Results Studio Grid (matches zqm-phase2.v1.css v2.0 white studio cards) */
.zqm-pf-results {
  max-width: 1200px;
  margin: 0 auto 32px;
}
.zqm-pf-results[hidden], .zqm-pf-empty[hidden] { display: none !important; }
.zqm-pf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.zqm-pf-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.zqm-pf-card:hover {
  transform: translateY(-2px);
  border-color: #0f1d30;
  box-shadow: 0 10px 24px rgba(15, 29, 48, 0.08);
}
.zqm-pf-card-imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  padding: 16px;
  border-bottom: 1px solid #edf1f6;
}
.zqm-pf-card-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.zqm-pf-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 15px 15px;
}
.zqm-pf-card-cat {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.01em;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.zqm-pf-card-title {
  margin: 0 0 8px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  line-height: 1.38 !important;
  color: #0f1d30 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.zqm-pf-card-title a {
  color: #0f1d30 !important;
  text-decoration: none !important;
}
.zqm-pf-card-title a:hover { color: #1d4ed8 !important; }
.zqm-pf-card-dim {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f1d30;
  background: #f4f7fb;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.zqm-pf-card-dim--muted { color: #64748b; font-weight: 500; }
.zqm-pf-sod-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 3px 7px;
  margin-bottom: 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.zqm-pf-card-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zqm-pf-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 10px;
  background: #0f1d30;
  color: #ffffff !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}
.zqm-pf-card-btn:hover { background: #1e3a5f; }
.zqm-pf-card-copy {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f1d30;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.zqm-pf-card-copy:hover { border-color: #0f1d30; background: #f8fafc; }
.zqm-pf-card-copy.is-copied { background: #0f1d30; color: #ffbc28; border-color: #0f1d30; }

/* Zero-Match B2B Recovery Card */
.zqm-pf-empty {
  max-width: 1200px;
  margin: 0 auto 32px;
}
.zqm-pf-empty-card {
  background: #ffffff;
  border: 1px solid #dce3ec;
  border-top: 3px solid #ffbc28;
  border-radius: 6px;
  padding: 28px 24px;
  text-align: center;
}
.zqm-pf-empty-card h3 {
  margin: 0 0 8px !important;
  font-size: 19px !important;
  color: #0f1d30 !important;
  font-weight: 700 !important;
}
.zqm-pf-empty-card p {
  margin: 0 auto 18px !important;
  max-width: 660px;
  font-size: 14.5px;
  color: #475569;
  line-height: 1.65;
}
.zqm-pf-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.zqm-pf-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  background: #ffbc28;
  color: #0f1d30 !important;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}
.zqm-pf-btn-gold:hover { background: #f0ad18; }
.zqm-pf-btn-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  background: #ffffff;
  color: #0f1d30 !important;
  border: 1.5px solid #0f1d30;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}
.zqm-pf-btn-navy:hover { background: #0f1d30; color: #ffffff !important; }
.zqm-pf-btn-copy-q {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f4f7fb;
  color: #0f1d30;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.zqm-pf-btn-copy-q.is-copied { background: #0f1d30; color: #ffbc28; border-color: #0f1d30; }

/* Tablet */
@media (max-width: 1024px) {
  .zqm-pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

/* Mobile 390px Ergonomics (UI QA & CRO Conditions) */
@media (max-width: 640px) {
  .zqm-pf-bar { padding: 14px; margin-bottom: 18px; }
  .zqm-pf-bar input[type="search"],
  .zqm-pf-bar input[type="number"],
  .zqm-pf-bar select {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
    min-height: 44px;
  }
  .zqm-pf-search-wrap { flex: 1 1 100%; }
  .zqm-pf-mob-toggle { display: inline-flex; align-items: center; justify-content: center; width: 100%; }
  .zqm-pf-adv {
    display: none;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .zqm-pf-adv.is-open { display: grid; }
  .zqm-pf-num-wrap, .zqm-pf-cat-wrap, .zqm-pf-sort-wrap { width: 100%; flex: none; }
  .zqm-pf-cat-wrap { grid-column: 1 / -1; }
  .zqm-pf-reset { width: 100%; }
  /* Horizontal snap-scroll pill rail so pills never stack into a 5-row wall */
  .zqm-pf-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
  }
  .zqm-pf-pill { scroll-snap-align: start; flex: 0 0 auto; min-height: 38px; }
  .zqm-pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .zqm-pf-card-body { padding: 10px 10px 12px; }
  .zqm-pf-card-actions { flex-direction: column; align-items: stretch; gap: 6px; }
  .zqm-pf-card-btn, .zqm-pf-card-copy { width: 100%; }
}
