/* Maro Medical Center - refined medical UX overlay */

:root {
  --navy: #123B72;
  --royal: #1E5AB6;
  --page: #F7F9FC;
  --ink: #132033;
  --muted: #667085;
  --gold: #C69A3C;
  --primary: #123B72;
  --primary-dark: #0E2F5A;
  --primary-deep: #123B72;
  --primary-light: #E8F0FA;
  --royal-blue: #1E5AB6;
  --gold-accent: #C69A3C;
  --bg-body: #F7F9FC;
  --bg-surface: #ffffff;
  --bg-subtle: #EEF3F9;
  --text-main: #132033;
  --text-muted: #667085;
  --border-color: #D9E2EC;
  --container-max: 1200px;
  --radius-md: 18px;
  --radius-lg: 20px;
  --nav-height: 72px;
  --fab-safe: 96px;
  --font-arabic: 'IBM Plex Sans Arabic', 'Cairo', system-ui, sans-serif;
  --shadow-sm: 0 4px 16px rgba(18, 59, 114, 0.06);
  --shadow-md: 0 10px 28px rgba(18, 59, 114, 0.08);
  --primary-gradient: linear-gradient(135deg, #1E5AB6 0%, #123B72 100%);
}

[data-theme="dark"] {
  --navy: #1E5AB6;
  --royal: #4C8DDF;
  --page: #0B1524;
  --ink: #F4F7FB;
  --muted: #C5D0DE;
  --bg-body: #0B1524;
  --bg-surface: #15263C;
  --bg-subtle: #1B2E46;
  --text-main: #F4F7FB;
  --text-muted: #C5D0DE;
  --border-color: #2F4663;
  --primary: #1E5AB6;
  --primary-dark: #163F86;
  --primary-light: #1E3A5F;
}

html { direction: rtl; }
html[dir="ltr"] { direction: ltr; }

body {
  font-family: var(--font-arabic);
  background: var(--page);
  color: var(--ink);
  line-height: 1.75;
  padding-bottom: var(--fab-safe);
}

.container { max-width: var(--container-max); }

.btn {
  border-radius: 12px;
  min-height: 48px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.btn:focus-visible,
.nav-link:focus-visible,
.theme-toggle-btn:focus-visible,
.language-toggle-btn:focus-visible,
.mobile-menu-btn:focus-visible,
.form-control:focus-visible,
.fab-main:focus-visible,
.fab-choice:focus-visible {
  outline: 3px solid #1E5AB6;
  outline-offset: 3px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover { background: #0E2F5A; color: #fff; }
[data-theme="dark"] .btn-primary { background: #1E5AB6; color: #fff; }

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid #C9D7E8;
}
.btn-secondary:hover { background: var(--primary-light); color: var(--navy); }
[data-theme="dark"] .btn-secondary:hover {
  background: #163F86 !important;
  color: #ffffff !important;
}

.btn-gold {
  background: var(--navy);
  color: #fff;
}
.btn-gold:hover { background: #0E2F5A; color: #fff; }

.top-bar-badge,
.footer .top-bar-badge { display: none !important; }
.header {
  height: var(--nav-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1000;
}
.header.scrolled { height: 64px; box-shadow: 0 6px 20px rgba(18, 59, 114, 0.10); }
[data-theme="dark"] .header { background: #101E31; border-bottom-color: #2A3E58; }
[data-theme="dark"] .header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38); }

/* One header shape on every screen size: logo, visible links, then the same
   round icon buttons and navy booking CTA that the phone layout uses. */
.header, .header.scrolled { height: 64px; }
.header-container { gap: 16px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions > a.btn,
.header-actions .btn.btn-sm {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.88rem;
  white-space: nowrap;
}
.mobile-menu-btn { width: 40px; height: 40px; }
@media (min-width: 1025px) {
  .mobile-menu-btn { display: none !important; }
}
@media (max-width: 1024px) {
  .mobile-menu-btn { display: inline-flex !important; }
}
@media (max-width: 479px) {
  .header-actions > a.btn, .header-actions .btn.btn-sm { display: none !important; }
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--navy);
  box-shadow: none;
}
.logo-pulse-ring { display: none; }
.logo-title { font-size: 1.12rem; font-weight: 800; color: var(--ink); }
.logo-title span { color: var(--navy); }
.logo-slogan { font-size: 0.72rem; color: var(--muted); }

.nav-menu { gap: 8px; }
.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
}
.nav-link::after { display: none; }
.nav-link:hover, .nav-link.active { color: var(--navy); background: var(--primary-light); border-radius: 10px; }

.nav-item { position: relative; }
.nav-sub-toggle {
  background: none;
  border: 0;
  font: inherit;
}
.nav-sub {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 30;
}
html[dir="ltr"] .nav-sub { right: auto; left: 0; }
.nav-item.open .nav-sub, .nav-item:hover .nav-sub { display: block; }
.nav-sub a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: var(--primary-light); color: var(--navy); }

.nav-menu .btn-book-mobile { display: none; }
  padding: 0 18px;
  min-height: 44px;
}
.theme-toggle-btn, .language-toggle-btn {
  width: 40px;
  height: 40px;
  transform: none;
}
.theme-toggle-btn:hover { transform: none; }

/* Hero */
.hero {
  padding: 40px 0 24px;
  background: var(--page);
  overflow: visible !important;
}
.hero-title {
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0 !important;
  line-height: 1.45 !important;
  overflow: visible;
  padding-block: 0.12em;
}
.hero-content { overflow: visible; }
[data-theme="dark"] .hero-subtitle { color: #D5DEEA !important; }
[data-theme="dark"] .price-amount,
[data-theme="dark"] .price-label,
[data-theme="dark"] .price-currency {
  color: #F4F7FB !important;
}
.hero-subtitle {
  max-width: 640px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.8;
}
.hero-banner-tag, .hero-features-list, .care-note, .floating-badge { display: none !important; }
.hero-image-wrapper {
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.hero-image { height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; }
.hero-image-wrapper:hover .hero-image { transform: none; }

.benefits-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.benefit-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.benefit-card i { color: var(--navy); font-size: 1.15rem; margin-bottom: 10px; }
.benefit-card h3 { font-size: 1rem; margin-bottom: 6px; color: var(--ink); }
.benefit-card p { font-size: 0.88rem; color: var(--muted); margin: 0; }
[data-theme="dark"] .benefit-card { background: var(--bg-surface); }

.stats-section { display: none !important; }

.departments-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.offers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.offer-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.offer-card .offer-body { display: flex; flex-direction: column; flex: 1; }
.offer-card .offer-body > .btn { margin-top: auto; }
.section-title {
  color: var(--text-main) !important;
  font-weight: 800;
  line-height: 1.45;
  overflow: visible;
  padding-top: 0.12em;
}
.section-desc { color: var(--text-muted) !important; }

.dept-card-preview,
.offer-decision,
.benefit-card,
.trust-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
.dept-card-preview { overflow: hidden; }

/* Uniform, uncropped card media (all source images are 4:3) */
.offer-image-box,
.dept-card-img-box {
  height: auto !important;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: var(--bg-subtle);
}
.offer-image,
.dept-card-img,
.offer-decision .offer-image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center center;
}
.offer-card:hover .offer-image,
.dept-card-preview:hover .dept-card-img { transform: none; }

/* Labels sit on photos, so they must stay solid in both themes. */
.offer-ribbon {
  z-index: 4;
  top: 14px;
  inset-inline-start: 14px;
  left: auto;
  right: auto;
}
.offer-ribbon .badge {
  white-space: nowrap;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(16, 35, 61, 0.32);
}
.offer-ribbon .badge-gold {
  background: #C69A3C !important;
  color: #10233D !important;
}
.offer-ribbon .badge-primary,
.offer-ribbon .badge-teal,
.offer-ribbon .badge-rose {
  background: #1E5AB6 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .badge-gold {
  background: #C69A3C;
  color: #10233D;
}
[data-theme="dark"] .badge-primary,
[data-theme="dark"] .badge-teal,
[data-theme="dark"] .badge-rose {
  background: #1E5AB6;
  color: #ffffff;
}
.dept-card-title,
.offer-decision .offer-title,
.benefit-card h3,
.trust-card h3 {
  color: var(--text-main) !important;
}
.dept-card-text,
.offer-desc,
.benefit-card p,
.trust-card p {
  color: var(--text-muted) !important;
}
.dept-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.dept-pills span {
  background: #E8F0FA;
  color: #123B72 !important;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.dept-card-preview .btn-secondary {
  background: #fff;
  color: #123B72 !important;
  border: 1.5px solid #123B72;
}
[data-theme="dark"] .dept-pills span {
  background: #1E3A5F;
  color: #F4F7FB !important;
}
[data-theme="dark"] .dept-card-preview .btn-secondary,
[data-theme="dark"] .offer-decision .btn-secondary,
[data-theme="dark"] .btn-secondary {
  background: #1E5AB6 !important;
  color: #ffffff !important;
  border-color: #1E5AB6 !important;
}

.offer-decision {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.offer-decision .offer-image { height: auto; }
.offer-decision .offer-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.offer-decision .offer-title { font-size: 1.15rem; }
.offer-includes { margin: 0; padding: 0; display: grid; gap: 6px; }
.offer-includes li {
  position: relative;
  padding-right: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}
.offer-includes li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--navy);
  border-radius: 50%;
  position: absolute;
  right: 0;
  top: 8px;
}
html[dir="ltr"] .offer-includes li { padding-right: 0; padding-left: 16px; }
html[dir="ltr"] .offer-includes li::before { right: auto; left: 0; }
.price-amount { color: var(--navy); }
.offer-condition { font-size: 0.8rem; color: var(--muted); background: var(--bg-subtle); border-radius: 10px; padding: 8px 10px; }
.gold-note { color: var(--gold); font-weight: 700; font-size: 0.82rem; }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.trust-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
}
.trust-card h3 { margin: 12px 0 8px; }
.trust-card p { color: var(--muted); margin: 0; }

.cta-final {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.cta-final h2, .cta-final p { color: #fff; }
.cta-final .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.free-promo-box { display: none !important; }

.page-hero {
  padding: 40px 0 32px;
  background: linear-gradient(135deg, #123B72 0%, #1E5AB6 100%);
}
.booking-hero { padding: 28px 0 22px; }
.page-hero-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}
.consent-row input { margin-top: 4px; width: 18px; height: 18px; }
.consent-row a { color: var(--navy); text-decoration: underline; }

.whatsapp-alt {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.whatsapp-alt a { color: #128C4A; font-weight: 700; }

.fab-dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
html[dir="ltr"] .fab-dock { left: auto; right: 16px; align-items: flex-end; }
.fab-main, .fab-scroll {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: #128C4A;
  box-shadow: 0 8px 20px rgba(18, 140, 74, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.fab-scroll {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border-color);
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}
.fab-scroll.visible { opacity: 1; pointer-events: auto; }
.fab-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 180px;
}
.fab-dock.open .fab-panel { display: grid; gap: 6px; }
.fab-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
}
.fab-choice:hover { background: var(--bg-subtle); }
.modal-backdrop { visibility: hidden; }
.modal-backdrop.active { visibility: visible; }

.footer {
  background:
    linear-gradient(180deg, rgba(198, 154, 60, 0.07) 0, transparent 72px),
    #0B1F3A;
  color: #C9D4E3;
  border-top: 1px solid rgba(198, 154, 60, 0.32);
  padding: 72px 0 28px;
}
.footer-grid {
  gap: 40px 48px;
  margin-bottom: 48px;
  align-items: start;
}
.footer-brand { gap: 18px; }
.footer-brand .logo-title,
.footer-brand .logo-title span { color: #F7F4EE !important; }
.footer-brand .logo-slogan { color: #D4B56A !important; letter-spacing: 0.04em; }
.footer-brand p {
  max-width: 34ch;
  color: #A9B7C9 !important;
  font-size: 0.92rem;
  line-height: 1.9;
}
.footer-heading {
  color: #F7F4EE !important;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  padding-bottom: 12px;
}
.footer-heading::after {
  width: 28px;
  height: 1px;
  background: #C69A3C;
  bottom: 0;
}
html[dir="ltr"] .footer-heading::after { right: auto; left: 0; }
.footer-links { gap: 4px; }
.footer-link {
  color: #B7C4D4 !important;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 0;
  gap: 10px;
  transform: none !important;
}
.footer-link i { display: none; }
.footer-link::before {
  content: '';
  width: 10px;
  height: 1px;
  background: rgba(198, 154, 60, 0.7);
  flex: 0 0 auto;
}
.footer-link:hover {
  color: #E8D5A3 !important;
  transform: none !important;
}
.footer-contact-list { gap: 14px; }
.footer-contact-item {
  color: #B7C4D4;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.7;
}
.footer-contact-item i {
  width: 32px;
  height: 32px;
  margin-top: 0;
  border-radius: 8px;
  border: 1px solid rgba(198, 154, 60, 0.35);
  background: rgba(198, 154, 60, 0.08);
  color: #E8D5A3 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.78rem;
}
.footer-contact-item a {
  color: #F7F4EE;
  direction: ltr;
  unicode-bidi: isolate;
}
.footer-contact-item a:hover { color: #E8D5A3; }
.footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #8A99AE;
  padding-top: 22px;
  font-size: 0.82rem;
}
.footer-bottom a { color: #E8D5A3; }
.footer a:hover { color: #E8D5A3; }

@media (min-width: 1025px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
  }
  .hero-visual { order: 0; }
  .hero-image { height: 420px; max-height: none; aspect-ratio: auto; }

  /* Links stay inline and visible from tablet-landscape up, never in a drawer. */
  .nav-menu {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    right: auto !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: row !important;
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
    transition: none !important;
  }
  .nav-sub { position: absolute !important; }
  .nav-menu .btn-book-mobile,
  .mobile-theme-menu-btn { display: none !important; }
}

@media (max-width: 1024px) {
  .benefits-bar, .trust-grid, .departments-overview-grid { grid-template-columns: 1fr 1fr; }
  .hero-visual { order: -1; }
}

@media (max-width: 768px) {
  .hero-actions {
    align-items: stretch;
  }
  .hero-actions .btn {
    width: calc(100% - 72px);
    margin-inline-end: 72px;
  }
  .fab-dock {
    left: 12px;
    bottom: 20px;
  }
  .logo-slogan { display: none; }
  .nav-menu {
    display: none !important;
    position: fixed;
    inset: 100px 16px auto 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 120px);
    overflow: auto;
  }
  .nav-menu.active { display: flex !important; }
  .nav-sub { position: static; box-shadow: none; border: 0; padding: 0 0 0 8px; display: none; }
  .nav-item.open .nav-sub { display: block; }
  .nav-menu .btn-book-mobile {
    display: flex !important;
    margin-top: 8px;
  }
  .benefits-bar, .trust-grid, .departments-overview-grid, .offers-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 16px; }
  .hero-image { aspect-ratio: 16/9; max-height: 220px; }
  .booking-hero { padding: 20px 0 16px; }
  .page-hero { padding: 28px 0 20px; }
  .cta-final { padding: 24px; }
  .fab-dock { left: 12px; bottom: 12px; }
}

/* Keeps in-page anchors and scrollIntoView clear of the fixed header. */
html { scroll-padding-top: 84px; }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 30, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 900;
}
.nav-overlay.active { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }

@media (min-width: 1025px) {
  .nav-overlay { display: none !important; }
  body.nav-open { overflow: visible; }
}

@media (max-width: 1024px) {
  .nav-menu {
    background: var(--bg-surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    justify-content: flex-start !important;
    height: auto !important;
    bottom: auto !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  /* iOS Safari zooms the page when a focused control is under 16px. */
  .form-control,
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
  .consent-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }
  .modal-box {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
  .footer-links .footer-link {
    padding: 7px 0;
  }
}

@media (max-width: 390px) {
  .hero-title { font-size: 1.7rem; }
  .container { padding: 0 16px; }
  .fab-main, .fab-scroll { width: 52px; height: 52px; }
  /* The logo must be able to shrink, otherwise the header pushes the page wider. */
  .header-container { gap: 8px; }
  .header-container .logo-link { min-width: 0; flex: 1 1 auto; }
  .header-container .logo-text { min-width: 0; }
  .header-container .logo-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
}

@media (max-width: 360px) {
  .booking-page-layout { grid-template-columns: minmax(0, 1fr); }
  .booking-form-box,
  .booking-summary-sidebar {
    min-width: 0;
    padding: 18px 14px;
  }
  .booking-form-box .btn,
  .booking-summary-sidebar .btn { white-space: normal; }
}

@media (max-width: 340px) {
  .container { padding: 0 12px; }
  .header-actions { gap: 6px; }
  .header-container .logo-icon { width: 40px; height: 40px; }
  .header-container .logo-title { font-size: 0.95rem; }
}
