/*
Theme Name: ELGANA - مركز الجنة
Theme URI: https://elgana.com
Description: Custom WordPress theme for مركز الجنة للتخسيس والعلاج الطبيعي (Al Ganna Slimming & Physiotherapy Center)
Version: 1.0.0
Author: ELGANA
Text Domain: elgana
*/

/* ═══════════════════════════════════════════
   Reset
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ═══════════════════════════════════════════
   Theme Tokens — Delta (default light)
   ═══════════════════════════════════════════ */
:root {
  /* Surface */
  --bg: #F7F2EE;
  --bg2: #EFE7E1;
  --surface: #FFFFFF;
  --ink: #241420;
  --muted: #7A6872;
  --line: rgba(36,20,32,.12);
  --plum: #1E1119;

  /* Accent */
  --acc: #B8236F;
  --tint: rgba(184,35,111,.06);

  /* Buttons */
  --btn: #241420;
  --btnInk: #F7F2EE;
  --btnHover: #B8236F;

  /* Chrome */
  --hdr: rgba(247,242,238,.88);
  --shadow: 0 30px 60px -30px rgba(36,20,32,.25);
  --chip: #FFFFFF;

  /* Fixed palette */
  --mag: #B8236F;
  --magDeep: #B8236F;
  --lime: #B5D334;
  --blue: #3A8DE8;
  --wa: #25D366;
  --waInk: #06301A;
  --gold: #C9A66B;
  --cream: #F7F2EE;

  /* Typography */
  --ft: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  --fl: 'Cormorant Garamond', serif;
  --fd: 'El Messiri', 'IBM Plex Sans Arabic', serif;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.1,1);

  /* Direction helpers (overridden by JS for EN) */
  --trk: 0;
  --flip: 1;
}

/* ═══════════════════════════════════════════
   Theme Tokens — Zayed (dark VIP)
   ═══════════════════════════════════════════ */
[data-theme="zayed"] {
  --bg: #0F0A0D;
  --bg2: #171015;
  --surface: #1A1217;
  --ink: #EFE6DA;
  --muted: #A8979F;
  --line: rgba(239,230,218,.14);
  --plum: #171015;

  --acc: #C9A66B;
  --tint: rgba(201,166,107,.08);

  --btn: #C9A66B;
  --btnInk: #120B10;
  --btnHover: #DDBF8A;

  --hdr: rgba(15,10,13,.86);
  --shadow: 0 30px 60px -30px rgba(0,0,0,.8);
  --chip: #1A1217;
}

/* English overrides */
[data-lang="en"] {
  --trk: .28em;
  --flip: -1;
  --fd: 'Cormorant Garamond', serif;
}

/* ═══════════════════════════════════════════
   Base Elements
   ═══════════════════════════════════════════ */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ft);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .6s var(--ease), color .6s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover { color: var(--acc); }

::selection {
  background: var(--acc);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}

/* ═══════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════ */
@keyframes elgSoft {
  0%   { box-shadow: 0 0 0 0 rgba(184,35,111,.35); }
  100% { box-shadow: 0 0 0 14px rgba(184,35,111,0); }
}
@keyframes elgUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes elgPulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,51,143,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(224,51,143,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,51,143,0); }
}
@keyframes elgFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes elgSheet {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════
   Layout Utilities
   ═══════════════════════════════════════════ */
.elg-section {
  padding: clamp(72px,9vw,144px) clamp(20px,5vw,72px);
}
.elg-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════
   Typography Utilities
   ═══════════════════════════════════════════ */
.elg-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: var(--trk);
  color: var(--muted);
  font-weight: 500;
}
.elg-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--acc);
}

.elg-heading {
  margin: 20px 0 0;
  font-family: var(--fd);
  font-weight: 500;
  font-size: clamp(30px,3.4vw,48px);
  line-height: 1.2;
}

/* ═══════════════════════════════════════════
   Button & Pill
   ═══════════════════════════════════════════ */
.elg-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink);
}
.elg-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.elg-pill:hover { border-color: var(--acc); }

.elg-btn {
  height: 52px;
  padding: 0 30px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btnInk);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .02em;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.elg-btn:hover {
  background: var(--btnHover);
  color: var(--btnInk);
}

