/* ==========================================================================
   SANJARMedi Public Website Stylesheet
   Design System: Modern Healthcare (Premium Slate & Blue)
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Brand Design Tokens */
:root {
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Color Palette */
  --primary: hsl(215, 90%, 52%); /* Brand Blue */
  --primary-hover: hsl(215, 90%, 45%);
  --primary-light: hsl(215, 90%, 96%);
  --primary-ink: hsl(215, 90%, 40%); /* Brand blue as readable type */

  --secondary: hsl(150, 75%, 38%); /* Wellness Green */
  --secondary-hover: hsl(150, 75%, 32%);
  --secondary-light: hsl(150, 75%, 96%);
  --secondary-ink: hsl(150, 75%, 26%);

  --accent: hsl(187, 85%, 42%); /* Medical Teal */
  --accent-light: hsl(187, 85%, 96%);
  --accent-ink: hsl(187, 85%, 26%);

  --danger: hsl(354, 76%, 53%); /* Alert Red */
  --danger-light: hsl(354, 76%, 96%);
  --danger-ink: hsl(354, 70%, 42%);

  --rating-bg: hsl(45, 100%, 94%);
  --rating-ink: hsl(42, 100%, 25%);

  --warning: hsl(35, 92%, 52%); /* Alert Orange */
  --warning-light: hsl(35, 92%, 96%);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, hsl(215, 90%, 52%) 0%, hsl(200, 95%, 48%) 100%);
  --grad-hero: radial-gradient(circle at top right, hsl(215, 90%, 96%) 0%, hsl(220, 30%, 99%) 100%);
  --grad-glow: radial-gradient(800px circle at 50% 200px, rgba(26, 115, 232, 0.06), transparent 80%);

  /* Light Theme Neutrals */
  --bg-app: hsl(220, 20%, 98%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-sidebar: hsl(0, 0%, 100%);
  --text-main: hsl(220, 25%, 15%);
  --text-secondary: hsl(220, 15%, 42%);
  /* 65% lightness left the footer and search label at 2.5:1 on white. */
  --text-muted: hsl(220, 10%, 48%);
  --border-color: hsl(220, 15%, 90%);
  --border-light: hsl(220, 15%, 95%);

  /* Layout Metrics */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --shadow-sm: 0 2px 8px rgba(26, 115, 232, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 115, 232, 0.06);
  --shadow-lg: 0 16px 48px rgba(26, 115, 232, 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(26, 115, 232, 0.04);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1280px;
  --header-height: 80px;
  --container-pad: var(--space-md);
  /* What a sticky in-page toolbar must clear. Re-declared per breakpoint. */
  --sticky-top: var(--header-height);
}

/* Dark Mode Tokens (Triggered via .dark-theme) */
.dark-theme {
  --bg-app: hsl(220, 28%, 8%);
  --bg-card: hsl(220, 24%, 12%);
  --bg-sidebar: hsl(220, 24%, 12%);
  --text-main: hsl(220, 20%, 94%);
  --text-secondary: hsl(220, 12%, 70%);
  --text-muted: hsl(220, 10%, 60%);

  --primary-light: hsl(215, 60%, 17%);
  --primary-ink: hsl(215, 95%, 74%);
  --secondary-light: hsl(150, 45%, 13%);
  --secondary-ink: hsl(150, 70%, 62%);
  --accent-light: hsl(187, 50%, 13%);
  --accent-ink: hsl(187, 75%, 62%);
  --danger-light: hsl(354, 45%, 15%);
  --danger-ink: hsl(354, 90%, 74%);
  --warning-light: hsl(35, 50%, 14%);
  --rating-bg: hsl(42, 55%, 14%);
  --rating-ink: hsl(45, 90%, 66%);
  --border-color: hsl(220, 20%, 20%);
  --border-light: hsl(220, 20%, 16%);

  --grad-hero: radial-gradient(circle at top right, hsl(220, 28%, 11%) 0%, hsl(220, 28%, 7%) 100%);
  --grad-glow: radial-gradient(800px circle at 50% 200px, rgba(26, 115, 232, 0.15), transparent 85%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-app);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: var(--grad-glow);
  background-repeat: no-repeat;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-app);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}
h1 { font-size: 2.75rem; letter-spacing: 0; }
h2 { font-size: 2rem; letter-spacing: 0; }
h3 { font-size: 1.4rem; letter-spacing: 0; }
h4 { font-size: 1.15rem; }
p {
  color: var(--text-secondary);
  line-height: 1.6;
}
a {
  color: var(--primary-ink);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

/* Container Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.subpage-view {
  width: 100%;
}

.hidden-section {
  display: none !important;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-normal);
}
.dark-theme .header-wrapper {
  background: rgba(18, 24, 38, 0.7);
}
.header-wrapper.scrolled {
  height: 68px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}
.dark-theme .header-wrapper.scrolled {
  background: rgba(18, 24, 38, 0.9);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary-ink);
  cursor: pointer;
}
.brand svg {
  stroke: var(--primary);
  fill: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}
.nav-link {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-secondary);
  position: relative;
  padding: var(--space-xs) 0;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-ink);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
}
.nav-link.active::after, .nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: var(--radius-pill);
}

@media (max-width: 900px) {
  .header-container {
    position: relative;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: var(--space-md);
    width: min(280px, calc(100vw - 32px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    display: block;
    padding: 0.75rem;
  }
  .nav-link::after {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 680px) {
  .header-wrapper {
    height: auto;
    min-height: 72px;
  }
  .header-container {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    gap: var(--space-xs);
    align-items: center;
    min-height: 72px;
  }
  .brand span {
    font-size: 1rem;
  }
  .header-actions {
    gap: 8px;
    align-items: center;
  }
  .theme-toggle,
  .mobile-nav-toggle {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.theme-toggle:hover {
  background: var(--border-light);
  color: var(--primary-ink);
  transform: scale(1.05);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}
.theme-toggle .sun-icon { display: none; }
.dark-theme .theme-toggle .moon-icon { display: none; }
.dark-theme .theme-toggle .sun-icon { display: block; }

/* ==========================================================================
   Auth User Avatar & Dropdown
   ========================================================================== */
.auth-user-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast);
  padding: 0;
}

.auth-avatar-btn:hover,
.auth-avatar-btn:focus-visible {
  border-color: var(--primary);
  color: var(--primary-ink);
}

.auth-avatar-btn svg {
  width: 20px;
  height: 20px;
}

.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 110;
  overflow: hidden;
}

.auth-dropdown.open {
  display: flex;
}

.auth-dropdown-header {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.auth-dropdown-item {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
  font-family: inherit;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.auth-dropdown-item:hover,
.auth-dropdown-item:focus-visible {
  background: var(--border-light);
  color: var(--primary-ink);
}

.auth-dropdown-logout {
  border-top: 1px solid var(--border-light);
  color: var(--danger-ink);
}

.auth-dropdown-logout:hover,
.auth-dropdown-logout:focus-visible {
  color: var(--danger-ink);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
}
.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 115, 232, 0.3);
}
.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 157, 88, 0.2);
}
.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--border-light);
  color: var(--primary-ink);
}
.btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-wrapper {
  background: var(--grad-hero); /* Theme-aware hero wash */
  padding: var(--space-xl) 0 var(--space-xl);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  /* 85vh alone ballooned the hero on tall monitors, leaving the content
     stranded in the middle of a mostly-empty band. */
  min-height: clamp(560px, 82vh, 780px);
  display: flex;
  align-items: center;
}

.hero-container.relative-z {
  position: relative;
  z-index: 2;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: flex-start;
}

@media (max-width: 992px) {
  .hero-content {
    align-items: center;
  }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--text-main);
  max-width: 800px;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 500px;
}

/* Elevated Search Bar */
/* ==========================================================================
   Hero Search Bar — Redesigned
   ========================================================================== */
