:root {
  --app-radius: 22px;
  --app-header-height: 68px;
  --app-bottom-nav-height: 58px;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-tap-highlight-color: transparent;
}

/* تفعيل تحسينات الجوال فقط بدون تغيير هوية الموقع */
@media (max-width: 900px) {
  body.mobile-app-ui {
    padding-bottom: env(safe-area-inset-bottom);
  }

  #header,
  .header,
  header.site-header,
  header {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  #header .container,
  .header .container,
  header.site-header .container,
  header .container {
    min-height: var(--app-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .container {
    width: calc(100% - 24px);
  }

  section,
  .section,
  .block,
  .card,
  .service-card,
  .feature-card,
  .project-card,
  .about-box,
  .contact-box,
  .hero-card,
  .article-card,
  .inner-hero-box,
  .side-card,
  .cta-box,
  .profile-card {
    border-radius: var(--app-radius);
  }

  img {
    max-width: 100%;
    height: auto;
  }

  h1 {
    font-size: 1.9rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  p,
  li,
  a {
    line-height: 1.7;
  }

  .hero {
    padding: 100px 0 40px !important;
  }

  .hero-card {
    grid-template-columns: 1fr !important;
    gap: 22px;
    text-align: center;
    padding: 22px;
  }

  .hero-content {
    align-items: center;
  }

  .hero-badge {
    margin-inline: auto;
  }

  .profile-card {
    max-width: 250px;
    margin-inline: auto;
  }

  .cards,
  .cards-grid,
  .services-grid,
  .projects-grid,
  .features-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-top: 24px;
  }

  .card {
    width: 100%;
    min-width: 0;
    padding: 20px;
  }

  .card h3 {
    font-size: 24px;
    line-height: 1.25;
  }

  .card p {
    font-size: 15px;
    line-height: 1.8;
  }

  .inner-hero {
    padding: 100px 0 40px;
  }

  .inner-hero-box {
    padding: 22px;
  }

  .inner-hero h1 {
    font-size: 34px;
    line-height: 1.2;
  }

  .inner-hero p {
    font-size: 16px;
    line-height: 1.9;
  }

  .quick-stats {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
  }

  .content-grid {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .side-card {
    position: static;
    top: auto;
    padding: 20px;
  }

  .side-card h3 {
    font-size: 24px;
  }

  .side-card li {
    padding: 10px 0;
    font-size: 15px;
    line-height: 1.7;
  }

  .article-wrap {
    gap: 16px;
  }

  .article-card {
    padding: 20px;
    min-width: 0;
  }

  .article-card h2 {
    font-size: 24px;
    line-height: 1.3;
  }

  .article-card p {
    font-size: 16px;
    line-height: 1.9;
    word-break: break-word;
  }

  .cta-box {
    padding: 22px;
  }

  .cta-box h3 {
    font-size: 24px;
    line-height: 1.3;
  }

  .cta-box p {
    font-size: 15px;
    line-height: 1.8;
  }

  .btn,
  .button,
  button,
  input[type="submit"],
  input[type="button"],
  a.btn {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 600;
  }

  footer {
    padding-bottom: 14px;
    margin-top: 24px;
  }

  .floating-whatsapp,
  .whatsapp-float,
  .chat-float,
  .floating-contact {
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none !important;
  }

  .menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    min-width: 52px;
    font-size: 26px;
    line-height: 1;
  }

  .mobile-menu {
    display: none !important;
  }

  .mobile-menu.open {
    display: grid !important;
  }

  .header-wrap {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
}

/* Splash Screen */
#appSplash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(34,211,238,.10), transparent 25%),
    radial-gradient(circle at top left, rgba(59,130,246,.10), transparent 30%),
    linear-gradient(180deg, #020617 0%, #081120 100%);
  transition: opacity .45s ease, visibility .45s ease, transform .45s ease;
}

#appSplash.hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
}

#appSplash .splash-box {
  text-align: center;
  padding: 28px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  min-width: 240px;
}

#appSplash .splash-logo {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

#appSplash .splash-subtitle {
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 16px;
}

#appSplash .splash-loader {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: #22d3ee;
  animation: splashSpin .9s linear infinite;
}

@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

/* Install bar */
#installAppBar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(2,6,23,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}

#installAppBar.show {
  display: flex;
}

#installAppBar .install-text {
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
}

#installAppBar .install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#installAppBtn,
#closeInstallBar {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}

#installAppBtn {
  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  color: #03111f;
}

#closeInstallBar {
  background: rgba(255,255,255,.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}

/* Page transition */
#pageTransition {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  background: rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .22s ease;
}

#pageTransition.show {
  opacity: 1;
}

@media (max-width: 900px) {
  #installAppBar {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

#appSplash .splash-box {
  text-align: center;
  padding: 28px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  min-width: 240px;
}

#appSplash .splash-icon {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 24px;
  display: block;
  margin: 0 auto 14px;
  border: 2px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

#appSplash .splash-subtitle {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

