/* ============================================================
   شركة النحاس للتطوير العقاري
   ============================================================ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --navy: #0a1a33;
  --navy-light: #12294d;
  --navy-2: #0d2244;
  --gold: #c9a227;
  --gold-light: #e0bc4c;
  --gold-dark: #a88418;
  --gold-gradient: linear-gradient(135deg, #c9a227 0%, #e0bc4c 50%, #c9a227 100%);
  --gold-shine: linear-gradient(135deg, #f0d16b 0%, #c9a227 50%, #e0bc4c 100%);
  --cream: #faf8f2;
  --cream-2: #f5f1e6;
  --white: #ffffff;
  --text: #1a2332;
  --text-muted: #64748b;
  --border: #e8ecf3;
  --green: #25D366;
  --red: #dc2626;
  --shadow-sm: 0 2px 8px rgba(10,26,51,.06);
  --shadow-md: 0 4px 20px rgba(10,26,51,.10);
  --shadow-lg: 0 12px 40px rgba(10,26,51,.15);
  --shadow-gold: 0 6px 24px rgba(201,162,39,.4);
  --shadow-gold-lg: 0 12px 40px rgba(201,162,39,.55);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
  --vh: 1vh;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0; left: 0; right: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.gold-text {
  background: var(--gold-shine);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.scroll-progress {
  position: fixed; top: 0; right: 0;
  height: 3px; width: 0%;
  background: var(--gold-gradient);
  z-index: 10000;
  transition: width .1s ease-out;
  box-shadow: 0 0 12px rgba(201,162,39,.7);
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.25,.8,.25,1);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* الهيدر */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(10,26,51,.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  transition: all .3s;
  border-bottom: 1px solid rgba(201,162,39,.15);
  padding-top: var(--safe-top);
}
.header.scrolled {
  background: rgba(10,26,51,.95);
  box-shadow: 0 4px 30px rgba(0,0,0,.35);
  border-bottom-color: rgba(201,162,39,.3);
}
.header-content { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-text { text-align: left; }
.logo-text h1 { color: var(--white); font-size: 18px; font-weight: 800; line-height: 1.1; }
.logo-text span { color: var(--gold); font-size: 12px; font-weight: 600; }
.logo-icon {
  width: 50px; height: 50px; border-radius: 50%;
  border: 2px solid var(--gold); background: var(--navy-light);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
  transition: all .3s;
}
.logo-icon:hover { box-shadow: 0 0 0 3px rgba(201,162,39,.35), 0 0 20px rgba(201,162,39,.5); transform: rotate(-5deg); }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.logo-icon .logo-fallback {
  color: var(--gold); font-size: 24px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  position: absolute; inset: 0;
}
.logo-icon:not(.no-logo) .logo-fallback { display: none; }
.logo-icon.no-logo img { display: none; }
.logo-icon.large { width: 64px; height: 64px; }

.menu-toggle {
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 10px;
  background: transparent; border: none;
  transition: all .3s; border-radius: 8px;
}
.menu-toggle:active { transform: scale(.9); background: rgba(255,255,255,.1); }
.menu-toggle span { width: 26px; height: 3px; background: var(--white); border-radius: 2px; transition: all .3s; }

/* القائمة الجانبية */
.side-menu {
  position: fixed; top: 0; right: -100%;
  width: 320px; max-width: 85vw;
  height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  z-index: 2000;
  transition: right .4s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
  overscroll-behavior: contain;
}
.side-menu.active { right: 0; }
.side-menu-header {
  padding: 30px 24px 24px; text-align: center;
  border-bottom: 1px solid rgba(201,162,39,.2);
  position: relative;
}
.side-menu-header::after {
  content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 3px;
  background: var(--gold-gradient); border-radius: 2px;
}
.side-menu-header .logo-icon { margin: 0 auto 12px; width: 70px; height: 70px; }
.side-menu-header .logo-fallback { font-size: 32px; }
.side-menu-header h3 { color: var(--white); font-size: 18px; font-weight: 800; }
.side-menu-header p { color: var(--gold); font-size: 13px; }

.side-nav { flex: 1; display: flex; flex-direction: column; padding: 20px 0; }
.side-nav a {
  color: var(--white); text-decoration: none;
  padding: 16px 24px; font-weight: 600; font-size: 15px;
  border-right: 3px solid transparent;
  transition: all .3s;
}
.side-nav a:hover, .side-nav a:active {
  background: rgba(201,162,39,.08);
  border-right-color: var(--gold);
  color: var(--gold);
  padding-right: 30px;
}
.side-menu-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(201,162,39,.2);
  background: rgba(0,0,0,.2);
}
.side-contact {
  display: block; color: var(--gold); text-decoration: none;
  padding: 12px 16px; font-weight: 700; font-size: 14px;
  direction: ltr; text-align: left; border-radius: 10px;
  transition: all .3s;
}
.side-contact:hover, .side-contact:active { background: rgba(201,162,39,.1); transform: translateX(-4px); }
.side-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0; visibility: hidden;
  transition: all .3s;
}
.side-overlay.active { opacity: 1; visibility: visible; }

/* Hero */
.hero {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(100px + var(--safe-top)) 20px 80px;
  background: url('assets/hero-bg.jpg') center/cover no-repeat fixed;
  background-color: var(--navy);
  overflow: hidden;
}
@media (max-width: 768px) {
  .hero {
    background-attachment: scroll;
    min-height: calc(var(--vh, 1vh) * 100);
    padding: calc(80px + var(--safe-top)) 16px 60px;
  }
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,26,51,.96) 0%, rgba(18,41,77,.88) 50%, rgba(10,26,51,.96) 100%);
}
.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .4; pointer-events: none;
  animation: glowFloat 8s ease-in-out infinite;
}
.glow-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,162,39,.6), transparent 70%);
  top: 10%; right: -100px;
}
.glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(64,120,255,.4), transparent 70%);
  bottom: -100px; left: -150px;
  animation-delay: 4s;
}
@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.1); }
}
.hero-content { position: relative; z-index: 2; max-width: 850px; width: 100%; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 22px;
  background: rgba(201,162,39,.08);
  border: 1px solid rgba(201,162,39,.4);
  border-radius: 50px; color: var(--gold-light);
  font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeInDown .8s ease-out;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}
