/* Select & book individual tests — AarogyaLabs */
.select-tests-page {
  --st-primary: #2f8f7a;
  --st-primary-dark: #247a68;
  --st-surface: #ffffff;
  --st-muted: #64748b;
  --st-border: #e2e8f0;
  --st-bg: #f4f7f6;
  --st-radius: 14px;
  background: var(--st-bg);
  padding-bottom: 0;
}

.select-tests-page .select-tests-hero {
  background: linear-gradient(145deg, #1e4d42 0%, #2f8f7a 42%, #3aa88f 100%);
  color: #fff;
  padding: 28px 0 32px;
  text-align: left;
}

.select-tests-page .select-tests-hero .container {
  max-width: 1200px;
}

.select-tests-page .select-tests-hero h1 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.select-tests-page .select-tests-hero > .container > p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.92;
  max-width: 36rem;
  line-height: 1.5;
}

.select-tests-page .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.select-tests-page .stat-item {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.select-tests-page .stat-number {
  font-size: inherit;
  font-weight: 800;
}

.select-tests-page .stat-label {
  font-size: inherit;
  opacity: 0.95;
  font-weight: 500;
}

.select-tests-page .selection-interface {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.select-tests-page .tests-section {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  border: 1px solid var(--st-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  min-width: 0;
}

.select-tests-page .tests-header {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--st-border);
  background: #fafcfb;
}

.select-tests-page .st-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.select-tests-page .search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--st-border);
  border-radius: 12px;
  font-size: 16px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
}

.select-tests-page .search-input:focus {
  outline: none;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(47, 143, 122, 0.15);
}

.select-tests-page .sort-select {
  padding: 10px 12px;
  border: 1px solid var(--st-border);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  color: #0f172a;
  max-width: 11rem;
}

.select-tests-page .st-cat-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -4px;
  padding: 2px 4px 4px;
}

.select-tests-page .st-cat-scroll::-webkit-scrollbar {
  display: none;
}

.select-tests-page .category-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  min-width: 100%;
}

.select-tests-page .category-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--st-border);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.select-tests-page .category-btn:hover {
  border-color: var(--st-primary);
  color: var(--st-primary-dark);
}

.select-tests-page .category-btn.active {
  background: var(--st-primary);
  border-color: var(--st-primary);
  color: #fff;
}

.select-tests-page .tests-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: none;
  overflow: visible;
}

.select-tests-page .test-item {
  border: 1px solid var(--st-border);
  border-radius: 12px;
  padding: 14px 44px 14px 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
  background: #fff;
}

.select-tests-page .test-item:hover {
  border-color: #a7d4c8;
  box-shadow: 0 4px 14px rgba(47, 143, 122, 0.1);
}

.select-tests-page .test-item.selected {
  border-color: var(--st-primary);
  background: #f0faf7;
  box-shadow: 0 0 0 1px rgba(47, 143, 122, 0.25);
}

.select-tests-page .test-checkbox {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  accent-color: var(--st-primary);
  cursor: pointer;
}

.select-tests-page .test-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f172a;
  line-height: 1.35;
  padding-right: 4px;
}

.select-tests-page .test-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--st-primary-dark);
  margin-bottom: 6px;
}

.select-tests-page .test-description {
  color: var(--st-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.select-tests-page .test-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.select-tests-page .test-category {
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: capitalize;
  font-size: 0.68rem;
  font-weight: 600;
}

.select-tests-page .know-more-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--st-primary-dark);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: #ecfdf8;
}

.select-tests-page .know-more-btn:hover {
  background: #d1fae5;
  text-decoration: none;
}

.select-tests-page .selection-summary {
  background: var(--st-surface);
  border-radius: var(--st-radius);
  border: 1px solid var(--st-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 76px;
  overflow: hidden;
}

.select-tests-page .summary-header {
  background: linear-gradient(135deg, var(--st-primary-dark), var(--st-primary));
  color: #fff;
  padding: 16px 18px;
}

.select-tests-page .summary-title {
  font-size: 1rem;
  margin: 0 0 8px;
  font-weight: 700;
}

.select-tests-page .summary-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}

.select-tests-page .selected-tests-list {
  padding: 12px 14px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.select-tests-page .selected-tests-list .st-empty {
  text-align: center;
  color: var(--st-muted);
  font-size: 0.9rem;
  margin: 16px 0;
}

.select-tests-page .selected-test-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.select-tests-page .selected-test-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #0f172a;
}