.search-bar-engine {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dark-theme .search-bar-engine {
  background: var(--bg-card);
  border-color: var(--border-color);
}
.search-bar-engine:hover {
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.13), 0 4px 10px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
}

/* Label inside search */
.search-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  line-height: 1;
}

/* Input row: icon + text + button */
.search-input-row {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  padding: 6px 6px 6px 18px;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dark-theme .search-input-row {
  background: var(--bg-app);
  border-color: var(--border-color);
}
.search-input-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Field wrap (icon + input) */
.search-field-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.search-field-wrap svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  fill: none;
  flex-shrink: 0;
}
.search-field-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 500;
}
.dark-theme .search-field-wrap input {
  color: var(--text-main);
}
.search-field-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Inline search button */
.search-inline-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.28);
}
.search-inline-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.34);
}
.search-inline-btn svg {
  flex-shrink: 0;
}

/* Quick-category chips */
.search-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-app);
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.dark-theme .search-chip {
  background: var(--bg-app);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.search-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-ink);
  transform: translateY(-1px);
}



/* Quick Stats */

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: var(--space-md);
}

.stat-box {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 6px;
}

/* Hero Graphics Floating Cards */
.hero-graphic {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.clean-frame-outer {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-hero-img {
  width: 85%;
  height: 85%;
  object-fit: cover;
  border-radius: 50%; /* Circle framing for cleaner 3D aesthetic */
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15), 0 0 0 15px var(--bg-card);
  display: block;
}

.elevated-panel-small {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.8rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);
  color: var(--text-main);
}

.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
}

.icon-circle.text-primary {
  color: var(--primary-ink);
  background: var(--primary-light);
}

/* Availability is a positive signal, so it reads in the wellness green
   rather than the alert red it used to borrow. */
.icon-circle.text-secondary {
  color: var(--secondary-ink);
  background: var(--secondary-light);
}

.panel-text {
  display: flex;
  flex-direction: column;
}

.panel-text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.panel-top {
  top: 15%;
  right: -5%;
}

.panel-bottom {
  bottom: 10%;
  left: -5%;
}

.floating-cross {
  position: absolute;
  top: 26%;
  left: 2%;
  color: var(--primary-ink);
  opacity: 0.16;
  filter: drop-shadow(0 15px 25px rgba(37, 99, 235, 0.12));
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .panel-top { right: 5%; }
  .panel-bottom { left: 5%; }
  .floating-cross { left: 10%; }
}

.floating-anim-1 { animation: float1 5s infinite ease-in-out; }
.floating-anim-2 { animation: float2 7s infinite ease-in-out alternate-reverse; }
.floating-anim-3 { animation: float1 6s infinite ease-in-out alternate-reverse; }

@keyframes float1 {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

@keyframes float2 {
  0% { transform: translateY(0px); }
  50% { transform: translateY(15px); }
  100% { transform: translateY(0px); }
}
.trust-strip {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  overflow: hidden;
}
.trust-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.25rem 0 0.25rem;
}
@media (max-width: 768px) {
  .trust-strip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Individual trust badge */
.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-app);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.trust-badge:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.trust-badge span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.trust-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trust-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--primary-ink);
}


/* ==========================================================================
   Quick Navigation Blocks (Cards Grid)
   ========================================================================== */
.section-title-wrap {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.section-title-wrap p {
  max-width: 600px;
  margin: var(--space-xs) auto 0 auto;
}

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.quick-nav-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.quick-nav-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.quick-nav-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.quick-nav-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-blue { background: var(--primary-light); color: var(--primary-ink); }
.icon-green { background: var(--secondary-light); color: var(--secondary-ink); }
.icon-teal { background: var(--accent-light); color: var(--accent-ink); }

.quick-nav-card h3 {
  font-size: 1.25rem;
}
.quick-nav-card p {
  font-size: 0.875rem;
}
.quick-nav-link {
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-xxs);
  color: var(--primary-ink);
  margin-top: auto;
}
.quick-nav-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  transition: transform var(--transition-fast);
}
.quick-nav-card:hover .quick-nav-link svg {
  transform: translateX(4px);
}

/* ==========================================================================
    Benefits Block
   ========================================================================== */
.benefits-section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border-color);
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  align-items: center;
}
/* ==========================================================================
   Savings Showcase Card
   ========================================================================== */
.savings-showcase-card {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.savings-showcase-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, rgba(15,23,42,0) 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}
.savings-showcase-header {
  position: relative;
  z-index: 1;
}
.savings-badge {
  display: inline-block;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.savings-showcase-header h3 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #fff;
  line-height: 1.2;
}
.savings-showcase-header p {
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.6;
}
.savings-comparisons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.comparison-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  transition: transform 0.2s, background 0.2s;
}
.comparison-item:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(5px);
}
.comparison-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.comparison-icon svg {
  width: 24px;
  height: 24px;
}
.comparison-icon.icon-blue svg { stroke: #60a5fa; }
.comparison-icon.icon-green svg { stroke: #4ade80; }
.comparison-icon.icon-teal svg { stroke: #2dd4bf; }

.comparison-details {
  flex: 1;
}
.comparison-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.3rem;
}
.price-compare {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
}
.market-price {
  color: #94a3b8;
  text-decoration: line-through;
}
.sanjar-price {
  color: #f8fafc;
  font-weight: 700;
}
.savings-tag {
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.savings-showcase-footer {
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}
.savings-showcase-footer .btn {
  width: 100%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.savings-showcase-footer .btn:hover {
  background: #fff;
  color: #0f172a;
}

/* Mobile specific tweaks for savings card */
@media (max-width: 768px) {
  .savings-showcase-card {
    padding: 1.5rem;
    gap: 1.5rem;
  }
  .savings-showcase-header h3 {
    font-size: 1.7rem;
  }
  .savings-showcase-header p {
    font-size: 0.95rem;
  }
  .comparison-item {
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
  }
  .comparison-details h4 {
    font-size: 0.95rem;
    line-height: 1.3;
  }
  .price-compare {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-top: 0.4rem;
  }
  .savings-tag {
    align-self: center;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.benefit-item {
  display: flex;
  gap: var(--space-sm);
}
.benefit-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--secondary-light);
  color: var(--secondary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.benefit-check svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
}
.benefit-text h4 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xxs);
}
.benefit-text p {
  font-size: 0.875rem;
}

.care-journey-section {
  padding: var(--space-xl) var(--space-md);
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.journey-step {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.journey-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--primary-light);
  color: var(--primary-ink);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}
.journey-step h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
}
.journey-step p {
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .journey-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Search & Listing Portal (Sub-routing Panels)
   ========================================================================== */
.listing-section {
  padding: var(--space-xl) 0;
  background: var(--bg-app);
}

.search-portal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-md);
  align-items: start;
}

/* Left Sidebar Filter */
.filter-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: 100px;
  height: fit-content;
}

@media (max-width: 992px) {
  .search-portal-layout {
    grid-template-columns: 1fr;
  }
  .filter-sidebar {
    position: static;
    top: auto;
  }
}
@media (max-width: 576px) {
  .search-portal-layout {
    gap: var(--space-sm);
  }
}
.filter-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}
.filter-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.filter-clear-btn {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--primary-ink);
  background: none;
  border: none;
  cursor: pointer;
}

.filter-group-title {
  font-weight: 700;
  font-size: 0.825rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.form-group-filter {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
}
.form-input-filter {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}
.form-input-filter:focus {
  border-color: var(--primary);
}

.checkbox-label-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-xxs) 0;
}
.checkbox-input {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  accent-color: var(--primary);
  cursor: pointer;
}