.hero-title {
  font-size: clamp(34px, 9vw, 78px);
  font-weight: 900; color: var(--white);
  margin-bottom: 20px; line-height: 1.1;
  letter-spacing: -1px;
  animation: fadeInUp .8s ease-out .1s both;
}
.hero-subtitle {
  font-size: clamp(14px, 3.5vw, 18px);
  color: rgba(255,255,255,.85);
  margin: 0 auto 32px; max-width: 620px; line-height: 1.8;
  animation: fadeInUp .8s ease-out .2s both;
}
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; animation: fadeInUp .8s ease-out .3s both; }
.hero-phones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: fadeInUp .8s ease-out .4s both; }
.hero-phone {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(201,162,39,.3);
  border-radius: 50px; color: var(--white);
  text-decoration: none; font-weight: 700; font-size: 14px;
  transition: all .3s; direction: ltr;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-phone:hover, .hero-phone:active { background: rgba(201,162,39,.15); border-color: var(--gold); transform: translateY(-2px); }
.hero-phone svg { color: var(--gold); direction: rtl; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* الأزرار */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 32px; border-radius: 50px;
  text-decoration: none; font-weight: 800; font-size: 15px;
  transition: all .3s; cursor: pointer; border: none;
  font-family: inherit; text-align: center;
  min-height: 50px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.btn-gold {
  background: var(--gold-gradient); color: var(--navy);
  box-shadow: var(--shadow-gold);
  background-size: 200% 200%;
  animation: goldShift 3s ease infinite;
}
@keyframes goldShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: var(--shadow-gold-lg); }
.btn-gold:active { transform: translateY(-1px) scale(.98); }
.btn-outline {
  background: rgba(255,255,255,.05); color: var(--white);
  border: 2px solid rgba(255,255,255,.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-outline:hover { background: var(--white); color: var(--navy); border-color: var(--white); transform: translateY(-3px); }

.hero-scroll {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: var(--gold); text-decoration: none;
  animation: bounce 2s infinite;
  opacity: .8;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Sections */
section { padding: 80px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-tag-gold {
  display: inline-block; color: var(--gold-dark);
  font-weight: 700; font-size: 15px;
  position: relative; padding-bottom: 10px;
  letter-spacing: 1px;
}
.section-tag-gold::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 50px; height: 3px;
  background: var(--gold-gradient);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(201,162,39,.5);
}

/* المشاريع */
.projects { background: var(--cream); }
.projects-title {
  font-size: clamp(26px, 6vw, 46px); color: var(--navy);
  text-align: center; font-weight: 900;
  margin: 20px 0 16px; letter-spacing: -1px;
}
.projects-subtitle { text-align: center; color: var(--text-muted); max-width: 620px; margin: 0 auto 50px; font-size: 15px; line-height: 1.8; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }

.project-card {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  min-height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: all .4s;
  box-shadow: 0 4px 20px rgba(10,26,51,.15);
  background: linear-gradient(135deg, #12294d, #0a1a33);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.project-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 24px 60px rgba(10,26,51,.28); }
.project-card:active { transform: translateY(-4px) scale(.99); }
.project-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--navy);
  transition: transform .6s;
}
.project-card:hover .project-cover { transform: scale(1.08); }
.project-cover::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,26,51,.98) 0%, rgba(10,26,51,.85) 25%, rgba(10,26,51,.4) 55%, rgba(10,26,51,.05) 100%);
  z-index: 1;
}
.project-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 22px; z-index: 2;
  color: var(--white);
  display: flex; flex-direction: column; gap: 8px;
}
.project-info h3 { color: var(--white); font-size: 22px; font-weight: 900; margin: 0; text-shadow: 0 2px 8px rgba(0,0,0,.6); line-height: 1.2; }
.project-info p {
  color: rgba(255,255,255,.92); font-size: 13px;
  margin: 0; line-height: 1.5; text-shadow: 0 1px 4px rgba(0,0,0,.6);
  display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.project-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.project-meta span {
  background: rgba(201,162,39,.9); color: var(--navy);
  padding: 5px 12px; border-radius: 50px;
  font-size: 11px; font-weight: 800;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(224,188,76,.6);
  white-space: nowrap;
}

/* الخدمات */
.services {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white); padding: 90px 0;
  position: relative; overflow: hidden;
}
.services::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--gold-gradient);
}
.services::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(201,162,39,.08) 0%, transparent 50%);
  pointer-events: none;
}
.services .section-tag-gold { color: var(--gold); }
.services-title { font-size: clamp(26px, 6vw, 46px); color: var(--white); text-align: center; font-weight: 900; margin: 20px 0 16px; }
.services-subtitle { text-align: center; color: rgba(255,255,255,.7); max-width: 620px; margin: 0 auto 50px; font-size: 15px; }
.services-list { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }
.service-item {
  display: grid; grid-template-columns: auto 1fr;
  gap: 24px; padding: 32px 0;
  border-bottom: 1px solid rgba(201,162,39,.15);
  align-items: start; transition: all .4s;
}
.service-item:last-child { border-bottom: none; }
.service-item:hover { padding-right: 12px; }
.service-num {
  font-size: 48px; font-weight: 900;
  background: var(--gold-shine);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1; min-width: 70px;
  transition: all .3s;
}
.service-item:hover .service-num { transform: scale(1.1); }
.service-body h3 { color: var(--white); font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.service-body p { color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.9; }

/* تواصل */
.contact { background: var(--cream); position: relative; overflow: hidden; }
.contact::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: linear-gradient(135deg, rgba(201,162,39,.06), transparent);
  transform: rotate(-15deg); pointer-events: none;
}
.contact::after {
  content: ''; position: absolute; bottom: -50%; left: -20%;
  width: 60%; height: 200%;
  background: linear-gradient(135deg, transparent, rgba(201,162,39,.06));
  transform: rotate(-15deg); pointer-events: none;
}
.contact-title { font-size: clamp(26px, 6vw, 46px); color: var(--navy); text-align: center; font-weight: 900; margin: 20px 0 16px; }
.contact-subtitle { text-align: center; color: var(--text-muted); max-width: 620px; margin: 0 auto 40px; font-size: 15px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 750px; margin: 0 auto 26px; position: relative; z-index: 1; }
.contact-card {
  display: flex; align-items: center; gap: 16px;
  padding: 24px; background: var(--white);
  border-radius: var(--radius-md); text-decoration: none;
  box-shadow: 0 4px 16px rgba(10,26,51,.06);
  transition: all .4s;
  border: 1px solid rgba(201,162,39,.15);
  -webkit-tap-highlight-color: transparent;
}
.contact-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(10,26,51,.15); border-color: var(--gold); }
.contact-card:active { transform: translateY(-3px) scale(.98); }
.contact-card-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(201,162,39,.15), rgba(201,162,39,.05));
  color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .4s;
}
.contact-card:hover .contact-card-icon { background: var(--gold-gradient); color: var(--navy); transform: rotate(-10deg) scale(1.05); }
.contact-card-text { text-align: right; }
.contact-card-text span { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 4px; font-weight: 600; }
.contact-card-text strong { color: var(--navy); font-size: 20px; font-weight: 900; }
.btn-whatsapp {
  display: flex; margin: 0 auto; max-width: 340px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white); padding: 18px 32px; border-radius: 50px;
  font-weight: 800; font-size: 16px;
  transition: all .4s;
  box-shadow: 0 8px 24px rgba(10,26,51,.25);
  position: relative; z-index: 1;
}
.btn-whatsapp:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(10,26,51,.4); }
.btn-whatsapp svg { color: var(--green); filter: drop-shadow(0 0 6px rgba(37,211,102,.5)); }
.contact-location {
  text-align: center; color: var(--text-muted);
  margin-top: 26px; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; z-index: 1;
}
.contact-location svg { color: var(--gold-dark); }

