/* ==========================================================================
   M ILYAS & SONS - COMPREHENSIVE MASTER MOBILE RESPONSIVE ENGINE (v4.0)
   Pixel-perfect on iPhone SE, iPhone 12/13/14/15/16 Pro, Samsung Galaxy,
   Google Pixel, iPad, iPad Air/Pro & Android Tablets (320px - 1024px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL VIEWPORT & RESET
   -------------------------------------------------------------------------- */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

*, *:before, *:after {
  box-sizing: border-box !important;
}

img, video, iframe, svg, canvas {
  max-width: 100% !important;
  height: auto;
}

/* Neutralize old Elementor / ElementsKit broken mobile overlays ONLY */
.elementskit-menu-overlay,
.ekit-nav-menu--overlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Fix missing glyph tofu for dropdown indicator icon with sleek FontAwesome chevron */
.ekit-wid-con .icon.icon-down-arrow1,
.icon.icon-down-arrow1,
.elementskit-submenu-indicator {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  display: inline-block !important;
}

.ekit-wid-con .icon.icon-down-arrow1::before,
.icon.icon-down-arrow1::before,
.elementskit-submenu-indicator::before {
  content: "\f078" !important; /* FontAwesome chevron-down */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-size: 10px !important;
  margin-left: 6px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  transition: transform 0.25s ease, color 0.25s ease !important;
}

.elementskit-dropdown-has:hover .elementskit-submenu-indicator::before,
.ekit-menu-dropdown-toggle:hover .elementskit-submenu-indicator::before,
.elementskit-dropdown-has:hover .icon-down-arrow1::before {
  transform: rotate(180deg) !important;
  color: #ff9843 !important;
}

/* ==========================================================================
   GLOBAL HEADER STACKING CONTEXT & BULLETPROOF DROPDOWN Z-INDEX (ALL SCREENS)
   ========================================================================== */
.ekit-template-content-header,
header,
.ekit-template-content-markup,
.elementor-460,
.elementor-element-a4af8dc {
  position: relative !important;
  z-index: 99999 !important;
  background: #ffffff !important;
}

/* Main body content & sections stay BELOW the header dropdown */
main#content,
.site-main,
.page-content,
.elementor-section:not(.ekit-template-content-header):not(header),
.elementor-element-eedf064,
.hero-ribbon-section,
.elementor-element-be73bb0 {
  position: relative;
  z-index: 1 !important;
}

/* Dropdown Submenu Panel - Completely Solid, High Z-Index, Glitch-Free */
.elementskit-navbar-nav-default .elementskit-dropdown,
.elementskit-navbar-nav .elementskit-submenu-panel,
ul.elementskit-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 9999999 !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #e2e8f0 !important;
  min-width: 260px !important;
  padding: 6px 0 !important;
  list-style: none !important;
  overflow: visible !important;
}

