/* ==========================================================================
   شركة الفارس للمقاولات والصيانة - Responsive Stylesheet
   Mobile, Tablet, and Desktop Breakpoints
   ========================================================================== */

/* Tablet & Smaller Screens (< 1024px) */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 38px;
  }

  .features-grid-3,
  .why-us-grid,
  .projects-grid-3,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-story-grid,
  .contact-main-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

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

/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
  .header-inner {
    height: 74px;
  }

  .mobile-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 74px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 74px);
    background-color: var(--color-primary-dark);
    border-left: 1px solid var(--color-dark-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 24px;
    gap: 20px;
    transition: right var(--transition-normal);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
  }

  .main-nav.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 16px;
  }

  .nav-link {
    font-size: 16px;
    width: 100%;
  }

  .header-cta {
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }

  /* Scroll Hero Responsive (Tablet & Mobile) */
  .scroll-hero-container {
    height: 380vh;
  }

  .scroll-hero-sticky {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    background-color: #0b1118;
    position: relative;
    overflow: hidden;
  }

  /* 16:9 Architectural Video Viewport on Mobile - 100% Full Video Visibility, Zero Cropping */
  .hero-stages-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b1118;
    z-index: 1;
  }

  .hero-stage-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .stage-media-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b1118;
  }

  /* Mobile Video & Poster Framing - Pure 16:9 Frame, 100% Uncropped, Original Unfiltered MP4 Quality */
  .stage-poster-img,
  .stage-direct-media,
  .stage-hd-video,
  .stage-video-anim {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    display: block;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    mix-blend-mode: normal !important;
    transform: none !important;
    opacity: 1 !important;
    background-color: transparent !important;
  }

  .hero-hud-container {
    padding-top: 84px;
    padding-bottom: 12px;
  }

  .hero-hud-top {
    gap: 8px;
    padding: 0 10px;
  }

  .hud-phase-badge {
    font-size: 11px;
    padding: 5px 12px;
    background-color: rgba(15, 23, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
  }

  .hud-timeline-steps {
    padding: 5px 10px;
    gap: 6px;
    background-color: rgba(15, 23, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
  }

  .hud-step-dot {
    width: 8px;
    height: 8px;
  }

  /* Brand Card positioned cleanly below the 16:9 video frame on mobile */
  .hero-brand-card,
  html[lang="en"] .hero-brand-card {
    position: absolute;
    bottom: 18px !important;
    right: 12px !important;
    left: 12px !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    padding: 14px 16px;
    margin: 0 auto !important;
    background-color: rgba(15, 23, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
    border-radius: var(--radius-sm);
    z-index: 25;
  }

  .hero-badge {
    font-size: 11px;
    padding: 3px 8px;
    margin-bottom: 6px;
  }

  .hero-title {
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  .hero-description {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    flex: 1;
    min-height: 42px;
    padding: 9px 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .hud-scroll-prompt {
    font-size: 10.5px;
    padding: 4px 10px;
  }


  .floating-features-wrapper {
    margin-top: 20px;
  }

  .features-grid-3,
  .why-us-grid,
  .projects-grid-3,
  .services-grid,
  .about-story-grid,
  .about-mv-grid,
  .contact-info-grid,
  .contact-main-grid {
    grid-template-columns: 1fr !important;
  }

  /* About Page Mobile Optimizations */
  .about-story-grid {
    gap: 24px !important;
  }

  .about-image-card {
    min-height: 240px !important;
    max-height: 320px !important;
    order: -1;
    margin-bottom: 4px;
  }

  .about-mv-grid {
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  /* Contact Page Mobile Optimizations */
  .contact-info-grid {
    gap: 16px !important;
    margin-bottom: 30px !important;
  }

  .contact-main-grid {
    gap: 28px !important;
  }

  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .contact-side-card,
  .contact-guarantee-card {
    padding: 24px 20px !important;
    margin-bottom: 20px !important;
  }

  .contact-form-container {
    padding: 24px 18px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-contact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .floating-actions {
    bottom: 16px;
    left: 16px;
  }

  .fab-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .page-banner {
    padding-top: 110px;
    padding-bottom: 40px;
  }

  .page-banner-title {
    font-size: 28px;
  }
}

/* Smallest Devices (< 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 17px;
    line-height: 1.3;
  }

  .brand-title {
    font-size: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .lamp-form-card {
    padding: 20px 16px;
    border-radius: 18px;
  }
}

/* Height-constrained mobile devices (e.g. iPhone SE / height <= 680px) */
@media (max-width: 768px) and (max-height: 680px) {
  .hero-brand-card,
  html[lang="en"] .hero-brand-card {
    bottom: 10px !important;
    padding: 10px 12px;
  }

  .hero-title {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .hero-description {
    display: none;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    min-height: 38px;
    padding: 8px 4px;
    font-size: 11px;
  }
}

/* Tablet & Mobile for Lamp Section */
@media (max-width: 900px) {
  .lamp-interactive-stage {
    flex-direction: column;
    gap: 36px;
    min-height: auto;
  }

  .lamp-contact-form-wrap {
    max-width: 100%;
  }

  .lamp-pull-btn {
    padding: 11px 20px;
    font-size: 13px;
  }
}

