/* ============================================================
   VitalWatch Tech — Product Collection page (§10)
   Function navigation + product filters + results grid
   ============================================================ */

/* Portfolio summary strip under the intro */
.intro-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px auto 0;
  max-width: 860px;
}
.intro-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 26px;
  min-width: 158px;
}
.intro-stats strong {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}
.intro-stats span { font-size: 12.5px; color: var(--slate); }

/* ---------------- Sticky function navigation ---------------- */
.fn-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin-top: 34px;
}
.site-header.is-hidden ~ main .fn-bar { top: 0; }
.fn-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
/* center the row when it fits, keep it reachable while scrolling when it doesn't */
.fn-nav > :first-child { margin-left: auto; }
.fn-nav > :last-child { margin-right: auto; }
.fn-nav::-webkit-scrollbar { display: none; }
.fn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 40px;
  white-space: nowrap;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: #33415C;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.fn-pill svg { width: 17px; height: 17px; color: var(--blue); }
.fn-pill:hover { border-color: #B9CFF3; color: var(--navy); }
.fn-pill.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(23, 105, 255, .55);
}
.fn-pill.is-active svg { color: #fff; }

/* ---------------- Sidebar filters + results layout ---------------- */
.collection-section { padding: 34px 0 96px; }

.collection-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 22px 22px 10px;
}
.site-header.is-hidden ~ main .filter-panel { top: 16px; }
.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.filter-head h2 {
  font-size: 16px;
  font-weight: 800;
}
.f-reset {
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 0;
}
.f-reset:hover { text-decoration: underline; }

.f-group { border: 0; padding: 14px 0 12px; margin: 0; }
.f-group + .f-group { border-top: 1px solid #EDF2F9; }
.f-group legend {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #7A8AA5;
  padding: 0;
  margin-bottom: 10px;
}

.f-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 14.5px;
  color: #2A3B57;
  position: relative;
}
.f-check input { position: absolute; opacity: 0; pointer-events: none; }
.f-check .box {
  width: 19px;
  height: 19px;
  flex: none;
  border: 1.5px solid #C4D2E4;
  border-radius: 6px;
  background: #fff;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.f-check .box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}
.f-check input:checked + .box { background: var(--blue); border-color: var(--blue); }
.f-check input:checked + .box::after { opacity: 1; transform: scale(1); }
.f-check input:focus-visible + .box { outline: 2px solid var(--blue); outline-offset: 2px; }
.f-check:hover .box { border-color: var(--blue); }
.f-label { flex: 1; }
.f-count { font-size: 12px; font-weight: 700; color: var(--slate); background: #EFF4FA; border-radius: 999px; padding: 2px 8px; }

/* ---------------- Results bar ---------------- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.results-count { font-size: 14.5px; color: var(--slate); }
.results-count strong { color: var(--navy); font-weight: 700; }
.f-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
}
.f-toggle svg { width: 17px; height: 17px; color: var(--blue); }

/* ---------------- Card action row (View Details + Quote) ---------------- */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #EDF2F9;
  padding-top: 15px;
  margin-top: auto;
}
.card-actions .card-link { border-top: 0; padding-top: 0; white-space: nowrap; flex: none; }
.card-quote {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  margin-left: auto;
  transition: background .2s ease, color .2s ease;
}
.card-quote:hover { background: var(--blue); color: #fff; }

.collection-card .card-kicker {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7A8AA5;
  margin-bottom: 8px;
}
.collection-card h3 { font-size: 18px; }

.no-results {
  background: #fff;
  border: 1px dashed #C9D8EC;
  border-radius: var(--radius);
  padding: 44px 32px;
  margin-top: 6px;
}
.no-results p { max-width: 52ch; margin: 0 auto 8px; }
.no-results-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ---------------- Navy quote CTA band ---------------- */
.cta-navy {
  background:
    radial-gradient(70% 130% at 88% -10%, rgba(23, 105, 255, .35), transparent 55%),
    radial-gradient(50% 110% at 4% 110%, rgba(25, 201, 138, .18), transparent 55%),
    linear-gradient(160deg, #0B1F3A 0%, #0E2A52 100%);
  padding: 78px 0;
}
.cta-navy .cta-inner {
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  text-align: left;
}
.cta-navy h2 { font-size: clamp(26px, 2.8vw, 36px); margin-bottom: 10px; }
.cta-navy p { margin-bottom: 0; max-width: 56ch; font-size: 15.5px; }
.cta-navy .cta-actions { flex: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .collection-layout { grid-template-columns: 1fr; }

  .fn-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .fn-nav::-webkit-scrollbar { display: none; }
  .fn-bar { -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }

  .filter-panel {
    position: static;
    display: none;
    padding-bottom: 22px;
  }
  .filter-panel.is-open { display: block; }
  .f-toggle { display: inline-flex; }
  .f-toggle[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); }

  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .fn-bar { margin-top: 26px; }

  .cta-navy .cta-inner { flex-direction: column; text-align: center; }
  .cta-navy p { margin: 0 auto 28px; }
}

@media (max-width: 640px) {
  .collection-grid { grid-template-columns: 1fr; }
  .intro-stats { gap: 10px; }
  .intro-stats li { min-width: 138px; padding: 12px 18px; }
  .results-bar { flex-wrap: wrap; }
  .collection-section { padding-bottom: 72px; }
  .help-panel { padding: 36px 26px; }
}
