/* =========================================
   MAHRAJ INDUSTRIES - Performance & Design Enhancements
   Version: 2.0
   ========================================= */

/* =========================================
   1. CRITICAL PERFORMANCE - Image Optimization
   ========================================= */
img {
  content-visibility: auto;
  max-width: 100%;
  height: auto;
}

/* Force lazy loading on non-critical images */
img:not([fetchpriority="high"]):not(.eager) {
  loading: lazy;
}

/* Smooth image loading transition */
img[data-src], img[data-lazyloaded] {
  transition: opacity 0.3s ease;
}

img.loading {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

/* =========================================
   2. TYPOGRAPHY FIXES - Text Sizes
   ========================================= */
:root {
  --font-xs: clamp(10px, 1.2vw, 12px);
  --font-sm: clamp(12px, 1.4vw, 14px);
  --font-base: clamp(14px, 1.6vw, 16px);
  --font-md: clamp(16px, 1.8vw, 18px);
  --font-lg: clamp(18px, 2.2vw, 22px);
  --font-xl: clamp(22px, 2.8vw, 28px);
  --font-2xl: clamp(26px, 3.5vw, 36px);
  --font-3xl: clamp(30px, 4.5vw, 48px);
  --mahraj-orange: #EA5501;
  --mahraj-dark: #121933;
  --mahraj-gray: #666;
  --mahraj-light: #f7f7f7;
}

body {
  font-size: var(--font-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: clamp(26px, 4vw, 48px); line-height: 1.2; }
h2 { font-size: clamp(22px, 3vw, 36px); line-height: 1.3; }
h3 { font-size: clamp(18px, 2.2vw, 26px); line-height: 1.4; }
h4 { font-size: clamp(16px, 1.8vw, 22px); line-height: 1.4; }
h5 { font-size: clamp(14px, 1.6vw, 18px); line-height: 1.5; }
h6 { font-size: clamp(13px, 1.4vw, 16px); line-height: 1.5; }
p  { font-size: var(--font-base); line-height: 1.75; }

/* Fix small text that's too tiny */
.elementor-widget-container p,
.desc-text,
.elementor-icon-list-text {
  font-size: clamp(13px, 1.4vw, 15px);
}

/* Fix heading sizes */
.elementor-heading-title { line-height: 1.3; }
.prelements-heading .title-inner .title { font-size: clamp(22px, 3vw, 36px); line-height: 1.3; }
.prelements-heading .title-inner span.sub-text { font-size: clamp(11px, 1.2vw, 13px); }

/* Fix button text */
.rs-btn span, .elementor-button { font-size: clamp(13px, 1.3vw, 15px); }

/* =========================================
   3. MAHRAJ HEADER ENHANCEMENT
   ========================================= */
#mahraj-nav-wrapper {
  position: relative;
  z-index: 9999;
}

/* Enhanced sticky header */
.rs-sticky-default.show_shadow {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* =========================================
   4. MAHRAJ CUSTOM MENU
   ========================================= */
#mahraj-mega-menu {
  background: linear-gradient(135deg, #0d1b2a 0%, #121933 100%);
  border-bottom: 3px solid #EA5501;
  position: sticky;
  top: 0;
  z-index: 9998;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

#mahraj-mega-menu.scrolled {
  padding: 0;
  box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

#mahraj-mega-menu .menu-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

#mahraj-mega-menu .menu-logo img {
  height: 45px;
  width: auto;
  object-fit: contain;
}

#mahraj-mega-menu .menu-logo a {
  display: flex;
  align-items: center;
}

#mahraj-mega-menu nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
  align-items: center;
}

#mahraj-mega-menu nav ul li {
  position: relative;
}

#mahraj-mega-menu nav ul li > a {
  color: #e8e8e8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

#mahraj-mega-menu nav ul li > a:hover,
#mahraj-mega-menu nav ul li.active > a {
  color: #fff;
  background: rgba(234, 85, 1, 0.15);
}

#mahraj-mega-menu nav ul li.active > a {
  color: #EA5501;
}

/* Dropdown arrow */
#mahraj-mega-menu nav ul li.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

#mahraj-mega-menu nav ul li.has-dropdown:hover > a::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* Dropdown Menu */
#mahraj-mega-menu .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  min-width: 220px;
  padding: 8px 0;
  border-top: 3px solid #EA5501;
  z-index: 9999;
  animation: menuFadeIn 0.2s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

#mahraj-mega-menu nav ul li.has-dropdown:hover .dropdown-menu {
  display: block;
}

#mahraj-mega-menu .dropdown-menu li a {
  color: #333 !important;
  padding: 9px 18px !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  display: block !important;
  border-radius: 0 !important;
  background: transparent !important;
  border-left: 3px solid transparent;
  transition: all 0.2s ease !important;
}

#mahraj-mega-menu .dropdown-menu li a:hover {
  background: #fff8f5 !important;
  color: #EA5501 !important;
  border-left-color: #EA5501 !important;
  padding-left: 22px !important;
}

