/* ============================================================
   mobile-fixes.css — إصلاحات الموبايل الشاملة
   الصقر الجارح — نقل العفش بجدة
   ============================================================ */

/* === GLOBAL: منع الـ overflow الأفقي في كل الصفحات === */
html {
  overflow-x: hidden !important;
}
body {
  overflow-x: hidden !important;
  width: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
img, picture, video, iframe, svg {
  max-width: 100%;
  height: auto;
}
/* Force content sections to stay within bounds — exclude fixed elements */
section, main, footer, article, aside {
  max-width: 100%;
}
/* Ensure fixed-position header stays full width */
.site-header {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}
.sticky-cta-bar {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

/* Hidden utility classes for mobile/desktop */
.d-none-mobile { display: inline-flex !important; }
.d-mobile-only { display: none !important; }

/* ============================================================
   TABLET — max 900px
   ============================================================ */
@media (max-width: 900px) {
  .d-none-mobile { display: none !important; }
  .d-mobile-only { display: inline-flex !important; }
}

/* ============================================================
   MOBILE — max 768px
   ============================================================ */
@media (max-width: 768px) {

  /* ── OVERFLOW CONTAINMENT ────────────────────────── */
  .hero::before,
  section::before,
  section::after {
    display: none !important;
  }

  /* ── CONTAINER PADDING ────────────────────────────── */
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  /* ── SECTION SPACING — reduce large vertical gaps ── */
  section {
    padding: 2.5rem 0 !important;
  }
  .section-title {
    font-size: 1.4rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
  }
  .section-desc {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.7 !important;
  }
  .section-label {
    font-size: 0.75rem !important;
    letter-spacing: 1px !important;
    margin-bottom: 0.5rem !important;
  }

  /* ── HERO SECTION ──────────────────────────────────── */
  .hero {
    padding: 2.5rem 0 2rem !important;
  }
  .hero .badge {
    font-size: 0.78rem !important;
    padding: 6px 12px !important;
    margin-bottom: 1rem !important;
  }
  .hero h1 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    margin-bottom: 1rem !important;
    word-break: break-word;
  }
  .hero h1 br {
    display: none;
  }
  .hero p {
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1.5rem !important;
    padding: 0 !important;
  }

  /* Hero CTAs */
  .hero-cta-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .hero-cta-group .btn {
    width: 100% !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    padding: 12px 10px !important;
    white-space: normal !important;
    line-height: 1.4 !important;
  }

  /* Hero stats */
  .hero-stats {
    gap: 0.75rem !important;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
  }
  .hero-stat {
    min-width: 70px;
    text-align: center;
  }
  .hero-stat-num {
    font-size: 1.6rem !important;
  }
  .hero-stat-label {
    font-size: 0.65rem !important;
    line-height: 1.3 !important;
  }

  /* Hero banner image */
  .hero-main-img {
    padding: 0 16px !important;
    margin-top: 1.5rem !important;
  }
  .hero-main-img img {
    height: 200px !important;
    border-radius: 12px !important;
  }

  /* ── GRIDS — collapse ──────────────────────────────── */
  .grid-2,
  .grid-3,
  .grid-4,
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* 2-col inline grids → 1 col */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Grid span items go back to 1 col */
  [style*="grid-column:span 2"],
  [style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }
  [style*="grid-row:span 2"],
  [style*="grid-row: span 2"] {
    grid-row: span 1 !important;
  }

  /* ── CARDS ─────────────────────────────────────────── */
  .card {
    padding: 1.25rem !important;
  }
  .card h3 {
    font-size: 1.05rem !important;
  }
  .card p {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
  }
  .card-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.3rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Cards with images */
  .card img,
  .card picture img {
    height: 180px !important;
    object-fit: cover;
  }

  /* ── GALLERY ITEMS ─────────────────────────────────── */
  .gallery-item {
    aspect-ratio: 4/3 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 10px !important;
  }
  .gallery-item picture,
  .gallery-item picture img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .gallery-content {
    padding: 8px 10px !important;
  }
  .gallery-content h3 {
    font-size: 0.85rem !important;
    margin: 0 !important;
    line-height: 1.3 !important;
  }
  .gallery-tag {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
  }

  /* Gallery grid page */
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Filters bar */
  .filters-container {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .filter-btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  /* ── PHOTO GALLERY (homepage) ─────────────────────── */
  /* All gallery images same height on mobile */
  [style*="height:450px"],
  [style*="height: 450px"] {
    height: 200px !important;
  }
  [style*="height:380px"],
  [style*="height: 380px"] {
    height: 180px !important;
  }
  [style*="height:340px"],
  [style*="height: 340px"] {
    height: 180px !important;
  }
  [style*="height:220px"],
  [style*="height: 220px"] {
    height: 160px !important;
  }
  [style*="height:194px"],
  [style*="height: 194px"] {
    height: 160px !important;
  }

  /* All gallery images should be full height */
  picture img[style*="height:194px"],
  picture img[style*="height: 194px"] {
    height: 160px !important;
  }

  /* ── COMPARISON TABLE ──────────────────────────────── */
  .comparison-table {
    font-size: 0.78rem !important;
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 8px 5px !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .comparison-table th {
    font-size: 0.72rem !important;
  }

  /* ── PROCESS STEPS ─────────────────────────────────── */
  .process-steps {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .process-step {
    padding: 15px !important;
    gap: 12px !important;
  }
  .process-step-num {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
  }
  .process-step-content h3 {
    font-size: 1rem !important;
  }
  .process-step-content p {
    font-size: 0.85rem !important;
  }

  /* ── PRICING TEASER ────────────────────────────────── */
  .pricing-teaser {
    margin: 0 !important;
    padding: 1.5rem 1rem !important;
    border-radius: 0 !important;
  }
  .pricing-teaser h2 {
    font-size: 1.2rem !important;
  }
  .pricing-teaser p {
    font-size: 0.9rem !important;
  }

  /* ── PRICING CARDS ─────────────────────────────────── */
  .price-pkg-card {
    padding: 25px 20px !important;
    margin-top: 15px !important;
  }
  .price-pkg-card.popular {
    transform: none !important;
    margin-top: 25px !important;
  }
  .price-pkg-card.popular:hover {
    transform: translateY(-5px) !important;
  }
  .price-pkg-amount {
    font-size: 2rem !important;
  }
  .price-pkg-features li {
    font-size: 0.88rem !important;
    padding: 8px 0 !important;
  }

  /* ── CALCULATOR ────────────────────────────────────── */
  .calc-wrapper {
    border-radius: 8px !important;
  }
  .calc-body {
    padding: 15px !important;
  }
  .calc-body .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .calc-checkbox-label {
    font-size: 0.82rem !important;
    padding: 8px 10px !important;
  }
  .calc-result {
    padding: 15px !important;
  }
  #calc-total {
    font-size: 2.2rem !important;
  }

  /* ── TESTIMONIALS / REVIEWS ────────────────────────── */
  .detailed-review {
    padding: 18px !important;
  }
  .detailed-review .review-text {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
  }

  /* ── BLOG CARDS ────────────────────────────────────── */
  .b-img-wrap {
    height: 180px !important;
  }
  .b-img-wrap img {
    height: 180px !important;
  }
  .b-content {
    padding: 15px !important;
  }
  .b-title {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  .b-desc {
    font-size: 0.85rem !important;
    margin-bottom: 12px !important;
  }

  /* ── PAGE HEADER (inner pages) ─────────────────────── */
  .page-header {
    padding: 2.5rem 0 !important;
  }
  .page-header::before {
    display: none !important;
  }
  .page-header h1 {
    font-size: 1.4rem !important;
    line-height: 1.4 !important;
  }
  .page-header p {
    font-size: 0.9rem !important;
    padding: 0 1rem;
    line-height: 1.6 !important;
  }

  /* ── EMERGENCY OFFER BAR ───────────────────────────── */
  .emergency-bar {
    font-size: 0.76rem !important;
    padding: 5px 0 !important;
    line-height: 1.4 !important;
  }
  .emergency-bar .container,
  .emergency-bar .emergency-inner,
  .emergency-bar > div {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px 8px !important;
    padding: 0 28px !important;
  }
  .emergency-badge {
    font-size: 0.65rem !important;
    padding: 1px 5px !important;
  }
  .countdown {
    gap: 2px !important;
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
  }
  .countdown span small {
    font-size: 0.44rem !important;
  }
  .close-emergency {
    font-size: 1rem !important;
    padding: 3px !important;
  }

  /* ── CTA STRIP SECTION ─────────────────────────────── */
  section[style*="background: var(--primary)"] h2,
  section[style*="background:var(--primary)"] h2 {
    font-size: 1.3rem !important;
    line-height: 1.4 !important;
  }
  section[style*="background: var(--primary)"] p,
  section[style*="background:var(--primary)"] p {
    font-size: 0.9rem !important;
  }
  section[style*="background: var(--primary)"] .btn,
  section[style*="background:var(--primary)"] .btn {
    font-size: 0.88rem !important;
    padding: 12px 16px !important;
    white-space: normal !important;
  }

  /* ── FOOTER ────────────────────────────────────────── */
  .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .footer-brand {
    grid-column: 1 !important;
  }
  .site-footer {
    padding-top: 2.5rem !important;
  }

  /* ── TEXT OVERFLOW PREVENTION ───────────────────────── */
  h1, h2, h3, h4 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p {
    overflow-wrap: break-word;
  }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* ── BUTTONS — full width on mobile ────────────────── */
  .btn-lg {
    font-size: 0.95rem !important;
    padding: 12px 20px !important;
    white-space: normal !important;
  }

  /* ── ICON GRID (auto 1fr) ──────────────────────────── */
  [style*="grid-template-columns:auto 1fr"],
  [style*="grid-template-columns: auto 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── TRUST BAR ─────────────────────────────────────── */
  .top-trust-bar {
    font-size: 0.72rem !important;
    gap: 6px !important;
    padding: 5px 10px !important;
  }

  /* ── CTA inline flex wrap ──────────────────────────── */
  [style*="display:flex"][style*="justify-content:center"][style*="flex-wrap:wrap"],
  [style*="display: flex"][style*="justify-content: center"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
}

/* ============================================================
   SMALL MOBILE — max 420px (تليفونات أصغر)
   ============================================================ */
@media (max-width: 420px) {

  /* Container tighter */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Hero even smaller */
  .hero h1 {
    font-size: 1.3rem !important;
  }
  .hero p {
    font-size: 0.85rem !important;
  }

  /* Hero image smaller */
  .hero-main-img img {
    height: 160px !important;
  }

  /* Stats even smaller */
  .hero-stat-num {
    font-size: 1.4rem !important;
  }
  .hero-stat-label {
    font-size: 0.6rem !important;
  }

  /* Cards images */
  .card img,
  .card picture img {
    height: 150px !important;
  }

  /* Section title */
  .section-title {
    font-size: 1.2rem !important;
  }

  /* Page header */
  .page-header h1 {
    font-size: 1.2rem !important;
  }

  /* Pricing cards */
  .price-pkg-amount {
    font-size: 1.8rem !important;
  }

  /* Blog images */
  .b-img-wrap,
  .b-img-wrap img {
    height: 150px !important;
  }

  /* Calculator total */
  #calc-total {
    font-size: 1.8rem !important;
  }
}

/* ============================================================
   MOBILE HEADER REDESIGN + CRO FIXES
   ============================================================ */

/* Hide duplicate WA float on mobile — Sticky Bar is sufficient */
@media (max-width: 768px) {
  .wa-float-new {
    display: none !important;
  }
}

/* ── MOBILE HEADER: Clean, single-layer look ──────────────── */
@media (max-width: 768px) {

  /* TRUST BAR: completely hidden on mobile — info is in Hero Stats */
  .top-trust-bar {
    display: none !important;
  }

  /* EMERGENCY BAR: sleek, compact, modern */
  .emergency-bar {
    padding: 6px 0 !important;
    font-size: 0.75rem !important;
    line-height: 1.3;
    background: linear-gradient(90deg, #1e3a8a, #2563eb) !important;
    border-bottom: none;
  }
  .emergency-bar .container {
    gap: 8px !important;
    padding: 0 12px !important;
  }
  .emergency-badge {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
    border-radius: 3px;
    background: #f59e0b !important;
    animation: none !important;
  }
  .emergency-text.d-mobile-only {
    font-size: 0.7rem !important;
  }
  .countdown {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
    gap: 2px !important;
    background: rgba(255,255,255,0.15) !important;
    border-radius: 4px;
  }
  .countdown span {
    margin: 0 1px !important;
  }
  .countdown small {
    font-size: 0.4rem !important;
  }
  .close-emergency {
    font-size: 0.9rem !important;
    padding: 2px !important;
    right: 4px !important;
    left: auto !important;
  }

  /* HEADER: tighter, cleaner */
  .site-header {
    height: 60px !important;
    border-bottom: 2px solid #e2e8f0;
  }
  body {
    padding-top: 60px !important;
  }

  /* Logo: compact on mobile */
  .logo-img {
    width: 36px !important;
    height: 36px !important;
  }
  .logo-img-wrap {
    gap: 8px !important;
  }
  .logo-main {
    font-size: 1rem !important;
  }
  .logo-sub {
    font-size: 0.6rem !important;
  }

  /* Header CTA: mini call button inside header */
  .menu-toggle {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px;
  }

  /* Mobile nav panel */
  .main-nav {
    top: 60px !important;
  }
}

/* ── Auto-hide emergency bar on scroll ──────────────────── */
.emergency-bar {
  transition: transform 0.3s ease, opacity 0.3s ease, max-height 0.3s ease;
}
@media (max-width: 768px) {
  body.bars-hidden .emergency-bar {
    max-height: 0;
    padding: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

/* ── Desktop trust bar remains visible ──────────────────── */
.top-trust-bar {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Pulse animation for primary CTA button */
@keyframes ctaPulse {
  0% { box-shadow: 0 4px 20px rgba(30,58,138,0.25); }
  50% { box-shadow: 0 4px 30px rgba(30,58,138,0.45), 0 0 0 8px rgba(30,58,138,0.08); }
  100% { box-shadow: 0 4px 20px rgba(30,58,138,0.25); }
}
.hero-cta-group .btn-primary {
  animation: ctaPulse 2.5s ease-in-out infinite;
}
.hero-cta-group .btn-primary:hover {
  animation: none;
}
