/* ==========================================================================
   LAVIE DENTAL CLINICS — DESIGN SYSTEM
   Brand: Premium, calming, spa-like dental experience
   ========================================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Brand Palette — extracted from logo */
  --sage-50:  #F4F7F0;
  --sage-100: #E5ECDD;
  --sage-200: #C8D6BB;
  --sage-300: #A8BC97;
  --sage-400: #9CAF88;   /* Primary brand sage */
  --sage-500: #7A9070;   /* Deep sage */
  --sage-600: #5E7256;
  --sage-700: #475841;

  --beige-50:  #FBF8F1;
  --beige-100: #F5EFE0;
  --beige-200: #E8DEC5;
  --beige-300: #D4C4A0;   /* Primary brand beige */
  --beige-400: #C2AE82;
  --beige-500: #A8946A;
  --beige-600: #836F4D;

  --cream:      #FAF6EC;
  --cream-soft: #FDFBF4;
  --ivory:      #FFFEFB;
  --white:      #FFFFFF;

  /* Text */
  --ink-900: #2C3329;     /* Strong headings */
  --ink-700: #3F4A3C;     /* Headings */
  --ink-500: #5A6357;     /* Body */
  --ink-400: #7C8576;     /* Muted */
  --ink-300: #A8B0A2;     /* Disabled */

  /* Semantic */
  --success: #6B8E5A;
  --warning: #C9A961;
  --error:   #B5654A;
  --info:    #7A9094;

  /* Surfaces */
  --bg-primary:    var(--cream-soft);
  --bg-secondary:  var(--beige-50);
  --bg-tertiary:   var(--sage-50);
  --bg-card:       var(--white);
  --bg-overlay:    rgba(63, 74, 60, 0.55);

  /* Borders */
  --border-subtle: rgba(156, 175, 136, 0.15);
  --border-soft:   rgba(156, 175, 136, 0.25);
  --border-strong: rgba(156, 175, 136, 0.45);

  /* Shadows — soft and warm */
  --shadow-xs:  0 1px 2px rgba(63, 74, 60, 0.04);
  --shadow-sm:  0 2px 8px rgba(63, 74, 60, 0.06);
  --shadow-md:  0 8px 24px rgba(63, 74, 60, 0.08);
  --shadow-lg:  0 20px 50px rgba(63, 74, 60, 0.12);
  --shadow-xl:  0 30px 80px rgba(63, 74, 60, 0.16);
  --shadow-glow: 0 0 0 6px rgba(156, 175, 136, 0.15);

  /* Spacing — 4px scale */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.25rem;   /* 20 */
  --space-6: 1.5rem;    /* 24 */
  --space-8: 2rem;      /* 32 */
  --space-10: 2.5rem;   /* 40 */
  --space-12: 3rem;     /* 48 */
  --space-16: 4rem;     /* 64 */
  --space-20: 5rem;     /* 80 */
  --space-24: 6rem;     /* 96 */
  --space-32: 8rem;     /* 128 */

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-2xl:  40px;
  --radius-pill: 999px;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Playfair Display', 'Cairo', serif;
  --font-script:  'Allura', 'Dancing Script', cursive;
  --font-body:    'Inter', 'Cairo', system-ui, -apple-system, sans-serif;
  --font-arabic:  'Cairo', 'Tajawal', system-ui, sans-serif;

  /* Type scale */
  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.875rem;   /* 14 */
  --fs-base: 1rem;       /* 16 */
  --fs-md:   1.125rem;   /* 18 */
  --fs-lg:   1.25rem;    /* 20 */
  --fs-xl:   1.5rem;     /* 24 */
  --fs-2xl:  1.875rem;   /* 30 */
  --fs-3xl:  2.25rem;    /* 36 */
  --fs-4xl:  3rem;       /* 48 */
  --fs-5xl:  3.75rem;    /* 60 */
  --fs-6xl:  4.5rem;     /* 72 */

  --lh-tight: 1.15;
  --lh-snug:  1.35;
  --lh-base:  1.6;
  --lh-loose: 1.8;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 180ms var(--ease-out);
  --transition-base: 280ms var(--ease-out);
  --transition-slow: 480ms var(--ease-out);

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 960px;
  --header-height: 92px;
}

/* ---------- 2. BASE & RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink-700);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

[dir="rtl"] body, html[dir="rtl"] {
  font-family: var(--font-arabic);
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--sage-200); color: var(--ink-900); }

/* ---------- 3. TYPOGRAPHY ---------- */
.h-display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h4 { font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-snug); color: var(--ink-900); }
h5 { font-size: var(--fs-lg); font-weight: 600; color: var(--ink-900); }