/* CTA Button in menu */
#mahraj-mega-menu .menu-cta a {
  background: #EA5501;
  color: #fff !important;
  padding: 10px 20px !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.5px;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

#mahraj-mega-menu .menu-cta a:hover {
  background: #c94800 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234,85,1,0.4) !important;
}

/* Mobile menu toggle */
#mahraj-menu-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: #fff;
  flex-direction: column;
  gap: 4px;
  transition: all 0.3s ease;
}

#mahraj-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
  border-radius: 2px;
}

#mahraj-menu-toggle:hover {
  border-color: #EA5501;
  background: rgba(234,85,1,0.1);
}

#mahraj-mobile-menu {
  display: none;
  background: #0d1b2a;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

#mahraj-mobile-menu.open {
  max-height: 600px;
}

#mahraj-mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 12px 20px;
}

#mahraj-mobile-menu ul li a {
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 0;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s ease;
}

#mahraj-mobile-menu ul li a:hover {
  color: #EA5501;
}

#mahraj-mobile-menu .sub-menu {
  padding-left: 16px;
}

#mahraj-mobile-menu .sub-menu li a {
  font-size: 13px;
  color: #aaa;
}

@media (max-width: 1024px) {
  #mahraj-mega-menu nav.desktop-nav { display: none; }
  #mahraj-menu-toggle { display: flex; }
  #mahraj-mobile-menu { display: block; }
  #mahraj-mega-menu .menu-container { height: 60px; }
}

@media (max-width: 768px) {
  #mahraj-mega-menu .menu-logo img { height: 36px; }
}

/* =========================================
   5. MAHRAJ FOOTER
   ========================================= */
#mahraj-footer {
  background: linear-gradient(180deg, #0d1b2a 0%, #060e18 100%);
  color: #ccc;
  margin-top: 0;
  border-top: 4px solid #EA5501;
  font-family: 'Space Grotesk', 'Roboto', sans-serif;
}

#mahraj-footer .footer-top {
  padding: 60px 0 40px;
}

#mahraj-footer .footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.4fr;
  gap: 48px;
}

#mahraj-footer .footer-brand img {
  height: 50px;
  width: auto;
  margin-bottom: 18px;
  filter: brightness(1.2);
}

#mahraj-footer .footer-brand p {
  font-size: 13.5px;
  line-height: 1.75;
  color: #a0aec0;
  max-width: 280px;
  margin: 0 0 20px;
}

/* Social icons */
#mahraj-footer .social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

#mahraj-footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  color: #ccc;
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
}

#mahraj-footer .social-links a:hover {
  background: #EA5501;
  color: #fff;
  border-color: #EA5501;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(234,85,1,0.4);
}

/* Footer columns */
#mahraj-footer .footer-col h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #EA5501;
  display: inline-block;
  letter-spacing: 0.3px;
}

#mahraj-footer .footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#mahraj-footer .footer-col ul li {
  margin-bottom: 10px;
}

#mahraj-footer .footer-col ul li a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  line-height: 1.5;
}

#mahraj-footer .footer-col ul li a::before {
  content: '›';
  color: #EA5501;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  flex-shrink: 0;
}

#mahraj-footer .footer-col ul li a:hover {
  color: #EA5501;
  padding-left: 4px;
}

/* Contact info */
#mahraj-footer .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

#mahraj-footer .contact-item .icon {
  color: #EA5501;
  font-size: 15px;
  width: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

#mahraj-footer .contact-item span,
#mahraj-footer .contact-item a {
  font-size: 13.5px;
  color: #a0aec0;
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.2s ease;
}

#mahraj-footer .contact-item a:hover {
  color: #EA5501;
}

/* Footer divider & bottom */
#mahraj-footer .footer-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.15), transparent);
  margin: 0;
}

#mahraj-footer .footer-bottom {
  padding: 18px 24px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

#mahraj-footer .copyright {
  font-size: 13px;
  color: #718096;
}

#mahraj-footer .copyright a {
  color: #EA5501;
  text-decoration: none;
}

#mahraj-footer .footer-legal {
  display: flex;
  gap: 20px;
}

#mahraj-footer .footer-legal a {
  font-size: 12px;
  color: #718096;
  text-decoration: none;
  transition: color 0.2s ease;
}

#mahraj-footer .footer-legal a:hover {
  color: #EA5501;
}

