/* Estilos base */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* Barra de Navegación */
.navbar {
    transition: background-color 0.3s ease-in-out;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5em;
}

.nav-link {
    margin-left: 15px;
    font-weight: 500;
    transition: color 0.3s ease-in-out;
}

.nav-link:hover {
    color: #f8f9fa !important;
}

/* Banner */
.banner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    padding-top: 80px; /* Espacio para el navbar fijo */
    padding-bottom: 50px;
    text-align: center;
    color: white;
}

.banner-content {
    text-align: center;
    z-index: 10; /* Asegura que el contenido esté sobre el video */
    padding: 20px; /* Añade un poco de padding alrededor del texto */
}

.banner-title {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6); /* Sombra oscura para contraste */
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out 0.2s;
}

.banner-subtitle {
    font-size: 1.3em;
    margin-bottom: 25px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Sombra ligeramente más suave */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.5s;
}

.banner::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%; /* Ajusta la altura del degradado según sea necesario */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%); /* Degradado oscuro en la parte inferior */
    z-index: 2; /* Asegura que esté sobre el video pero debajo del texto */
    pointer-events: none; /* Permite la interacción con el video */
}

.banner-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.banner-media iframe,
.banner-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-button {
    display: inline-block;
    background-color: #00c698; /* Un tono de verde turquesa vibrante */
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 7px;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, opacity 0.5s ease-out 0.6s, transform 0.5s ease-out 0.8s;
    opacity: 0;
    transform: scale(0.8);
}

.banner-button:hover {
    background-color: #00a37d; /* Un tono ligeramente más oscuro al pasar el ratón */
    transform: scale(1.05);
}

/* Sección de aviso y contacto directo */
.free-advice {
    background: linear-gradient(to bottom, #fdfdfd, #faf5cc);
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
}

.free-advice h2 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.free-advice p {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 0px;
    color: #555;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.free-advice .btn-success {
    background-color: #28a745;
    border-color: #28a745;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: white;
}

.free-advice .btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
    transform: scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.free-advice .d-flex { /* Para centrar la imagen y el botón */
    display: flex;
    align-items: center;
    justify-content: center;
}

#img-mapa-animado {
    height: 500px;
    width: auto;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* Sección de Servicios */
.services {
    padding-top: 80px;
    padding-bottom: 60px;
    text-align: center;
    background-color: #fff;
}

.services h2 {
    font-size: 3em;
    margin-bottom: 40px;
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.service-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-card .card-title {
    margin-bottom: auto;
}

.service-card .btn {
    margin-top: auto;
}

.service-card .card-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.service-card .card-footer a {
    background-color: #00c698;
    color: white;
    text-decoration: none;
    border-radius: 7px;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, opacity 0.3s ease-out 0.3s, transform 0.3s ease-out 0.3s;
}

.service-card .card-footer a:hover {
    background-color: #00a37d; /* Un tono ligeramente más oscuro al pasar el ratón */
    transform: scale(1.05);
}

.service-card .btn-block {
    display: block;
    width: 100%;
}

.service-card .card-footer .btn-primary {
    border-radius: 7px; /* O el radio de borde que prefieras */
}

.service-card .card-body .btn-outline-info {
    border-radius: 7px;
}

.modal-title {
    color: #007bff; /* Un color distintivo para el título del modal */
}

.modal-footer .btn-primary {
    border-radius: 7px;
}

/* Estilos para el carrusel Swiper (REVISADO) */
.services-swiper {
    display: none;
    padding: 40px 0;
}

.swiper-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
}

.swiper-slide {
    width: 85%; /* Aumentamos el ancho de los slides */
    flex-shrink: 0;
    opacity: 0.7; /* Ligera opacidad para los slides no activos */
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9); /* Escala ligeramente los slides no activos */
    margin-right: 20px; /* Espacio entre slides */
}

.swiper-slide:last-child {
    margin-right: 0; /* Evita margen en el último slide */
}

.swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

.swiper-pagination {
    position: static !important;
    margin-top: 20px;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    background: #ccc;
    opacity: 0.8;
    margin: 0 5px;
    cursor: pointer;
}

.swiper-pagination-bullet-active {
    background: #007bff;
    opacity: 1;
}

/* Ajustes adicionales para el ancho de las cards dentro del carrusel */
.services-swiper .swiper-slide .service-card {
    width: 100%; /* Asegura que la card ocupe el ancho del slide */
    min-width: auto; /* Permite que el ancho se ajuste al contenido */
}

/* Galería */
.mosaic-gallery {
    padding-top: 80px;
    padding-bottom: 60px;
}

