/* ==========================================
   Media queries only – mobile & other viewports
   No base styles; does not change existing header/CSS
   ========================================== */

/* Prevent horizontal scroll on small viewports */
@media (max-width: 1199px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    .container, .container-fluid { max-width: 100%; }
}

/* Header nav: show hamburger when window is narrowed (tablet / small desktop) */
@media (max-width: 1199px) {
    .navbar { flex-wrap: wrap; }
    .navbar-brand { flex: 0 1 auto; max-width: calc(100% - 56px); min-width: 0; }
    /* Force hamburger visible – override Bootstrap .navbar-expand-* */
    .site-header .navbar .navbar-toggler,
    .navbar-expand-lg .navbar-toggler,
    .navbar-expand-xl .navbar-toggler { display: flex !important; visibility: visible !important; opacity: 1 !important; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex: 0 0 auto; margin-left: auto; }
    .site-header .navbar .navbar-collapse,
    .navbar-expand-lg .navbar-collapse,
    .navbar-expand-xl .navbar-collapse { flex-basis: 100%; width: 100%; max-height: 80vh; overflow-y: auto; overflow-x: hidden; }
    .site-header .navbar .navbar-collapse:not(.show),
    .navbar-expand-lg .navbar-collapse:not(.show),
    .navbar-expand-xl .navbar-collapse:not(.show) { display: none !important; }
    .site-header .navbar .navbar-collapse.show,
    .navbar-expand-lg .navbar-collapse.show,
    .navbar-expand-xl .navbar-collapse.show { display: flex !important; flex-direction: column; }
    .navbar-nav { flex-direction: column !important; width: 100%; margin: 0 !important; }
    .navbar-nav .nav-item { width: 100%; margin: 0 !important; }
    .navbar-nav .nav-link { display: block; width: 100%; box-sizing: border-box; padding: 12px 16px; margin: 0 !important; }
    .nav-item.dropdown { width: 100%; }
    .mega-menu-wrapper { position: static !important; width: 100% !important; max-width: 100% !important; margin-top: 0 !important; max-height: 70vh; overflow-y: auto; }
    .menu-panel { min-width: 100% !important; max-width: 100% !important; width: 100% !important; }
}

