/* ==========================================================================
   YiHaoBan Medical Tourism — Global Stylesheet
   Languages: EN (root) / RU (/ru/) / AR (/ar/, RTL)
   Design: professional medical-travel look — calm navy + teal, no stock-photo kitsch
   RTL: uses CSS logical properties so the layout mirrors automatically
   ========================================================================== */

:root {
  --navy: #0b3c5d;
  --navy-deep: #072a42;
  --teal: #1d9a8c;
  --teal-dark: #15796e;
  --teal-light: #e6f5f3;
  --ink: #1c2b33;
  --ink-soft: #4b5d68;
  --line: #dfe7ec;
  --bg: #ffffff;
  --bg-soft: #f5f8fa;
  --gold: #c9a15c;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(11, 60, 93, 0.10);
  --maxw: 1140px;
  --font-latin: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-arabic: "Cairo", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-latin);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body[lang="ar"] { font-family: var(--font-arabic); }
body[lang="ar"] .num-ltr { direction: ltr; unicode-bidi: embed; }

img { max-width: 100%; display: block; }
a { color: var(--teal-dark); }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* ---------- Header / sticky nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800;
  flex-shrink: 0;
}
.brand-sub { display: block; font-size: 0.66rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.06em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--teal-light); color: var(--teal-dark); }

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

/* Language switcher — native names, no flags */
.lang-switch { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.lang-switch a {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.lang-switch a:hover { background: var(--bg-soft); }
.lang-switch a[aria-current="true"] { background: var(--navy); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.75); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-whatsapp { background: #25d366; color: #06301b; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(115deg, rgba(7, 42, 66, 0.92) 0%, rgba(11, 60, 93, 0.82) 45%, rgba(29, 154, 140, 0.55) 100%),
    var(--hero-img, none) center / cover no-repeat;
  color: #fff;
  padding: 96px 0 104px;
}
.hero-content { max-width: 720px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.2; font-weight: 800; margin-bottom: 18px; }
.hero p.lead { font-size: clamp(1rem, 2vw, 1.18rem); opacity: 0.94; margin-bottom: 30px; max-width: 620px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 18px; font-size: 0.85rem; opacity: 0.85; }

/* ---------- Trust bar ---------- */
.trustbar { background: var(--navy-deep); color: #fff; }
.trustbar-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 0;
}
.trustbar-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; font-weight: 500;
  justify-content: center;
  text-align: center;
}
.trustbar-item svg { flex-shrink: 0; }

/* ---------- Sections ---------- */
section.section { padding: 72px 0; }
section.section.alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head .kicker {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--navy); line-height: 1.25; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); }

/* ---------- Service cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.service-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service-card .thumb { aspect-ratio: 4 / 3; background: var(--teal-light); }
.service-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.service-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.service-card h3 { font-size: 1.05rem; color: var(--navy); }
.service-card p { font-size: 0.9rem; color: var(--ink-soft); flex: 1; }
.service-card .more { font-weight: 600; font-size: 0.88rem; text-decoration: none; color: var(--teal-dark); }
.service-card .more::after { content: " →"; }
[dir="rtl"] .service-card .more::after { content: " ←"; }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.why-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.why-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.why-item h3 { font-size: 1rem; color: var(--navy); margin-bottom: 6px; }
.why-item p { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Cities ---------- */
.city-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.city-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--navy) center / cover no-repeat;
}
.city-card .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,42,66,0.85), rgba(7,42,66,0.15) 60%);
}
.city-card .city-body { position: relative; padding: 26px; }
.city-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.city-card p { font-size: 0.9rem; opacity: 0.92; max-width: 420px; }