/* Dropdown list items */
.elementskit-navbar-nav-default .elementskit-submenu-panel > li,
ul.elementskit-dropdown > li {
  display: block !important;
  width: 100% !important;
  background: #ffffff !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Dropdown links */
.elementskit-navbar-nav-default .elementskit-submenu-panel > li > a,
ul.elementskit-dropdown > li > a {
  display: block !important;
  width: 100% !important;
  padding: 11px 20px !important;
  color: #1e1d23 !important;
  font-family: 'Poppins', 'Montserrat', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  text-decoration: none !important;
  background: #ffffff !important;
  border-bottom: 1px solid #f1f4f8 !important;
  transition: all 0.22s ease !important;
  box-sizing: border-box !important;
}

.elementskit-navbar-nav-default .elementskit-submenu-panel > li:last-child > a,
ul.elementskit-dropdown > li:last-child > a {
  border-bottom: none !important;
}

.elementskit-navbar-nav-default .elementskit-submenu-panel > li > a:hover,
ul.elementskit-dropdown > li > a:hover {
  background: #fff4ea !important;
  color: #ff9843 !important;
  padding-left: 25px !important;
}

/* Ensure desktop navigation is fully visible and styled on desktop (> 1024px) */
@media (min-width: 1025px) {
  .elementskit-menu-container,
  .elementskit-navbar-nav-default,
  ul#menu-main-menu {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  button.elementskit-menu-hamburger {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   2. HEADER & MOBILE NAVIGATION (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Header section container */
  .ekit-template-content-header,
  header {
    width: 100% !important;
    position: relative !important;
    z-index: 1000 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  }

  .ekit-template-content-header .elementor-section,
  header .elementor-section {
    padding: 0 !important;
  }

  /* Force single horizontal row - NEVER stack header on mobile */
  .ekit-template-content-header .elementor-container,
  header .elementor-container,
  .ekit-template-content-header .elementor-row,
  header .elementor-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 60px !important;
    margin: 0 auto !important;
  }

  /* Columns inside header */
  .ekit-template-content-header .elementor-column,
  header .elementor-column {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Left column with logo */
  .ekit-template-content-header .elementor-column:first-child,
  header .elementor-column:first-child {
    flex: 1 1 auto !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
  }

  .ekit-template-content-header img,
  header img,
  .elementskit-nav-logo img {
    height: 42px !important;
    max-height: 42px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  /* Right column with hamburger toggler */
  .ekit-template-content-header .elementor-column:last-child,
  header .elementor-column:last-child {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
  }

  /* Hide desktop menu container completely */
  .elementskit-navbar-nav-default,
  .elementskit-menu-container:not(#misMobileNavDrawer),
  ul#menu-main-menu {
    display: none !important;
    visibility: hidden !important;
  }

  /* Style the mobile hamburger button */
  button.elementskit-menu-hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 8px !important;
    border-radius: 8px !important;
    border: 1.5px solid #ff9843 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 100 !important;
  }

  button.elementskit-menu-hamburger:hover,
  button.elementskit-menu-hamburger:active {
    background: #fff4ea !important;
    transform: scale(1.05) !important;
  }

  button.elementskit-menu-hamburger .elementskit-menu-hamburger-icon {
    display: block !important;
    width: 22px !important;
    height: 2.5px !important;
    background-color: #ff9843 !important;
    border-radius: 2px !important;
    margin: 0 !important;
    transition: all 0.25s ease !important;
  }
}

/* --------------------------------------------------------------------------
   3. ELEMENTOR GENERAL GRID & SECTIONS COLLAPSE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Generic content sections collapse into stacked columns */
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-container,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-row {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-column,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-10,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-11,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-12,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-14,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-16,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-20,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-25,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-33,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-50,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-66,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-75,
  .elementor-section:not(.ekit-template-content-header):not(header) .elementor-col-100 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    margin-bottom: 20px !important;
  }

  .elementor-column:last-child {
    margin-bottom: 0 !important;
  }

  /* Section Padding */
  .elementor-section {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  /* Headings & Text on Mobile */
  h1, .elementor-heading-title.elementor-size-large {
    font-size: 26px !important;
    line-height: 1.25 !important;
  }

  h2, .elementor-heading-title.elementor-size-medium {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }

  h3, .elementor-heading-title.elementor-size-small {
    font-size: 19px !important;
    line-height: 1.35 !important;
  }

  p {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
}

/* --------------------------------------------------------------------------
   4. HERO BANNER SECTION (index.html)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .elementor-element-eedf064,
  .hero-ribbon-section {
    min-height: 170px !important;
    height: auto !important;
    padding: 24px 14px !important;
  }

  .hero-content-wrap {
    justify-content: center !important;
    padding: 0 12px !important;
    text-align: center !important;
  }

  .hero-text-inner {
    text-align: center !important;
    max-width: 100% !important;
  }

  .hero-text-inner .welcome-italics {
    font-size: 14.5px !important;
    margin-bottom: 3px !important;
  }

  .hero-text-inner .title-bold-white {
    font-size: 24px !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
  }

  .hero-text-inner .subtitle-orange {
    font-size: 13.5px !important;
    letter-spacing: 0.8px !important;
  }

  .elementor-shape svg {
    height: 18px !important;
  }
}

@media (max-width: 480px) {
  .elementor-element-eedf064,
  .hero-ribbon-section {
    min-height: 155px !important;
    padding: 18px 10px !important;
  }

  .hero-text-inner .welcome-italics {
    font-size: 13px !important;
  }

  .hero-text-inner .title-bold-white {
    font-size: 20px !important;
  }

  .hero-text-inner .subtitle-orange {
    font-size: 12px !important;
  }

  .elementor-shape svg {
    height: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   5. CLIENT CAROUSEL ON HOMEPAGE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .exact-clients-section {
    padding: 35px 14px 25px 14px !important;
  }

  .exact-clients-title {
    font-size: 21px !important;
    margin-bottom: 20px !important;
  }

  .exact-clients-carousel-viewport {
    width: 100% !important;
  }

  .client-carousel-item {
    flex: 0 0 100% !important;
    padding: 8px 12px !important;
    font-size: 15.5px !important;
  }

  .client-carousel-arrow {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   6. OUR CLIENTS PAGE (our-clients.html)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .our-clients-wrapper,
  .elementor-element-4e00508 .elementor-container {
    flex-direction: column !important;
  }

  .clients-checklist-col,
  .clients-vector-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  .clients-checklist-col ul {
    padding-left: 0 !important;
  }

  .clients-checklist-col li {
    font-size: 15px !important;
    padding: 8px 0 !important;
    line-height: 1.4 !important;
  }

  .clients-vector-col lottie-player {
    max-width: 280px !important;
    height: 240px !important;
    margin: 20px auto !important;
  }
}

/* --------------------------------------------------------------------------
   7. COMPANY PROFILE BANNER
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .company-profile-banner {
    padding: 30px 14px !important;
    min-height: auto !important;
    text-align: center !important;
  }

  .company-profile-banner lottie-player {
    width: 160px !important;
    height: 110px !important;
    margin: 0 auto 12px auto !important;
  }

  .profile-banner-heading {
    font-size: 20px !important;
    margin-bottom: 14px !important;
  }

  .company-profile-banner .custom-orange-btn {
    padding: 10px 22px !important;
    font-size: 14px !important;
  }

  .wave-brush-divider svg {
    height: 20px !important;
  }
}

/* --------------------------------------------------------------------------
   8. GALLERY & SUBPAGES GRID (gallery.html & all category pages)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .elementor-gallery__container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 0 12px !important;
  }

  .e-gallery-item {
    height: 180px !important;
  }
}

@media (max-width: 600px) {
  .elementor-gallery__titles-container {
    gap: 6px 8px !important;
    margin: 16px auto 20px auto !important;
    padding: 0 10px !important;
  }

  .elementor-gallery-title {
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
  }

  .elementor-gallery__container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 0 10px !important;
    margin-bottom: 35px !important;
  }

  .e-gallery-item {
    height: 155px !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 380px) {
  .elementor-gallery__container {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .e-gallery-item {
    height: 210px !important;
  }
}

/* --------------------------------------------------------------------------
   9. CONTACT FORM & MAP ON MOBILE (contact.html & homepage)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .modern-contact-section {
    padding: 30px 14px !important;
  }

  .modern-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
  }

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

  .modern-form-card {
    padding: 20px 15px !important;
  }

  /* Crucial: 16px font-size prevents iOS Safari automatic page zooming */
  .modern-input,
  .modern-textarea,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    font-size: 16px !important;
  }

  .modern-map-card-wrapper {
    height: 300px !important;
  }

  .modern-map-overlay-badge {
    position: static !important;
    margin: 12px auto 0 auto !important;
    width: 100% !important;
    box-shadow: none !important;
  }
}