/* Listings Container */
.listings-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.listing-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}
.listing-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Provider Listing Card */
.provider-card {
  /* Each card carries its module's accent, so a badge colour means something. */
  --card-accent: var(--primary);
  --card-accent-ink: var(--primary-ink);
  --card-accent-light: var(--primary-light);

  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-areas:
    "media content"
    "media footer";
  grid-template-rows: 1fr auto;
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal),
    border-color var(--transition-normal);
  position: relative;
}
.provider-card[data-category="pathology"] {
  --card-accent: var(--accent);
  --card-accent-ink: var(--accent-ink);
  --card-accent-light: var(--accent-light);
}
.provider-card[data-category="ultrasound"] {
  --card-accent: var(--secondary);
  --card-accent-ink: var(--secondary-ink);
  --card-accent-light: var(--secondary-light);
}

@media (hover: hover) {
  .provider-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--card-accent);
  }
}
/* Touch devices keep :hover applied after a tap, which leaves cards stuck
   lifted; they get a press response instead. */
.provider-card:active {
  transform: scale(0.994);
}

.provider-media {
  grid-area: media;
  border-radius: var(--radius-sm);
  background: var(--card-accent-light, var(--primary-light));
  overflow: hidden;
  position: relative;
  aspect-ratio: 7 / 6;
  min-height: 120px;
}
.provider-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.provider-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.provider-name {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 4px;
  /* Long branch names must not push the rating or the price out of the card. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rating-count {
  font-weight: 600;
  opacity: 0.75;
}
.media-rating {
  display: none;
}
.provider-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xxs);
}
.provider-badge {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: var(--primary-light);
  padding: var(--space-xxs) var(--space-xs);
  border-radius: var(--radius-xs);
}
.provider-card .provider-badge {
  color: var(--card-accent-ink);
  background: var(--card-accent-light);
}
.provider-rating {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rating-ink);
  background: var(--rating-bg);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: fit-content;
}
.provider-location {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.provider-location svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  flex: 0 0 14px;
}
.provider-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.provider-footer-row {
  grid-area: footer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-light);
}

.provider-actions-row,
.detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.direction-action {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-color));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.direction-action:hover,
.direction-action:focus-visible {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.direction-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 16px;
}

.direction-action-compact {
  padding-inline: 0.72rem;
}

.price-strike {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.payable-fee-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
}
.payable-fee-wrap strong {
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--card-accent-ink, var(--primary-ink));
  font-variant-numeric: tabular-nums;
}
.fee-save-chip {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--secondary-ink);
  background: var(--secondary-light);
  border: 1px solid color-mix(in srgb, var(--secondary) 22%, transparent);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ==========================================================================
   Details / Booking Subpage
   ========================================================================== */
.details-subpage-layout {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: var(--space-md);
  min-width: 0;
}
.details-subpage-layout > * {
  min-width: 0;
}
@media (max-width: 992px) {
  .details-subpage-layout {
    grid-template-columns: 1fr;
  }
}

.details-main-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

/* Gallery slider/grid */
.detail-gallery {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  grid-template-rows: minmax(0, 1fr);
  gap: var(--space-xs);
  height: clamp(240px, 26vw, 340px);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.gallery-cover {
  background: var(--primary-light);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.gallery-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 0;
}
.gallery-strip-item {
  flex: 1;
  background: var(--border-light);
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.gallery-cover img,
.gallery-strip-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gallery-strip-item span {
  position: absolute;
  left: var(--space-xs);
  right: var(--space-xs);
  bottom: var(--space-xs);
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-md);
  min-width: 0;
}
.detail-card h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.35rem;
}

/* --- Provider head card --------------------------------------------------
   The title used to share a flex row with the rating and the directions
   button, which squeezed both to nothing on a phone. Everything now stacks
   in reading order and the actions get a rail of their own. */
.detail-head-card {
  --card-accent: var(--primary);
  --card-accent-ink: var(--primary-ink);
  --card-accent-light: var(--primary-light);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  border-top: 3px solid var(--card-accent);
}
.detail-head-card[data-category="pathology"] {
  --card-accent: var(--accent);
  --card-accent-ink: var(--accent-ink);
  --card-accent-light: var(--accent-light);
}
.detail-head-card[data-category="ultrasound"] {
  --card-accent: var(--secondary);
  --card-accent-ink: var(--secondary-ink);
  --card-accent-light: var(--secondary-light);
}
.detail-head-card .provider-badge {
  color: var(--card-accent-ink);
  background: var(--card-accent-light);
}
.detail-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.detail-head-card h2 {
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  line-height: 1.22;
  margin: 0;
  overflow-wrap: break-word;
}
.detail-location-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}
.detail-location-row svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 2px;
  color: var(--text-muted);
}
.detail-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xxs);
}
.detail-jump-btn {
  display: none;
}
.detail-jump-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* --- Pricing aside ------------------------------------------------------ */
.details-aside {
  min-width: 0;
}
.pricing-aside-card {
  border-top: 4px solid var(--primary);
  position: sticky;
  top: 100px;
}
.pricing-aside-card > h3 {
  margin-bottom: var(--space-sm);
}
#side-pricing-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.pricing-aside-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}
.pricing-aside-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
}
.pricing-aside-fee {
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--primary-ink);
  font-variant-numeric: tabular-nums;
}
.pricing-aside-row .price-strike {
  font-size: 1.05rem;
}
.pricing-aside-note {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

/* --- Gallery dots (carousel mode only) ---------------------------------- */
.detail-gallery-wrap {
  position: relative;
}
.gallery-dots {
  display: none;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-xs);
}
.gallery-dots.is-visible {
  display: flex;
}
.gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-color);
  transition: width var(--transition-fast), background var(--transition-fast);
}
.gallery-dot.active {
  width: 18px;
  background: var(--primary);
}

/* Doctor & Services Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: var(--space-sm);
  max-width: 100%;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.table-element {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.table-element th,
.table-element td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.table-element td.wrap-text,
.table-element td p {
  white-space: normal;
}
.table-element th {
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-app);
}
.table-element tbody tr:hover {
  background: var(--bg-app);
}

/* ==========================================================================
   Booking Drawer Widget (Slide-out panel/Modal)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 24, 38, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.booking-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border-color);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}
.booking-drawer.active {
  right: 0;
}

.drawer-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-drawer-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.close-drawer-btn:hover {
  background: var(--border-light);
  color: var(--danger-ink);
}

.drawer-body {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group-modal {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
}
.form-group-modal label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group-modal input,
.form-group-modal select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}
.form-group-modal input:focus {
  border-color: var(--primary);
}

/* Pricing Breakdown widget */
.pricing-breakdown {
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.price-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.price-breakdown-row.total-row {
  font-weight: 700;
  color: var(--text-main);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-color);
  font-size: 1.05rem;
}

.drawer-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-color);
  background: var(--bg-app);
}

/* ==========================================================================
   Toasts system
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.toast-notice {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  max-width: 320px;
}
.toast-notice.success {
  border-left-color: var(--secondary);
}
.toast-notice.active {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-wrap {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: var(--space-lg) 0 var(--space-md) 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.footer-partner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: clamp(24px, 4vw, 40px);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--primary-light), var(--secondary-light));
}
.footer-partner-eyebrow {
  color: var(--primary-ink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-partner-banner h2 {
  margin: 8px 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}
.footer-partner-banner p {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.footer-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-shrink: 0;
  min-height: 56px;
  padding: 16px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--primary-ink);
  color: var(--bg-card);
  font: inherit;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.footer-register-btn:hover { background: var(--primary-hover); }
.footer-login-links {
  display: grid;
  gap: 8px;
  list-style: none;
}
.footer-login-links a,
.footer-login-links button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.footer-login-links a:hover,
.footer-login-links button:hover {
  background: var(--primary-light);
  border-color: var(--primary-ink);
  color: var(--primary-ink);
}
.footer-register-btn:focus-visible,
.footer-login-links a:focus-visible,
.footer-login-links button:focus-visible {
  outline: 3px solid var(--primary-ink);
  outline-offset: 4px;
}
@media (max-width: 768px) {
  .footer-partner-banner { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer-register-btn { width: 100%; }
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer-col h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--primary-ink);
}
.footer-credit {
  margin-left: auto;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.footer-credit strong {
  color: var(--primary-ink);
}
.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
@media (max-width: 576px) {
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }
}

/* ==========================================================================
   Patient Portal Authentication & Dashboard Styles
   ========================================================================== */
