body {
    margin: 0;
    font-family: Arial, sans-serif;
}

.contenedor {
    position: relative;
    width: 100%;
    height: 60vh; /* ocupa toda la altura de la pantalla */
    overflow: hidden;
}

.contenedor img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(50%); /* oscurece la imagen */
}

.texto-superpuesto {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    font-size: 2rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); /* mejora la legibilidad */
}

.custom-carousel .carousel-control-prev,
.custom-carousel .carousel-control-next {
    width: 50px; /* Ajusta el ancho del botón */
    top: 40%; /* Centrar verticalmente */
    transform: translateY(-50%); /* Ajuste fino para centrar */
    background-color: #386c5c;
}

/* Asegura que las tarjetas estén alineadas horizontalmente dentro del slide */
.carousel-item .row {
    display: flex;
    flex-wrap: nowrap; /* evita que las tarjetas bajen de línea */
    justify-content: center; /* centra el contenido */
}
  
/* Ajusta el ancho de las tarjetas según el tamaño de pantalla */
.carousel-item .col-md-6 {
    flex: 0 0 auto;
}
  
/* Por defecto (lg y superior): 3 tarjetas */
@media (min-width: 992px) {
    .carousel-item .col-md-6 {
    width: 33.3333%;
}
}
  
/* En pantallas medianas (md): 2 tarjetas */
@media (min-width: 768px) and (max-width: 991.98px) {
    .carousel-item .col-md-6 {
    width: 50%;
}
.carousel-item .col-md-6:nth-child(n+3) {
    display: none !important;
    }
}
  
  /* En pantallas pequeñas (sm): 1 tarjeta */
  @media (max-width: 767.98px) {
    .carousel-item .col-md-6 {
      width: 100%;
    }
    .carousel-item .col-md-6:nth-child(n+2) {
      display: none !important;
    }
}

.card-img-top {
    height: 300px;
}

#btn-cards {
    color: white;
    background-color: #386c5c;
}

#btn-cards-servicios {
    color: white;
    background-color: #386c5c;
}

#btnTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #386c5c;
    color: white;
    font-size: 22px;
    border: none;
    cursor: pointer;
    display: none;           /* Lo ocultamos al inicio */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0.8;
}

#btnTop:hover {
    opacity: 1;
}

#btnTop.footer-active {
    background-color: #fff;   /* Color cuando llega al footer */
    color: #386c5c;
}