:root {
  --brand-900: #6b1d16;
  --brand-800: #912820;
  --brand-700: #b8332a;
  --brand-600: #c9453c;
  --brand-500: #d9554c;
  --brand-200: #fecaca;
  --brand-100: #fde8e6;
  --brand-50: #fff8f7;
  --white: #ffffff;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(145, 40, 32, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --header-h: 72px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: min(1140px, calc(100% - 32px));
  margin-inline: auto;
}

.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.section-lead {
  margin-top: 12px;
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 560px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo img {
  height: 42px;
  width: auto;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-800);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-desktop a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-desktop a:hover {
  color: var(--brand-700);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botões do Header Reestilizados */
.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--text);
  border: 1px solid #d1d5db;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-portal i {
  font-size: 1rem;
  color: var(--brand-700);
}

.btn-portal:hover {
  background: var(--brand-50);
  border-color: var(--brand-700);
  color: var(--brand-700);
  transform: translateY(-1px);
}

.btn-portal-paciente {
  border-color: #cbd5e1;
}

.btn-portal-lab {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-header-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--brand-700);
  color: #ffffff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(184, 51, 42, 0.28);
  transition: all 0.15s ease;
}

.btn-header-whatsapp:hover {
  background: var(--brand-800);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(184, 51, 42, 0.35);
}

.btn-header-whatsapp i {
  font-size: 1.125rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-primary {
  background: var(--brand-700);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(184, 51, 42, 0.28);
}

.btn-primary:hover {
  background: var(--brand-800);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  color: var(--brand-700);
  border: 1.5px solid var(--brand-200);
}

.btn-outline:hover {
  background: var(--brand-50);
  border-color: var(--brand-700);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font-size: 1.375rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-links a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.mobile-highlight {
  background: var(--brand-50);
  color: var(--brand-700);
}

.mobile-nav-portals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mobile-portal-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
}

.mobile-portal-card i {
  font-size: 1.5rem;
  color: var(--brand-700);
}

.mobile-portal-card strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--text);
}

.mobile-portal-card small {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.btn-mobile-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #25d366;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

/* Hero */
.hero {
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  max-width: 540px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 18px;
}

.hero h1 span {
  color: var(--brand-700);
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  position: relative;
}

.hero-image-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--brand-100) 0%, #e8eef5 100%);
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-float-card {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 240px;
}

.hero-float-card i {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
}

.hero-float-card strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
}

.hero-float-card span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Services */
.services {
  padding: 80px 0;
}

.services-header {
  text-align: center;
  margin-bottom: 48px;
}

.services-header .section-lead {
  margin-inline: auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(184, 51, 42, 0.15);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.service-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.service-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Location */
.location {
  padding: 80px 0;
  background: var(--white);
}

.location-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.location-image {
  border-radius: var(--radius-lg);
  min-height: 420px;
  background:
    linear-gradient(rgba(107, 29, 22, 0.55), rgba(107, 29, 22, 0.25)),
    url('../images/background3.jpg') center / cover no-repeat;
  box-shadow: var(--shadow-lg);
}

.location-content h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.location-content h2 em {
  font-style: normal;
  color: var(--brand-700);
}

.location-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.location-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.location-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.location-detail i {
  color: var(--brand-700);
  font-size: 1.25rem;
  margin-top: 2px;
}

.location-detail strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.location-detail span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Exams */
.exams {
  padding: 80px 0;
}

.exams-header {
  text-align: center;
  margin-bottom: 48px;
}

.exams-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.exam-category {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.exam-category:hover {
  box-shadow: var(--shadow-md);
}

.exam-category-head {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-600) 100%);
  color: var(--white);
}

.exam-category-head h3 {
  font-size: 1rem;
  font-weight: 700;
}

.exam-category ul {
  padding: 16px 18px 20px;
}

.exam-category li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.exam-category li:last-child {
  border-bottom: none;
}

.exam-category li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
}