dialog.auth-dialog-modal,
dialog.sim-dialog-modal {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 90%;
  outline: none;
  z-index: 1002;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
}

.partner-dialog-modal {
  max-width: 620px;
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

.partner-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.auth-modal-header,
.sim-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.close-auth-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.close-auth-btn:hover {
  background: var(--border-light);
  color: var(--danger-ink);
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-md);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: var(--space-xs) 0;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  color: var(--primary-ink);
  border-bottom-color: var(--primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Patient Dashboard Layout */
.patient-dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  align-items: start;
  animation: fade-in-up 0.4s ease-out;
}

@media (max-width: 900px) {
  .patient-dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
    top: auto;
    padding: var(--space-sm);
  }
  .dashboard-viewport {
    min-height: auto;
    padding: var(--space-sm);
  }
  .dashboard-sidebar .dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: visible;
  }
  .dashboard-sidebar .dashboard-nav::-webkit-scrollbar {
    display: none;
  }
  .dashboard-sidebar .dash-nav-btn {
    flex: 0 0 auto;
    white-space: normal;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: left;
    justify-content: flex-start;
    background: var(--bg-app);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
  }
  .dashboard-sidebar .dash-nav-btn.active {
    background: var(--primary-light);
    color: var(--primary-ink);
    border-color: var(--primary);
  }
  .profile-summary-card {
    padding: 0 0 var(--space-sm);
  }
  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
  .dash-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  .dash-card-header h3 {
    font-size: 1.05rem;
  }
  .dash-card-header p {
    font-size: 0.82rem;
  }
  .record-item-card {
    padding: var(--space-sm);
  }
  .record-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  .record-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .record-actions .btn {
    flex: 1;
    min-width: calc(50% - var(--space-xxs));
  }
  .table-wrap {
    margin-left: calc(-1 * var(--space-sm));
    margin-right: calc(-1 * var(--space-sm));
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    width: calc(100% + 2 * var(--space-sm));
  }
  .chat-messages-container {
    max-height: 220px !important;
  }
  .chatbot-container {
    height: 420px;
  }
}

@media (max-width: 480px) {
  .dashboard-sidebar .dash-nav-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    min-height: 34px;
  }
  .patient-wallet-card strong {
    font-size: 1.1rem;
  }
  .complaint-thread-box h4 {
    font-size: 0.95rem;
  }
  .complaint-thread-box #complaint-reply-text {
    font-size: 0.85rem;
  }
  .new-complaint-box .form-group-modal,
  .complaint-thread-box .form-group-modal {
    gap: var(--space-xxs);
  }
  .new-complaint-box form > div:last-child,
  .reply-complaint-form {
    flex-wrap: wrap;
  }
  .new-complaint-box form > div:last-child .btn,
  .reply-complaint-form .btn {
    width: 100%;
  }
}

.dashboard-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-glass);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.profile-summary-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) 0 var(--space-md);
  border-bottom: 1px dashed var(--border-color);
}

.profile-summary-card .profile-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.profile-avatar {
  width: 52px;
  height: 52px;
  background: var(--grad-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.25);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.profile-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  word-break: break-all;
  line-height: 1.3;
}

.wallet-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
}

.wallet-inline .wallet-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wallet-inline .wallet-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  display: inline-block;
}

.wallet-inline strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.85rem var(--space-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.dash-nav-btn:hover {
  background: var(--bg-app);
  color: var(--primary-ink);
  transform: translateX(4px);
}

.dash-nav-btn.active {
  background: var(--primary-light);
  color: var(--primary-ink);
  border-left-color: var(--primary);
  font-weight: 700;
}

.dashboard-viewport {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  min-height: 480px;
}

.dash-card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.dash-records-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.record-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.record-item-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.record-header-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: var(--space-xs);
}

.record-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-xs);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.record-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* Simulation details styling */
.sim-payment-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.sim-details-box {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.875rem;
}

.sim-detail-row {
  display: flex;
  justify-content: space-between;
  word-break: break-all;
}

.sim-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

/* Chatbot Premium UI */
.chatbot-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-app);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 550px;
  box-shadow: var(--shadow-md);
}

.chat-message {
  margin-bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
}

.chat-message.user {
  align-items: flex-end;
}

.chat-message.bot {
  align-items: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.chat-message.user .message-bubble {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md) var(--radius-md) 0 var(--radius-md);
}

.chat-message.bot .message-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 0;
}

.chat-message .message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-tab-content {
  animation: fade-in-up 0.3s ease-out;
}

/* ==========================================================================
   About Us Section
   ========================================================================== */
.about-section {
  padding: var(--space-xl) 0;
  background: var(--bg-body);
  border-top: 1px solid var(--border-color);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.about-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.about-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  color: var(--primary-ink);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.about-icon svg {
  width: 26px;
  height: 26px;
}

.about-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: var(--space-xxs);
  color: var(--text-primary);
}

.about-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Custom Calendar UI */
.custom-calendar-dates {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.custom-calendar-dates::-webkit-scrollbar {
  height: 4px;
}
.custom-calendar-dates::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.calendar-date-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 60px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.calendar-date-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.calendar-date-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-body);
}
.calendar-date-btn span.day-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
}
.calendar-date-btn span.day-num {
  font-size: 1.1rem;
  font-weight: 700;
}

.custom-calendar-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.calendar-slot-btn {
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.calendar-slot-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.calendar-slot-btn:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary-ink);
}

/* ==========================================================================
   MOBILE RESPONSIVE — Full Rewrite
   Covers all breakpoints: 992px, 768px, 576px, 480px
   ========================================================================== */

/* Global baseline — prevent ALL horizontal overflow */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  min-width: 0; /* allow flex/grid children to shrink below content size */
}

/* Titles should never overflow */
h1, h2, h3, h4, h5 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Inputs should never burst containers */
input, textarea, select {
  max-width: 100%;
}

/* -------------------------
   TABLET — max-width: 992px
   ------------------------- */
