/* ============================================================
   IMEDIC — Design System
   Premium Hospital Website Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

/* --- 1. Design Tokens ---------------------------------------- */
:root {
  /* Brand Colors */
  --primary:         #0F52BA;
  --primary-light:   #3A78D8;
  --primary-dark:    #072F6B;
  --secondary:       #10B981;
  --accent:          #6366F1;

  /* Neutrals */
  --text-dark:   #0F172A;
  --text-body:   #334155;
  --text-muted:  #64748B;
  --bg-light:    #F8FAFC;
  --bg-white:    #FFFFFF;
  --border:      #E2E8F0;
  --border-soft: #F1F5F9;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / .06);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .10), 0 2px 4px -2px rgb(0 0 0 / .10);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .10), 0 4px 6px -4px rgb(0 0 0 / .10);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .12), 0 8px 10px -6px rgb(0 0 0 / .10);
  --shadow-2xl:0 25px 50px -12px rgb(0 0 0 / .25);

  /* Glass */
  --glass-bg:     rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.55);

  /* Radius */
  --radius-sm:  0.5rem;
  --radius-md:  0.875rem;
  --radius-lg:  1.25rem;
  --radius-xl:  2rem;
  --radius-full:9999px;

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Lang Switcher & i18n ------------------------------------ */
.lang-switcher { display: flex; align-items: center; gap: 0.5rem; margin-left: 1.5rem; border-left: 1px solid rgba(255,255,255,0.2); padding-left: 1rem; }
header.scrolled .lang-switcher { border-left-color: var(--border); }
.lang-btn { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 0.75rem; font-weight: 700; cursor: pointer; padding: 0.25rem 0.4rem; transition: all 0.3s; border-radius: 4px; }
.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.lang-btn.active { color: #fff; background: var(--primary); }
header.scrolled .lang-btn { color: var(--text-muted); }
header.scrolled .lang-btn:hover { color: var(--primary); background: var(--bg-light); }
header.scrolled .lang-btn.active { color: #fff; background: var(--primary); }

[dir="ar"] { font-family: 'Cairo', sans-serif !important; }
[dir="ar"] .lang-switcher { margin-left: 0; margin-right: 1.5rem; border-left: none; border-right: 1px solid rgba(255,255,255,0.2); padding-left: 0; padding-right: 1rem; }

/* --- 2. Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-body);
  background-color: var(--bg-white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-width: 0;
}

a { text-decoration: none; color: inherit; transition: all .3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
address { font-style: normal; }

/* --- 3. Utilities -------------------------------------------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}
.relative      { position: relative; }
.text-center   { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

/* --- 4. Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.875rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .9375rem;
  cursor: pointer;
  border: none;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease, background-color .25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  background-size: 200% 100%;
  background-position: right center;
  color: #fff;
  box-shadow: 0 4px 14px rgb(15 82 186 / .35);
}
.btn-primary:hover {
  background-position: left center;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgb(15 82 186 / .45);
  color: #fff;
}

.btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.25);
  transform: translateY(-2px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-white {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-md);
}
.btn-white:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--primary);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.0625rem;
}

/* Nav CTA button */
.btn-nav-cta {
  background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
  color: #fff !important;
  padding: .55rem 1.4rem;
  font-size: .875rem;
  border-radius: var(--radius-full);
  box-shadow: 0 3px 10px rgb(16 185 129 / .35);
}
.btn-nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgb(16 185 129 / .45);
}

/* --- 5. Header / Navbar -------------------------------------- */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background .4s ease, padding .4s ease, box-shadow .4s ease;
  padding: 1.5rem 0;
}

header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: .875rem 0;
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
@media (max-width: 768px) {
  .logo-img { width: 28px; height: 28px; }
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
  transition: color .3s ease;
}
.logo-dot { display: none; } /* Dot removed to fix duplication with logo image */

header.scrolled .logo-text { color: var(--primary-dark); }

/* Nav Links */
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: .9375rem;
  color: rgba(255,255,255,.9);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--secondary);
  transition: width .3s ease;
  border-radius: 2px;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

header.scrolled .nav-links a:not(.btn-nav-cta) { color: var(--text-body); }
header.scrolled .nav-links a:not(.btn-nav-cta):hover { color: var(--primary); }