p { line-height: var(--lh-base); }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-500);
  margin-bottom: var(--space-4);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--sage-500);
  font-size: 1.4em;
  line-height: 0.9;
}

.text-muted { color: var(--ink-500); }
.text-faint { color: var(--ink-400); }
.text-sage  { color: var(--sage-500); }
.text-beige { color: var(--beige-500); }

/* ---------- 4. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section { padding: var(--space-24) 0; }
.section-sm { padding: var(--space-16) 0; }
.section-lg { padding: var(--space-32) 0; }

.section-title {
  text-align: center;
  margin-bottom: var(--space-16);
}
.section-title p {
  max-width: 580px;
  margin: var(--space-4) auto 0;
  color: var(--ink-500);
  font-size: var(--fs-md);
}

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-3) auto;
}
.divider-ornament::before,
.divider-ornament::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--beige-300);
}
.divider-ornament .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-400);
}

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--sage-500);
  color: var(--ivory);
}
.btn-primary:hover {
  background: var(--sage-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--beige-300);
  color: var(--ink-900);
}
.btn-secondary:hover {
  background: var(--beige-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--sage-600);
  border-color: var(--sage-400);
}
.btn-outline:hover {
  background: var(--sage-500);
  color: var(--ivory);
  border-color: var(--sage-500);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}
.btn-ghost:hover {
  background: var(--sage-50);
  color: var(--sage-600);
}

.btn-lg { padding: 18px 36px; font-size: var(--fs-base); }
.btn-sm { padding: 10px 20px; font-size: var(--fs-xs); }

.btn-icon { padding: 12px; border-radius: 50%; aspect-ratio: 1; }

/* ---------- 6. HEADER / NAV ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(253, 251, 244, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: background var(--transition-base);
}

.site-header.scrolled {
  background: rgba(253, 251, 244, 0.96);
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  min-width: 0;
}
/* Header logo (icon + Lavie name, landscape) — needs to be readable on mobile */
.brand-mark {
  height: 48px;
  width: auto;
  display: block;
  max-width: 200px;
  object-fit: contain;
}
/* For pages that still want the optional text label next to a square mark */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-text .name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--sage-600);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.brand-text .tag {
  font-size: 0.7rem;
  color: var(--beige-500);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}
/* Footer logo — bigger, stacked logo needs room */
.footer-brand .brand-mark {
  height: 96px;
  width: auto;
  max-width: 240px;
  filter: brightness(0) invert(1);
  margin-bottom: var(--space-4);
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-2);
}
.nav-links a {
  display: inline-block;
  padding: 10px 16px;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  font-weight: 500;
  border-radius: var(--radius-pill);
  position: relative;
  transition: color var(--transition-fast);
}
.nav-links a:hover { color: var(--sage-600); }
.nav-links a.active { color: var(--sage-600); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--sage-400);
  border-radius: 2px;
}

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

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--ink-700);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.lang-switch:hover {
  border-color: var(--sage-400);
  color: var(--sage-600);
}

.menu-toggle { display: none; }

/* ---------- 7. HERO ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-height) + var(--space-12));
  padding-bottom: var(--space-24);
  background: linear-gradient(180deg, var(--cream-soft) 0%, var(--beige-50) 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  min-height: 70vh;
}

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

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin: var(--space-3) 0 var(--space-4);
  color: var(--ink-900);
}
.hero-content h1 .accent {
  font-family: var(--font-script);
  color: var(--sage-500);
  font-weight: 400;
  font-size: 1.1em;
  display: inline-block;
  transform: translateY(8px);
}

.hero-content .lede {
  font-size: var(--fs-md);
  color: var(--ink-500);
  max-width: 520px;
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

.hero-trust {
  display: flex;
  gap: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.hero-trust .stat .num {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  color: var(--sage-600);
  font-weight: 500;
  line-height: 1;
}
.hero-trust .stat .lbl {
  font-size: var(--fs-xs);
  color: var(--ink-400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 4/5;
  max-width: 540px;
  margin-left: auto;
}

.hero-image {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl) var(--radius-2xl) var(--radius-2xl) 120px;
  background:
    linear-gradient(180deg, rgba(156,175,136,0.05), rgba(212,196,160,0.15)),
    url('https://images.unsplash.com/photo-1606811971618-4486d14f3f99?q=80&w=1200&auto=format&fit=crop') center/cover;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.hero-decor-1 {
  position: absolute;
  top: -40px; left: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--beige-200);
  z-index: -1;
}
.hero-decor-2 {
  position: absolute;
  bottom: -30px; right: -30px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: var(--sage-100);
  z-index: -1;
}

.hero-floating-card {
  position: absolute;
  bottom: 40px;
  left: -40px;
  background: var(--white);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 260px;
}
.hero-floating-card .ico {
  width: 44px; height: 44px;
  background: var(--sage-100);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sage-600);
  flex-shrink: 0;
}
.hero-floating-card .label {
  font-size: var(--fs-xs);
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-floating-card .value {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-900);
}

/* Hero ornaments */
.hero-orn {
  position: absolute;
  pointer-events: none;
  opacity: 0.4;
}
.hero-orn-1 { top: 12%; right: 48%; width: 80px; transform: rotate(-15deg); }
.hero-orn-2 { bottom: 8%; left: 5%; width: 60px; transform: rotate(20deg); }