/* الفوتر */
.footer {
  background: linear-gradient(180deg, var(--navy) 0%, #050e1c 100%);
  color: var(--white); padding: 60px 0 0;
  position: relative; overflow: hidden;
}
.footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gold-gradient); }
.footer-brand { display: flex; align-items: center; gap: 16px; justify-content: center; margin-bottom: 20px; position: relative; z-index: 1; }
.footer-brand h3 { color: var(--gold); font-size: 22px; font-weight: 900; }
.footer-brand p { color: rgba(255,255,255,.6); font-size: 12px; letter-spacing: 3px; font-weight: 600; }
.footer-desc { text-align: center; color: rgba(255,255,255,.75); max-width: 520px; margin: 0 auto 40px; font-size: 14px; position: relative; z-index: 1; }
.footer-columns {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px; padding: 30px 0;
  border-top: 1px solid rgba(201,162,39,.2);
  border-bottom: 1px solid rgba(201,162,39,.2);
  position: relative; z-index: 1;
}
.footer-col h4 { color: var(--gold); font-size: 16px; font-weight: 800; margin-bottom: 16px; position: relative; padding-bottom: 8px; }
.footer-col h4::after { content: ''; position: absolute; bottom: 0; right: 0; width: 30px; height: 2px; background: var(--gold-gradient); }
.footer-col a { display: block; color: rgba(255,255,255,.8); text-decoration: none; padding: 8px 0; font-size: 14px; transition: all .3s; }
.footer-col a:hover, .footer-col a:active { color: var(--gold); padding-right: 8px; }
.footer-bottom { text-align: center; padding: 22px 0; padding-bottom: calc(22px + var(--safe-bottom)); color: rgba(255,255,255,.6); font-size: 13px; }

/* واتساب عائم */
.whatsapp-float {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: calc(20px + var(--safe-left));
  width: 60px; height: 60px;
  background: var(--green); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.5);
  z-index: 999; transition: all .3s;
  animation: whatsappPulse 2s infinite;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.whatsapp-float svg { width: 32px; height: 32px; }
.whatsapp-float:hover, .whatsapp-float:active { transform: scale(1.15); }
.whatsapp-tooltip {
  position: absolute; right: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) scale(.9);
  background: var(--navy); color: var(--white);
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all .3s;
}
.whatsapp-float:hover .whatsapp-tooltip { opacity: 1; transform: translateY(-50%) scale(1); }
@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37,211,102,.5), 0 0 0 0 rgba(37,211,102,.7); }
  50% { box-shadow: 0 6px 20px rgba(37,211,102,.5), 0 0 0 16px rgba(37,211,102,0); }
}