/* --------------------------------------------------------------------------
   10. FOOTER ON MOBILE & TABLET (<= 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .custom-milyas-footer {
    padding-top: 35px !important;
  }

  .custom-footer-container {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    padding: 0 20px 25px 20px !important;
    text-align: left !important;
  }

  /* Col 1: Brand - Left Aligned */
  .footer-col-brand {
    display: block !important;
    text-align: left !important;
  }

  .footer-col-brand img {
    margin: 0 0 15px 0 !important;
    max-height: 52px !important;
  }

  .footer-col-brand p {
    text-align: left !important;
    max-width: 100% !important;
    margin: 0 0 18px 0 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  .footer-social-row {
    justify-content: flex-start !important;
    margin: 0 !important;
  }

  /* Col 2: Menu - Left Aligned */
  .footer-col-menu {
    text-align: left !important;
  }

  .footer-col-menu .footer-heading {
    text-align: left !important;
    font-size: 22px !important;
    margin: 0 0 14px 0 !important;
  }

  .footer-menu-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .footer-menu-list li {
    margin-bottom: 0 !important;
    text-align: left !important;
  }

  .footer-menu-list li a {
    font-size: 15px !important;
    text-align: left !important;
  }

  /* Col 3: Contact Info - 100% Clean Left Aligned */
  .footer-col-contact {
    display: block !important;
    text-align: left !important;
    width: 100% !important;
  }

  .footer-col-contact .footer-heading {
    text-align: left !important;
    font-size: 22px !important;
    margin: 0 0 18px 0 !important;
    width: 100% !important;
  }

  .contact-info-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .contact-info-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
    text-align: left !important;
  }

  .contact-info-circle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    background: #1e1d23 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.3s ease !important;
  }

  .contact-info-item:hover .contact-info-circle {
    background: #ff9843 !important;
    transform: scale(1.08) !important;
  }

  .contact-info-text {
    flex: 1 1 auto !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .contact-info-text strong {
    display: block !important;
    font-size: 16px !important;
    color: #1e1d23 !important;
    font-weight: 700 !important;
    font-family: 'Poppins', 'Montserrat', sans-serif !important;
    margin-bottom: 2px !important;
    text-align: left !important;
  }

  .contact-info-text p,
  .contact-info-text a {
    margin: 0 !important;
    font-size: 14px !important;
    color: #555555 !important;
    line-height: 1.45 !important;
    text-align: left !important;
    display: block !important;
    text-decoration: none !important;
    word-break: break-word !important;
  }

  .contact-info-text a:hover {
    color: #ff9843 !important;
  }

  /* Bottom Copyright Bar - NO EXTRA GAP */
  .footer-bottom-bar {
    padding: 14px 16px !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    text-align: center !important;
    position: relative !important;
    z-index: 10 !important;
  }

  .footer-bottom-bar a {
    color: #ff9843 !important;
    font-weight: 700 !important;
  }

  /* Floating WhatsApp Button on Mobile */
  .floating-whatsapp-btn,
  a[title="Chat on WhatsApp"] {
    bottom: 16px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 26px !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45) !important;
  }
}

/* --------------------------------------------------------------------------
   12. LIGHTBOX MODAL ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .mis-lightbox-modal {
    padding: 10px !important;
  }

  .mis-lightbox-image {
    max-width: 94vw !important;
    max-height: 75vh !important;
    border-radius: 8px !important;
  }

  .mis-lightbox-close {
    top: 14px !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 28px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50% !important;
  }

  .mis-lightbox-prev,
  .mis-lightbox-next {
    width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 50% !important;
  }

  .mis-lightbox-prev {
    left: 10px !important;
  }

  .mis-lightbox-next {
    right: 10px !important;
  }
}