/* ---------- 8. SERVICE CARDS ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.service-card {
  background: var(--white);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sage-200);
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage-400), var(--beige-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}
.service-card:hover::before { transform: scaleX(1); }

.service-card .icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--sage-100), var(--beige-100));
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--sage-600);
  margin-bottom: var(--space-5);
}

.service-card h3 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-3);
  color: var(--ink-900);
}
.service-card p {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
  line-height: 1.7;
}
.service-card .more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--sage-600);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: gap var(--transition-fast);
}
.service-card .more:hover { gap: var(--space-3); color: var(--sage-700); }

/* ---------- 9. DOCTOR CARDS ---------- */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.doctor-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--border-subtle);
  position: relative;
}
.doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.doctor-card .photo {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--sage-100), var(--beige-100));
  position: relative;
  overflow: hidden;
}
.doctor-card .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.doctor-card:hover .photo img { transform: scale(1.05); }

.doctor-card .specialty-badge {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  padding: 6px 14px;
  background: rgba(253, 251, 244, 0.95);
  backdrop-filter: blur(8px);
  color: var(--sage-600);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.doctor-card .info {
  padding: var(--space-6);
}
.doctor-card .info h4 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  color: var(--ink-900);
  margin-bottom: var(--space-2);
}
.doctor-card .meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--beige-500);
  margin-bottom: var(--space-3);
}
.doctor-card .bio {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  margin-bottom: var(--space-5);
  line-height: 1.55;
}
.doctor-card .languages {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  font-size: var(--fs-xs);
  color: var(--ink-400);
}
.doctor-card .languages .pill {
  padding: 4px 10px;
  background: var(--sage-50);
  border-radius: var(--radius-pill);
  color: var(--sage-600);
  font-weight: 500;
}

/* ---------- 10. TESTIMONIAL CARDS ---------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.testimonial-card {
  padding: var(--space-8);
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all var(--transition-base);
}
.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sage-200);
}
.testimonial-card .quote-mark {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--beige-300);
  line-height: 0.5;
  margin-bottom: var(--space-3);
}
.testimonial-card .text {
  color: var(--ink-700);
  font-size: var(--fs-md);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  font-style: italic;
}
.testimonial-card .person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.testimonial-card .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--sage-100);
  display: grid;
  place-items: center;
  color: var(--sage-600);
  font-weight: 600;
  font-size: var(--fs-md);
}
.testimonial-card .person .name {
  font-weight: 600;
  color: var(--ink-900);
  font-size: var(--fs-sm);
}
.testimonial-card .person .role {
  font-size: var(--fs-xs);
  color: var(--ink-400);
}

/* ---------- 11. CTA BANNER ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--sage-500) 0%, var(--sage-600) 100%);
  color: var(--ivory);
  border-radius: var(--radius-2xl);
  padding: var(--space-16);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 320px; height: 320px;
  background: rgba(212, 196, 160, 0.15);
  border-radius: 50%;
}
.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.cta-banner .content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}
.cta-banner h2 {
  color: var(--ivory);
  font-family: var(--font-display);
  margin-bottom: var(--space-4);
}
.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-md);
  margin-bottom: var(--space-8);
}
.cta-banner .btn-primary {
  background: var(--ivory);
  color: var(--sage-700);
}
.cta-banner .btn-primary:hover {
  background: var(--beige-100);
}
.cta-banner .btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--ivory);
}
.cta-banner .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--ivory);
}

/* ---------- 12. FOOTER ---------- */
.site-footer {
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.75);
  padding: var(--space-20) 0 var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}
