/* ==========================================================================
   1. Local Font Families (Madani Arabic & IBM Plex Sans)
   ========================================================================== */

/* Madani Arabic Font Family Definitions (All Weights 100 - 900) */
@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Light%20400.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Light%20400.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Medium%20400.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Medium%20400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20SemiBold%20400.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20SemiBold%20400.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Bold%20400.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20ExtraBold%20400.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Madani Arabic';
  src: url('../fonts/Madani_Arabic_Font_Family/Madani%20Arabic%20Black%20400.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* IBM Plex Sans Font Family Definitions (Local from assets/fonts/Sans-Serif/) */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/Sans-Serif/IBMPlexSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Global Font Overrides for Arabic Pages - Enforced Madani Arabic */
html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p,
html[lang="ar"] span,
html[lang="ar"] a,
html[lang="ar"] li,
html[lang="ar"] label,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] div {
  font-family: 'Madani Arabic', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Global Font Overrides for English Pages - Enforced Local IBM Plex Sans */
html[lang="en"],
html[lang="en"] body,
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] h5,
html[lang="en"] h6,
html[lang="en"] p,
html[lang="en"] span,
html[lang="en"] a,
html[lang="en"] li,
html[lang="en"] label,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] select,
html[lang="en"] textarea,
html[lang="en"] div {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Allow Arabic language switcher button in English pages to use Madani Arabic */
html[lang="en"] a[href*="index.html"]:lang(ar),
html[lang="en"] a:lang(ar),
html[lang="en"] .font-arabic,
html[lang="en"] [lang="ar"],
.font-\[\'IBM_Plex_Sans_Arabic\'\],
.font-\[\'Madani_Arabic\'\] {
  font-family: 'Madani Arabic', sans-serif !important;
}

/* ==========================================================================
   2. MOBILE & VIEWPORT RESPONSIVE SYSTEM
   ========================================================================== */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  background-color: #F7F6F2;
  color: #252729;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile input zoom prevention */
@media (max-width: 767px) {

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Mobile Header solid graphite background */
  #main-header {
    background-color: #363D4C !important;
    border-bottom: 1px solid rgba(217, 218, 220, 0.2) !important;
  }
}

/* Mobile tap targets & touch responsiveness */
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Fluid responsive typography utilities */
.fluid-hero-title {
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  line-height: 1.15;
}

.fluid-section-title {
  font-size: clamp(1.65rem, 3.5vw + 0.5rem, 2.75rem);
  line-height: 1.25;
}

/* ==========================================================================
   3. ARCHITECTURAL MOTION & REVEAL SYSTEM (MOTION INTENSITY: 2/10)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.image-reveal {
  opacity: 0;
  transform: scale(0.995);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.image-reveal.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger Delays - Snappy & Responsive */
.reveal-delay-1 {
  transition-delay: 0.04s;
}

.reveal-delay-2 {
  transition-delay: 0.08s;
}

.reveal-delay-3 {
  transition-delay: 0.12s;
}

.reveal-delay-4 {
  transition-delay: 0.16s;
}

/* Architectural Client hover */
.client-logo-item {
  transition: border-color 0.25s ease, opacity 0.25s ease;
}

/* Button Subtle State */
button:not(#menu-toggle):not(#close-menu-btn),
a.btn {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Image Zoom Transitions (Restrained 1.015) */
.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img,
.gallery-item img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.img-hover-zoom:hover img,
.gallery-item:hover img {
  transform: scale(1.015);
}

/* Custom Architectural Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #F7F6F2;
}

::-webkit-scrollbar-thumb {
  background: #D9DADC;
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: #363D4C;
}

/* ==========================================================================
   4. ARCHITECTURAL HERO SECTION & OVERLAYS
   ========================================================================== */

/* Subtle Functional Readability Overlays */
.hero-overlay-dark-ltr {
  background: linear-gradient(90deg,
      rgba(37, 39, 41, 0.65) 0%,
      rgba(37, 39, 41, 0.38) 45%,
      rgba(37, 39, 41, 0.10) 75%,
      transparent 100%);
}

@media (max-width: 768px) {
  .hero-overlay-dark-ltr {
    background: linear-gradient(180deg,
        rgba(37, 39, 41, 0.70) 0%,
        rgba(37, 39, 41, 0.45) 60%,
        rgba(37, 39, 41, 0.20) 100%);
  }
}

.hero-overlay-dark-rtl {
  background: linear-gradient(270deg,
      rgba(37, 39, 41, 0.65) 0%,
      rgba(37, 39, 41, 0.38) 45%,
      rgba(37, 39, 41, 0.10) 75%,
      transparent 100%);
}

@media (max-width: 768px) {
  .hero-overlay-dark-rtl {
    background: linear-gradient(180deg,
        rgba(37, 39, 41, 0.70) 0%,
        rgba(37, 39, 41, 0.45) 60%,
        rgba(37, 39, 41, 0.20) 100%);
  }
}

/* Architectural Primary Button */
.btn-arch-primary {
  background-color: #363D4C;
  color: #ffffff;
  border: 1px solid rgba(217, 218, 220, 0.3);
  border-radius: 2px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.btn-arch-primary:hover {
  background-color: #BC000C;
  border-color: #BC000C;
}

/* Architectural Secondary Button */
.btn-arch-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: #F7F6F2;
  border: 1px solid rgba(217, 218, 220, 0.3);
  border-radius: 2px;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-arch-secondary:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Active Nav Indicator (Thin underline) */
.nav-link-active {
  position: relative;
  color: #ffffff !important;
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #BC000C;
}

/* ==========================================================================
   Continuous Horizontal Marquee for Clients & Partners
   ========================================================================== */
@keyframes marquee-track-ltr {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes marquee-track-rtl {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(50%, 0, 0);
  }
}

.clients-marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.clients-marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

/* LTR animation: smoothly scrolls from right to left */
html[dir="ltr"] .clients-marquee-track {
  animation: marquee-track-ltr 28s linear infinite;
}

/* RTL animation: smoothly scrolls in natural RTL flow */
html[dir="rtl"] .clients-marquee-track {
  animation: marquee-track-rtl 28s linear infinite;
}

.clients-marquee-container:hover .clients-marquee-track {
  animation-play-state: paused;
}

/* Floating WhatsApp Button */
.whatsapp-float-btn {
  position: fixed;
  bottom: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #25D366;
  color: #ffffff;
  border-radius: 9999px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

html[dir="rtl"] .whatsapp-float-btn {
  left: 24px;
}

html[dir="ltr"] .whatsapp-float-btn {
  right: 24px;
}

.whatsapp-float-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
  background-color: #20BA56;
}

.whatsapp-float-btn .whatsapp-tooltip {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: max-width 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
  color: #ffffff;
}

.whatsapp-float-btn:hover .whatsapp-tooltip {
  max-width: 220px;
  opacity: 1;
  padding: 0 6px;
}

/* Subtle pulsating radar ring */
.whatsapp-float-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background-color: #25D366;
  opacity: 0.4;
  z-index: -1;
  animation: whatsapp-pulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Floating Back to Top Button */
.back-to-top-floating {
  position: fixed;
  bottom: 24px;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: #363D4C;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

html[dir="rtl"] .back-to-top-floating {
  right: 24px;
}

html[dir="ltr"] .back-to-top-floating {
  left: 24px;
}

.back-to-top-floating:hover {
  background-color: #BC000C;
  border-color: #BC000C;
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(188, 0, 12, 0.4);
}

/* Smooth Architectural Filtering Transitions */
.product-card-enter {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1), transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  will-change: opacity, transform;
}

.product-card-enter.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}