/* Mobile Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: .25rem;
  z-index: 1001;
  transition: color .3s;
}
header.scrolled .menu-toggle { color: var(--text-dark); }

/* --- 6. Hero ------------------------------------------------- */
.hero {
  height: 100vh;
  min-height: 640px;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: scale(1.06);
  transition: transform 8s ease-out;
}
.hero.loaded .hero-bg { transform: scale(1); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(7, 47, 107, .92) 0%,
    rgba(15, 82, 186, .72) 55%,
    rgba(15, 82, 186, .25) 100%
  );
  z-index: 1;
}

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

.hero-content {
  max-width: 640px;
  padding-top: 5rem;
  width: 100%;
}

/* Hero animated children */
.animate-hero {
  opacity: 0;
  transform: translateY(28px);
  animation: heroFadeUp .8s var(--ease-out) forwards;
}
@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,.9);
  font-size: .8125rem;
  font-weight: 600;
  padding: .35rem .9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  max-width: 100%;
  flex-wrap: wrap;
  word-break: break-word;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16,185,129,.3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.3); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,.1); }
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -.5px;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: rgba(255,255,255,.82);
  margin-bottom: 2.5rem;
  max-width: 520px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* Scroll cue */
.hero-scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,.55);
  animation: bounce 2.2s infinite;
  transition: color .3s;
}
.hero-scroll-cue:hover { color: rgba(255,255,255,.9); }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* --- 7. Stats Bar -------------------------------------------- */
.stats-bar {
  background: var(--primary-dark);
  padding: 3rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item { padding: .5rem 1rem; min-width: 0; }

.stat-icon {
  color: var(--secondary);
  margin-bottom: .75rem;
  display: flex;
  justify-content: center;
}

.stat-number {
  font-size: 2.75rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline;
}
.stat-unit {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  display: inline;
  margin-left: .15rem;
}

.stat-label {
  font-size: .875rem;
  color: rgba(255,255,255,.55);
  margin-top: .5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
  word-break: break-word;
  hyphens: auto;
}

/* --- 8. Section Common --------------------------------------- */
.section-padding { padding: 6rem 0; }
.bg-light { background-color: var(--bg-light); }

.eyebrow-label {
  display: inline-block;
  font-size: .9375rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 1rem;
}
.eyebrow-light { color: rgba(16,185,129,.85); }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.section-title.light { color: #fff; }

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

.section-body {
  font-size: 1.0625rem;
  color: var(--text-body);
  line-height: 1.8;
}
.section-body.light { color: rgba(255,255,255,.75); }

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-header .section-subtitle { margin: 0 auto; }

/* --- 9. Grid Layouts ----------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

/* --- 10. Feature Pills --------------------------------------- */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-bottom: 1.75rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(15,82,186,.07);
  color: var(--primary);
  border: 1px solid rgba(15,82,186,.15);
  padding: .35rem .875rem;
  border-radius: var(--radius-full);
  font-size: .8125rem;
  font-weight: 600;
}
.pill svg { color: var(--secondary); flex-shrink: 0; }

/* --- 11. Section Image --------------------------------------- */
.section-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  object-fit: cover;
  display: block;
}



/* --- 12. Service Cards --------------------------------------- */
.service-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .35s var(--ease-spring), box-shadow .35s ease, border-color .35s ease;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,82,186,.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(15,82,186,.18);
}
.service-card:hover::before { opacity: 1; }

.service-card-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--icon-color) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--icon-color);
  transition: transform .35s var(--ease-spring);
}
.service-card:hover .service-card-icon { transform: scale(1.1) rotate(-3deg); }

.service-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .75rem;
  line-height: 1.35;
}

.service-card-desc {
  font-size: .9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.service-card-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 700;
  color: var(--primary);
  transition: gap .25s ease, color .25s ease;
}
.service-card-link:hover {
  gap: .625rem;
  color: var(--primary-light);
}
.service-card-link svg { transition: transform .25s ease; }
.service-card-link:hover svg { transform: translateX(3px); }

