/* =============================================================
   SECTION 4 — POPULAR TESTS & HEALTH PACKAGES
   All rules scoped under .popular-tests
   ============================================================= */

.popular-tests {
  --pt-navy-900: #071B31;
  --pt-navy-800: #0A2F52;
  --pt-teal-500: #14B8A6;
  --pt-teal-050: #EEFBF9;
  --pt-cyan-300: #67E8F9;
  --pt-ink: #0A2F52;
  --pt-ink-soft: #5B7186;
  --pt-border: #E7EEF2;
  --pt-white: #FFFFFF;
  --pt-font-display: 'Bricolage Grotesque', 'Inter', sans-serif;
  --pt-font-body: 'Inter', sans-serif;

  position: relative;
  background: var(--pt-white);
  padding-top: 6.5rem;
  padding-bottom: 6.5rem;
  font-family: var(--pt-font-body);
  overflow: hidden;
}

/* ---------- Header ---------- */
.popular-tests-header {
  max-width: 42rem;
  margin: 0 auto 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
}

.popular-tests-header.is-visible {
  animation: popular-tests-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popular-tests-rise {
  to { opacity: 1; transform: translateY(0); }
}

.popular-tests-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pt-teal-500);
  margin-bottom: 0.85rem;
}

.popular-tests-title {
  font-family: var(--pt-font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  color: var(--pt-ink);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.popular-tests-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--pt-ink-soft);
}

/* ---------- Carousel track ---------- */
.popular-tests-carousel {
  position: relative;
  margin: 0 -0.25rem 1.75rem;
}

.popular-tests-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.25rem 1.25rem;
  scrollbar-width: none;
}

.popular-tests-track::-webkit-scrollbar {
  display: none;
}

/* ---------- Card ---------- */
.popular-tests-card {
  position: relative;
  flex: 0 0 auto;
  width: 300px;
  scroll-snap-align: start;
  background: var(--pt-white);
  border: 1px solid var(--pt-border);
  border-radius: 1.1rem;
  padding: 1.85rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  opacity: 0;
  transform: translateY(20px);
}

.popular-tests-card.is-visible {
  animation: popular-tests-card-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popular-tests-card-rise {
  to { opacity: 1; transform: translateY(0); }
}

.popular-tests-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -18px rgba(10, 47, 82, 0.24);
  border-color: rgba(20, 184, 166, 0.35);
}

.popular-tests-card-accent {
  position: absolute;
  top: 0;
  left: 1.6rem;
  width: 2rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pt-teal-500), var(--pt-cyan-300));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.popular-tests-card:hover .popular-tests-card-accent {
  width: 3.75rem;
}

.popular-tests-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.popular-tests-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: linear-gradient(150deg, var(--pt-teal-050), #E3F6F4);
  color: var(--pt-navy-800);
  font-size: 1.15rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease, color 0.35s ease;
}

.popular-tests-card:hover .popular-tests-card-icon {
  transform: rotate(-6deg) scale(1.06);
  background: linear-gradient(150deg, var(--pt-teal-500), #0EA5A0);
  color: var(--pt-white);
}

.popular-tests-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pt-ink-soft);
}

.popular-tests-card-title {
  font-family: var(--pt-font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--pt-ink);
  margin-bottom: 0.2rem;
  line-height: 1.25;
}

.popular-tests-card-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pt-teal-500);
  margin-bottom: 0.75rem;
}

.popular-tests-card-desc {
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--pt-ink-soft);
  margin-bottom: 1.25rem;
}

.popular-tests-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--pt-border);
}

.popular-tests-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--pt-ink-soft);
}

.popular-tests-card-meta-item i {
  color: var(--pt-teal-500);
  font-size: 0.85rem;
}

.popular-tests-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.popular-tests-card-price {
  font-family: var(--pt-font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--pt-ink);
}

.popular-tests-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.popular-tests-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pt-white);
  background: linear-gradient(90deg, var(--pt-teal-500), #0EA5A0);
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.popular-tests-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px rgba(20, 184, 166, 0.55);
  color: var(--pt-white);
}

.popular-tests-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pt-ink-soft);
  text-decoration: none;
  transition: color 0.3s ease, gap 0.3s ease;
}

.popular-tests-card-link i {
  font-size: 0.72rem;
  transition: transform 0.3s ease;
}

.popular-tests-card-link:hover {
  color: var(--pt-teal-500);
}

.popular-tests-card-link:hover i {
  transform: translateX(3px);
}

.popular-tests-card-btn:focus-visible,
.popular-tests-card-link:focus-visible {
  outline: 2px solid var(--pt-teal-500);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

/* ---------- Controls ---------- */
.popular-tests-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.popular-tests-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.popular-tests-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--pt-border);
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.popular-tests-dot:hover {
  background: var(--pt-cyan-300);
}

.popular-tests-dot.is-active {
  width: 1.5rem;
  background: linear-gradient(90deg, var(--pt-teal-500), var(--pt-cyan-300));
}

.popular-tests-dot:focus-visible {
  outline: 2px solid var(--pt-teal-500);
  outline-offset: 2px;
}

.popular-tests-arrows {
  display: flex;
  gap: 0.6rem;
}

.popular-tests-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--pt-border);
  background: var(--pt-white);
  color: var(--pt-ink);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
}

.popular-tests-arrow:hover {
  background: var(--pt-navy-800);
  border-color: var(--pt-navy-800);
  color: var(--pt-white);
  transform: translateY(-2px);
}

.popular-tests-arrow:focus-visible {
  outline: 2px solid var(--pt-teal-500);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .popular-tests {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .popular-tests-card {
    width: 268px;
  }
}

@media (max-width: 575.98px) {
  .popular-tests-title {
    font-size: 1.7rem;
  }

  .popular-tests-card {
    width: 84vw;
    padding: 1.6rem 1.35rem 1.4rem;
  }

  .popular-tests-arrows {
    display: none;
  }

  .popular-tests-controls {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .popular-tests-header,
  .popular-tests-card,
  .popular-tests-card-icon,
  .popular-tests-card-accent,
  .popular-tests-card-link i,
  .popular-tests-arrow,
  .popular-tests-dot {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .popular-tests-track {
    scroll-behavior: auto;
  }
}