/* Badge */
#mahraj-footer .uae-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(234,85,1,0.15);
  border: 1px solid rgba(234,85,1,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: #EA5501;
  margin-top: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Responsive footer */
@media (max-width: 1024px) {
  #mahraj-footer .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  #mahraj-footer .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  #mahraj-footer .footer-top { padding: 40px 0 30px; }
  #mahraj-footer .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* =========================================
   6. TEAM PAGE
   ========================================= */
.mahraj-team-page {
  background: #f8f9fa;
  min-height: 100vh;
}

.mahraj-team-hero {
  background: linear-gradient(135deg, #0d1b2a 0%, #121933 50%, #1a2744 100%);
  color: #fff;
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.mahraj-team-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(234,85,1,0.15) 0%, transparent 70%);
}

.mahraj-team-hero .hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.mahraj-team-hero h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.2;
}

.mahraj-team-hero p {
  font-size: clamp(15px, 1.6vw, 17px);
  color: #a0aec0;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.mahraj-team-hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(234,85,1,0.2);
  border: 1px solid rgba(234,85,1,0.4);
  color: #EA5501;
  border-radius: 25px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.ceo-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.ceo-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 500px;
}

.ceo-image-area {
  background: linear-gradient(180deg, #0d1b2a 0%, #1a2744 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 30px;
  text-align: center;
  position: relative;
}

.ceo-image-area::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #EA5501, #ff7a30);
}

.ceo-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 5px solid #EA5501;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(234,85,1,0.4);
}

.ceo-avatar-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EA5501 0%, #c94800 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  border: 5px solid rgba(255,255,255,0.2);
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(234,85,1,0.4);
}

.ceo-image-area h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.ceo-image-area .ceo-title {
  color: #EA5501;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.ceo-image-area .ceo-quote {
  color: #a0aec0;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  margin-top: 4px;
}

.ceo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}

.ceo-tags span {
  background: rgba(234,85,1,0.15);
  border: 1px solid rgba(234,85,1,0.3);
  color: #EA5501;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
}

.ceo-content-area {
  padding: 48px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #EA5501;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-label::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: #EA5501;
}

.ceo-content-area h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  color: #0d1b2a;
  font-weight: 800;
  margin: 0 0 24px;
  line-height: 1.3;
}

.ceo-message-box {
  background: linear-gradient(135deg, #fff8f5 0%, #fff3ec 100%);
  border-left: 4px solid #EA5501;
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin-bottom: 28px;
  position: relative;
}

.ceo-message-box .quote-mark {
  font-size: 72px;
  color: #EA5501;
  opacity: 0.15;
  position: absolute;
  top: -10px;
  right: 20px;
  font-family: serif;
  line-height: 1;
}

.ceo-message-box p {
  color: #444;
  font-size: 15.5px;
  line-height: 1.8;
  margin: 0 0 14px;
  position: relative;
}

.ceo-message-box p:last-child { margin: 0; }

.ceo-announcements {
  margin-top: 32px;
}

.ceo-announcements h4 {
  font-size: 17px;
  color: #0d1b2a;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.announcement-item:last-child { border-bottom: none; }

.announce-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #EA5501 0%, #c94800 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 16px;
}

.announce-text strong {
  display: block;
  font-size: 14px;
  color: #0d1b2a;
  font-weight: 600;
  margin-bottom: 3px;
}

.announce-text span {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* Team grid */
.team-grid-section {
  background: #fff;
  padding: 60px 0;
}

.team-grid-section .section-header {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.team-grid-section h2 {
  font-size: clamp(24px, 3vw, 36px);
  color: #0d1b2a;
  font-weight: 800;
  margin: 0 0 12px;
}

.team-grid-section p {
  font-size: 15px;
  color: #666;
  max-width: 540px;
  margin: 0 auto;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.team-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  border-color: #EA5501;
}

.team-card-img {
  height: 220px;
  background: linear-gradient(135deg, #0d1b2a, #1a2744);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  color: #EA5501;
  font-weight: 800;
  position: relative;
  overflow: hidden;
}

.team-card-img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, #EA5501, #ff7a30);
}

.team-card-info {
  padding: 20px;
  text-align: center;
}

.team-card-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0d1b2a;
  margin: 0 0 5px;
}

.team-card-info span {
  font-size: 12px;
  color: #EA5501;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .ceo-card {
    grid-template-columns: 1fr;
  }
  .ceo-image-area { padding: 36px 20px; }
  .ceo-content-area { padding: 30px 20px; }
}

/* =========================================
   7. SCROLL TO TOP BUTTON
   ========================================= */
#scroll-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: #EA5501;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(234,85,1,0.45);
  transition: all 0.3s ease;
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

#scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#scroll-to-top:hover {
  background: #c94800;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(234,85,1,0.6);
}

/* =========================================
   8. PERFORMANCE HINTS - Critical CSS
   ========================================= */
/* Reduce layout shift */
.swiper-wrapper { min-height: 200px; }
.elementor-widget-slides { min-height: 300px; }

/* Reduce animation jank */
.elementor-invisible {
  visibility: visible !important; /* Show content by default */
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Fix overlapping z-index issues */
.elementor-element { z-index: auto; }
#mahraj-mega-menu, #mahraj-footer { position: relative; z-index: 1; }

/* WhatsApp float button style */
.ht-ctc-chat {
  z-index: 999 !important;
}