/* --- 13. Doctors Section ------------------------------------- */
.doctors-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1341A0 100%);
  position: relative;
  overflow: hidden;
}
.doctors-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  pointer-events: none;
}
.doctors-inner { align-items: center; }

/* --- 14. CTA Banner ------------------------------------------ */
.cta-banner {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--bg-light) 0%, #EEF2FF 100%);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse, rgba(15,82,186,.07) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}
.cta-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.25rem;
  line-height: 1.75;
}

/* CTA banner: center button on all screens */
.cta-banner .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- 15. Page Header (Inner Pages) --------------------------- */
.page-header {
  padding: 11rem 0 5rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
}
.page-subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,.75);
  position: relative;
}

/* --- 16. Forms ---------------------------------------------- */
.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: .5rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: .8125rem 1.125rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9375rem;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(15,82,186,.12);
  background: var(--bg-white);
}
textarea.form-control { min-height: 130px; resize: vertical; }

/* Premium Card (used on inner pages) */
.premium-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform .3s var(--ease-spring), box-shadow .3s ease;
}
.premium-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* --- 17. Footer ---------------------------------------------- */
footer {
  background-color: var(--primary-dark);
  color: #fff;
  padding: 5rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.footer-logo-text {
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.footer-desc {
  color: rgba(255,255,255,.6);
  font-size: .9375rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.footer-address {
  color: rgba(255,255,255,.5);
  font-size: .875rem;
  line-height: 1.75;
}

.footer-col h4 {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.45);
  margin-bottom: 1.5rem;
}

.footer-col ul li { margin-bottom: .875rem; }
.footer-col a {
  color: rgba(255,255,255,.65);
  font-size: .9375rem;
  transition: color .25s ease, padding-left .25s ease;
}
.footer-col a:hover { color: #fff; padding-left: 4px; }
.footer-col li:not(a) { color: rgba(255,255,255,.55); font-size: .9375rem; }

.footer-bottom {
  text-align: center;
  padding: 1.75rem 0;
  color: rgba(255,255,255,.35);
  font-size: .8125rem;
}

/* --- 18. Animations / Scroll --------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 19. Responsive ------------------------------------------ */
@media (max-width: 1100px) {
  .hero-title { font-size: 3.5rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: 3rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  .doctors-inner { direction: ltr; }
}

@media (max-width: 768px) {
  header { padding: 1rem 0; }

  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: min(85vw, 320px);
    height: 100%;
    height: 100dvh;
    background: var(--bg-white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5.5rem 2rem 2rem;
    box-shadow: var(--shadow-2xl);
    transition: right .4s var(--ease-out);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
  }
  .nav-links.open { right: 0; }

  .nav-links a {
    color: var(--text-body) !important;
    width: 100%;
    padding: .875rem 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 1rem;
  }
  .nav-links a:last-child { border-bottom: none; }
  .btn-nav-cta {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }

  /* Language switcher overrides for mobile nav panel */
  .nav-links .lang-switcher {
    margin-left: 0;
    margin-right: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 1.25rem;
    margin-top: 1rem;
    width: 100%;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .nav-links .lang-btn {
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--bg-light);
    flex: 1;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
  }
  .nav-links .lang-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(15,82,186,.06);
  }
  .nav-links .lang-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .menu-toggle { display: flex; }

  .hero-title { font-size: 2.75rem; }
  .hero-content { padding-top: 3rem; }
  .section-padding { padding: 4.5rem 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  /* Prevent any element from causing horizontal overflow */
  .stats-bar, .section-padding, section, footer {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

@media (max-width: 520px) {
  .container { padding: 0 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-item { padding: .5rem .5rem; min-width: 0; }
  .stat-number { font-size: 2rem; }
  .stat-unit { font-size: 1rem; }
  .stat-label { font-size: .75rem; letter-spacing: .02em; }
  .stat-icon svg { width: 22px; height: 22px; }
  .hero-title { font-size: 2.25rem; }
  .hero-subtitle { font-size: .9375rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-badge { font-size: .75rem; }
}

/* --- 14. Scroll to Top Button -------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all .4s var(--ease-out);
  border: none;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(15, 82, 186, 0.4);
}
@media (max-width: 768px) {
  .back-to-top { bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; }
}