/* (legacy rule overridden above) */
.footer-brand .name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ivory);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-6);
  max-width: 320px;
  font-size: var(--fs-sm);
}
.footer-socials {
  display: flex;
  gap: var(--space-3);
}
.footer-socials a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--beige-200);
  transition: all var(--transition-fast);
}
.footer-socials a:hover {
  background: var(--sage-500);
  color: var(--ivory);
  transform: translateY(-2px);
}

.footer-col h5 {
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-3); }
.footer-col a {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--fs-sm);
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--beige-200); }

.footer-contact { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-contact .item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--fs-sm);
}
.footer-contact .item svg {
  color: var(--sage-300);
  margin-top: 2px;
  flex-shrink: 0;
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.4);
}

/* ---------- 13. PAGE HEADER (sub-pages) ---------- */
.page-header {
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
  background: linear-gradient(180deg, var(--sage-50) 0%, var(--cream-soft) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header h1 {
  font-family: var(--font-display);
  margin-bottom: var(--space-3);
}
.page-header p {
  color: var(--ink-500);
  max-width: 580px;
  margin: 0 auto;
}
.page-header .breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--ink-400);
  font-size: var(--fs-xs);
  margin-bottom: var(--space-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-header .breadcrumb a:hover { color: var(--sage-600); }
.page-header .breadcrumb .sep { color: var(--beige-400); }

/* ---------- 14. FORM ELEMENTS ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
.form-grid .full { grid-column: span 2; }

.form-field { display: flex; flex-direction: column; gap: var(--space-2); }
.form-field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--ivory);
  color: var(--ink-900);
  font-size: var(--fs-base);
  transition: all var(--transition-fast);
  font-family: inherit;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--sage-400);
  box-shadow: var(--shadow-glow);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.form-help { font-size: var(--fs-xs); color: var(--ink-400); }

/* Time slots */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.slot {
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--ivory);
}
.slot:hover { border-color: var(--sage-400); color: var(--sage-600); }
.slot.selected {
  background: var(--sage-500);
  color: var(--ivory);
  border-color: var(--sage-500);
}
.slot.unavailable { opacity: 0.4; pointer-events: none; text-decoration: line-through; }

/* ---------- 15. STEPPER ---------- */
.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-12);
  position: relative;
}
.stepper::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 12%; right: 12%;
  height: 2px;
  background: var(--border-soft);
  z-index: 0;
}
.stepper .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}
.stepper .step .num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--border-soft);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  color: var(--ink-400);
  font-weight: 600;
  transition: all var(--transition-base);
}
.stepper .step.active .num {
  background: var(--sage-500);
  border-color: var(--sage-500);
  color: var(--ivory);
}
.stepper .step.done .num {
  background: var(--beige-300);
  border-color: var(--beige-300);
  color: var(--ink-900);
}
.stepper .step .lbl {
  font-size: var(--fs-xs);
  color: var(--ink-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stepper .step.active .lbl { color: var(--sage-600); font-weight: 600; }

/* ---------- 16. BADGE / CHIP ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: var(--sage-50);
  color: var(--sage-600);
  font-size: var(--fs-xs);
  font-weight: 500;
  border-radius: var(--radius-pill);
}
.chip-beige { background: var(--beige-100); color: var(--beige-600); }
.chip-soft { background: var(--ivory); color: var(--ink-500); border: 1px solid var(--border-soft); }

/* ---------- 17. UTILITY ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.text-center { text-align: center; }
.relative { position: relative; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ---------- 18. FEATURE LIST ---------- */
.feature-list { display: flex; flex-direction: column; gap: var(--space-5); }
.feature-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.feature-item .check {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sage-100);
  color: var(--sage-600);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.feature-item h4 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: var(--space-1);
}
.feature-item p {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  line-height: 1.6;
}

/* ---------- 19. ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.animate-up { animation: fadeUp 0.8s var(--ease-out) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.float { animation: float 6s ease-in-out infinite; }

/* ---------- 20. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-12); }
  .hero-visual { max-width: 480px; margin: 0 auto; }
  .services-grid, .doctors-grid, .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root { --header-height: 80px; }
  .container { padding-left: var(--space-4); padding-right: var(--space-4); }
  .nav-wrap { gap: var(--space-3); }
  .nav-actions { gap: var(--space-2); }
  .nav-links { display: none; }
  /* Hide "Book Appointment" CTA on mobile - it lives in the mobile menu */
  .nav-actions .btn-primary { display: none; }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--sage-50);
    color: var(--sage-600);
    flex-shrink: 0;
  }
  .lang-switch {
    padding: 6px 10px;
    flex-shrink: 0;
  }
  .lang-switch span { display: none; }
  .brand-text .tag { display: none; }
  .brand-text .name { font-size: 1.2rem; }
  .brand-mark { height: 56px; width: auto; max-width: 180px; }
  .footer-brand .brand-mark { height: 80px; width: auto; max-width: 200px; }

  .section { padding: var(--space-16) 0; }
  .section-lg { padding: var(--space-20) 0; }

  .hero { padding-top: calc(var(--header-height) + var(--space-8)); padding-bottom: var(--space-16); }
  .hero-content h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-trust { flex-direction: column; gap: var(--space-4); }
  .hero-floating-card { display: none; }  /* Hide floating card on mobile to prevent overlap */

  /* Cases slider on mobile */
  .case-card { flex: 0 0 92%; }
  .case-card .case-image, .ba-stage { aspect-ratio: 1/1; }
  .case-card .case-info { padding: var(--space-4) var(--space-5); }
  .slider-arrow {
    display: grid !important;
    place-items: center;
    width: 40px; height: 40px;
    top: auto; bottom: -55px;
    transform: none;
    box-shadow: var(--shadow-md);
  }
  .slider-arrow.prev { left: 30%; }
  .slider-arrow.next { right: 30%; }
  .cases-slider-wrap { padding-bottom: 60px; }
  [dir="rtl"] .slider-arrow.prev { left: auto; right: 30%; }
  [dir="rtl"] .slider-arrow.next { right: auto; left: 30%; }

  .services-grid, .doctors-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: span 1; }
  .slot-grid { grid-template-columns: repeat(3, 1fr); }
  .stepper .step .lbl { display: none; }

  .cta-banner { padding: var(--space-10) var(--space-6); }
}



