/* =========================================================
   BAGHDAD INTERNATIONAL GROUP — MULTI-DEVICE RESPONSIVE SYSTEM
   PC + Tablet + Android + iPhone / iOS Safe Areas
   ========================================================= */

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
}

/* RTL / LTR General Alignments */
body.lang-en .hero-copy,
body.lang-en .section-heading,
body.lang-en .about-copy,
body.lang-en .why-content,
body.lang-en .contact-box,
body.lang-en .contact-form,
body.lang-en .service-card,
body.lang-en .program-item,
body.lang-en .destination-card,
body.lang-en .subsidiary-card,
body.lang-en .trust-item,
body.lang-en .social-banner-inner,
body.lang-en .why-list,
body.lang-en .why-list > div,
body.lang-en .slide-overlay,
body.lang-en .section-note {
  direction: ltr;
  text-align: left;
}

body.lang-en .hero-actions,
body.lang-en .hero-stats,
body.lang-en .main-nav {
  direction: ltr;
}

body.lang-en .boarding-pass {
  text-align: left;
  direction: ltr;
}

body.lang-en .boarding-pass h3,
body.lang-en .boarding-pass .bp-stub p {
  text-align: left !important;
}

/* Large Desktop (> 1200px) */
@media (min-width: 1200px) {
  .container {
    width: min(1180px, calc(100% - 64px));
  }
  .hero {
    min-height: 780px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    gap: 70px;
  }
}

/* Laptops & Small Desktop (801px - 1199px) */
@media (max-width: 1199px) and (min-width: 801px) {
  .container {
    width: min(1080px, calc(100% - 44px));
  }
  .hero-grid {
    gap: 35px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  }
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .subsidiary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stats-counter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .destinations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .why-grid {
    gap: 50px;
  }
}

/* Desktop Navigation (min-width: 1025px) */
@media (min-width: 1025px) {
  .nav-wrap {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
    gap: 8px !important;
  }

  .brand {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    z-index: 2 !important;
  }

  .main-nav {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    z-index: 1 !important;
    gap: clamp(4px, 0.85vw, 14px) !important;
  }

  .main-nav a {
    font-size: clamp(11px, 0.82vw, 13px) !important;
    white-space: nowrap !important;
  }

  body:not(.lang-en) .main-nav {
    gap: clamp(3px, 0.75vw, 12px) !important;
  }

  body:not(.lang-en) .main-nav a {
    font-size: clamp(10.5px, 0.78vw, 12.5px) !important;
  }

  .header-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    z-index: 2 !important;
  }

  .social, .control-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 13px !important;
  }

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

  .header-actions .social-links {
    display: flex !important;
    gap: 6px !important;
  }
}

