/* =============================================
   INTERMAK - Layout Fixes
   ============================================= */

/* --- 0. Fix: regla global .active en styles.css pone height:160px y fondo rojo
        a CUALQUIER elemento con esa clase (incluyendo nav-links).
        Se restringe solo a su uso real: .portfolio-item-caption --- */
.active {
  height: auto !important;
  background-color: transparent !important;
  border-radius: 0 !important;
}
.portfolio-item .portfolio-item-caption.active {
  height: 100% !important;
  background-color: rgba(223, 41, 29, 0.5) !important;
  border-radius: 0.5rem !important;
}

/* --- 1. Navbar: fondo sólido y altura fija (elimina la transparencia) --- */
#mainNav {
  background: #ffffff !important;
  min-height: 72px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
#mainNav.navbar-shrink {
  background: #ffffff !important;
  min-height: 64px;
}

/* --- 1b. Navbar Logo Responsive --- */
.navbar-brand { padding: 0; }
.navbar-logo {
  height: 55px;
  width: auto;
  max-width: 220px;
}

/* --- 2. Breadcrumb / row1 contenedor responsivo --- */
.row1 {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* --- 3. Product Hero responsive --- */
.product-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 60vh;
  margin-top: 80px;
}
@media (max-width: 991px) {
  .product-hero { height: 40vh; margin-top: 56px; }
}

/* --- 4. Fix header-img-5 ancho fijo --- */
.header-img-5 { width: 100% !important; }

/* --- 5. Iframes de mapas responsive --- */
.google-map iframe { width: 100% !important; }

/* --- 6. Imágenes en modales --- */
.portfolio-modal img { max-width: 100%; height: auto; }

/* --- 7. Thumbnails de PDF --- */
.forma1 { max-width: 100%; height: auto; }

/* --- 8. Portfolio items --- */
.portfolio-item img { max-width: 100%; height: auto; display: block; }

/* --- 9. Grid mobile --- */
@media (max-width: 575px) {
  .portfolio-grid-item { width: 100%; }
}

/* --- 10. Seccin hero antigua --- */
.header-img-4 { margin-top: 0; }

/* --- 11. Neutralizar featured-text --- */
.page-section .featured-text,
.page-section .featured-text p {
  position: static !important;
  margin-top: 0 !important;
  transform: none !important;
}

/* --- 12. Texto descriptivo intro --- */
.section-intro-text {
  font-size: 1rem;
  line-height: 1.7;
  color: #555;
  padding: 1rem;
}
@media (max-width: 991px) {
  .section-intro-text {
    padding: 1.5rem 1rem;
    text-align: center;
  }
}

/* --- 13. Navbar móvil: fondo sólido al desplegar menú --- */
@media (max-width: 991px) {
  #mainNav .navbar-collapse {
    background-color: #ffffff; /* White background to match the navbar and make red links pop */
    padding: 0.5rem 1rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Elegant shadow for the dropdown */
  }
  #mainNav .navbar-collapse .nav-link {
    border-bottom: 1px solid rgba(0,0,0,0.06); /* Subtle grey separator */
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    font-weight: 700;
  }
  #mainNav .navbar-collapse .nav-item:last-child .nav-link {
    border-bottom: none;
  }
}

/* =====================================================
   FOOTER REDISEÑADO COMPLETO
   ===================================================== */
.footer {
  background: linear-gradient(160deg, #1a252f 0%, #1c2e3d 100%) !important;
  padding: 56px 0 40px !important;
}
.footer .row {
  justify-content: center;
}
.footer .row .col-lg-6 {
  padding: 0 32px;
}
@media (min-width: 992px) {
  .footer .row .col-lg-6:first-child {
    border-right: 1px solid rgba(255,255,255,.1);
  }
}
.footer h4.text-uppercase {
  color: #fff !important;
  font-size: .87rem !important;
  letter-spacing: .2em;
  font-weight: 700;
  margin-bottom: 18px !important;
}
.footer p.lead {
  color: rgba(255,255,255,.5) !important;
  font-size: .82rem !important;
  font-weight: 400 !important;
  letter-spacing: .02em;
  margin-top: 14px;
  text-transform: none !important;
  line-height: 1.5;
}
.footer .lead a,
.footer a {
  color: rgba(255,255,255,.65) !important;
  text-decoration: none;
  transition: color .2s;
}
.footer .lead a:hover,
.footer a:hover {
  color: #e74c3c !important;
  text-decoration: none;
}
.footer .btn-social {
  width: 46px !important;
  height: 46px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,.3) !important;
  color: rgba(255,255,255,.85) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0 !important;
  margin: 0 6px 16px !important;
  background: transparent !important;
  transition: all .25s ease !important;
  text-decoration: none !important;
}
.footer .btn-social:hover {
  background: #e74c3c !important;
  border-color: #e74c3c !important;
  color: #fff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(231,76,60,.35) !important;
}
.copyright {
  background-color: #0f171e !important;
  border-top: 1px solid rgba(255,255,255,.06);
}
.copyright small {
  color: rgba(255,255,255,.4);
  font-size: .8rem;
}
@media (max-width: 991px) {
  .footer { padding: 40px 0 30px !important; }
  .footer .row .col-lg-6 { padding: 0 20px; margin-bottom: 32px; }
  .footer .row .col-lg-6:first-child { border-right: none; }
  .footer .row .col-lg-6:last-child { margin-bottom: 0; }
}