.select-tests-page .selected-test-price {
  color: var(--st-primary-dark);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

.select-tests-page .remove-test {
  color: #dc2626;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.select-tests-page .remove-test:hover {
  background: #fef2f2;
}

.select-tests-page .summary-total {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--st-border);
  background: #fafcfb;
}

.select-tests-page .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
  color: #0f172a;
}

.select-tests-page .book-all-btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--st-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.select-tests-page .book-all-btn:hover:not(:disabled) {
  background: var(--st-primary-dark);
}

.select-tests-page .book-all-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* Mobile sticky cart */
.select-tests-page .st-mobile-cart {
  display: none;
}

.select-tests-page .booking-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2005;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.select-tests-page .booking-modal.show {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.select-tests-page .booking-form-container {
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}

.select-tests-page .booking-header {
  background: linear-gradient(135deg, var(--st-primary-dark), var(--st-primary));
  color: #fff;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.select-tests-page .booking-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}

.select-tests-page .booking-summary {
  font-size: 0.88rem;
  opacity: 0.92;
}

.select-tests-page .booking-body {
  padding: 20px;
}

.select-tests-page .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.select-tests-page .form-group {
  margin-bottom: 14px;
}

.select-tests-page .form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
}

.select-tests-page .form-input,
.select-tests-page .form-select,
.select-tests-page .form-textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--st-border);
  border-radius: 10px;
  font-size: 16px;
}

.select-tests-page .form-input:focus,
.select-tests-page .form-select:focus,
.select-tests-page .form-textarea:focus {
  outline: none;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(47, 143, 122, 0.12);
}

.select-tests-page .booking-actions {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--st-border);
  display: flex;
  gap: 10px;
  justify-content: stretch;
  position: sticky;
  bottom: 0;
  background: #fff;
}

.select-tests-page .btn-secondary {
  flex: 1;
  padding: 12px;
  background: #f1f5f9;
  color: #334155;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.select-tests-page .btn-primary {
  flex: 2;
  padding: 12px;
  background: var(--st-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.select-tests-page .btn-primary:hover {
  background: var(--st-primary-dark);
}

@media (max-width: 1024px) {
  .select-tests-page .selection-interface {
    grid-template-columns: 1fr;
    padding-bottom: 100px;
  }

  .select-tests-page .selection-summary {
    position: static;
    order: 2;
  }

  .select-tests-page .tests-section {
    order: 1;
  }

  .select-tests-page .st-mobile-cart {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--st-border);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(10px);
  }

  .select-tests-page .st-mobile-cart-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .select-tests-page .st-mobile-cart-meta {
    min-width: 0;
  }

  .select-tests-page .st-mobile-cart-meta span {
    display: block;
    font-size: 0.8rem;
    color: var(--st-muted);
    font-weight: 600;
  }

  .select-tests-page .st-mobile-cart-meta strong {
    font-size: 1.15rem;
    color: #0f172a;
  }

  .select-tests-page .st-mobile-cart-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }

  .select-tests-page .st-mobile-view-btn {
    padding: 10px 14px;
    border: 1px solid var(--st-border);
    background: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
  }

  .select-tests-page .st-mobile-book-btn {
    padding: 10px 18px;
    border: none;
    background: var(--st-primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
  }

  .select-tests-page .st-mobile-book-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
  }

  .select-tests-page .sort-select {
    max-width: none;
    flex: 0 0 auto;
    min-width: 7.5rem;
  }

  .select-tests-page .tests-grid {
    grid-template-columns: 1fr;
  }

  .select-tests-page .summary-header .summary-title {
    font-size: 0.95rem;
  }
}

@media (min-width: 1025px) {
  .select-tests-page .booking-modal.show {
    align-items: center;
  }

  .select-tests-page .booking-form-container {
    border-radius: 16px;
    max-height: 90vh;
  }
}

@media (max-width: 768px) {
  .select-tests-page .form-row {
    grid-template-columns: 1fr;
  }

  .select-tests-page .st-search-row {
    flex-direction: column;
  }

  .select-tests-page .sort-select {
    width: 100%;
    max-width: none;
  }
}