.exams-budget-cta {
  margin-top: 36px;
  background: linear-gradient(135deg, var(--brand-50) 0%, #ffffff 100%);
  border: 1.5px solid var(--brand-100);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.exams-budget-cta-text {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exams-budget-cta-text i {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-100);
  color: var(--brand-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.exams-budget-cta-text strong {
  display: block;
  font-size: 1.0625rem;
  color: var(--text);
  margin-bottom: 2px;
}

.exams-budget-cta-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 768px) {
  .exams-budget-cta {
    flex-direction: column;
    text-align: center;
  }
  .exams-budget-cta-text {
    flex-direction: column;
    text-align: center;
  }
}

/* CTA */
.cta {
  padding: 0 0 80px;
}

.cta-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.cta-image {
  min-height: 320px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url('../images/background2.jpg') center / cover no-repeat;
}

.cta-content {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cta-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text);
}

.cta-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1rem;
}

.btn-whatsapp {
  align-self: flex-start;
  background: #25d366;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: #1fb855;
  transform: translateY(-1px);
}

/* Footer */
.site-footer {
  background: var(--brand-900);
  color: rgba(255, 255, 255, 0.9);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.footer-item {
  text-align: center;
}

.footer-item i {
  font-size: 1.75rem;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.footer-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-item p,
.footer-item a {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-item a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .nav-desktop,
  .header-actions .btn-outline {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-grid,
  .location-grid,
  .cta-card {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .exams-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-float-card {
    left: 16px;
    bottom: 16px;
  }

  .cta-content {
    padding: 32px 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 560px) {
  .exams-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: calc(var(--header-h) + 24px);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

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

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

/* ==========================================================================
   PÁGINA DE ORÇAMENTO / SIMULADOR DE EXAMES
   ========================================================================== */

.nav-link-active,
.mobile-link-active {
  color: var(--brand-700) !important;
  font-weight: 700 !important;
}

.budget-main {
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* Hero */
.budget-hero {
  background: linear-gradient(180deg, var(--brand-50) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}

.budget-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.budget-breadcrumb a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.budget-breadcrumb a:hover {
  color: var(--brand-700);
}

.budget-hero-content h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin: 12px 0 10px;
}

.budget-hero-content h1 span {
  color: var(--brand-700);
}

.budget-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.55;
}

/* Budget Layout Grid */
.budget-section {
  padding: 36px 0 64px;
}

.budget-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Toolbar & Search */
.budget-toolbar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.budget-search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.budget-search-box .search-icon {
  position: absolute;
  left: 14px;
  font-size: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
}

.budget-search-box input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: #fdfdfd;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.budget-search-box input:focus {
  outline: none;
  border-color: var(--brand-700);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(184, 51, 42, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--brand-700);
  background: var(--brand-100);
}

/* Category Chips */
.category-chips-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.category-chips {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--brand-200, #f5c4c0);
  background: var(--brand-50);
  color: var(--brand-800);
}

.chip.active {
  background: var(--brand-700);
  color: var(--white);
  border-color: var(--brand-700);
  box-shadow: 0 2px 8px rgba(184, 51, 42, 0.25);
}

.chip-count {
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

/* Quick Presets */
.preset-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.preset-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.preset-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-800);
  background: var(--brand-100);
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.preset-btn:hover {
  background: #f7cfcb;
  transform: translateY(-1px);
}

/* Catalog Groups */
.catalog-group {
  margin-bottom: 32px;
}

.catalog-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-100);
}

.catalog-group-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-icon {
  font-size: 1.25rem;
}

.group-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Exam Cards Grid */
.exams-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.exam-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.exam-card:hover {
  border-color: var(--brand-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.exam-card.is-selected {
  border-color: var(--brand-700);
  background: linear-gradient(180deg, var(--brand-50) 0%, #ffffff 100%);
  box-shadow: 0 4px 18px rgba(184, 51, 42, 0.15);
}

.exam-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.exam-code {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f1f3f5;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.exam-card.is-selected .exam-code {
  background: var(--brand-100);
  color: var(--brand-800);
}

.exam-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--white);
  font-size: 1rem;
  transition: all 0.15s ease;
}

.exam-checkbox.checked {
  background: var(--brand-700);
  border-color: var(--brand-700);
}

.exam-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 12px;
}

.exam-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.exam-type-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.exam-price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand-800);
}

/* Empty Search State */
.empty-search-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.empty-search-state i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-search-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-search-state p {
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 20px;
  font-size: 0.9375rem;
}

/* Sticky Sidebar Summary */
.budget-sidebar-wrap {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  z-index: 10;
  max-height: calc(100vh - var(--header-h) - 32px);
}

.budget-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-title i {
  font-size: 1.75rem;
  color: var(--brand-700);
  background: var(--brand-50);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-title span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-clear-all {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-clear-all:hover {
  background: #fee2e2;
}

/* Patient Info Accordion */
.patient-info-box {
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-patient-fields {
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}

.toggle-patient-fields span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-patient-fields i.bx-chevron-down {
  font-size: 1.125rem;
  transition: transform 0.2s ease;
}

.patient-fields {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.patient-fields .form-group {
  margin-bottom: 10px;
}

.patient-fields .form-group:last-child {
  margin-bottom: 0;
}

.patient-fields label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.patient-fields input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--text);
}

.patient-fields input:focus {
  outline: none;
  border-color: var(--brand-700);
}

/* Selected Items Container */
.selected-items-container {
  max-height: 260px;
  min-height: 120px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.empty-quote-state {
  padding: 24px 12px;
  text-align: center;
}

.empty-quote-state .empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.empty-quote-state .empty-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-quote-state .empty-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.selected-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  margin-bottom: 6px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.selected-item-row .item-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 16px;
}

.selected-item-row .item-info {
  flex: 1;
  min-width: 0;
}

.selected-item-row .item-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-item-row .item-cat {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.selected-item-row .item-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-800);
  white-space: nowrap;
}

.selected-item-row .item-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all 0.15s;
}

.selected-item-row .item-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Totals Box */
.budget-totals {
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 18px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subtotal-row {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(145, 40, 32, 0.15);
  margin-bottom: 10px;
}

.final-total-row .total-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-900);
}

.final-total-row .total-note {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.final-total-row .total-price {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--brand-800);
  letter-spacing: -0.02em;
}

/* Actions */
.budget-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-whatsapp-quote {
  width: 100%;
  background: #25d366;
  color: var(--white);
  font-size: 0.9375rem;
  padding: 13px 20px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  text-decoration: none;
}

.btn-whatsapp-quote:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  color: var(--white);
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action-secondary {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8125rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-action-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.sidebar-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-disclaimer i {
  font-size: 1rem;
  color: var(--brand-700);
  flex-shrink: 0;
  margin-top: 2px;
}

/* FAQ / Bottom Help */
.budget-faq {
  padding: 32px 0 64px;
}

.faq-card {
  background: linear-gradient(135deg, var(--brand-50) 0%, #ffffff 100%);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  box-shadow: var(--shadow-sm);
}

.faq-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--brand-700);
  color: var(--white);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(184, 51, 42, 0.25);
}

.faq-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.faq-content p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 18px;
  max-width: 680px;
}

/* Mobile Floating Budget Bar */
.mobile-budget-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 18px;
  z-index: 95;
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.12);
  align-items: center;
  justify-content: space-between;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-budget-bar.is-active {
  transform: translateY(0);
  display: flex;
}