/* =====================================================
   AGRICULTURE & GLOBAL UNIT PAGES FIXES
   ===================================================== */
@media (max-width: 991px) {
  .row1, .row123, .row2000, .row200, .row2 {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 30px 20px !important;
    background: linear-gradient(145deg, #34495e, #2c3e50) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10;
    flex-wrap: wrap !important;
  }
  /* Fix grid rows so they wrap and don't squish elements */
  .row3, .row40, .row4 {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    line-height: normal !important; /* Override styles.css 10px line-height */
  }
  .letra1, .letra10, .letra3, .letra30 { font-size: 1.1rem !important; word-wrap: break-word; color: #fff !important; display: block; line-height: 1.5 !important; margin-bottom: 15px !important; }
  .letra2, .letra20 { font-size: 1.8rem !important; word-wrap: break-word; line-height: 1.2 !important; display: block; margin: 10px 0; color: #fff !important; font-weight: bold; }

  .page-section.portfolio .col-md-2,
  .page-section1.portfolio .col-md-2,
  .row3 > div, .row4 > div, .row40 > div {
      flex: 0 0 100% !important;
      max-width: 100% !important;
      margin-bottom: 2.5rem !important;
      padding: 0 15px;
  }

  .portfolio-item h2.page-section-heading,
  .portfolio-item + h2,
  .portfolio-item + h4 {
      font-size: 1.4rem !important;
      margin: 15px 0 !important;
  }

  .portfolio-item img.forma, 
  .portfolio-item img.forma1 {
      width: 100% !important;
      height: auto !important;
      max-width: 100% !important;
      object-fit: contain;
  }
}

.portfolio-item .portfolio-item-caption.active {
    background-color: transparent !important;
}
.portfolio-item .portfolio-item-caption-content i.fa-plus {
    display: none !important;
}
.portfolio-item .portfolio-item-caption a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    text-decoration: none;
}
.portfolio-item {
    position: relative;
}

/* =====================================================
   GLOBAL FIXES FOR UNIT CONTENT (CONSTRUCTION/AGRICULTURE)
   ===================================================== */
@media (max-width: 1199px) {
    /* Fix missing container and negative margins breaking mobile view */
    .page-section.portfolio { overflow-x: hidden; }
    .page-section.portfolio > .row,
    .page-section.portfolio > div > .row {
        max-width: 1200px;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Fix hardcoded 260px margin on main image causing layout explosion */
    .img-fec {
        margin-left: auto !important;
        margin-right: auto !important;
        display: block;
        width: 100% !important;
        max-width: 800px !important;
    }

    /* Improve readability for specification boxes on mobile */
    .project .project-text { padding: 2rem 1.5rem !important; }
    .project .project-text p {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
        color: rgba(255,255,255,0.8) !important;
    }

    /* FIX TERRIBLE STYLES.CSS MEDIA QUERIES */
    /* styles.css uses position absolute and 6px fonts on mobile for these utility classes! */
    .text-black-50, .text-white-50, .text-white-500, .text-whit {
        position: static !important;
        margin-left: 0 !important;
        top: auto !important;
        font-size: 1rem !important;
        display: block !important;
        text-align: left !important;
    }

    /* styles.css puts 100px margin on .no-gutter which squishes everything on mobile! */
    .no-gutter, .no-gutters {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* =====================================================
   PREMIUM CARD STYLE FOR SPECIFICATIONS (.featured-text)
   ===================================================== */
.featured-text {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 5px solid #e74c3c; /* Brand Red Accent */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}
.featured-text:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.featured-text p.text-black-50,
.featured-text p {
    color: #2c3e50 !important; /* Premium Slate Color */
    font-size: 1.05rem !important;
    line-height: 2 !important; /* Generous spacing between specs */
    margin: 0;
    text-align: left !important;
}


