/* Global responsive safeguards — loaded after custom.css */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
table { max-width: 100%; }
.table-responsive-auto, .main-wrapper table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
iframe { border: 0; }
h1, h2, h3, h4, h5, h6, p, a, li { overflow-wrap: break-word; word-wrap: break-word; }

@media (max-width: 1199px) {
  .eco-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .eco-about-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .eco-values, .eco-why-grid3 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 991px) {
  .navbar-collapse { max-height: 80vh; overflow-y: auto; }
  .eco-process-steps, .eco-feature-grid, .eco-areas-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .eco-cta-inner { grid-template-columns: 1fr !important; }
}

@media (max-width: 767px) {
  section, .section-padding, .section-padding-top { padding-top: 60px; padding-bottom: 60px; }
  h1 { font-size: 2rem; line-height: 1.25; }
  h2 { font-size: 1.6rem; line-height: 1.3; }
  h3 { font-size: 1.35rem; }
  .top-bar .col-md-9 { text-align: center; }
  .top-bar-info ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding: 0; margin: 0; }
  .eco-values, .eco-why-grid3, .eco-mv-grid, .eco-process-5 { grid-template-columns: 1fr !important; }
  .butn, .btn { white-space: normal; }
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }
  .form-control, input, select, textarea { font-size: 16px; } /* prevents iOS zoom */
}

@media (max-width: 575px) {
  .eco-stats-grid, .eco-about-stats, .eco-process-steps, .eco-feature-grid, .eco-areas-grid { grid-template-columns: 1fr !important; }
  .navbar-brand img, #logo { max-height: 48px; width: auto; }
}

/* Services cards: on hover the photo is clearly visible behind white text */
body .card-style06:hover { background: var(--nyc-navy, #14232b) !important; }
body .card-style06:hover .card-bg-img { opacity: 1 !important; transform: scale(1.08) !important; }
body .card-style06:hover .card-bg-img::after {
  background: linear-gradient(180deg, rgba(20,35,43,0.30) 0%, rgba(20,35,43,0.78) 100%) !important;
}
body .card-style06:hover h3.h5 a,
body .card-style06:hover .card-body h3 a,
body .card-style06:hover .card-body p { color: #ffffff !important; text-shadow: 0 1px 6px rgba(0,0,0,0.5) !important; }
body .card-style06:hover .card-img img { filter: brightness(0) invert(1) !important; }
body section .card-style06:hover .card-body h3,
body section .card-style06:hover .card-body h3 a,
body section .card-style06:hover .card-body h3.h5 a,
body section .card-style06:hover .card-body p { color: #ffffff !important; text-shadow: 0 1px 6px rgba(0,0,0,0.5) !important; }
body section .card-style06:hover .card-body h3 a:hover { color: #ffd9d9 !important; }
html body section.eco-alt-white .card.card-style06:hover .card-body h3,
html body section.eco-alt-white .card.card-style06:hover .card-body h3 a,
html body section.eco-alt-white .card.card-style06:hover .card-body h3.h5 a,
html body section.eco-alt-white .card.card-style06:hover .card-body p { color: #ffffff !important; text-shadow: 0 1px 6px rgba(0,0,0,0.55) !important; }

/* Mobile menu: submenus open inline when the +/− button is tapped */
@media (max-width: 991px) {
  .navbar-nav li ul {
    position: static !important;
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    min-width: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    border: 0 !important;
    border-top: 0 !important;
    border-radius: 0 !important;
    background: #f8fafc !important;
    padding: 0 !important;
  }
  .navbar-nav li.has-sub.active > ul { display: block !important; }
  .navbar-nav li ul li a { padding: 12px 28px !important; color: #14232b !important; }
}
@media (max-width: 991px) {
  .navbar-nav#nav { max-height: calc(100vh - 140px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* CTA band: phone number and button never clip */
.eco-cta-actions { flex-wrap: wrap; }
.eco-cta-phone { font-size: clamp(1.05rem, 4.6vw, 1.5rem); white-space: normal; word-break: keep-all; }
@media (max-width: 575px) { .eco-cta-actions { gap: 14px !important; } .eco-cta-phone { flex: 1 1 100%; } }

/* View Your Project / sign-in, sign-up pages */
@media (max-width: 767px) {
  .eco-form-card, .eco-login-card, .card-body { padding-left: 18px; padding-right: 18px; }
  form .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  form .butn, form button[type=submit] { width: auto; }
  .form-check, .form-check-inline, form label { white-space: normal; }
}

/* Mobile accordion headings (Our Vision / Our History …) always white on navy */
html body section h2.resp-accordion,
html body section h2.resp-accordion span,
html body section h2.resp-accordion i { color: #ffffff !important; }
html body section h2.resp-accordion.resp-tab-active { background: #7c1012 !important; }
html body .tab-style1 h2.resp-accordion,
html body .tab-style1 h2.resp-accordion *,
html body h2.resp-accordion { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }
html body section.eco-alt-red .tab-style1 .resp-tabs-container h2.resp-accordion,
html body section.eco-alt-white .tab-style1 .resp-tabs-container h2.resp-accordion,
html body section[class] .tab-style1 .resp-tabs-container h2.resp-accordion { color: #ffffff !important; }

/* Services cards on touch / small screens: no hover exists, so show the photo behind white text by default */
@media (max-width: 991px), (hover: none) {
  html body .card.card-style06 { background: var(--nyc-navy, #14232b) !important; }
  html body .card.card-style06 .card-bg-img { opacity: 1 !important; transform: scale(1.04) !important; }
  html body .card.card-style06 .card-bg-img::after {
    background: linear-gradient(180deg, rgba(20,35,43,0.35) 0%, rgba(20,35,43,0.80) 100%) !important;
  }
  html body section .card.card-style06 .card-body h3,
  html body section .card.card-style06 .card-body h3 a,
  html body section .card.card-style06 .card-body h3.h5 a,
  html body section .card.card-style06 .card-body p,
  html body section.eco-alt-white .card.card-style06 .card-body h3.h5 a,
  html body section.eco-alt-white .card.card-style06 .card-body p {
    color: #ffffff !important; text-shadow: 0 1px 6px rgba(0,0,0,0.55) !important;
  }
  html body .card.card-style06 .card-img img { filter: brightness(0) invert(1) !important; }
}

/* Hero on phones/tablets: fit the content, no big empty space above and below */
@media (max-width: 991px) {
  .slider-fade, .slider-fade.min-vh-100 { min-height: 0 !important; }
  .slider-fade .item .container { padding-top: 0 !important; }
  .slider-fade .item .row { min-height: 0 !important; padding-top: 0 !important; }
  .slider-fade .item .eco-hero-text-col { padding-top: 48px !important; padding-bottom: 48px !important; margin-bottom: 0 !important; }
  .slider-fade .owl-dots { bottom: 12px !important; }
}
@media (max-width: 991px) {
  html body .slider-fade .item .row.min-vh-100 { min-height: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
}
@media (max-width: 991px) {
  .slider-fade .item .eco-hero-text-col { padding-bottom: 48px !important; }
}

/* Mobile header: always fixed to the top (also while scrolling); menu opens right under it */
@media (max-width: 991px) {
  header.header-style2 {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    z-index: 99999 !important;
  }
  header.header-style2 .navbar-nav#nav { top: 100% !important; max-height: calc(100vh - 100px); }
  header.header-style2 .navbar { position: relative; }
}