.elg-btn-outline {
  height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid var(--acc);
  color: var(--acc);
  background: transparent;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.elg-btn-outline:hover {
  background: var(--acc);
  color: var(--btnInk);
}

.elg-link {
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  text-decoration: none;
  color: inherit;
}
.elg-link:hover {
  color: var(--acc);
  border-color: var(--acc);
}

/* ═══════════════════════════════════════════
   Scrollbar Hiding
   ═══════════════════════════════════════════ */
.elg-scroll-x {
  overflow-x: auto;
  scrollbar-width: none;
}
.elg-scroll-x::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════
   Image Placeholders
   ═══════════════════════════════════════════ */
.elg-img-placeholder {
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.elg-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ═══════════════════════════════════════════
   Overlays, Sheets, Menus
   ═══════════════════════════════════════════ */
.elg-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: auto;
  animation: elgFade .4s ease;
}
.elg-overlay-bg {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(16,7,16,.55);
  animation: elgFade .25s ease;
}
.elg-sheet {
  position: fixed;
  z-index: 96;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 640px;
  border-radius: 28px 28px 0 0;
  animation: elgSheet .4s var(--ease);
  max-height: 86vh;
  overflow: auto;
}
.elg-hidden { display: none !important; }

/* ═══════════════════════════════════════════
   Body Map
   ═══════════════════════════════════════════ */
.body-map-dot {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--acc);
  background: var(--bg);
  cursor: pointer;
  padding: 0;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  transition: all 0.3s var(--ease);
}
.body-map-dot.active {
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  animation: elgSoft 2s infinite;
  background: var(--acc);
}

/* ═══════════════════════════════════════════
   Before / After Slider
   ═══════════════════════════════════════════ */
.ba-slider {
  position: relative;
  overflow: hidden;
  user-select: none;
  border-radius: 4px;
}
.ba-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #fff;
  pointer-events: none;
}
.ba-handle {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 13px;
}

/* ═══════════════════════════════════════════
   Device Lab (dark section)
   ═══════════════════════════════════════════ */
.device-lab {
  background: #160D14;
  color: #EFE6DA;
}
.device-lab .elg-eyebrow { color: #B9A6AE; }
.device-lab .elg-eyebrow::before { background: #C9A66B; }

.device-tab {
  flex-shrink: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: .04em;
  color: #8E7C86;
}
.device-tab.active {
  color: #EFE6DA;
  border-bottom-color: #C9A66B;
}

/* ═══════════════════════════════════════════
   Trust Section (dark)
   ═══════════════════════════════════════════ */
.trust-section {
  background: var(--plum);
  color: #EFE6DA;
}
.trust-section .elg-eyebrow { color: #B9A6AE; }
.trust-section .elg-eyebrow::before { background: #C9A66B; }

/* ═══════════════════════════════════════════
   Footer (dark)
   ═══════════════════════════════════════════ */
.site-footer {
  background: #140B11;
  color: #EFE6DA;
}
.site-footer a { color: #E9D8E2; }
.site-footer a:hover { color: var(--acc); }

/* ═══════════════════════════════════════════
   Sticky Header
   ═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hdr);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

/* ═══════════════════════════════════════════
   Mobile Bottom Bar
   ═══════════════════════════════════════════ */
.mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--hdr);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
}
.mobile-bar a {
  height: 50px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 15px;
}

/* ═══════════════════════════════════════════
   Desktop WhatsApp FAB
   ═══════════════════════════════════════════ */
.wa-fab {
  position: fixed;
  bottom: 28px;
  z-index: 60;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--wa);
  color: var(--waInk);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 40px -12px rgba(6,48,26,.5);
}
[dir="rtl"] .wa-fab { left: 28px; }
[dir="ltr"] .wa-fab { right: 28px; }

/* ═══════════════════════════════════════════
   Responsive: Desktop / Mobile toggle
   ═══════════════════════════════════════════ */
.desktop-only, .elg-desktop-only { display: flex; }
.mobile-only, .elg-mobile-only  { display: none; }

@media (max-width: 959px) {
  .desktop-only, .elg-desktop-only { display: none !important; }
  .mobile-only, .elg-mobile-only  { display: flex; }

  #elg-hero-grid,
  #elg-bm-grid,
  #elg-dev-grid,
  #elg-ba-grid,
  #elg-founder-grid,
  #elg-tests-grid,
  #elg-faq-grid,
  #elg-book-grid,
  #elg-sched-grid {
    grid-template-columns: 1fr !important;
  }

  #elg-hero-grid { gap: 32px !important; }
  #elg-hero-grid > div:last-child { order: -1; justify-self: center !important; }
  #elg-hero-img-wrap { width: min(100%, 320px) !important; }

  #elg-founder-grid > div:first-child { justify-self: center; }

  .wa-fab { bottom: 80px; }
}
