/* ==========================================================================
   FFSE MOBILE ENHANCEMENTS — SCOPED & COMPONENT-ISOLATED STYLES
   ========================================================================== */

/* ELIMINATE WHITE STRIPE UNDER HEADER ON DESKTOP & MOBILE */
html,
body,
.site-header-wrapper,
.site-header,
.header-top-bar {
  background-color: #04141F !important;
}

/* Center Hero Slider Controls Pill & Inner Contents on all viewports */
.hero-section .hero-slider-controls,
.hero-slider-controls {
  position: absolute !important;
  bottom: 1.5rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background: rgba(6, 29, 42, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  padding: 0.45rem 0.55rem !important;
  border-radius: 50px !important;
  margin: 0 auto !important;
  width: auto !important;
}

.hero-section .hero-slider-arrows,
.hero-slider-arrows {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  margin: 0 auto !important;
}
  justify-content: center !important;
  gap: 0.5rem !important;
}

.hero-section .hero-slider-dots {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
}

.hero-section .hero-slider-dots:empty {
  display: none !important;
}

/* Floating Action Buttons (WhatsApp & Back to Top) */
.whatsapp-float,
.back-to-top-btn {
  position: fixed !important;
  right: 20px !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.whatsapp-float {
  bottom: 20px !important;
  background-color: #25D366 !important;
}

.back-to-top-btn {
  bottom: 78px !important;
  background: #00A7E1 !important;
  border: 2px solid var(--color-brand-gold, #F2A20B) !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 20px rgba(0, 167, 225, 0.4) !important;
}

.whatsapp-float svg {
  width: 24px !important;
  height: 24px !important;
}

.back-to-top-btn svg {
  width: 22px !important;
  height: 22px !important;
}

@media (max-width: 640px) {
  .whatsapp-float,
  .back-to-top-btn {
    right: 16px !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
  }

  .whatsapp-float {
    bottom: 16px !important;
  }

  .back-to-top-btn {
    bottom: 70px !important;
  }
}

/* Fullscreen Video Background — Single Authoritative Block */
.fullscreen-video-cta-section {
  position: relative !important;
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  background-color: var(--color-brand-navy-deep, #04141F) !important;
}

.fullscreen-video-wrapper {
  position: relative !important;
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important;
}

.video-bg-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  overflow: hidden !important;
}

.video-bg-iframe {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 400vw !important;
  height: 400vh !important;
  min-width: 300vmax !important;
  min-height: 300vmax !important;
  border: 0 !important;
  pointer-events: none !important;
  filter: brightness(0.72) contrast(1.15) !important;
}

/* Hide mobile accordions on Tablet & Desktop */
@media (min-width: 768px) {
  .why-mobile-accordion,
  .services-mobile-accordion {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   MOBILE ONLY (<= 767px) — WHY EPC & SERVICES ACCORDIONS
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Hide Desktop grids on mobile */
  .why-cards-grid,
  .why-master-detail-grid,
  .services-showcase-grid {
    display: none !important;
  }

  /* Display Mobile Accordions */
  .why-mobile-accordion,
  .services-mobile-accordion {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }

  /* Accordion Item Card */
  .why-mobile-item,
  .service-mobile-item {
    background: #FFFFFF !important;
    border: 1px solid var(--color-border, #E2E8F0) !important;
    border-radius: var(--radius-lg, 12px) !important;
    overflow: hidden !important;
    transition: box-shadow 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }

  .why-mobile-item.is-open,
  .service-mobile-item.is-open {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(242, 162, 11, 0.4) !important;
  }

  /* Header row */
  .why-mobile-header,
  .service-mobile-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1.125rem 1.25rem !important;
    cursor: pointer !important;
    user-select: none !important;
    gap: 0.75rem !important;
    background: #FFFFFF !important;
  }

  .why-mobile-header-left,
  .service-mobile-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    flex: 1 !important;
  }

  .why-mobile-num,
  .service-mobile-num {
    font-family: var(--font-heading, 'Outfit', sans-serif) !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: var(--color-brand-gold, #F2A20B) !important;
    background: #04141F !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .why-mobile-title,
  .service-mobile-title {
    font-family: var(--font-heading, 'Outfit', sans-serif) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--color-brand-navy-deep, #04141F) !important;
    line-height: 1.35 !important;
  }

  .why-mobile-icon,
  .service-mobile-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(4, 20, 31, 0.06) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--color-brand-navy-deep, #04141F) !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease !important;
  }

  .why-mobile-item.is-open .why-mobile-icon,
  .service-mobile-item.is-open .service-mobile-icon {
    transform: rotate(45deg) !important;
    background: var(--color-brand-gold, #F2A20B) !important;
    color: #FFFFFF !important;
  }

  /* Body container */
  .why-mobile-body,
  .service-mobile-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1), padding 0.3s ease;
    background: #F8FAFC !important;
    padding: 0 1.25rem;
  }

  .why-mobile-item.is-open .why-mobile-body,
  .service-mobile-item.is-open .service-mobile-body {
    max-height: 2000px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 1.25rem !important;
  }

  .why-mobile-img,
  .service-mobile-img {
    width: 100% !important;
    height: auto !important;
    max-height: 220px !important;
    min-height: 160px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
  }

  .service-mobile-subhead {
    font-size: 0.8125rem !important;
    font-weight: 800 !important;
    color: var(--color-brand-gold, #F2A20B) !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    margin-bottom: 0.5rem !important;
  }

  .why-mobile-desc,
  .service-mobile-desc {
    font-size: 0.9375rem !important;
    color: var(--color-text-body, #475569) !important;
    line-height: 1.6 !important;
    margin-bottom: 1.25rem !important;
  }

  /* Expandable Technical Scope details inside Services Accordion */
  .service-tech-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0.65rem 1rem !important;
    background: rgba(7, 95, 148, 0.08) !important;
    border: 1px solid rgba(7, 95, 148, 0.2) !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: var(--color-brand-blue, #075F94) !important;
    cursor: pointer !important;
    margin-bottom: 1rem !important;
  }

  .service-tech-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.35s ease !important;
    font-size: 0.875rem !important;
    color: #334155 !important;
    line-height: 1.6 !important;
  }

  .service-tech-content.is-open {
    padding-bottom: 0.75rem !important;
  }

  .service-tech-content ul {
    margin: 0 !important;
    padding-left: 1.25rem !important;
  }

  .service-tech-content li {
    margin-bottom: 0.4rem !important;
  }

  .why-mobile-btn,
  .service-mobile-cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
  }
}

/* --------------------------------------------------------------------------
   PRODUCTION MOBILE CAROUSEL (<= 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .projects-slider-wrapper,
  .testimonials-carousel-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 0.25rem 1rem !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .projects-slider-viewport,
  .testimonials-carousel-viewport {
    order: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    touch-action: pan-y !important;
    box-sizing: border-box !important;
    margin-bottom: 1.25rem !important;
    padding: 0 !important;
  }

  .projects-slider-track,
  .testimonials-carousel-track {
    display: flex !important;
    gap: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1) !important;
  }

  .project-item-card,
  .testimonial-slide-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Centered Arrow Buttons Row Below Slide Card */
  .projects-slider-arrow.prev-btn,
  .testimonials-nav-arrow.prev-btn,
  #projSliderPrev,
  #testPrev {
    order: 2 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 25 !important;
    margin: 0 0.65rem !important;
  }

  .projects-slider-arrow.next-btn,
  .testimonials-nav-arrow.next-btn,
  #projSliderNext,
  #testNext {
    order: 3 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 25 !important;
    margin: 0 0.65rem !important;
  }

  /* Hide Pagination Dots on Mobile */
  .projects-slider-dots,
  .testimonials-carousel-dots {
    display: none !important;
  }

  /* Mobile Section & Container Scoped Padding */
  .homepage-section,
  .section {
    padding: 3.25rem 0 !important;
  }

  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .section-header h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }

  .section-header p {
    font-size: 0.9375rem !important;
  }

  /* Scoped Mobile Footer Centering */
  .site-footer .footer-widget,
  .site-footer .footer-heading {
    text-align: center !important;
  }

  .site-footer .footer-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .site-footer .footer-brand a {
    display: inline-block !important;
    margin: 0 auto !important;
  }

  .site-footer .footer-brand img {
    display: block !important;
    margin: 0 auto !important;
  }

  .site-footer .footer-brand p {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  .site-footer .footer-heading::after {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .site-footer .footer-links {
    align-items: center !important;
  }

  .site-footer .footer-contact-item {
    justify-content: center !important;
  }

  /* Mobile Section Grids Single Column */
  #engineering-flow [style*="grid-template-columns"],
  .engineering-flow-section [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  #awards [style*="grid-template-columns"],
  .awards-section [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Tablet (768px - 1024px): 2 cards visible */
@media (min-width: 768px) and (max-width: 1024px) {
  .testimonial-slide-card {
    flex: 0 0 calc((100% - 1.5rem) / 2) !important;
    max-width: calc((100% - 1.5rem) / 2) !important;
    width: calc((100% - 1.5rem) / 2) !important;
    min-width: auto !important;
    margin: 0 !important;
  }
}

/* Desktop (1025px+): 3 cards visible */
@media (min-width: 1025px) {
  .testimonial-slide-card,
  .project-item-card {
    flex: 0 0 calc((100% - 3rem) / 3) !important;
    max-width: calc((100% - 3rem) / 3) !important;
    width: calc((100% - 3rem) / 3) !important;
    min-width: calc((100% - 3rem) / 3) !important;
    box-sizing: border-box !important;
  }
}

/* Dark Section Typography Alignment */
.iconic-projects-section h2,
.testimonials-section h2,
#projects h2,
#testimonials h2,
.fullscreen-video-cta-section h2 {
  color: #FFFFFF !important;
}

.iconic-projects-section .section-header p,
.testimonials-section .section-header p,
#projects .section-header p,
#testimonials .section-header p {
  color: #CBD5E1 !important;
}