.mobile-bar-info {
  display: flex;
  flex-direction: column;
}

.mobile-bar-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mobile-bar-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-800);
}

/* Mobile Drawer Bottom Sheet */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.is-open {
  display: block;
  opacity: 1;
}

.mobile-drawer-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  z-index: 1001;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-sheet.is-open {
  transform: translateY(0);
}

.mobile-drawer-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 12px auto 4px;
  flex-shrink: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-drawer-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 1.25rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-drawer-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer-footer {
  padding: 14px 20px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1100;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.toast-notification.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification i {
  font-size: 1.25rem;
  color: #10b981;
}

/* Printable Document Hidden in Web View */
.printable-quote {
  display: none;
}

/* Print Media Query */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }

  .site-header,
  .mobile-nav,
  .budget-hero,
  .budget-toolbar,
  .exams-catalog,
  .budget-sidebar-wrap,
  .budget-faq,
  .mobile-budget-bar,
  .mobile-drawer-overlay,
  .mobile-drawer-sheet,
  .site-footer,
  .toast-notification {
    display: none !important;
  }

  .printable-quote {
    display: block !important;
    padding: 20px;
    font-family: var(--font);
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
  }

  .print-logo-area h2 {
    font-size: 24pt;
    color: #912820;
    margin: 0;
  }

  .print-logo-area p {
    font-size: 11pt;
    font-weight: bold;
    margin: 2px 0 6px;
  }

  .print-logo-area small {
    font-size: 9pt;
    color: #555;
  }

  .print-meta-area {
    text-align: right;
  }

  .print-meta-area h3 {
    font-size: 14pt;
    margin: 0 0 6px;
  }

  .print-meta-area p {
    font-size: 10pt;
    margin: 2px 0;
  }

  .print-patient-box {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
  }

  .print-patient-box p {
    margin: 4px 0;
    font-size: 10.5pt;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
  }

  .print-table th,
  .print-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    font-size: 10pt;
  }

  .print-table th {
    background: #f0f0f0;
    text-align: left;
    font-weight: bold;
  }

  .print-table tfoot td {
    border-top: 2px solid #333;
    font-size: 12pt;
    padding-top: 12px;
  }

  .print-footer {
    border-top: 1px solid #ccc;
    padding-top: 14px;
    text-align: center;
    font-size: 9pt;
    color: #666;
  }
}

/* Responsive Media Queries for Budget Page */
@media (max-width: 1024px) {
  .budget-grid {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }
  .header-actions .btn-portal span {
    display: none;
  }
  .header-actions .btn-portal {
    padding: 8px;
  }
}

@media (max-width: 960px) {
  .budget-grid {
    grid-template-columns: 1fr;
  }

  .budget-sidebar-wrap {
    display: none;
  }

  .budget-hero {
    padding: 24px 0 20px;
  }

  .budget-hero-content h1 {
    font-size: 1.75rem;
  }

  .faq-card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
  }

  .faq-icon {
    margin: 0 auto;
  }

  .nav-desktop,
  .header-actions .btn-portal,
  .header-actions .btn-header-whatsapp {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .budget-hero {
    padding: 20px 0 16px;
  }

  .exams-grid-cards {
    grid-template-columns: 1fr;
  }

  .preset-pills {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-actions {
    grid-template-columns: 1fr;
  }

  .mobile-budget-bar {
    padding: 10px 16px;
  }
}

