/* RESET */
html {
  overflow-x: hidden;
}

body{
    max-width: 100vw;
    background-color: white;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow-x: hidden;
}

/* ============================= */
/* CONTENEDOR PRINCIPAL */
/* ============================= */


.content-contractor{
    background-color:#009ca3;
    background-position: center 30%;
    background-size: cover; 
    background-attachment: fixed; 
    background-repeat: no-repeat; 
    min-height: 701px;

    position: relative;
    padding: 50px 20px;
}

/* Imagen */
.content-contractor img{
    width: 100%;
    max-width: 800px;
    left:-10%;
    position: absolute;
    top: -14%;
    z-index: 1;
}
/* ============================= */
/* TITULOS */
/* ============================= */

.titles{
    position:absolute;
    display: flex;
    flex-direction: column;
    width: 100%;
    top:40%;
}

/* TITULO 1 */
.titles .title1{
    white-space: normal;
    width: 100%;              
    max-width: 100%;
    text-align: center;
    left: -30px;  
    border-radius: 0 50px 50px 0;
    background-color: white;

    font-weight: bold;
    color:#009ca3;
    font-family: Arial, sans-serif;
    letter-spacing: 3px;
    font-size: clamp(28px, 4vw, 60px);
    padding: 10px 5px 10px 350px;

    margin-left: 0;   
    margin-right: 60%;         
    position: relative;

}

/* TITULO 2 */
.titles .title2{
    white-space: normal;

    width: 70%;
    max-width: 100%;

    text-align: center;

    border-radius: 50px 0 0 50px;
    font-weight: bold;

    padding: 10px 15px 10px 60px;

    color:white;
    font-family: Arial, sans-serif;
    font-size: clamp(28px, 4vw, 60px);
    letter-spacing: 3px;

    margin-left: auto;
    margin-right: 20px;  
    background-color:#f7aa00;
}

/* ============================= */
/* HEADER DE CONTRATISTAS */
/* ============================= */

.contractors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(20px, 5vw)
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  flex-wrap: wrap;
}

.title-principle{
  color:#009ca3;
  font-family: Arial, sans-serif;
  font-weight: bold;
  margin-left: 40px;;
  font-size: 50px;
  text-shadow: 1px 2px 0px rgba(0, 84, 89, 0.9);
}

/* FILTRO */
.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 35px;
}

.filter-form label {
  font-size: 20px;
  color: #005459;
}

.filter-form select {
  padding: 6px 10px;
  border: 1px solid #009ca3;
  border-radius: 50px;
  background: white;
  color: #009ca3;
  cursor: pointer;
}

.filter-form select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 100, 117, 0.3);
}

/* ============================= */
/* SECCIÓN CONTRATISTAS */
/* ============================= */

/* GRID */
.grid-contractors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 50px auto 0
}

/* CARD */
.card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background: #fff;
  transition: transform .2s;
}

.card:hover {
  transform: translateY(-4px);
}

/* IMAGEN */
.card-image {
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* OVERLAY */
.card-image .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: .3s;
}

.card-image:hover .overlay {
  opacity: 1;
}

/* BODY */
.card-body {
  padding: 16px;
}

.card-body .profession {
  text-align: center;
  font-weight: bold;
  color: #009ca3;
  margin-bottom: 12px;
}

/* BOTÓN */
.card-body .btn-quote {
  justify-content: center;
  align-items: center;
  text-align: center;
  display: block;
  margin: 0 auto;
  padding: 8px 16px;
  background: #f7aa00;
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-weight: bold;
  transition: .2s;
}

.card-body .btn-quote:hover {
  transform: scale(1.05);
  background-color: #005459;
}

/* ============================= */
/* PAGINACIÓN */
/* ============================= */

.pagination {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  list-style: none;
  padding: 0;
}

.pagination li {
  margin: 0 5px;
}

.pagination a {
  text-decoration: none;
  color: #009ca3;
  padding: 8px 12px;
  border: 1px solid #009ca3;
  border-radius: 4px;
}

.pagination .active a {
  background-color: #009ca3;
  color: white;
}

.pagination .disabled a {
  color: #ccc;
  border-color: #ccc;
  pointer-events: none;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

/* TABLET */
@media (max-width: 992px) {

  
  .content-contractor{
    min-height: unset !important;  
    height: 545px;                
    overflow: hidden;             
  }

  
  .content-contractor img{
    width: 85%;
    max-width: 600px;

    position: absolute;
    left: 50%;
    transform: translateX(-95%); 

    top: -10%; 
  }

  .titles{
    top: 50%;                   
    transform: translateY(-50%);
  }

  .titles .title1,
  .titles .title2 {
    font-size: clamp(18px, 4vw, 40px);
  }

  .titles .title1{
    padding: 10px 10px 10px 200px; 
    margin-right: 50%;
  }

  .titles .title2{
    width: 600px !important;  
    max-width: 600px;
    flex: none;                
    
    padding: 10px 5px 10px 50px;
    margin-left: auto;
    margin-right: 5px;
}

.contractors-header {
    flex-direction: column;
    align-items: flex-start;

    padding: 30px!important; 
    gap: 15px;     
  }


  .title-principle {
    margin: 0;
    font-size: 32px;
  }

  .filter-form {
    margin: 0;
    width: 100%;
    justify-content: flex-start;
    padding-left: 20px; 
  }

  .grid-contractors {
    display: grid;
    gap: 24px;

    grid-template-columns: repeat(2, minmax(300px, 380px))!important;

    max-width: 1300px;
    margin: 50px auto 0;

    padding-inline: clamp(20px, 5vw, 60px);
    justify-content: center;
    box-sizing: border-box;
  }
}


/* CELULAR */
@media (max-width: 576px) {

  .content-constructors{
    background-size: 80%;
    background-position: center;
    background-attachment: scroll;
  }

  .content-contractor{
    min-height: unset !important;  
    height: 550px;                
    overflow: hidden;             
  }

   .titles{
    top: 40%;                   
    transform: translateY(-50%);
  }

  .titles .title1,
  .titles .title2 {
    font-size: 24px;
    letter-spacing: 1px;
    padding: 10px;
  }

   .titles .title2{
    width: 400px !important;  
    max-width: 100%;          /* 🔥 evita que se salga del contenedor */
    flex: none;                

    padding: 10px 20px 10px 30px;

    margin-left: auto;        /* 🔥 mantiene el fondo pegado a la derecha */
    margin-right: 0;
   }

  .content-contractor img{
    width: 90%;
    max-width: 900px!important;
    position: absolute;
    left: 47%;
    transform: translateX(-75%); 
    top: 40%; 
  }

  .grid-contractors {
    grid-template-columns: 1fr!important;
  }

  .title-principle {
    font-size: 28px;
    text-align: center;
  }

  .filter-form {
    padding-left: 4px; 
  }

}