@media (max-width: 992px) {
  /* Hero */
  .hero-wrapper {
    min-height: auto;
    padding: 4rem 0 2rem;
  }
  .hero-container {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem;
  }
  .hero-content {
    align-items: center;
    margin-top: var(--space-sm);
  }
  .hero-description {
    max-width: 100%;
  }
  .search-bar-engine {
    max-width: 100%;
  }
  .hero-stats {
    justify-content: center;
    gap: 2rem;
  }

  /* Hero graphic — hide on small tablets to avoid overflow */
  .hero-graphic {
    display: none;
  }

  /* Search & Listing */
  .search-portal-layout {
    grid-template-columns: 1fr;
  }
  .filter-sidebar {
    position: static;
    top: auto;
  }

  /* Details */
  .details-subpage-layout {
    grid-template-columns: 1fr;
  }

  /* Benefits */
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------
   MOBILE — max-width: 768px
   ------------------------- */
@media (max-width: 768px) {
  /* Base spacing */
  :root {
    --space-xl: 2.5rem;
    --space-lg: 1.8rem;
  }

  /* Hero */
  .hero-wrapper {
    padding: 3rem 0 1.5rem;
  }
  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1.2;
    padding: 0 4px;
    margin-top: var(--space-sm);
  }
  .hero-description {
    font-size: 1rem;
    padding: 0 4px;
  }

  /* Search Bar — mobile tweaks */
  .search-bar-engine {
    width: 100%;
    box-sizing: border-box;
    padding: 1.1rem 1.1rem;
  }
  .search-input-row {
    padding: 5px 5px 5px 14px;
  }
  .search-inline-btn span {
    display: none; /* show icon only on very small screens */
  }
  .search-inline-btn {
    padding: 0.65rem 0.9rem;
  }

  /* Stats */
  .hero-stats {
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem 2rem;
    width: 100%;
  }
  .stat-box {
    flex: 1 1 80px;
    text-align: center;
  }
  .stat-num {
    font-size: 1.6rem;
  }

  /* Quick Nav Cards — 2x1 grid */
  .quick-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .quick-nav-grid .quick-nav-card:first-child {
    grid-column: 1 / -1;
  }
  .quick-nav-card p {
    font-size: 0.85rem;
  }
  .quick-nav-card h3 {
    font-size: 1.05rem;
  }

  /* Benefits */
  .benefits-section {
    padding: 2rem 0;
  }
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .benefits-photo-card {
    min-height: 280px;
  }
  .benefits-photo-card img {
    height: 280px;
  }
  .savings-ledger {
    position: static;
    margin: 0 1rem 1rem;
    border-radius: var(--radius-sm);
  }
  .benefits-list {
    padding: 0 0.5rem;
  }

  /* Journey Steps */
  .care-journey-section {
    padding: 2rem 1rem;
  }
  .journey-grid {
    grid-template-columns: 1fr;
  }

  /* Listing */
  .listing-section {
    padding: 1.5rem 0;
  }
  .search-portal-layout {
    gap: 0.75rem;
  }
  .listings-wrapper {
    gap: 0.75rem;
  }
  .listing-meta-row {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Patient Dashboard */
  .patient-dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
    padding: 0.75rem;
  }
  .dashboard-viewport {
    min-height: auto;
    padding: 1rem;
  }

  /* Dashboard Nav — vertical compact list on mobile */
  .dashboard-sidebar .dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    overflow: visible;
  }
  .dashboard-sidebar .dash-nav-btn {
    flex: 0 0 auto;
    white-space: normal;
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: left;
    justify-content: flex-start;
    background: var(--bg-app);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
  }
  .dashboard-sidebar .dash-nav-btn.active {
    background: var(--primary-light);
    color: var(--primary-ink);
    border-color: var(--primary);
  }
  .dashboard-sidebar .dash-nav-btn:active {
    transform: scale(0.98);
  }
  .dashboard-sidebar .dashboard-nav::-webkit-scrollbar {
    display: none;
  }

  /* Header */
  .header-wrapper {
    height: auto;
    min-height: 70px;
  }
  .header-container {
    padding-top: 1rem;
    padding-bottom: 1rem;
    align-items: center;
    min-height: 70px;
  }
  .theme-toggle,
  .mobile-nav-toggle {
    width: 40px;
    height: 40px;
  }

  /* Modals */
  .modal-inner {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* -------------------------
   SMALL MOBILE — max-width: 576px
   ------------------------- */
@media (max-width: 576px) {
  /* Container padding */
  :root {
    --container-pad: 1rem;
  }

  /* Hero */
  .hero-wrapper {
    padding: 3.5rem 0 1.5rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-description {
    font-size: 0.92rem;
  }

  /* Stats compact */
  .stat-num {
    font-size: 1.4rem;
  }
  .stat-lbl {
    font-size: 0.78rem;
  }

  /* Quick Nav Cards */
  .quick-nav-card {
    padding: 1rem;
    gap: 0.5rem;
  }
  .quick-nav-icon {
    width: 42px;
    height: 42px;
  }
  .quick-nav-icon svg {
    width: 22px;
    height: 22px;
  }

  /* Provider card */
  .provider-avatar {
    width: 60px;
    height: 60px;
  }

  /* Patient wallet card */
  .patient-wallet-card strong {
    font-size: 1.4rem;
  }

  /* Footer bottom stacked */
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Filters */
  .filter-sidebar {
    padding: 1rem;
  }

  /* Details page tabs */
  .detail-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* -------------------------
   EXTRA SMALL — max-width: 400px
   ------------------------- */
@media (max-width: 400px) {
  .hero-wrapper {
    padding: 3rem 0 1rem;
  }
  .hero-title {
    font-size: 1.55rem;
  }
  .hero-stats {
    gap: 0.75rem 1.25rem;
  }
  .stat-num {
    font-size: 1.25rem;
  }
  .search-bar-engine.elevated-panel {
    padding: 0.75rem;
  }
  .search-inline-btn {
    font-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  .partner-two-col {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MOBILE POLISH — Remaining Gaps & Touch Improvements
   ========================================================================== */

/* Touch-friendly minimum tap targets */
@media (pointer: coarse) {
  .btn,
  .mobile-nav-toggle,
  .theme-toggle,
  .nav-link,
  .dash-nav-btn,
  .cat-pill,
  .calendar-date-btn,
  .calendar-slot-btn,
  .close-drawer-btn,
  .close-auth-btn,
  .filter-clear-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Booking drawer — full width on small screens */
@media (max-width: 480px) {
  .booking-drawer {
    max-width: 100vw;
    width: 100vw;
  }
  .drawer-header {
    padding: var(--space-sm);
  }
  .drawer-body {
    padding: var(--space-sm);
  }
  .drawer-body .form-group-modal input,
  .drawer-body .form-group-modal select {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }
}

/* ==========================================================================
   REDESIGNED CATEGORIES & MOBILE FILTERS
   ========================================================================== */

/* Category Tab Grid */
.category-tab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.category-tab-grid .cat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.8rem var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  width: 100%;
  border: 1.5px solid transparent;
}

.category-tab-grid .cat-pill svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-tab-grid .cat-pill.btn-outline {
  border-color: var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-card);
}

.category-tab-grid .cat-pill.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-tab-grid .cat-pill.btn-primary {
  background: var(--grad-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

.category-tab-grid .cat-pill.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 115, 232, 0.25);
}

/* Mobile Filter Trigger Button (hidden by default on desktop) */
.mobile-filter-btn {
  display: none;
}

/* Close Filter Button (hidden on desktop) */
.close-filter-btn {
  display: none;
}

/* Only the mobile sheet needs a dismiss action — desktop filters apply live. */
.filter-apply-btn {
  display: none;
}

@media (max-width: 992px) {
  /* Redesign category bar for mobile screen */
  .category-tab-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
  }
  
  .category-tab-grid .cat-pill {
    padding: 0.75rem var(--space-xs);
    font-size: 0.8rem;
  }
  
  .category-tab-grid .cat-pill svg {
    width: 16px;
    height: 16px;
  }

  /* Show mobile filter toggle button */
  .mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xxs);
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-weight: 600;
  }
  
  .mobile-filter-btn svg {
    stroke-width: 2.5;
  }

  /* Turn filter sidebar into slide-out drawer on mobile */
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    z-index: 1010; /* high index to overlap headers but match portals */
    transition: left var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    border-radius: 0;
    overflow-y: auto;
    border: none;
    border-right: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    padding: var(--space-md);
  }
  
  .filter-sidebar.active {
    left: 0;
  }
  
  .filter-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-xs);
  }

  /* Show close filter button in mobile sidebar */
  .close-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
  }
  
  .close-filter-btn:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
  }
}

/* Chatbot — better sizing on small screens */
@media (max-width: 576px) {
  .chatbot-container {
    height: 380px;
  }
  .message-bubble {
    max-width: 90%;
    font-size: 0.9rem;
  }
  #chatbot-query-form {
    padding: var(--space-xs);
    gap: var(--space-xs);
  }
}

/* Auth dialog — full width on very small screens */
@media (max-width: 400px) {
  dialog.auth-dialog-modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    margin: 0;
    padding: var(--space-sm);
  }
  dialog.auth-dialog-modal::backdrop {
    border-radius: 0;
  }
}