@media (max-width: 991px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    .container, .container-fluid { max-width: 100%; padding-left: 15px; padding-right: 15px; }
    /* Header nav – responsive: hamburger visible, menu vertical, all items visible */
    .navbar { flex-wrap: wrap; }
    .navbar-brand { flex: 0 1 auto; max-width: calc(100% - 56px); min-width: 0; }
    .navbar-toggler { display: flex !important; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex: 0 0 auto; margin-left: auto; }
    .navbar-collapse { flex-basis: 100%; flex-grow: 1; width: 100%; max-height: 80vh; overflow-y: auto; overflow-x: hidden; }
    .navbar-collapse:not(.show) { display: none !important; }
    .navbar-collapse.show { display: flex !important; flex-direction: column; }
    .navbar-nav { flex-direction: column !important; width: 100%; margin: 0 !important; }
    .navbar-nav .nav-item { width: 100%; margin: 0 !important; }
    .navbar-nav .nav-link { display: block; width: 100%; box-sizing: border-box; padding: 12px 16px; margin: 0 !important; }
    .nav-item.dropdown { width: 100%; }
    .mega-menu-wrapper { position: static !important; width: 100% !important; max-width: 100% !important; margin-top: 0 !important; max-height: 70vh; overflow-y: auto; }
    .menu-panel { min-width: 100% !important; max-width: 100% !important; width: 100% !important; }
    /* Top bar – responsive view only */
    .top-bar { padding: 10px 0; font-size: 13px; }
    .top-bar .row { flex-wrap: wrap; justify-content: center; text-align: center; }
    .top-bar .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .top-bar-left ul { justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
    .top-bar-right { display: flex; justify-content: center; }
    .social-links { justify-content: center; flex-wrap: wrap; gap: 10px; }
    .social-links a { width: 28px; height: 28px; font-size: 13px; }
    .hero-title { font-size: 36px; max-width: 90%; }
    .hero-title-arabic { font-size: 26px; max-width: 90%; }
    .hero-tagline { font-size: 16px; }
    .hero-banner { min-height: 400px; }
    .about-content { padding-left: 0; margin-top: 30px; text-align: center; }
    .about-content .section-title::after { left: 50%; transform: translateX(-50%); }
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .service-card { height: 360px; }
    .service-card-front, .service-card-back { padding: 28px 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .stat-card { height: 300px; }
    .stat-number { font-size: 32px; }
    .stat-number .stat-text { font-size: 22px; }
    .stat-suffix { font-size: 18px; }
    .divisions-grid { grid-template-columns: 1fr; gap: 28px; }
    .division-image-container { height: 280px; }
    .feature-stat-card { padding: 35px 24px; min-height: 220px; }
    .feature-stat-number { font-size: 38px; }
    .feature-stat-icon { width: 60px; height: 60px; margin-bottom: 18px; }
    .feature-stat-icon i { font-size: 28px; }
    .section-title { font-size: 32px; }
    .certifications-list { padding: 30px 24px; gap: 16px; }
    .cert-item { padding: 14px 22px; font-size: 14px; }
    .contact-form { padding: 35px 28px; }
    .contact-info { padding: 30px 24px; }
}

@media (max-width: 767px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    .container, .container-fluid { max-width: 100%; padding-left: 15px; padding-right: 15px; }
    /* Top bar – responsive view only (compact, stacked) */
    .top-bar { display: block; padding: 8px 0; font-size: 12px; }
    .top-bar .row { flex-wrap: wrap; justify-content: center; text-align: center; margin: 0 -8px; }
    .top-bar .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding: 0 8px; }
    .top-bar-left ul { justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 6px 0; }
    .top-bar-left ul li { white-space: nowrap; }
    .top-bar-right { display: flex; justify-content: center; }
    .social-links { justify-content: center; flex-wrap: wrap; gap: 8px; }
    .social-links a { width: 26px; height: 26px; font-size: 12px; }
    .navbar-collapse { padding: 16px 0; margin-top: 12px; border-top: 1px solid rgba(0,0,0,0.08); }
    .navbar-nav .nav-link { padding: 12px 16px; font-size: 15px; }
    .mega-menu-wrapper { position: static; margin-top: 8px; max-height: 70vh; overflow-y: auto; }
    .menu-panel-item { padding: 12px 16px 12px 20px; }
    .hero-banner { height: 55vh; min-height: 320px; }
    .hero-banner .container { align-items: center; justify-content: center; }
    .hero-content { text-align: center; padding: 0 10px; }
    .hero-title { font-size: 26px; max-width: 100%; margin-left: auto; margin-right: auto; text-align: center; }
    .hero-title::after { left: 50%; transform: translateX(-50%); }
    .hero-title-arabic { font-size: 20px; max-width: 100%; text-align: center; margin-left: auto; margin-right: auto; }
    .hero-tagline { font-size: 14px; text-align: center; margin-bottom: 20px; }
    .hero-btns { flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
    .hero-btns .btn { width: 100%; max-width: 260px; padding: 12px 24px; font-size: 15px; }
    .hero-slider-indicators { bottom: 16px; }
    .hero-slider-indicators .indicator { width: 10px; height: 10px; }
    .hero-slider-indicators .indicator.active { width: 24px; }
    section { padding: 50px 0; }
    .section-header { margin-bottom: 32px; }
    .section-title { font-size: 26px; }
    .section-subtitle { font-size: 13px; }
    .section-description { font-size: 15px; }
    .features-section { padding: 45px 0; margin-top: -30px; }
    .feature-stat-card { padding: 28px 20px; min-height: 200px; }
    .feature-stat-number { font-size: 34px; }
    .feature-stat-label { font-size: 16px; }
    .feature-stat-desc { font-size: 11px; letter-spacing: 1px; }
    .feature-stat-icon { width: 54px; height: 54px; margin-bottom: 14px; }
    .feature-stat-icon i { font-size: 24px; }
    .about-section { padding: 50px 0; }
    .about-content { padding-top: 24px; text-align: center; }
    .about-content p { font-size: 15px; }
    .about-content .btn { width: 100%; max-width: 280px; }
    .services-section { padding: 50px 0; }
    .services-grid { grid-template-columns: 1fr; gap: 20px; margin-top: 32px; }
    .service-card { height: 340px; }
    .service-card-front, .service-card-back { padding: 24px 20px; }
    .service-card-front h3, .service-card-back h3 { font-size: 18px; }
    .service-card-front p, .service-card-back ul li { font-size: 14px; }
    .service-icon-wrapper { width: 64px; height: 64px; font-size: 28px; margin-bottom: 18px; }
    .why-choose-section { padding: 50px 0; }
    .why-choose-section .section-title { font-size: 26px; }
    .stats-grid { grid-template-columns: 1fr; gap: 20px; margin-top: 32px; }
    .stat-card { height: 280px; }
    .stat-number { font-size: 30px; }
    .stat-number .stat-text { font-size: 20px; }
    .stat-suffix { font-size: 16px; }
    .stat-label { font-size: 14px; }
    .stat-icon-wrapper { width: 64px; height: 64px; margin-bottom: 18px; }
    .stat-icon { font-size: 26px; }
    .divisions-section { padding: 50px 0; }
    .divisions-grid { gap: 24px; margin-top: 32px; }
    .division-image-container { height: 240px; }
    .division-body { padding: 24px 20px; }
    .division-body h3 { font-size: 20px; }
    .division-tagline { font-size: 14px; }
    .division-summary { font-size: 14px; }
    .division-toggle { padding: 10px 20px; font-size: 13px; }
    .projects-section { padding: 50px 0; }
    .project-img img { height: 220px; }
    .project-info h4 { font-size: 18px; }
    .btn-view-more { padding: 12px 28px !important; font-size: 15px !important; display: inline-flex !important; }
    .certifications-section { padding: 50px 0; }
    .certifications-list { padding: 24px 16px; gap: 12px; }
    .cert-item { padding: 12px 18px; font-size: 13px; }
    .mission-section { padding: 50px 0; }
    .mission-icon { font-size: 44px; margin-bottom: 18px; }
    .mission-content h2 { font-size: 24px; }
    .mission-quote { font-size: 26px; margin: 20px 0; }
    .mission-text { font-size: 15px; }
    .contact-section { padding: 50px 0; }
    .contact-info { padding: 24px 20px; margin-bottom: 20px; }
    .contact-info h4 { font-size: 18px; }
    .contact-info p { font-size: 14px; }
    .contact-icon { width: 56px; height: 56px; font-size: 24px; margin-bottom: 18px; }
    .contact-form { padding: 28px 20px; }
    .contact-form .form-control { padding: 12px 14px; font-size: 16px; }
    .form-group { margin-bottom: 18px; }
    .site-footer { padding: 45px 0 24px; }
    .footer-title { font-size: 20px; margin-bottom: 16px; }
    .footer-logo { width: 64px; max-height: 48px; }
    .footer-widget p { font-size: 14px; }
    .footer-heading { font-size: 16px; margin-bottom: 14px; }
    .footer-menu a { font-size: 14px; }
    .footer-bottom { margin-top: 28px; padding-top: 24px; }
    .footer-bottom p { font-size: 13px; }
    .scroll-top { width: 44px; height: 44px; bottom: 20px; right: 16px; font-size: 18px; }
}

@media (max-width: 576px) {
    .container, .container-fluid { padding-left: 12px; padding-right: 12px; }
    /* Top bar – responsive view only (smaller) */
    .top-bar { padding: 6px 0; font-size: 11px; }
    .top-bar-left ul { gap: 6px 12px; }
    .top-bar-left ul li i { font-size: 10px; }
    .social-links a { width: 24px; height: 24px; font-size: 11px; }
    .hero-banner { height: 50vh; min-height: 280px; }
    .hero-title { font-size: 22px; }
    .hero-title-arabic { font-size: 17px; }
    .hero-tagline { font-size: 13px; }
    .hero-btns .btn { max-width: 100%; }
    .section-title { font-size: 22px; }
    .section-subtitle { font-size: 12px; }
    .feature-stat-number { font-size: 30px; }
    .feature-stat-label { font-size: 15px; }
    .service-card { height: 320px; }
    .service-card-front h3, .service-card-back h3 { font-size: 17px; }
    .stat-number { font-size: 26px; }
    .division-image-container { height: 200px; }
    .division-body h3 { font-size: 18px; }
    .project-img img { height: 180px; }
    .mission-quote { font-size: 22px; }
    .mission-content h2 { font-size: 20px; }
    .cert-item { padding: 10px 14px; font-size: 12px; }
    .footer-title { font-size: 18px; }
}

@media (max-width: 380px) {
    /* Top bar – responsive view only (very compact) */
    .top-bar { padding: 5px 0; font-size: 10px; }
    .top-bar-left ul { gap: 4px 10px; }
    .social-links a { width: 22px; height: 22px; font-size: 10px; }
    .hero-title { font-size: 20px; }
    .hero-title-arabic { font-size: 15px; }
    .section-title { font-size: 20px; }
    .feature-stat-number { font-size: 26px; }
    .btn, .btn-main, .btn-outline { padding: 11px 20px; font-size: 14px; }
}