/* Very narrow phones (iPhone SE, small Android) */
@media (max-width: 380px) {
  .brand-mark { height: 48px; max-width: 150px; }
  .lang-switch { padding: 5px 8px; }
  .menu-toggle { width: 40px; height: 40px; }
  .container { padding-left: var(--space-3); padding-right: var(--space-3); }
}

/* ---------- 21. RTL SUPPORT ---------- */
[dir="rtl"] body,
html[dir="rtl"] body {
  font-family: var(--font-arabic);
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}
[dir="rtl"] .eyebrow {
  letter-spacing: 0.1em;
}
[dir="rtl"] .hero-image {
  border-radius: var(--radius-2xl) var(--radius-2xl) 120px var(--radius-2xl);
}
[dir="rtl"] .hero-floating-card {
  left: auto;
  right: -40px;
}
[dir="rtl"] .nav-links a.active::after { left: 16px; right: 16px; }
[dir="rtl"] .footer-bottom { flex-direction: row-reverse; }
[dir="rtl"] .breadcrumb { flex-direction: row-reverse; }
[dir="rtl"] .hero-visual { margin-left: 0; margin-right: auto; }
[dir="rtl"] .hero-decor-1 { left: auto; right: -40px; }
[dir="rtl"] .hero-decor-2 { right: auto; left: -30px; }
[dir="rtl"] .feature-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .doctor-card .specialty-badge { right: auto; left: var(--space-4); }
[dir="rtl"] .stepper { direction: rtl; }
[dir="rtl"] .footer-grid,
[dir="rtl"] .footer-contact .item { text-align: right; }
[dir="rtl"] .footer-contact .item { flex-direction: row-reverse; }
[dir="rtl"] .footer-bottom > div { flex-direction: row-reverse; }
[dir="rtl"] .btn svg { transform: scaleX(-1); }
[dir="rtl"] .more svg, [dir="rtl"] .breadcrumb svg { transform: scaleX(-1); }
[dir="rtl"] .nav-links { padding: 0; }
[dir="rtl"] .lang-switch span { font-family: var(--font-body); }
[dir="rtl"] .testimonial-card .person { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .doctor-card .meta { flex-direction: row-reverse; }
[dir="rtl"] .service-card .more { flex-direction: row-reverse; }
[dir="rtl"] .hero-trust { flex-direction: row-reverse; }
[dir="rtl"] .nav-actions { flex-direction: row-reverse; }
/* Arabic-specific typography adjustments */
html[lang="ar"] .accent {
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 1em;
  color: var(--sage-500);
}

/* ---------- 22. CASES SLIDER ---------- */
.cases-slider-wrap {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}

.cases-slider {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: var(--space-2) var(--space-1) var(--space-6);
  margin: 0;
  list-style: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.cases-slider::-webkit-scrollbar { display: none; }

.case-card {
  flex: 0 0 calc(55% - var(--space-3));
  scroll-snap-align: start;
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}
.case-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.case-card .case-image {
  aspect-ratio: 1/1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: var(--sage-100);
  position: relative;
}

/* ---- Before/After toggle stage ---- */
.ba-stage {
  position: relative;
  aspect-ratio: 1/1;
  background: var(--sage-100);
  overflow: hidden;
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease;
}
.ba-img.before { opacity: 0; }
.ba-img.after  { opacity: 1; }
.ba-stage[data-state="before"] .ba-img.before { opacity: 1; }
.ba-stage[data-state="before"] .ba-img.after  { opacity: 0; }
.ba-stage[data-state="before"] .ba-state-badge::before { content: "Before"; }
.ba-stage[data-state="after"]  .ba-state-badge::before { content: "After"; }
[dir="rtl"] .ba-stage[data-state="before"] .ba-state-badge::before { content: "قبل"; }
[dir="rtl"] .ba-stage[data-state="after"]  .ba-state-badge::before { content: "بعد"; }

.ba-state-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-800);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.ba-toggle {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-pill);
  padding: 4px;
  display: inline-flex;
  gap: 2px;
  box-shadow: var(--shadow-md);
  z-index: 2;
  backdrop-filter: blur(8px);
}
.ba-tab {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--ink-600);
  transition: all 0.2s ease;
  min-width: 64px;
}
.ba-tab.active {
  background: var(--sage-500);
  color: var(--white);
}
.ba-tab:hover:not(.active) {
  background: var(--sage-50);
  color: var(--ink-800);
}
.case-card.placeholder .case-image {
  background: linear-gradient(135deg, var(--sage-100), var(--beige-100));
  display: grid;
  place-items: center;
}
.case-card.placeholder .case-image::before {
  content: '+';
  font-size: 4rem;
  color: rgba(255,255,255,0.6);
  font-weight: 300;
  font-family: var(--font-display);
}
.case-card .case-info {
  padding: var(--space-5) var(--space-6);
}