/* Payment simulation dialog — full width on small screens */
@media (max-width: 480px) {
  dialog.sim-dialog-modal {
    width: 95vw;
    max-width: 95vw;
  }
  .sim-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* Prevent text overflow in all cards */
.quick-nav-card,
.about-card,
.journey-step,
.detail-card,
.record-item-card {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Tables — better mobile scroll UX */
@media (max-width: 768px) {
  .table-wrap {
    position: relative;
  }
  .table-wrap::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--bg-card));
    pointer-events: none;
    float: right;
  }
}

/* Profile card on mobile — compact layout */
@media (max-width: 480px) {
  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
  .profile-info h3 {
    font-size: 0.9rem;
  }
  .profile-info p {
    font-size: 0.72rem;
  }
  .dashboard-sidebar .dash-nav-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    min-height: 34px;
  }
}

/* Footer link columns — 2-col grid on tablets */
@media (min-width: 577px) and (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

/* Smooth scrolling for all anchor clicks */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-sm));
}

/* Category pill scrollbar styling */
.custom-calendar-dates::-webkit-scrollbar,
[style*="overflow-x: auto"]::-webkit-scrollbar {
  height: 4px;
}
.custom-calendar-dates::-webkit-scrollbar-thumb,
[style*="overflow-x: auto"]::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Header actions — prevent overflow on tiny screens */
@media (max-width: 400px) {
  .header-wrapper {
    min-height: 64px;
  }
  .header-container {
    padding-top: var(--space-xs);
    padding-bottom: var(--space-xs);
  }
  .header-actions {
    gap: 4px;
  }
  .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
}

/* Hero section — ensure proper spacing on all screens */
@media (max-width: 992px) {
  .hero-wrapper {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-md);
  }
}

/* Quick nav cards — ensure minimum touch target */
@media (max-width: 768px) {
  .quick-nav-card {
    padding: var(--space-sm);
    min-height: 120px;
  }
}

/* Booking drawer form — prevent iOS zoom on input focus */
@media (max-width: 768px) {
  .drawer-body input,
  .drawer-body select,
  .drawer-body textarea {
    font-size: 16px !important;
  }
}

/* Auth dialog — prevent iOS zoom on input focus */
@media (max-width: 768px) {
  dialog.auth-dialog-modal input,
  dialog.auth-dialog-modal select {
    font-size: 16px !important;
  }
}

/* Fix for iOS safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer-wrap {
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  }
  .booking-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Responsive Table Elements on Mobile */
@media (max-width: 768px) {
  /* Prevent table from staying wide */
  .table-element {
    min-width: auto !important;
    width: 100% !important;
  }

  /* Hide table headers */
  .table-element thead {
    display: none;
  }

  /* Make rows behave as card blocks */
  .table-element tr {
    display: block;
    padding: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
  }

  /* Make cells flex columns with left-aligned label and right-aligned value */
  .table-element td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
  }

  /* Strip border-bottom from the last content cell */
  .table-element td:nth-last-child(2) {
    border-bottom: none;
  }

  /* Add data-label dynamically before cell contents */
  .table-element td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    text-align: left;
    margin-right: var(--space-sm);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Action button container styling at the bottom of the card */
  .table-element td.table-action-cell {
    display: block;
    text-align: center;
    padding: var(--space-sm) 0 0 0;
    border-bottom: none;
    margin-top: var(--space-xs);
  }

  .table-element td.table-action-cell::before {
    display: none;
  }

  .table-element td.table-action-cell .btn {
    width: 100%;
    justify-content: center;
  }
}

/* end of stylesheet */

/* ==========================================================================
   Accessibility & Motion Polish
   Global keyboard affordance plus a reduced-motion escape hatch for the
   hero's perpetual float animations.
   ========================================================================== */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Cards that act as buttons get the same ring when tabbed to. */
.quick-nav-card:focus-visible,
.provider-card:focus-visible,
.search-chip:focus-visible,
.category-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .floating-anim-1,
  .floating-anim-2,
  .floating-anim-3 {
    animation: none !important;
  }
}

/* ==========================================================================
   ADVANCED UI LAYER
   Aurora hero, glass surfaces, scroll reveal, richer cards.
   Everything here degrades to the base styling if JS never runs.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Aurora hero — three slow blurred colour fields behind the content.
   -------------------------------------------------------------------------- */
.hero-wrapper::before,
.hero-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.hero-wrapper::before {
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  top: -14%;
  left: -10%;
  background: radial-gradient(circle, hsl(215 90% 58% / 0.46), transparent 70%);
  animation: aurora-drift-a 22s ease-in-out infinite alternate;
}

.hero-wrapper::after {
  width: 40vw;
  height: 40vw;
  max-width: 540px;
  max-height: 540px;
  right: -8%;
  bottom: -18%;
  background: radial-gradient(circle, hsl(187 85% 52% / 0.42), transparent 70%);
  animation: aurora-drift-b 27s ease-in-out infinite alternate;
}

.dark-theme .hero-wrapper::before {
  background: radial-gradient(circle, hsl(215 90% 55% / 0.34), transparent 68%);
}

.dark-theme .hero-wrapper::after {
  background: radial-gradient(circle, hsl(187 85% 45% / 0.30), transparent 68%);
}

/* A third field sits between them, tinted with the wellness green. */
.hero-container::before {
  content: '';
  position: absolute;
  width: 30vw;
  height: 30vw;
  max-width: 420px;
  max-height: 420px;
  left: 38%;
  top: 42%;
  border-radius: 50%;
  filter: blur(100px);
  background: radial-gradient(circle, hsl(150 75% 50% / 0.30), transparent 72%);
  animation: aurora-drift-a 31s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes aurora-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6%, 8%, 0) scale(1.14); }
}

@keyframes aurora-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(-8%, -6%, 0) scale(1); }
}

/* A fine grid over the wash gives the hero depth instead of a flat gradient. */
.hero-wrapper > .hero-container {
  position: relative;
}

.hero-wrapper {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text-main) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text-main) 5%, transparent) 1px, transparent 1px),
    var(--grad-hero);
  background-size: 56px 56px, 56px 56px, auto;
  background-position: center, center, center;
}


/* --------------------------------------------------------------------------
   Glass search surface
   -------------------------------------------------------------------------- */
.search-bar-engine {
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--bg-card) 60%, var(--border-color));
  box-shadow:
    0 24px 60px -20px rgba(15, 23, 42, 0.28),
    0 2px 8px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dark-theme .search-bar-engine {
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.search-bar-engine:hover {
  box-shadow:
    0 34px 74px -22px rgba(15, 23, 42, 0.34),
    0 4px 10px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Header condense on scroll
   -------------------------------------------------------------------------- */
.header-wrapper {
  transition: height var(--transition-normal), background var(--transition-normal),
    box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.header-wrapper.scrolled {
  border-bottom-color: transparent;
  box-shadow: 0 6px 24px -12px rgba(15, 23, 42, 0.22);
}

.dark-theme .header-wrapper.scrolled {
  box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.7);
}

/* A hairline progress bar tracks how far down the page the reader is. */
.header-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: var(--scroll-progress, 0%);
  background: var(--grad-primary);
  border-radius: 0 2px 2px 0;
  transition: width 90ms linear;
}

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Quick-nav cards — gradient edge on hover
   -------------------------------------------------------------------------- */
.quick-nav-card {
  position: relative;
  overflow: hidden;
}

.quick-nav-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.quick-nav-card:hover::before {
  transform: scaleX(1);
}

.quick-nav-icon {
  transition: transform var(--transition-normal);
}

.quick-nav-card:hover .quick-nav-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* --------------------------------------------------------------------------
   Provider cards — media zoom, scrim, sharper hover
   -------------------------------------------------------------------------- */
.provider-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.34), transparent 58%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.provider-media img {
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .provider-card:hover .provider-media img {
    transform: scale(1.07);
  }

  .provider-card:hover .provider-media::after {
    opacity: 1;
  }

  .provider-card:hover::before {
    transform: scaleY(1);
  }
}