/* Modal */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(10,26,51,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000; padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal.active { display: flex; align-items: flex-start; justify-content: center; padding: 20px 12px; }
.modal-content {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 0; max-width: 900px; width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(var(--vh, 1vh) * 100 - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: modalIn .4s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute; top: 16px; left: 16px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.95); color: var(--navy);
  border: none; border-radius: 50%;
  font-size: 26px; cursor: pointer; transition: all .3s;
  line-height: 1; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover, .modal-close:active { background: var(--gold); color: var(--white); transform: rotate(90deg); }
.modal-content h3 { color: var(--navy); font-size: 22px; margin-bottom: 8px; padding: 26px 20px 0 50px; font-weight: 800; }
.modal-hint { color: var(--text-muted); font-size: 13px; padding: 0 20px 16px; }

/* تفاصيل المشروع */
.project-modal-content { padding: 0 !important; overflow-x: hidden; border-radius: var(--radius-lg); }
.proj-hero { position: relative; width: 100%; height: 320px; background: var(--navy); background-size: cover; background-position: center; overflow: hidden; }
.proj-hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(10,26,51,.85) 0%, rgba(10,26,51,.55) 60%, rgba(10,26,51,.7) 100%); }
.proj-hero-content { position: relative; z-index: 2; padding: 40px 26px 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.proj-category-badge { display: inline-block; background: var(--gold-gradient); color: var(--navy); padding: 6px 18px; border-radius: 50px; font-weight: 800; font-size: 12px; align-self: flex-start; box-shadow: 0 4px 14px rgba(201,162,39,.5); }
.proj-hero-title { color: var(--white); font-size: clamp(22px, 5vw, 32px); font-weight: 900; line-height: 1.2; text-shadow: 0 2px 12px rgba(0,0,0,.4); padding: 0 !important; margin: 0 !important; }
.proj-hero-location { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-light); font-size: 14px; font-weight: 700; }
.proj-hero-location svg { color: var(--gold); }
.proj-desc { padding: 24px 26px 8px; color: var(--text-muted); font-size: 15px; line-height: 1.85; text-align: right; }
.proj-stats { display: flex; flex-direction: column; gap: 12px; padding: 16px 26px 8px; }
.proj-stat-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: var(--cream); border-radius: var(--radius-md); border: 1px solid var(--border); transition: all .3s; }
.proj-stat-card:hover { border-color: var(--gold); box-shadow: 0 6px 20px rgba(201,162,39,.15); transform: translateX(-4px); }
.proj-stat-text { text-align: right; flex: 1; }
.proj-stat-label { display: block; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.proj-stat-value { color: var(--navy); font-size: 20px; font-weight: 900; }
.proj-stat-icon { width: 54px; height: 54px; border-radius: 50%; background: rgba(201,162,39,.12); color: var(--gold-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .3s; }
.proj-stat-card:hover .proj-stat-icon { background: var(--gold-gradient); color: var(--navy); transform: scale(1.08) rotate(-6deg); }
.proj-features-section { padding: 26px 26px 8px; }
.proj-features-title { color: var(--navy); font-size: 19px; font-weight: 900; margin-bottom: 16px; text-align: right; position: relative; padding-right: 16px; }
.proj-features-title::before { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 22px; background: var(--gold-gradient); border-radius: 3px; }
.proj-features-list { list-style: none; padding: 0; }
.proj-features-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; color: var(--text);
  font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  flex-direction: row-reverse; justify-content: flex-end;
}
.proj-features-list li:last-child { border-bottom: none; }
.proj-features-list li::before {
  content: '';
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(201,162,39,.15);
  border: 2px solid var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9a227' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
  flex-shrink: 0;
}
.proj-actions { display: flex; flex-direction: column; gap: 12px; padding: 20px 26px 30px; }
.proj-actions .btn { width: 100%; }
.btn-whatsapp-outline { background: var(--white); color: var(--navy); border: 2px solid var(--navy); padding: 14px 32px; }
.btn-whatsapp-outline:hover, .btn-whatsapp-outline:active { background: var(--navy); color: var(--white); transform: translateY(-2px); }
.btn-whatsapp-outline svg { color: var(--green); }
.btn-phone-outline { background: var(--white); color: var(--navy); border: 2px solid var(--border); padding: 14px 32px; }
.btn-phone-outline:hover, .btn-phone-outline:active { background: var(--cream); border-color: var(--gold); transform: translateY(-2px); }
.btn-phone-outline svg { color: var(--gold-dark); }

/* تبويبات المخططات */
.plan-tabs {
  display: flex; gap: 8px;
  margin: 12px 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.plan-tabs::-webkit-scrollbar { height: 4px; }
.plan-tabs::-webkit-scrollbar-thumb { background: rgba(201,162,39,.4); border-radius: 2px; }
.plan-tab {
  padding: 10px 20px;
  background: var(--cream); color: var(--navy);
  border: 2px solid transparent; border-radius: 50px;
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: all .25s;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.plan-tab:hover { background: rgba(201,162,39,.15); }
.plan-tab:active { transform: scale(.96); }
.plan-tab.active { background: var(--navy); color: var(--gold); border-color: var(--gold); box-shadow: 0 4px 14px rgba(10,26,51,.3); }

/* فلتر الطوابق */
.floor-filter-wrap {
  display: flex; align-items: center; gap: 12px;
  margin: 0 20px 16px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(201,162,39,.08), rgba(201,162,39,.02));
  border-radius: 12px;
  border: 1.5px solid rgba(201,162,39,.3);
}
.floor-filter-label { color: var(--navy); font-weight: 800; font-size: 14px; white-space: nowrap; }
.floor-filter-select {
  flex: 1; padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--navy);
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all .3s;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c9a227' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}
.floor-filter-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }

/* حاوية المخطط */
.plan-wrapper {
  background: #f8fafc;
  border: 2px solid rgba(201,162,39,.25);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 0 20px 14px;
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-width: calc(100vw - 40px);
}
.plan-container {
  position: relative; display: block;
  width: 100%; max-width: 100%;
  line-height: 0;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.plan-container img { display: block; width: 100%; height: auto; max-width: 100%; pointer-events: none; user-select: none; -webkit-user-select: none; }
.units-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.units-layer polygon, .units-layer rect {
  fill: rgba(201,162,39,.001);
  stroke: transparent; stroke-width: 2;
  transition: fill .2s, stroke .2s;
  vector-effect: non-scaling-stroke;
  cursor: pointer; pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.units-layer polygon:hover, .units-layer rect:hover {
  fill: rgba(201,162,39,.35); stroke: var(--gold);
}
.units-layer polygon.active, .units-layer rect.active {
  fill: rgba(201,162,39,.5); stroke: var(--gold-light); stroke-width: 3;
}
.labels-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.plan-unit-label {
  position: absolute;
  transform: translate(-50%,-50%) scale(.85);
  color: var(--navy); font-weight: 900; font-size: 12px;
  pointer-events: none; white-space: nowrap;
  padding: 3px 10px;
  background: var(--gold-gradient);
  border-radius: 50px;
  opacity: 0; transition: all .3s;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.plan-unit-label.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.plan-actions { display: flex; justify-content: center; padding: 0 20px 20px; }
.unit-details {
  background: var(--cream); padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-right: 4px solid var(--gold);
  display: none; margin: 0 20px 20px;
}
.unit-details.active { display: block; animation: modalIn .3s; }
.unit-details h4 { color: var(--navy); margin-bottom: 14px; font-size: 17px; font-weight: 800; text-align: right; }
.unit-details .info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.unit-details .info-item { background: var(--white); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); border-top: 3px solid var(--gold); }
.unit-details .info-item strong { color: var(--gold-dark); display: block; font-size: 11px; margin-bottom: 4px; font-weight: 700; }
.unit-details .info-item span { color: var(--navy); font-weight: 800; font-size: 14px; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(5,15,30,.98); z-index: 3000; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.lightbox.active { display: block; }
.lightbox-close { position: fixed; top: calc(15px + var(--safe-top)); left: 15px; width: 48px; height: 48px; background: var(--gold-gradient); color: var(--navy); border: none; border-radius: 50%; font-size: 26px; cursor: pointer; z-index: 3010; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.lightbox-hint { position: fixed; top: calc(25px + var(--safe-top)); right: 15px; color: var(--gold-light); font-size: 12px; background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 50px; z-index: 3010; border: 1px solid rgba(201,162,39,.4); }
.lightbox-content { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 70px 10px 20px; }
.lightbox-content img { max-width: 100%; height: auto; display: block; transform-origin: center; transition: transform .2s; user-select: none; -webkit-user-select: none; }

/* لوحة المالك */
.admin-trigger { position: fixed; bottom: 0; right: 0; width: 60px; height: 60px; background: transparent; z-index: 9998; cursor: default; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.admin-content { max-width: 850px; padding: 26px 20px !important; }
.admin-content h3 { padding: 0 0 0 50px; }

.storage-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--cream); border-radius: 12px; border: 1px solid var(--border); margin: 16px 0; flex-wrap: wrap; }
.storage-bar #storageInfo { font-size: 13px; font-weight: 700; color: var(--navy); flex: 1; min-width: 200px; }
.btn-clear-storage { padding: 8px 14px; font-size: 12px; font-weight: 700; background: var(--navy); color: var(--gold); border: 1px solid var(--gold); border-radius: 50px; cursor: pointer; font-family: inherit; transition: all .3s; -webkit-tap-highlight-color: transparent; }
.btn-clear-storage:hover, .btn-clear-storage:active { background: var(--navy-light); }
.storage-bar #logoutBtn { background: var(--red) !important; color: white !important; border-color: var(--red) !important; }

.admin-tabs { display: flex; gap: 8px; margin: 18px 0; border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-btn { padding: 12px 20px; background: transparent; border: none; color: var(--text-muted); font-family: inherit; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; transition: .3s; font-size: 14px; white-space: nowrap; min-height: 44px; -webkit-tap-highlight-color: transparent; }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; }

#addProjectForm { display: flex; flex-direction: column; gap: 10px; }
#addProjectForm label { color: var(--navy); font-weight: 700; font-size: 13px; margin-top: 8px; }
#addProjectForm input[type="text"],
#addProjectForm input[type="file"],
#addProjectForm textarea,
#addProjectForm select {
  padding: 13px 15px; background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-family: inherit; font-size: 14px; width: 100%;
  transition: border-color .3s; min-height: 46px;
}
#addProjectForm input:focus, #addProjectForm textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-2 > div { display: flex; flex-direction: column; }

/* القوالب السريعة */
.quick-templates { margin: 20px 0; padding: 18px; background: linear-gradient(135deg, rgba(201,162,39,.08), rgba(201,162,39,.02)); border-radius: var(--radius-md); border: 2px dashed rgba(201,162,39,.4); }
.quick-templates .units-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.template-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.template-btn {
  padding: 12px 10px; background: var(--white); border: 2px solid var(--border);
  border-radius: 12px; color: var(--navy); font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all .3s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 54px; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.template-btn:hover, .template-btn:active {
  background: var(--gold-gradient); color: var(--navy); border-color: var(--gold);
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(201,162,39,.3);
}

/* مدير المخططات */
.plans-manager { margin: 20px 0; padding: 18px; background: var(--cream); border-radius: var(--radius-md); border: 1px solid var(--border); border-top: 3px solid var(--gold-light); }
.plans-manager-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.plans-hint { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.plan-card { background: var(--white); border: 2px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; transition: all .3s; }
.plan-card:hover { border-color: var(--gold-light); }
.plan-card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.plan-card-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); font-size: 15px; }
.plan-card-title .plan-num { background: var(--navy); color: var(--gold); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--gold); }
.plan-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-card-body { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.plan-thumb { width: 100px; height: 100px; border-radius: 10px; background: var(--cream-2) center/cover; border: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 30px; }
.plan-card-info { flex: 1; min-width: 200px; }
.plan-card-info input { margin-bottom: 8px; }
.plan-units-count { display: inline-block; padding: 4px 12px; background: rgba(201,162,39,.15); color: var(--gold-dark); border-radius: 50px; font-size: 12px; font-weight: 700; border: 1px solid rgba(201,162,39,.4); }
.units-title { color: var(--navy); margin: 0; font-size: 15px; font-weight: 800; }

/* مدير الوحدات المبسط */
.units-manager { margin: 20px 0; padding: 18px; background: var(--cream); border-radius: var(--radius-md); border: 1px solid var(--border); border-top: 3px solid var(--gold-light); }
.units-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.units-header .units-title { margin: 0; }
.units-count { background: rgba(201,162,39,.15); color: var(--gold-dark); padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 700; border: 1px solid rgba(201,162,39,.4); }

.admin-floor-tabs {
  display: flex; gap: 8px; margin: 12px 0; padding: 10px;
  background: var(--white); border-radius: 12px;
  border: 1.5px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  min-height: 60px; align-items: center;
}
.admin-floor-tabs::-webkit-scrollbar { height: 4px; }
.admin-floor-tabs::-webkit-scrollbar-thumb { background: rgba(201,162,39,.4); border-radius: 2px; }
.admin-floor-tabs::before {
  content: '🏢 الطوابق:';
  color: var(--navy); font-weight: 800; font-size: 13px;
  white-space: nowrap; padding-left: 8px;
  border-left: 2px solid var(--border); margin-left: 4px;
}
.admin-floor-tabs .empty-floor-hint { color: var(--text-muted); font-size: 12px; font-style: italic; padding: 0 8px; }
.admin-floor-tab {
  padding: 8px 16px; background: var(--cream);
  border: 2px solid var(--border); border-radius: 50px;
  color: var(--navy); font-family: inherit; font-weight: 700; font-size: 12px;
  cursor: pointer; white-space: nowrap; transition: all .25s; min-height: 38px;
  display: flex; align-items: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.admin-floor-tab:hover { background: rgba(201,162,39,.15); border-color: var(--gold); }
.admin-floor-tab.active { background: var(--navy); color: var(--gold); border-color: var(--gold); box-shadow: 0 4px 12px rgba(10,26,51,.3); }
.admin-floor-tab .floor-count { background: rgba(255,255,255,.2); color: inherit; padding: 2px 8px; border-radius: 50px; font-size: 11px; font-weight: 800; }

.units-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.units-actions .btn { width: 100%; min-height: 48px; }

.unit-row {
  background: var(--white); padding: 14px;
  border-radius: 10px; margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; position: relative;
  border: 1px solid var(--border);
}
.unit-row.hidden-by-floor { display: none !important; }
.unit-row input, .unit-row select {
  padding: 10px 12px; background: var(--white);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: inherit;
  font-size: 13px; width: 100%; min-height: 42px;
}
.unit-row input:focus, .unit-row select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,162,39,.15); }
.unit-row .full { grid-column: span 2; }
.unit-row .remove-unit {
  position: absolute; top: 6px; left: 6px;
  width: 28px; height: 28px;
  background: var(--red); color: #fff;
  border: none; border-radius: 50%;
  cursor: pointer; font-size: 16px;
  line-height: 1; display: flex;
  align-items: center; justify-content: center; z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.unit-floor-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff; font-size: 10px;
  padding: 3px 10px; border-radius: 50px;
  font-weight: 800; z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  max-width: 80px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* محرر الرسم */
.draw-modal-content { max-width: 1200px; padding: 26px 20px !important; }
.draw-modal-content h3 { padding: 0 0 0 50px; }
.draw-mode-switch { display: flex; gap: 8px; margin: 12px 0; }
.mode-btn {
  flex: 1; padding: 12px 14px;
  background: var(--white); border: 2px solid var(--border);
  border-radius: 10px; color: var(--text-muted);
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all .3s; min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.mode-btn.active { background: var(--navy); color: var(--gold); border-color: var(--gold); }
.draw-hint { color: var(--navy); font-size: 13px; font-weight: 600; text-align: center; margin-bottom: 10px; padding: 10px; background: var(--cream); border-radius: 10px; border: 1px solid var(--border); }
.draw-tools-info {
  display: flex; gap: 8px; margin: 10px 0; padding: 10px;
  background: linear-gradient(135deg, rgba(201,162,39,.08), rgba(201,162,39,.02));
  border: 1px dashed rgba(201,162,39,.4);
  border-radius: 12px; font-size: 12px; color: var(--navy);
  flex-wrap: wrap; line-height: 1.5;
}
.draw-tools-info strong { color: var(--gold-dark); font-weight: 800; }
.draw-quick-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin: 12px 0; padding: 12px;
  background: var(--white); border: 2px solid var(--border); border-radius: 12px;
}
.quick-action-btn {
  padding: 12px 14px; background: var(--cream);
  border: 1.5px solid var(--border); border-radius: 10px;
  color: var(--navy); font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all .3s; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-btn:hover, .quick-action-btn:active { background: var(--navy); color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.quick-action-btn.warning { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.quick-action-btn.warning:hover { background: #f59e0b; color: white; }
.draw-toolbar { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 10px 0; padding: 10px; background: var(--cream); border-radius: 10px; flex-wrap: wrap; }
.zoom-label { font-weight: 800; color: var(--navy); min-width: 60px; text-align: center; background: var(--white); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.draw-canvas-scroll { overflow: auto; max-height: 55vh; max-height: 55dvh; background: #f1f5f9; border-radius: var(--radius-md); border: 2px solid var(--border); -webkit-overflow-scrolling: touch; padding: 10px; }
.draw-canvas-wrap { position: relative; background: #fff; border-radius: 8px; overflow: hidden; user-select: none; -webkit-user-select: none; line-height: 0; display: inline-block; min-width: 100%; transform-origin: top center; }
.draw-canvas-wrap img { width: 100%; display: block; pointer-events: none; }
#drawCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; -webkit-tap-highlight-color: transparent; }
.draw-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }

/* رسم الشبكة */
.grid-modal-content { max-width: 500px; padding: 24px 20px !important; }
.grid-modal-content h3 { padding: 0; margin-bottom: 20px; text-align: center; color: var(--navy); font-size: 18px; }
.grid-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.grid-input-row label { display: block; color: var(--navy); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.grid-input-row input { width: 100%; padding: 12px 14px; background: var(--cream); border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 15px; color: var(--text); text-align: center; font-weight: 700; }
.grid-input-row input:focus { outline: none; border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.grid-actions { display: flex; gap: 10px; margin-top: 20px; }
.grid-actions button { flex: 1; padding: 14px; border-radius: 12px; font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer; border: none; min-height: 50px; -webkit-tap-highlight-color: transparent; }
.grid-actions .btn-cancel { background: var(--cream); color: var(--navy); border: 1.5px solid var(--border); }
.grid-actions .btn-create { background: var(--gold-gradient); color: var(--navy); box-shadow: var(--shadow-gold); }

/* قائمة المشاريع */
.admin-project-item { background: var(--cream); padding: 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-right: 4px solid var(--gold); }
.admin-project-item .proj-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-project-item h4 { color: var(--navy); font-size: 16px; font-weight: 800; }
.admin-project-item p { color: var(--text-muted); font-size: 13px; }
.admin-project-item .proj-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-project-item .proj-actions button { padding: 10px 18px; border-radius: 50px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; border: none; color: #fff; transition: all .25s; min-height: 42px; -webkit-tap-highlight-color: transparent; }
.btn-edit { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.btn-edit:hover, .btn-edit:active { transform: translateY(-2px); }
.btn-copy { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-copy:hover, .btn-copy:active { transform: translateY(-2px); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #991b1b; }

/* أزرار عامة */
.btn-primary { background: var(--navy); color: var(--gold); border: 1px solid var(--gold); }
.btn-primary:hover, .btn-primary:active { background: var(--navy-light); transform: translateY(-2px); }
.btn-small { padding: 11px 20px; font-size: 13px; background: var(--cream); color: var(--navy); border: 1px solid var(--border); font-weight: 700; border-radius: 50px; min-height: 44px; }
.btn-small:hover, .btn-small:active { background: var(--navy); color: var(--gold); border-color: var(--gold); }
.btn-draw { background: var(--navy); color: var(--gold); border: 1px solid var(--gold); }
.btn-draw:hover { background: var(--navy-light); }
.btn-accent { background: var(--gold-gradient); color: var(--navy); border: none; font-weight: 800; }
.btn-success { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; border: none; font-weight: 700; }
.btn.full { width: 100%; margin-top: 20px; padding: 16px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* شاشة التحميل */
.loading-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; gap: 16px; color: var(--text-muted); }
.loading-state .spinner { width: 44px; height: 44px; border: 4px solid rgba(21,101,192,.15); border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* تسجيل الدخول */
.login-modal-content { max-width: 420px; padding: 30px 26px 26px !important; text-align: center; }
.login-modal-content .modal-close { background: var(--cream); color: var(--navy); }
.login-icon { width: 80px; height: 80px; margin: 0 auto 16px; background: var(--gold-gradient); color: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(201,162,39,.4); }
.login-panel h4 { color: var(--navy); font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.login-panel p { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.login-panel input { width: 100%; padding: 14px 16px; background: var(--cream); border: 1.5px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 14px; color: var(--text); margin-bottom: 12px; direction: ltr; text-align: left; transition: all .3s; min-height: 48px; }
.login-panel input:focus { outline: none; border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 4px rgba(201,162,39,.15); }
.login-panel .btn { width: 100%; margin-top: 6px; }
.login-error { color: var(--red); font-size: 13px; font-weight: 700; min-height: 20px; margin-bottom: 8px; }
#tab-import textarea { font-family: monospace; font-size: 12px; line-height: 1.5; direction: ltr; text-align: left; }

/* iPhone fixes */
@supports (-webkit-touch-callout: none) {
  .hero { min-height: -webkit-fill-available; }
  .plan-wrapper { max-height: none !important; min-height: auto; }
  .plan-container img { max-height: none !important; width: 100%; height: auto; display: block; }
  .modal.active .modal-content { max-height: none !important; height: auto; overflow-y: visible; }
  .modal { -webkit-overflow-scrolling: touch; overflow-y: auto; }
  .btn, .plan-tab, .tab-btn, .quick-action-btn, .template-btn, .mode-btn, .btn-small, .admin-floor-tab { min-height: 48px; }
  .modal-close { width: 48px; height: 48px; }
  .units-layer polygon, .units-layer rect { -webkit-tap-highlight-color: transparent; }
}

/* التجاوب */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .service-num { font-size: 42px; min-width: 60px; }
}

@media (max-width: 768px) {
  section { padding: 60px 0; }
  .hero { padding: calc(90px + var(--safe-top)) 16px 70px; min-height: calc(var(--vh, 1vh) * 100); }
  .hero-badge { font-size: 12px; padding: 8px 18px; }
  .hero-buttons { gap: 10px; }
  .hero-buttons .btn { padding: 14px 24px; font-size: 14px; width: 100%; max-width: 280px; }
  .hero-phones { flex-direction: column; align-items: center; }
  .hero-phone { width: 100%; max-width: 260px; justify-content: center; padding: 12px 20px; }

  .service-item { grid-template-columns: 1fr; gap: 12px; padding: 24px 0; }
  .service-num { font-size: 36px; min-width: auto; text-align: right; }
  .service-body h3 { font-size: 19px; }
  .service-body p { font-size: 14px; }

  .projects-grid { grid-template-columns: 1fr; gap: 20px; }
  .project-card { min-height: 320px; }

  .contact-cards { grid-template-columns: 1fr; }
  .contact-card { padding: 20px; }

  .modal.active { padding: 0; align-items: flex-start; }
  .modal-content { border-radius: 0; min-height: 100vh; min-height: calc(var(--vh, 1vh) * 100); max-height: none; }
  .modal-close { position: fixed; top: calc(10px + var(--safe-top)); left: 10px; background: var(--gold); color: var(--navy); z-index: 100; }
  .modal-content h3 { padding: 60px 20px 0; }
  .modal-hint { padding: 0 20px 16px; }

  .proj-hero { height: 280px; }
  .proj-hero-content { padding: 30px 20px 20px; }
  .proj-desc { padding: 20px 20px 8px; font-size: 14px; }
  .proj-stats { padding: 14px 20px 8px; gap: 10px; }
  .proj-stat-card { padding: 16px 18px; }
  .proj-stat-value { font-size: 18px; }
  .proj-stat-icon { width: 50px; height: 50px; }
  .proj-features-section { padding: 22px 20px 8px; }
  .proj-features-title { font-size: 17px; }
  .proj-features-list li { padding: 12px 0; font-size: 14px; }
  .proj-actions { padding: 16px 20px 24px; gap: 10px; }
  .proj-actions .btn { padding: 14px 24px; font-size: 14px; }

  .plan-tabs { margin: 12px 16px 10px; }
  .floor-filter-wrap { margin: 0 16px 12px; padding: 10px 12px; }
  .floor-filter-label { font-size: 13px; }
  .floor-filter-select { font-size: 13px; padding: 10px 12px 10px 32px; }
  .plan-wrapper { margin: 0 16px 12px; padding: 8px; max-width: calc(100vw - 32px); }
  .plan-container img { max-height: none; }
  .plan-actions { padding: 0 16px 16px; }
  .plan-actions .btn { width: 100%; }
  .unit-details { margin: 0 16px 16px; padding: 16px; }
  .unit-details .info-row { grid-template-columns: repeat(2, 1fr); }

  .form-row-2 { grid-template-columns: 1fr; }
  .unit-row { grid-template-columns: 1fr 1fr; }
  .draw-canvas-scroll { max-height: 45vh; max-height: 45dvh; }
  .template-buttons { grid-template-columns: repeat(2, 1fr); }

  .footer-brand { flex-direction: column; text-align: center; }
  .footer-columns { text-align: center; grid-template-columns: 1fr; gap: 24px; }
  .footer-col h4::after { right: 50%; transform: translateX(50%); }

  .whatsapp-float { width: 56px; height: 56px; bottom: calc(16px + var(--safe-bottom)); left: calc(16px + var(--safe-left)); }
  .whatsapp-float svg { width: 28px; height: 28px; }
  .whatsapp-tooltip { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .logo-text h1 { font-size: 16px; }
  .logo-text span { font-size: 11px; }
  .logo-icon { width: 44px; height: 44px; }
  .logo-icon .logo-fallback { font-size: 20px; }
  .hero-title { font-size: 32px; }
  .hero-subtitle { font-size: 14px; }
  .section-tag-gold { font-size: 13px; }
  .projects-title, .services-title, .contact-title { font-size: 26px; }
  .projects-subtitle, .services-subtitle, .contact-subtitle { font-size: 14px; }
  .project-card { min-height: 280px; }
  .project-info { padding: 20px 18px; }
  .project-info h3 { font-size: 19px; }
  .project-info p { font-size: 12px; }
  .project-meta span { font-size: 10px; padding: 4px 10px; }
  .contact-card { padding: 18px; }
  .contact-card-text strong { font-size: 17px; }
  .contact-card-icon { width: 48px; height: 48px; }
  .proj-hero { height: 240px; }
  .proj-hero-title { font-size: 22px; }
  .proj-stat-value { font-size: 17px; }
  .proj-stat-label { font-size: 12px; }
  .proj-stat-icon { width: 44px; height: 44px; }
  .unit-row { grid-template-columns: 1fr; }
  .unit-row .full { grid-column: span 1; }
  .unit-details .info-row { grid-template-columns: 1fr 1fr; }
  .unit-details .info-item { padding: 10px 12px; }
  .unit-details .info-item span { font-size: 13px; }
  .plan-container img { max-height: none; }
  .plan-unit-label { font-size: 10px; padding: 2px 8px; }
  .btn { min-height: 48px; padding: 14px 24px; font-size: 14px; }
  .btn.full { font-size: 15px; }
  .quick-action-btn { font-size: 12px; padding: 10px; }
  .template-btn { font-size: 12px; }
  .template-buttons { grid-template-columns: repeat(2, 1fr); }
  .admin-floor-tabs { padding: 8px; }
  .admin-floor-tab { font-size: 11px; padding: 7px 12px; }
  .units-actions { grid-template-columns: 1fr 1fr; }
}

/* منع التأخير عند اللمس */
button, a, .btn, .project-card, .contact-card, .plan-tab, .tab-btn, .admin-floor-tab {
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}