.mosaic-gallery h2 {
    font-size: 3em;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Ajusta el ancho mínimo de las columnas */
    gap: 10px; /* Espacio entre las imágenes del mosaico */
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
}

.mosaic-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: block; /* Asegura que el enlace ocupe el espacio del grid */
    aspect-ratio: 1 / 1; /* Proporción base para las imágenes cuadradas */
}

.mosaic-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.mosaic-item:hover img {
    transform: scale(1.05);
}

/* Definición de tamaños para las imágenes del mosaico */
.mosaic-item-small {
    grid-column: span 1;
    grid-row: span 1;
}

.mosaic-item-medium {
    grid-column: span 2;
    grid-row: span 1;
}

.mosaic-item-large {
    grid-column: span 2;
    grid-row: span 2;
}

.mosaic-gallery {
    padding-top: 80px;
    padding-bottom: 60px;
    background-repeat: repeat-x; /* Repetir horizontalmente suele dar una mejor sensación de continuidad */
    background-size: contain; /* Intenta contener el SVG dentro del fondo, mostrando el patrón completo */
    background-position: center bottom; /* Centrar horizontalmente y alinear en la parte inferior */
    background-color: #e0f7fa; /* Un tono azul muy claro de respaldo */
}

.mosaic-gallery h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    /* Opcional: Ajustar el color del título si el fondo lo requiere */
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    /* Opcional: Añadir un fondo semitransparente para mejorar el contraste de las imágenes */
    /* background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 10px; */
}

/* Adaptación para pantallas más pequeñas (opcional) */
@media (max-width: 768px) {
    .mosaic-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .mosaic-item-medium {
        grid-column: span 1;
        grid-row: span 1;
    }

    .mosaic-item-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}


/* Sección de Contacto */
.contact-form {
    padding-top: 80px;
    padding-bottom: 60px;
    background: #fcff9e;  /* fallback for old browsers */
    background: linear-gradient(to top right, #fcff9e 0%, #c67700 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
    color: #000;
}

.contact-form .container {
    width: 100%;
    justify-items: center; /* Centra la card */
}

.contact-form .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 40px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    overflow: hidden;
    background-color: transparent;
    position: relative;
    width: 100%;
    max-width: 700px;
}

.contact-form .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: -1;
    border-radius: inherit;
}

.contact-form h2 {
    color: #000;
    font-weight: 650;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.contact-form p {
    color: rgba(255, 255, 255, 0.8); /* Texto un poco más claro para el párrafo */
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contact-form .form-label {
    font-weight: 700;
    color: #000;
    display: block;
    margin-bottom: 5px;
}

.contact-form .form-control {
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.1); /* Fondo semitransparente para los inputs */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #000;
}

.contact-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.contact-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: #007bff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.15);
}

.contact-form textarea.form-control {
    min-height: 120px;
}

.contact-form .btn-success {
    border-radius: 8px;
    padding: 14px 28px;
    font-size: 1.2em;
    width: auto;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #000; 
    border-color: #000;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.contact-form .btn-success:hover {
    transform: scale(1.05);
    background-color: #25d366;
    border-color: #25d366;
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .contact-form .row.g-3 > div {
        width: calc(50% - 15px);
        flex: 0 0 auto;
    }
    .contact-form .col-md-12 {
        width: 100%;
        flex: 0 0 100%;
    }
    .contact-form .col-12.text-center {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .contact-form .col-12.text-center > .btn-success {
        width: auto;
    }
}

/* Footer */
footer {
    background-color: #343a40;
    color: white;
    padding: 60px 20px;
}

footer h4 {
    color: #f8f9fa;
    margin-bottom: 20px;
    border-bottom: 2px solid #6c757d;
    padding-bottom: 10px;
}

footer p, footer ul {
    color: #adb5bd;
    line-height: 1.7;
}

footer ul li {
    margin-bottom: 8px;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

footer a:hover {
    color: #f8f9fa;
}

footer .form-control {
    border-radius: 5px;
    padding: 10px;
    border: 1px solid #6c757d;
    background-color: #495057;
    color: #f8f9fa;
}

footer .form-control::placeholder {
    color: #adb5bd;
}

footer .btn-outline-light {
    border-color: #f8f9fa;
    color: #f8f9fa;
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

footer .btn-outline-light:hover {
    background-color: #f8f9fa;
    color: #343a40;
    border-color: #f8f9fa;
}

footer hr {
    border-color: #6c757d;
    margin-top: 30px;
    margin-bottom: 20px;
}

footer .text-center {
    color: #adb5bd;
}

/* Botón Flotante de WhatsApp */
.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    text-decoration: none;
    z-index: 1000;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.3);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .contact-form .card {
        padding: 20px;
    }
}