/* Tablets & Mobile Navigation Trigger (<= 1024px) */
@media (max-width: 1024px) {
  .container {
    width: min(100% - 28px, 940px);
    margin-inline: auto;
  }

  .nav-wrap {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 72px;
    gap: 10px;
    position: relative !important;
  }

  .brand {
    justify-self: auto !important;
    flex: 1;
    min-width: 0;
  }

  .header-actions {
    justify-self: auto !important;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
  }

  .brand-copy small {
    font-size: 7.5px;
    letter-spacing: 1.5px !important;
  }

  .main-nav {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    width: calc(100% - 24px) !important;
    padding: 16px 14px !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    background: #071827 !important;
    border: 1px solid rgba(228, 196, 125, 0.4) !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999 !important;
  }

  .main-nav.open {
    display: flex !important;
  }

  .main-nav a {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #e4ebf2;
    border: 1px solid transparent;
  }

  .main-nav a:hover {
    background: rgba(197, 154, 74, 0.15);
    color: var(--gold-light);
    border-color: rgba(197, 154, 74, 0.3);
  }

  .mobile-nav-socials {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(228, 196, 125, 0.2);
  }

  .mobile-nav-socials .social {
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
  }

  .menu-btn {
    display: inline-flex !important;
    flex: none;
  }

  .header-actions {
    gap: 6px;
    flex: none;
    display: flex !important;
    align-items: center !important;
  }

  .header-actions .social-links {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  @media (max-width: 600px) {
    .nav-wrap {
      gap: 8px !important;
      padding-inline: 4px !important;
    }

    .brand {
      flex: 1;
      min-width: 0;
      gap: 8px !important;
    }

    .brand-mark {
      width: 36px !important;
      height: 36px !important;
    }

    .brand-copy strong {
      font-size: 12px !important;
      max-width: 96px;
      white-space: normal !important;
      overflow: visible !important;
      line-height: 1.08;
    }

    .brand-copy small {
      font-size: 7.5px !important;
    }

    .header-actions .social-links .facebook,
    .header-actions .social-links .instagram {
      display: none !important;
    }

    .header-actions {
      gap: 4px !important;
    }

    .social, .control-btn, .menu-btn {
      width: 32px !important;
      height: 32px !important;
      font-size: 12.5px !important;
    }
  }

  .brand {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .brand-copy strong {
    font-size: 13.5px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    color: #ffffff;
    display: block;
    line-height: 1.08;
    max-width: 120px;
  }

  .social, .control-btn, .menu-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(228, 196, 125, 0.35) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .section {
    padding: 55px 0;
  }

  .hero {
    padding-top: 105px;
    padding-bottom: 45px;
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .hero-copy h1 {
    font-size: 34px;
    line-height: 1.25;
    margin: 14px 0 18px;
  }

  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 25px;
  }

  .hero-stats div {
    min-width: 85px;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-copy {
    padding-top: 0;
  }

  .about-copy .lead {
    font-size: 18px;
  }

  .trust-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .trust-item strong {
    font-size: 13px;
  }

  .stats-counter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .counter-card {
    padding: 16px 10px;
  }

  .counter-num {
    font-size: 34px;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .why-visual {
    height: 250px;
  }

  .big-number {
    font-size: 110px;
  }

  .why-ring {
    width: 220px;
    height: 220px;
  }

  .contact-box {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .subsidiary-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .subsidiary-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .hero-visual {
    min-height: 360px;
  }

  .hero-orbit {
    width: min(340px, 88vw);
    height: min(340px, 88vw);
  }

  .boarding-pass {
    width: 100%;
    transform: none !important;
    border-radius: 18px;
  }

  .bp-main { padding: 22px 18px 16px; }
  .bp-stub { padding: 16px 18px 20px; }

  .boarding-pass h3 { font-size: 21px; }
  .bp-stamp { width: 48px; height: 48px; }

  .floating-chip {
    font-size: 8.5px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .chip-one { right: 0; top: 2%; }
  .chip-two { left: 0; bottom: 2%; }

  .slides {
    height: 400px;
    border-radius: 18px;
  }

  .slide-overlay {
    padding: 20px;
    display: block;
  }

  .slide-overlay > span {
    display: block;
    margin-bottom: 6px;
  }

  .slide-overlay h3 { font-size: 20px; }

  .slider-btn {
    width: 42px;
    height: 42px;
    font-size: 13px;
  }

  .slider-btn-prev {
    left: 10px;
  }

  .slider-btn-next {
    right: 10px;
  }

  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .service-card {
    min-height: auto;
    padding: 22px 18px;
    border-radius: 18px;
  }

  .program-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .program-item {
    min-height: auto;
    padding: 22px 18px;
    border-radius: 18px;
  }

  /* DESTINATIONS SECTION ON MOBILE & TABLET */
  .destinations-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .node-glass-card {
    padding: 4px 8px !important;
    border-radius: 9px !important;
    gap: 5px !important;
  }

  .node-glass-card strong {
    font-size: 10.5px !important;
  }

  .node-glass-card small {
    display: none !important;
  }

  .hq-star {
    font-size: 7.5px !important;
    padding: 1px 3px !important;
  }

  .node-flag-img {
    width: 16px !important;
    height: 11px !important;
  }

  /* Non-overlapping Mobile Coordinates */
  .node-baghdad { top: 48% !important; left: 24% !important; }
  .node-cairo { top: 78% !important; left: 2% !important; }
  .node-turkey { top: 8% !important; left: 2% !important; }
  .node-iran { top: 70% !important; left: 58% !important; }
  .node-moscow { top: 8% !important; left: 58% !important; }

  .social-banner-inner {
    align-items: flex-start;
    flex-direction: column-reverse;
    min-height: auto;
    padding: 22px 18px;
    border-radius: 18px;
  }

  .social-banner-inner strong {
    font-size: 24px;
  }

  .section-heading h2, .section-top h2, .why-content h2, .contact-box h2 {
    font-size: 30px;
    line-height: 1.2;
  }

  .why-list > div {
    grid-template-columns: 36px 1fr;
    gap: 12px;
  }

  .floating-whatsapp {
    width: 48px !important;
    height: 48px !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    right: auto !important;
  }

  .floating-top {
    width: 48px !important;
    height: 48px !important;
    right: max(16px, env(safe-area-inset-right)) !important;
  }

  .hero-visual {
    margin-bottom: 8px;
  }

  .chip-two {
    bottom: 6% !important;
    left: 4% !important;
  }
}

/* Ultra Small Screens (<= 380px) */
@media (max-width: 380px) {
  .brand-copy strong {
    max-width: 78px;
    font-size: 9.5px;
  }

  .brand-copy small {
    font-size: 6.8px;
    letter-spacing: 1.4px;
  }

  .social-links {
    gap: 4px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .boarding-pass {
    width: 100%;
  }

  .bp-main, .bp-stub {
    padding-inline: 14px;
  }

  .hero-orbit {
    width: 270px;
    height: 270px;
  }

  .destinations-map-wrap {
    min-height: 360px !important;
  }

  /* Ultra compact mobile map badges */
  .node-glass-card {
    padding: 3px 6px !important;
  }
  .node-glass-card strong {
    font-size: 9.5px !important;
  }
  .node-baghdad { top: 48% !important; left: 16% !important; }
  .node-cairo { top: 78% !important; left: 1% !important; }
  .node-turkey { top: 6% !important; left: 1% !important; }
  .node-iran { top: 70% !important; left: 54% !important; }
  .node-moscow { top: 6% !important; left: 54% !important; }
}

/* Mobile Footer Centering */
@media (max-width: 768px) {
  .footer-bottom-inner {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .copyright-text {
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    line-height: 1.7 !important;
    font-size: 13px !important;
  }

  .footer-socials {
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
}

/* iOS Safe Areas */
@supports (padding: max(0px)) {
  .site-header {
    padding-top: max(0px, env(safe-area-inset-top));
  }
  .floating-whatsapp {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