.provider-card {
  overflow: hidden;
}

.provider-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--card-accent), color-mix(in srgb, var(--card-accent) 45%, transparent));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition-normal);
}

/* --------------------------------------------------------------------------
   Listing skeletons
   -------------------------------------------------------------------------- */
.listing-skeletons {
  display: grid;
  gap: var(--space-sm);
}

.listing-skeleton {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-areas:
    "media lines"
    "media foot";
  grid-template-rows: 1fr auto;
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.listing-skeleton .sk-media { grid-area: media; }
.listing-skeleton .sk-lines { grid-area: lines; }
.listing-skeleton .sk-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-light);
}
.listing-skeleton .sk-foot .sk-line { flex: 0 0 90px; }
.listing-skeleton .sk-btn { width: 108px; height: 34px; border-radius: var(--radius-xs); }

@media (max-width: 576px) {
  .listing-skeleton {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "media lines"
      "foot  foot";
    padding: 0.85rem;
    column-gap: 0.75rem;
  }
  .listing-skeleton .sk-media { aspect-ratio: 1 / 1; min-height: 0; }
  .listing-skeleton .sk-line.w90 { display: none; }
}

.sk {
  border-radius: var(--radius-sm);
  background:
    linear-gradient(90deg, var(--border-light) 0%, var(--border-color) 42%, var(--border-light) 82%)
    0 0 / 300% 100%;
  animation: sk-sweep 1.4s ease-in-out infinite;
}

.listing-skeleton .sk-media { aspect-ratio: 7 / 6; min-height: 120px; }
.listing-skeleton .sk-lines { display: grid; align-content: start; gap: 10px; }
.listing-skeleton .sk-line { height: 13px; }
.listing-skeleton .sk-line.w70 { width: 70%; }
.listing-skeleton .sk-line.w45 { width: 45%; }
.listing-skeleton .sk-line.w90 { width: 90%; }
.listing-skeleton .sk-line.tall { height: 22px; width: 55%; }

@keyframes sk-sweep {
  from { background-position: 150% 0; }
  to { background-position: -150% 0; }
}

/* --------------------------------------------------------------------------
   Hero stat counters hold their width while animating
   -------------------------------------------------------------------------- */
.stat-num {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .hero-wrapper::before,
  .hero-wrapper::after,
  .hero-container::before {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   Journey steps — a connecting rail ties 01 → 02 → 03 together
   -------------------------------------------------------------------------- */
.journey-grid {
  position: relative;
}

.journey-step {
  position: relative;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal),
    border-color var(--transition-normal);
}

.journey-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border-color));
}

/* The rail is drawn between cards, so it is hidden once they stack. */
@media (min-width: 901px) {
  .journey-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: calc(var(--space-md) + 18px);
    right: calc(var(--space-md) * -1);
    width: var(--space-md);
    height: 2px;
    background: linear-gradient(to right,
      color-mix(in srgb, var(--primary) 55%, transparent),
      color-mix(in srgb, var(--primary) 12%, transparent));
  }
}

.journey-step span {
  position: relative;
  overflow: hidden;
}

.journey-step:hover span {
  color: #fff;
  background: var(--primary);
}

/* --------------------------------------------------------------------------
   Trust strip — subtle lift, and the icons pick up the brand on hover
   -------------------------------------------------------------------------- */
.trust-badge {
  transition: border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

.trust-badge:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.trust-icon {
  transition: transform var(--transition-fast);
}

.trust-badge:hover .trust-icon {
  transform: scale(1.12);
}

/* --------------------------------------------------------------------------
   Benefits list — checkmarks animate in with the section
   -------------------------------------------------------------------------- */
.benefit-item {
  transition: transform var(--transition-fast);
}

.benefit-item:hover {
  transform: translateX(4px);
}

.benefit-check {
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.benefit-item:hover .benefit-check {
  transform: scale(1.12);
}

/* ==========================================================================
   MOBILE EXPERIENCE — Listing & Provider Detail
   --------------------------------------------------------------------------
   These two views were laid out for a desktop grid and merely allowed to
   stack on a phone: a 96px block of category buttons, one 520px card per
   screen, a provider title at 32px competing with a squeezed "Directions"
   button, and the booking price stranded below a full doctor table. This
   block rebuilds both for touch — a scrolling filter rail, a dense card, a
   swipeable gallery, and a booking action that is always reachable.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Category filters — a snap rail instead of a 2x2 block
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    /* Fallback only — the script overwrites this with the measured height. */
    --sticky-top: 72px;
  }

  .category-tab-grid {
    display: flex;
    gap: var(--space-xs);
    /* Bleed to the screen edges so the rail reads as scrollable. */
    margin-inline: calc(var(--container-pad) * -1);
    padding-inline: var(--container-pad);
    padding-block: 2px 4px;
    margin-bottom: var(--space-sm);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--container-pad);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--container-pad),
      #000 calc(100% - var(--container-pad)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--container-pad),
      #000 calc(100% - var(--container-pad)), transparent 100%);
  }
  .category-tab-grid::-webkit-scrollbar {
    display: none;
  }

  .category-tab-grid .cat-pill {
    flex: 0 0 auto;
    width: auto;
    scroll-snap-align: start;
    border-radius: var(--radius-pill);
    padding: 0.6rem 0.95rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  /* Lift on hover is a pointer affordance; on a rail it just clips the mask. */
  .category-tab-grid .cat-pill.btn-outline:hover,
  .category-tab-grid .cat-pill.btn-primary:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   2. Result count + Filters stay reachable down a long list
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .listing-meta-row {
    position: sticky;
    top: var(--sticky-top);
    z-index: 20;
    margin-inline: calc(var(--container-pad) * -1);
    margin-bottom: var(--space-xs);
    padding: 0.55rem var(--container-pad);
    background: color-mix(in srgb, var(--bg-app) 86%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: nowrap;
  }
  .listing-count {
    font-size: 0.82rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-filter-btn {
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
  }
}

/* --------------------------------------------------------------------------
   3. Filter panel becomes a bottom sheet
   Reaching a left drawer means stretching a thumb across the whole screen;
   a sheet rises into the thumb zone instead.
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .filter-sidebar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 84vh;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  }
  .filter-sidebar.active {
    left: 0;
    transform: translateY(0);
  }
  /* Grab handle — the affordance that says "drag or tap away to dismiss". */
  .filter-sidebar::before {
    content: '';
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--border-color);
  }
  .filter-sidebar {
    gap: 0.9rem;
  }

  /* Pinned to the sheet so it stays reachable while the filters scroll. */
  .filter-apply-btn {
    display: block;
    position: sticky;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    min-height: 48px;
    border-radius: var(--radius-sm);
  }
  .filter-apply-btn:disabled {
    opacity: 0.55;
    pointer-events: none;
  }
}

