
/* === Mobile Responsive Enhancements === */

/* Global fluid widths */
body, html {
  width: 100%;
  overflow-x: hidden;
}

/* Prevent horizontal scroll from any popup/overlay */
.aaraa-popup-overlay.active,
.ai-modal-overlay.active,
.modal.open,
#aaraa-success-modal[style*="display: flex"] {
  overflow-x: hidden;
}

/* Ensure all form inputs respect container width */
input, textarea, select, button {
  max-width: 100%;
  box-sizing: border-box;
}

/* Make text sizes responsive */
@media (max-width: 768px) {
  h1, .h1 { font-size: 36px !important; line-height: 44px !important; }
  h2, .h2 { font-size: 30px !important; line-height: 38px !important; }
  h3, .h3 { font-size: 26px !important; line-height: 34px !important; }
  p, .body-2, .body-3 {
    font-size: 16px !important;
    line-height: 26px !important;
  }

  /* Responsive container padding */
  .tf-container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Hide large fonts or text blocks */
  .section-about-right h3 .title {
    font-size: 36px !important;
    line-height: 44px !important;
  }

  /* Fix popup full width */
  #popupForm > div,
  #enquiryForm > div {
    width: 90% !important;
    padding: 20px !important;
  }

  /* Responsive header menu stacking */
  .header-content {
    flex-direction: column;
    gap: 10px;
  }

  .main-menu {
    flex-direction: column !important;
    text-align: center;
  }

  .custom-header-buttons {
    margin-left: 0 !important;
    margin-top: 15px;
  }

  .section-about-left,
  .section-about-right {
    width: 100% !important;
    text-align: center;
  }

  .section-about-inner {
    flex-direction: column !important;
  }

  /* Resize logo */
  .logo-header img {
    max-width: 160px !important;
  }
}

/* Blog section container fix */
.section-blog .tf-container {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
.section-blog .swiper {
  overflow: hidden;
  width: 100%;
}
.section-blog .swiper-wrapper {
  display: flex;
}
.section-blog .tf-post-grid {
  max-width: 100%;
}
.section-blog .image img {
  max-width: 100%;
  height: auto;
}
@media (max-width: 767px) {
  .section-blog .swiper-slide {
    width: 100% !important;
  }
}

/* Legacy: hide any dead #popupForm / #enquiryForm that are not actual popups */
/* Only hide if they have NO inline style with position:fixed (i.e., not a real popup) */
#popupForm:not([style*="position: fixed"]):not(.ai-modal-overlay):not(.aaraa-popup-overlay),
#enquiryForm:not([style*="position: fixed"]):not(.ai-modal-overlay):not(.aaraa-popup-overlay) {
  display: none !important;
}

/* Generic modal popups (used on sectors, renewables, and project-detail pages) */
.modal[style*="display: block"] {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal[style*="display: block"] .modal-content {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  .modal[style*="display: block"] .modal-content {
    width: 95% !important;
    margin: 10px auto !important;
    padding: 20px !important;
  }
}

/* Sector enquiry popup responsive */
.popup#enquiryPopup[style*="position: fixed"] > .popup-content {
  max-height: 85vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
@media (max-width: 480px) {
  .popup#enquiryPopup[style*="position: fixed"] > .popup-content {
    width: 95% !important;
    padding: 20px !important;
  }
  .popup#enquiryPopup[style*="position: fixed"] > .popup-content > form > div {
    flex-direction: column !important;
  }
  .popup#enquiryPopup[style*="position: fixed"] > .popup-content > form > div > div {
    flex: none !important;
    width: 100% !important;
  }
}

/* Responsive fixes for inline-style popups (used across many pages) */
#popupForm[style*="position: fixed"],
#vendorPopup[style*="position: fixed"],
#enquiryPopup[style*="position: fixed"] {
  padding: 20px !important;
  box-sizing: border-box !important;
}
#popupForm[style*="position: fixed"] > div,
#vendorPopup[style*="position: fixed"] > div,
#enquiryPopup[style*="position: fixed"] > div {
  max-height: 85vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
@media (max-width: 768px) {
  #popupForm[style*="position: fixed"] > div,
  #vendorPopup[style*="position: fixed"] > div,
  #enquiryPopup[style*="position: fixed"] > div {
    width: 95% !important;
    padding: 20px !important;
    max-height: 80vh !important;
  }
}
@media (max-width: 480px) {
  #popupForm[style*="position: fixed"],
  #vendorPopup[style*="position: fixed"],
  #enquiryPopup[style*="position: fixed"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #popupForm[style*="position: fixed"] > div,
  #vendorPopup[style*="position: fixed"] > div,
  #enquiryPopup[style*="position: fixed"] > div {
    width: 100% !important;
    max-height: 90vh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 24px 16px 16px !important;
    margin-top: auto !important;
  }
}

/* Bootstrap modal responsive fixes */
.modal.modalCentered {
  overflow-y: auto;
}
.modal.modalCentered .modal-dialog {
  margin: 20px auto;
  max-width: 540px;
  width: calc(100% - 40px);
}
.modal.modalCentered .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  padding: 28px 24px 24px;
}
.modal.modalCentered .modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal.modalCentered .modal-top .title {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
}
.modal.modalCentered .btn-hide-popup {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.modal.modalCentered .btn-hide-popup:hover {
  background: #ed2f39;
  color: #fff;
}
.modal.modalCentered .form-contact-us fieldset.item {
  margin-bottom: 12px;
  border: none;
  padding: 0;
}
.modal.modalCentered .form-contact-us fieldset.item input,
.modal.modalCentered .form-contact-us fieldset.item textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  background: #fafafa;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.modal.modalCentered .form-contact-us fieldset.item input:focus,
.modal.modalCentered .form-contact-us fieldset.item textarea:focus {
  border-color: #ed2f39;
  background: #fff;
}
.modal.modalCentered .form-contact-us fieldset.item textarea {
  min-height: 80px;
  resize: vertical;
}
.modal.modalCentered .form-contact-us .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal.modalCentered .form-contact-us .bottom-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}
.modal.modalCentered .form-contact-us .tf-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  background: #ed2f39;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Montserrat', sans-serif;
}
.modal.modalCentered .form-contact-us .tf-btn:hover {
  background: #d01f29;
}
@media (max-width: 576px) {
  .modal.modalCentered .modal-dialog {
    margin: 10px;
    width: auto;
    max-width: none;
  }
  .modal.modalCentered .modal-content {
    padding: 20px 16px 16px;
    border-radius: 12px;
  }
  .modal.modalCentered .form-contact-us .cols {
    grid-template-columns: 1fr;
  }
  .modal.modalCentered .modal-top .title { font-size: 18px; }
  .modal.modalCentered .form-contact-us .bottom-form {
    flex-direction: column;
    align-items: stretch;
  }
  .modal.modalCentered .form-contact-us .tf-btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Fix 100px inline font sizes */
  [style*="font-size: 100px"], [style*="font-size:100px"], [style*="font-size: 100px;"], [style*="font-size:100px;"] {
    font-size: clamp(2.2rem, 8vw, 3.8rem) !important;
    line-height: 1.15 !important;
  }
}

/* Hero video banner mobile height fixes to reduce empty white space */
@media (max-width: 768px) {
  .yt-hero,
  .page-title-home,
  .fullscreen-video-banner,
  .yt-hero__inner {
    height: 70vh !important;
    min-height: 70vh !important;
  }
}
@media (max-width: 480px) {
  .yt-hero,
  .page-title-home,
  .fullscreen-video-banner,
  .yt-hero__inner {
    height: 55vh !important;
    min-height: 55vh !important;
  }
}