/* ---------- Process timeline ---------- */
.process-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.process-step { text-align: center; position: relative; padding: 0 6px; }
.process-step .step-num {
  width: 42px; height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 2;
}
/* connecting line: logical border so it mirrors in RTL */
.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20px;
  inset-inline-start: 58%;
  width: 84%;
  border-top: 2px dashed var(--line);
  z-index: 1;
}
[dir="rtl"] .process-step:not(:last-child)::after { inset-inline-start: auto; inset-inline-end: 58%; }
.process-step h3 { font-size: 0.92rem; color: var(--navy); margin-bottom: 4px; }
.process-step p { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- CTA banner + mini form ---------- */
.cta-banner {
  background: linear-gradient(115deg, var(--navy) 0%, var(--teal-dark) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 44px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}
.cta-banner h2 { font-size: 1.6rem; margin-bottom: 10px; }
.cta-banner p { opacity: 0.92; font-size: 0.95rem; }
.mini-form { display: flex; flex-direction: column; gap: 10px; }
.mini-form input, .mini-form select {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-family: inherit;
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.88rem; color: var(--navy); }
.field label .req { color: #c0392b; margin-inline-start: 4px; }
.field .hint { font-size: 0.78rem; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}
.field input[dir="ltr"] { text-align: start; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: var(--ink-soft); }
.consent-row input { width: auto; margin-top: 4px; }
.form-success {
  display: none;
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.form-success.show { display: block; }
.form-success h3 { color: var(--teal-dark); margin-bottom: 8px; }
.form-success .wa-fallback { margin-top: 14px; font-size: 0.9rem; }

/* ---------- Contact page layout ---------- */
.contact-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: start; }
.contact-aside {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-aside .channel { display: flex; align-items: center; gap: 12px; }
.contact-aside .channel .c-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.channel-wa .c-icon { background: #e7f9ee; color: #1faa53; }
.channel-tg .c-icon { background: #e7f1fb; color: #226db7; }
.channel-em .c-icon { background: #fdf3e3; color: #b07a1f; }
.channel-wx .c-icon { background: #eaf7ea; color: #2e7d32; }
.contact-aside .channel b { display: block; font-size: 0.92rem; color: var(--navy); }
.contact-aside .channel span { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin-inline: auto; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
  position: relative;
  padding-inline-end: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--teal-dark);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 20px 16px; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: linear-gradient(115deg, var(--navy-deep), var(--navy) 60%, var(--teal-dark));
  color: #fff;
  padding: 64px 0;
}
.page-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 10px; }
.page-hero p { opacity: 0.9; max-width: 640px; }
.breadcrumbs { font-size: 0.82rem; opacity: 0.85; margin-bottom: 14px; }
.breadcrumbs a { color: #fff; text-decoration: none; }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.6; }

/* ---------- Prose / legal ---------- */
.prose { max-width: 780px; }
.prose h2 { color: var(--navy); font-size: 1.25rem; margin: 34px 0 12px; }
.prose h3 { color: var(--navy); font-size: 1.05rem; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 10px; }
.prose ul { padding-inline-start: 22px; }
.entity-block {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--teal);
  border-radius: 10px;
  padding: 22px 24px;
  margin: 24px 0;
}
.entity-block h2 { margin-top: 0; }

/* ---------- Anchor sections (services) ---------- */
.service-section { padding: 64px 0; scroll-margin-top: 84px; }
.service-section.alt { background: var(--bg-soft); }
.service-section .split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.service-section .split .media { border-radius: var(--radius); overflow: hidden; background: var(--teal-light); aspect-ratio: 16/10; }
.service-section .split .media img { width: 100%; height: 100%; object-fit: cover; }
.service-section h2 { color: var(--navy); font-size: 1.55rem; margin-bottom: 14px; }
.service-section ul.checks { list-style: none; padding: 0; margin: 16px 0 22px; }
.service-section ul.checks li {
  padding-inline-start: 30px;
  position: relative;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.service-section ul.checks li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--teal-dark);
  font-weight: 700;
}
/* even sections mirror the media side in RTL automatically via logical flow */
[dir="rtl"] .service-section .split.flip .media { order: 2; }
[dir="ltr"] .service-section .split.flip .media { order: 2; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 200;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  transition: transform 0.15s ease;
}
.wa-float:hover { transform: scale(1.08); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #cfdce5; padding: 56px 0 28px; font-size: 0.88rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; margin-bottom: 36px; }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #cfdce5; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-brand p { opacity: 0.8; max-width: 300px; margin-top: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* ---------- Mobile ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--navy);
}

@media (max-width: 960px) {
  .card-grid, .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .process-step:nth-child(3)::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-banner { grid-template-columns: 1fr; padding: 30px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; margin-inline-start: auto; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .lang-switch { display: none; }
  .mobile-lang { display: flex !important; }
  .trustbar-inner { grid-template-columns: repeat(2, 1fr); }
  .card-grid, .card-grid.cols-3, .card-grid.cols-2 { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .city-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .service-section .split { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 72px; }
  .hero-ctas .btn { width: 100%; }
}

/* mobile lang switch inside nav */
.mobile-lang { display: none; gap: 8px; padding: 8px 0; }
.mobile-lang a {
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