/* --------------------------------------------------------------------------
   4. The provider card — from one-per-screen to a scannable row
   140px of media on top plus two stacked full-width buttons made every card
   520px tall. Media becomes a 96px thumb, the actions share one row, and the
   saving is stated instead of left for the reader to subtract.
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .listings-wrapper {
    gap: 0.7rem;
  }

  .provider-card {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "media content"
      "footer footer";
    grid-template-rows: auto auto;
    column-gap: 0.8rem;
    row-gap: 0.7rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .provider-media {
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    align-self: start;
    border-radius: var(--radius-sm);
  }
  /* The rating rides the thumb, freeing a whole line in the text column. */
  .provider-media .media-rating {
    display: inline-flex;
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: 0.68rem;
    padding: 2px 5px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    backdrop-filter: blur(4px);
  }
  .provider-header-row .inline-rating {
    display: none;
  }

  .provider-header-row {
    margin-bottom: 5px;
  }
  .provider-badge {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
  }

  .provider-name {
    font-size: 0.98rem;
    line-height: 1.28;
    margin-bottom: 3px;
  }

  .provider-location {
    font-size: 0.74rem;
    margin-bottom: 0;
    align-items: flex-start;
  }
  .provider-location svg {
    margin-top: 1px;
  }
  .provider-location span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* The blurb repeats the category at this width; the thumb and badge carry it. */
  .provider-desc {
    display: none;
  }

  .provider-footer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding-top: 0.65rem;
  }

  .payable-fee-wrap strong {
    font-size: 1.2rem;
  }
  .price-strike {
    font-size: 0.78rem;
  }

  .provider-actions-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0.5rem;
    justify-content: stretch;
  }
  /* Directions collapses to its arrow; the aria-label carries the name. */
  .provider-actions-row .direction-action {
    width: 46px;
    min-width: 46px;
    padding: 0;
    justify-content: center;
  }
  .provider-actions-row .direction-action span {
    display: none;
  }
  .provider-cta {
    width: 100%;
    justify-content: center;
    font-size: 0.86rem;
  }

  /* The 3px accent rail would clip inside the tighter radius. */
  .provider-card::before {
    width: 2px;
  }
}

/* From the tablet layout up the thumbnail fills its column rather than
   leaving a gap under a fixed 7:6 box. */
@media (min-width: 577px) {
  .provider-media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 132px;
  }
}

/* --------------------------------------------------------------------------
   5. Provider detail — head card
   The 32px title used to share a flex row with the rating and a 74px-wide
   "Directions" button whose label spilled out of it.
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .detail-head-card {
    padding: var(--space-sm);
    gap: 0.55rem;
  }
  .detail-head-card h2 {
    font-size: 1.42rem;
    line-height: 1.25;
  }
  .detail-head-card #detail-description {
    font-size: 0.875rem;
  }
  .detail-location-row {
    font-size: 0.82rem;
  }
  /* Two equal targets on one row — neither can crush the other. */
  .detail-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .detail-head-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding-inline: 0.5rem;
  }
  .detail-jump-btn {
    display: inline-flex;
  }

  .details-subpage-layout {
    gap: var(--space-sm);
  }
  .details-main-panel {
    gap: var(--space-sm);
  }
  .detail-card {
    padding: var(--space-sm);
  }
  .pricing-aside-card {
    position: static;
  }
  .pricing-aside-fee {
    font-size: 1.45rem;
  }
}

/* --------------------------------------------------------------------------
   6. Gallery — a swipeable carousel instead of a fixed 280px grid
   .gallery-strip uses display:contents so its two children join the cover as
   siblings in one snap rail without changing the desktop markup.
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .detail-gallery {
    display: flex;
    height: auto;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--container-pad);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    margin-inline: calc(var(--container-pad) * -1);
    padding-inline: var(--container-pad);
  }
  .detail-gallery::-webkit-scrollbar {
    display: none;
  }
  .gallery-strip {
    display: contents;
  }
  .gallery-cover,
  .gallery-strip-item {
    flex: 0 0 86%;
    height: auto;
    aspect-ratio: 16 / 10;
    scroll-snap-align: center;
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .gallery-strip-item span {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   7. Persistent booking rail
   On a phone the pricing aside renders after the full doctor table, so the
   price and the way to act on it were several screens apart.
   -------------------------------------------------------------------------- */
.detail-cta-bar {
  display: none;
}

@media (max-width: 992px) {
  .detail-cta-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0.6rem var(--container-pad) calc(0.6rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.10);
  }
  /* .detail-cta-bar sets display:flex, which would beat [hidden]'s UA rule. */
  .detail-cta-bar[hidden] {
    display: none;
  }

  .detail-cta-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }
  .detail-cta-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .detail-cta-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .detail-cta-amount strong {
    font-size: 1.3rem;
    line-height: 1.1;
    color: var(--primary-ink);
    font-variant-numeric: tabular-nums;
  }
  .detail-cta-btn {
    flex: 0 0 auto;
    padding-inline: 1.4rem;
    min-height: 46px;
    border-radius: var(--radius-pill);
  }

  /* Keep the rail from covering the end of the page. */
  #subpage-detail {
    padding-bottom: 78px;
  }
  body:has(#subpage-detail:not(.hidden-section)) .footer-wrap {
    padding-bottom: calc(var(--space-md) + 78px);
  }
}

/* --------------------------------------------------------------------------
   8. Mobile type scale
   Headings were set for a 1280px canvas; at 375px a 2rem h2 spends three
   lines on a clinic name.
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.15rem;
  }
  .detail-card h3 {
    font-size: 1.08rem;
  }
}

@media (max-width: 400px) {
  .detail-cta-btn {
    padding-inline: 1rem;
  }
}

/* Below ~360px the text column needs the room back more than the thumb does. */
@media (max-width: 359px) {
  .provider-card {
    grid-template-columns: 78px minmax(0, 1fr);
    column-gap: 0.7rem;
    padding: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   9. Bookable services — real cards, not a table folded in half
   The generic table->card transform turned every column into a label/value
   row, so a doctor's name carried a "DOCTOR NAME" prefix and "SPECIALTY"
   broke mid-word against the value column. The name leads the card, the
   badge sits under it, and the fee it costs to book is the loudest thing.
   -------------------------------------------------------------------------- */
.fee-highlight {
  color: var(--primary-ink);
  font-variant-numeric: tabular-nums;
}
.fee-highlight-secondary {
  color: var(--secondary-ink);
}
.fee-highlight-accent {
  color: var(--accent-ink);
}

@media (max-width: 768px) {
  #detail-services-container .table-wrap {
    overflow: visible;
  }
  /* The scroll-hint gradient means nothing once the rows are stacked. */
  #detail-services-container .table-wrap::after {
    display: none;
  }

  #detail-services-container .table-element tr {
    padding: 0.9rem;
    margin-bottom: 0.7rem;
    background: var(--bg-app);
  }

  #detail-services-container .table-element td {
    font-size: 0.83rem;
    padding: 0.45rem 0;
  }
  /* Labels are a fixed column; letting them break mid-word split "SPECIALTY". */
  #detail-services-container .table-element td[data-label]::before {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  /* First column is always the name — a heading, so it drops its label. */
  #detail-services-container .table-element td:first-child {
    display: block;
    text-align: left;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 0 0 0.15rem;
    border-bottom: none;
  }
  #detail-services-container .table-element td:first-child::before {
    display: none;
  }
  #detail-services-container .table-element td:first-child strong {
    font-weight: 700;
  }
  #detail-services-container .table-element td:first-child a {
    color: var(--text-main);
  }

  /* A cell whose whole content is a chip reads as one, left aligned. */
  #detail-services-container .table-element td:has(> .provider-badge) {
    display: block;
    text-align: left;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid var(--border-light);
  }
  #detail-services-container .table-element td:has(> .provider-badge)::before {
    display: none;
  }

  /* The bookable price is the decision on this card. */
  #detail-services-container .table-element td[data-label="Special Fee"] {
    border-bottom: none;
    padding-bottom: 0.15rem;
  }
  #detail-services-container .table-element td[data-label="Special Fee"] .fee-highlight {
    font-size: 1.25rem;
    line-height: 1.1;
  }
  #detail-services-container .table-element td[data-label="Walk-in Fee"] {
    border-bottom: none;
    padding-bottom: 0;
  }

  #detail-services-container .table-element td.table-action-cell .btn {
    min-height: 46px;
    border-radius: var(--radius-sm);
  }

  /* Empty-state rows have one cell and no label; keep them centred. */
  #detail-services-container .table-element td[colspan] {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: none;
  }
}
