:root {
  --primary: #0e7c7b;
  --primary-dark: #0a5f5e;
  --primary-light: #e6f4f4;
  --ink: #1f2937;
  --muted: #64748b;
  --bg: #f6f8fa;
  --card: #ffffff;
  --line: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 42, 67, 0.08), 0 8px 24px rgba(16, 42, 67, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 42, 67, 0.14);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

.brand .logo-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}

.main-nav a:hover {
  color: var(--primary);
}

.nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px !important;
}

.nav-cta:hover {
  background: var(--primary-dark);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #f0f9f9 0%, #ffffff 55%, #e6f4f4 100%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: 34px;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero p {
  color: var(--muted);
  max-width: 720px;
  font-size: 16.5px;
}

.hero-small {
  padding: 32px 0 26px;
}

.hero-small h1 {
  font-size: 26px;
}

/* ---------- Search / Filters ---------- */
.search-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 28px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-row input,
.filter-row select {
  flex: 1 1 200px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}

.filter-row input:focus,
.filter-row select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

/* ---------- Homepage search hero ---------- */
.hero-search {
  text-align: center;
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 480px at 85% -10%, rgba(14, 124, 123, 0.14), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(20, 184, 166, 0.12), transparent 60%),
    linear-gradient(180deg, #f2faf9 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.hero-search h1 {
  font-size: 40px;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.hero-search p {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 6px;
}

.search-panel-lg {
  max-width: 860px;
  margin: 30px auto 0;
  padding: 14px;
}

.search-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn:active {
  transform: scale(0.98);
}

.quick-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 22px;
}

.quick-branches .qb-label {
  font-size: 13.5px;
  color: var(--muted);
  margin-right: 2px;
}

.quick-branches .chip {
  font-weight: 500;
  padding: 6px 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.quick-branches .chip:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- Stats ---------- */
.stats {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 22px 0;
}

.stat {
  text-align: center;
  padding: 8px;
}

.stat strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.stat span {
  font-size: 13.5px;
  color: var(--muted);
}

.results-wrap {
  padding-top: 28px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 16px 0;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  opacity: 0.6;
}

/* ---------- Doctor Grid ---------- */
.section-title {
  font-size: 22px;
  margin: 34px 0 16px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 20px;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.doctor-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.doctor-card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--primary-light);
  position: relative;
  overflow: hidden;
}

.doctor-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-card .thumb .avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e6f4f4, #d9eef2);
  color: var(--primary-dark);
  font-size: 42px;
  font-weight: 700;
}

.doctor-card .body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.doctor-card .body h3 {
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.doctor-card .body h3 a {
  color: var(--ink);
}

.doctor-card .body h3 a:hover {
  color: var(--primary);
}

.doctor-card .branch {
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.doctor-card .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Listing header ---------- */
.list-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 8px;
}

.list-hero h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.list-hero .lead {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Tabs ---------- */
.tab-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 24px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #fbfdfe;
  overflow-x: auto;
}

.tab-btn {
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  color: var(--primary);
}

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

.tab-panel {
  display: none;
  padding: 26px;
}

.tab-panel.active {
  display: block;
  animation: fadein 0.2s ease;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tab-panel ul {
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.tab-panel li {
  font-size: 15px;
}

.tab-panel h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* ---------- Doctor profile ---------- */
.doc-profile {
  display: flex;
  gap: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  align-items: flex-start;
  margin-top: 8px;
}

.doc-profile .photo {
  width: 190px;
  min-width: 190px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--primary-light);
  box-shadow: var(--shadow);
}

.doc-profile .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-profile .photo .avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e6f4f4, #d9eef2);
  color: var(--primary-dark);
  font-size: 64px;
  font-weight: 700;
}

.doc-profile h1 {
  font-size: 26px;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.doc-profile .branch-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.doc-info-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}

.doc-info-list li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
}

.doc-info-list li strong {
  color: var(--ink);
  font-weight: 600;
  min-width: 96px;
}

/* ---------- Summary box ---------- */
.summary-box {
  background: var(--primary-light);
  border: 1px solid #cde8e8;
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 24px;
}

.summary-box h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.summary-box p {
  color: #33475b;
  font-size: 15.5px;
}

/* ---------- Related ---------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.related-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.related-card:hover {
  transform: translateY(-3px);
}

.related-card .thumb {
  aspect-ratio: 1/1;
  background: var(--primary-light);
  overflow: hidden;
}

.related-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card .thumb .avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e6f4f4, #d9eef2);
  color: var(--primary-dark);
  font-size: 30px;
  font-weight: 700;
}

.related-card .body {
  padding: 12px 14px;
}

.related-card .body h3 {
  font-size: 14px;
  line-height: 1.3;
}

.related-card .body h3 a {
  color: var(--ink);
}

.related-card .body .branch {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f2f3d;
  color: #c7d6de;
  margin-top: 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 40px 0 30px;
}

.footer-inner h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 12px;
}

.footer-inner p,
.footer-inner a {
  font-size: 13.5px;
  color: #a9bec8;
}

.footer-inner a:hover {
  color: #fff;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 7px;
  padding: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
  font-size: 12.5px;
  text-align: center;
  color: #8aa4af;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 26px;
  }

  .main-nav {
    gap: 12px;
  }

  .main-nav a:not(.nav-cta) {
    display: none;
  }

  .doc-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .doc-profile .branch-line,
  .doc-info-list li {
    justify-content: center;
  }

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

  .tab-panel {
    padding: 18px;
  }
}