/* Slider arrow buttons */
.slider-arrow {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
  color: var(--sage-600);
}
.slider-arrow:hover {
  background: var(--sage-500);
  color: var(--ivory);
  border-color: var(--sage-500);
  transform: translateY(-50%) scale(1.05);
}
.slider-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.slider-arrow.prev { left: -24px; }
.slider-arrow.next { right: -24px; }

[dir="rtl"] .slider-arrow.prev { left: auto; right: -24px; }
[dir="rtl"] .slider-arrow.next { right: auto; left: -24px; }
[dir="rtl"] .slider-arrow svg { transform: scaleX(-1); }

/* Slider dots */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 0;
}
.slider-dots .dot.active {
  background: var(--sage-500);
  width: 28px;
  border-radius: 4px;
}



/* ---------- Responsive Safety Net ---------- */
* { min-width: 0; }
.container { 
  width: 100%;
  max-width: 1200px;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  margin-inline: auto;
}
@media (max-width: 720px) {
  .container { 
    padding-left: var(--space-4); 
    padding-right: var(--space-4); 
  }
  /* prevent any element from overflowing viewport */
  body, main, section { overflow-x: clip; }
  /* Make sure all images and media stay within bounds */
  img, picture, video, iframe { max-width: 100%; }
  /* Tables become scrollable horizontally */
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Force logo to always be visible */
.brand-mark {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* ---------- Contact Page Grid (responsive) ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: var(--space-12);
  align-items: start;
}
@media (max-width: 960px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}
@media (max-width: 720px) {
  .contact-grid > div > div[style*="padding: var(--space-10)"] {
    padding: var(--space-6) !important;
  }
  /* Contact info cards: stack icon and content on very small screens */
  .contact-grid div[style*="display: flex"][style*="gap: var(--space-4)"][style*="padding: var(--space-6)"] {
    padding: var(--space-5) !important;
  }
  /* Make phone numbers wrap properly */
  .contact-grid a[href^="tel:"], 
  .contact-grid a[href*="wa.me"] {
    word-break: break-all;
    font-size: var(--fs-lg) !important;
  }
}


/* ---------- Appointment Page Responsive Grids ---------- */
.appt-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
.appt-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
@media (max-width: 960px) {
  .appt-options-grid,
  .appt-info-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}
