html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 100px;
}

/*------------------------ Barras iniciales -----------------------*/
.sticky-container {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

.navbar-custom {
    background-color: white;
    padding: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-custom .nav-link {
    color: rgb(7, 7, 7);
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.navbar-custom .nav-link:hover {
    color: #40694b;
}

.navbar-custom .dropdown-menu {
    background-color: white;
}

.navbar-toggler {
    margin-left: auto;
    margin-right: 0;
}

.navbar-brand img {
    width: 30%;
    width: 20%;
    height: auto;
    margin-left: 0;
    margin-left: 850px;
    margin-right: 0;
}

.top-bar {
    background: linear-gradient(to bottom, #000000, #40694b);
    color: #fff;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    white-space: nowrap;
    width: 100%;
    z-index: 1040;
}

.top-bar .container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow: hidden;
    width: 100%;
}

/*------------------------ Video -----------------------*/
.video-background {
    position: relative;
    height: 100vh;
    overflow: hidden;
    margin-top: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-background video {
    position: absolute;
    top: 50%;
    top: 54%;
    left: 50%;
    width: 70%;
    height: 70%;
    object-fit: cover;
    object-position: center;
    transform: translate(-50%, -50%);
    max-width: 1400px;
    max-height: 788px;
}

.video-background-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 20px;
}

/*------------------------ Servicios -----------------------*/
.service-section {
    padding: 40px 0;
    position: relative;
    background: transparent;
}

.center-text h1 {
    font-size: 2rem;
    margin-bottom: 0rem;
    text-align: center;
}

.center-text h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.service-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: auto;
    margin: 1rem 0;
}

.service-grid .row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.service-grid .col-md-6 {
    flex: 1;   
}

.service-grid .col-md-6:first-child {
    flex: 0 0 60%; /* service-list ocupa 65% */
    max-width: 60%;
}

.service-grid .col-md-6:last-child {
    flex: 0 0 40%; /* imagen ocupa 35% */
    max-width: 40%;
}

.service-grid .service-list {
    font-size: 1.2rem;
    font-weight: bold;
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 0 0 0 10%;
}

.service-item {
    margin-bottom: 0.5rem;
}

.service-grid img {
    max-width: 80%;
    height: auto;
    border-radius: 10px;
    margin-left: 0%;
}

.Titulo_Servicios {
    color: white;
    font-weight: bold;
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
}

/*------------------------ Detalle de servicios -----------------------*/
/* Contenedor principal */
.container-Servicios {
    background-color: #40694b;
    padding: 1rem;
    border-radius: 15px;
    margin: 2rem auto;
    width: 95%;
    max-width: 1200px;
    display: grid;
    grid-template-rows: repeat(auto-fit, minmax(100px, auto));
    grid-gap: 1rem;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Filas impares (30% imágenes, 70% texto) */
.fila-impar {
    display: grid;
    grid-template-columns: 30% 70%;
    grid-gap: 1rem;
    border: 1px solid white;
    border-radius: 15px;
    margin-bottom: 0.5rem;
    align-items: start;
    box-sizing: border-box;
    padding: 0.5rem;
    min-height: 300px;
}

/* Filas pares (70% texto, 30% imágenes) */
.fila-par {
    display: grid;
    grid-template-columns: 70% 30%;
    grid-gap: 1rem;
    border: 1px solid white;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background-color: #40694b;
    align-items: start;
    box-sizing: border-box;
    padding: 0.5rem;
    min-height: 300px;
}

/* Ajustes para la galería - CORREGIDO */
.my-gallery {
    position: relative;
    height: 280px;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cada imagen ocupa el 100% del ancho - CORREGIDO */
.my-gallery-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

/* Mostrar siempre la primera imagen por defecto */
.my-gallery-item:first-child {
    opacity: 1;
    z-index: 1;
}

/* Imágenes dentro de la galería - CORREGIDO */
.my-gallery img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Animación para el reemplazo de imágenes - SIMPLIFICADA */
@keyframes fade-random {

    0%,
    20% {
        opacity: 0;
        z-index: 0;
    }

    30%,
    50% {
        opacity: 1;
        z-index: 1;
    }

    60%,
    100% {
        opacity: 0;
        z-index: 0;
    }
}

/* Aplicación de la animación con tiempos diferentes para filas */
/* Primera fila */
#desratizacion .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 0s;
}

#desratizacion .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 2.5s;
}

#desratizacion .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 5s;
}

/* Segunda fila */
#fumigación_cucarachas .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 1s;
}

#fumigación_cucarachas .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 3.5s;
}

#fumigación_cucarachas .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 6s;
}

/* tercera fila */
#pulgas .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 2s;
}

#pulgas .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 4.5s;
}

#pulgas .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 7s;
}

/* cuarta fila */
#hormigas .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 3s;
}

#hormigas .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 5.5s;
}

#hormigas .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 8s;
}

/* quinta fila */
#murcielagos .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 4s;
}

#murcielagos .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 6.5s;
}

#murcielagos .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 9s;
}

/* sexta fila */
#mosquitos .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 0s;
}

#mosquitos .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 2.5s;
}

#mosquitos .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 5s;
}

/* Septima fila */
#palmeras .my-gallery-item:nth-child(1) {
    animation: fade-random 10s infinite;
    animation-delay: 1s;
}

#palmeras .my-gallery-item:nth-child(2) {
    animation: fade-random 10s infinite;
    animation-delay: 3.5s;
}

#palmeras .my-gallery-item:nth-child(3) {
    animation: fade-random 10s infinite;
    animation-delay: 6s;
}

/* Contenedores de texto */
.text-container {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 1rem;
    height: 100%;
    box-sizing: border-box;
}

.text-container p {
    color: white;
    text-align: center;
    font-size: 1.1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    .container-Servicios {
        width: 95%;
        padding: 0.5rem;
    }

    .fila-impar,
    .fila-par {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .text-container p {
        font-size: 0.9rem;
    }

    .my-gallery {
        height: 200px;
        margin-bottom: 1rem;
    }

    /* Ajustar animaciones para móviles */
    .my-gallery-item {
        animation-duration: 12s !important;
    }

    .my-gallery-item:nth-child(2) {
        animation-delay: 4s !important;
    }

    .my-gallery-item:nth-child(3) {
        animation-delay: 8s !important;
    }
}

/* Aplicar animaciones a las galerías... (mantener las animaciones específicas) */

/*------------------------ Carrusel de clientes -----------------------*/
#clients {
    padding: 40px 0;
    margin: 2rem 0;
}

.client-img {
    width: 30%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

#clients h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #333;
    text-align: center;
}

.carousel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/*------------------------ Formulario de contactos -----------------------*/
.contact-section {
    background-color: #40694b;
    padding: 40px 20px;
    border-radius: 10px;
    width: 80%;
    margin: 2rem auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.contact-section h1 {
    color: white;
    margin-bottom: 20px;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.contact-image,
.contact-form {
    flex: 1;
    min-width: 300px;
    margin: 10px;
}

.contact-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.contact-form label {
    color: white;
    margin-bottom: 5px;
}

.contact-form input,
.contact-form textarea {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid white;
    border-radius: 5px;
    outline: none;
    font-size: 16px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #fff;
    box-shadow: 0 0 5px white;
}

.contact-form button {
    padding: 10px;
    color: white;
    background-color: #609760;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.contact-form button:hover {
    background-color: #40694b;
}

.contact-description {
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
}

/*------------------------ Mapa Encuéntranos -----------------------*/
.map-section {
    background-color: #f7fcf8;
    padding: 40px 20px;
    border-radius: 10px;
    width: 80%;
    margin: 2rem auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.map-section h1 {
    color: rgb(8, 8, 8);
    margin-bottom: 20px;
}

.map-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

/*------------------------ Footer -----------------------*/
#footerbackground {
    background: linear-gradient(to bottom, #40694b, #000000);
    text-align: center;
    padding: 20px 10px;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.footer-content {
    display: inline-block;
    width: 100%;
}

#tituloRS {
    color: white;
    text-align: center;
    font-family: "Nunito", sans-serif;
    font-style: italic;
    font-weight: 800;
}

.contenedor {
    margin: 20px 0;
    text-align: center;
}

.contenedor i {
    font-size: 25px;
    color: #48705d;
    margin: 15px;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.35);
    transition: 0.5s ease;
    background-color: white;
}

.contenedor i:hover {
    transform: scale(1.2);
}

.fa-whatsapp:hover {
    background-color: #25d366;
    color: white;
    box-shadow: 0 0 25px #25d366;
}

.fa-youtube:hover {
    background-color: #e10600;
    color: white;
    box-shadow: 0 0 25px #e10600;
}

.fa-facebook:hover {
    background-color: #3b5998;
    color: white;
    box-shadow: 0 0 25px #3b5998;
}

.fa-x-twitter:hover {
    background-color: #00acee;
    color: white;
    box-shadow: 0 0 25px #00acee;
}

.fa-instagram:hover {
    background-color: #cd486b;
    color: white;
    box-shadow: 0 0 25px #cd486b;
}

#Copyright {
    color: white;
    text-align: center;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-weight: 800;
    font-size: 0.7rem;
    margin-top: 15px;
}

.btn-wsp {
    position: fixed;
    width: 55px;
    height: 55px;
    line-height: 55px;
    bottom: 30px;
    right: 30px;
    background-color: #1ebe57;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.3);
    z-index: 1080;
}

.btn-wsp:hover {
    color: #1ebe57;
    background: #fff;
}

/*------------------------ Media Queries -----------------------*/

@media (max-width: 1800px) {

    .navbar-brand img {
        width: 40%;        
        height: 10%;        
        margin-left: 45%;
        margin-right: 0;
    }

    .top-bar {
        background: linear-gradient(to bottom, #000000, #40694b);
        color: #fff;
        padding: 0.5rem 0;
        font-size: 0.9rem;
        white-space: nowrap;
        width: 100%;
        z-index: 1040;
    }

    .top-bar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow: hidden;
        width: 100%;
    }

    .video-background {
        height: 60vh;
        margin-top: 150px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

   
}


@media (max-width: 1200px) {

    .navbar-brand img {
        width: 40%;        
        height: auto;        
        margin-left: 250px;
        margin-right: 0;
    }

    .top-bar {
        background: linear-gradient(to bottom, #000000, #40694b);
        color: #fff;
        padding: 0.5rem 0;
        font-size: 0.9rem;
        white-space: nowrap;
        width: 100%;
        z-index: 1040;
    }

    .top-bar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow: hidden;
        width: 100%;
    }

    .video-background {
        height: 60vh;
        margin-top: 130px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 1024px) {

    .navbar-brand img {
        width: 40%;        
        height: auto;        
        margin-left: 200px;
        margin-right: 0;
    }

    .top-bar {
        background: linear-gradient(to bottom, #000000, #40694b);
        color: #fff;
        padding: 0.5rem 0;
        font-size: 0.9rem;
        white-space: nowrap;
        width: 100%;
        z-index: 1040;
    }

    .top-bar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow: hidden;
        width: 100%;
    }


    .video-background {
        height: 60vh;
        margin-top: 110px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 992px) {

    .navbar-brand img {
        width: 40%;        
        height: auto;        
        margin-left: 150px;
        margin-right: 0;
    }

    .top-bar {
        background: linear-gradient(to bottom, #000000, #40694b);
        color: #fff;
        padding: 0.5rem 0;
        font-size: 0.9rem;
        white-space: nowrap;
        width: 100%;
        z-index: 1040;
    }

    .top-bar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow: hidden;
        width: 100%;
    }


    .service-grid .col-md-6 {
        flex-basis: 60%;
        max-width: 60%;
    }

    .service-grid .col-md-6:nth-child(2) {
        flex-basis: 40%;
        max-width: 40%;
    }

    .video-background {
        height: 57vh;
        margin-top: 140px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

   
}

@media (max-width: 768px) {
      

    .service-grid .col-md-6 {
        flex-basis: 100%;
        max-width: 100%;
    }

    .service-grid .col-md-6:nth-child(2) {
        flex-basis: 100%;
        max-width: 100%;
    }

    .service-grid img {
        max-width: 70%;
        margin: 0 auto;
        display: block;
    }

     .service-grid .row {
        flex-direction: column; /* Cambia a columna en móviles */
        flex-wrap: wrap;
    }
    
    .service-grid .col-md-6:first-child,
    .service-grid .col-md-6:last-child {
        flex: 0 0 100%; /* Ambos ocupan 100% del ancho */
        max-width: 100%;
    }
    
    .service-grid .service-list {
        margin-left: 0; /* Elimina el margen izquierdo */
        font-size: 1.1rem;
        text-align: center;
        width: 100%; /* Ocupa todo el ancho */
        padding: 0 15px; /* Agrega padding lateral para respirar */
    }

    .container-Servicios {
        width: 95%;
        padding: 1rem;
    }

    .fila-impar,
    .fila-par {
        grid-template-columns: 1fr;
    }

    .text-container p {
        font-size: 0.9rem;
    }

    .my-gallery {
        height: 200px;
        margin-bottom: 1rem;
    }

    .contact-section,
    .map-section {
        width: 95%;
        padding: 20px 15px;
    }

    .contact-container {
        flex-direction: column;
    }

    .contact-image,
    .contact-form {
        min-width: 100%;
        margin: 10px 0;
    }

    .navbar-brand img {
        width: 50% !important;
        /* 50% más grande (30% original * 1.5 = 45%) */
        max-width: 200px !important;
        margin: 0 auto !important;
        display: block;
    }

    .logo-container {
        width: 100%;
        text-align: center;
    }

    .navbar-toggler {
        position: absolute;
        right: 15px;
        top: 15px;
    }

    /* Ajuste adicional para el contenedor del navbar en móviles */
    .navbar-custom .container-fluid {
        position: relative;
    }

     .video-background {
        height: 45vh;
        margin-top: 185px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

}

@media (max-width: 768px) and (orientation: landscape) {
    .video-background {
        height: 60vh;
        margin-top: 70px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 680px) {

    .video-background {
        height: 40vh;
        margin-top: 190px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

     .service-grid .row {
        flex-direction: column; /* Cambia a columna en móviles */
        flex-wrap: wrap;
    }
    
    .service-grid .col-md-6:first-child,
    .service-grid .col-md-6:last-child {
        flex: 0 0 100%; /* Ambos ocupan 100% del ancho */
        max-width: 100%;
    }
    
    .service-grid .service-list {
        margin-left: 0; /* Elimina el margen izquierdo */
        font-size: 1.1rem;
        text-align: center;
        width: 100%; /* Ocupa todo el ancho */
        padding: 0 15px; /* Agrega padding lateral para respirar */
    }

}

@media (max-width: 480px) {
    .video-background {
        height: 26vh;
        margin-top: 190px;
    }

    .video-background video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .video-background-content {
        padding: 10px;
        padding-top: 15px;
    }

    /*.service-grid .service-list {
    font-size: 1.2rem;
    font-weight: bold;
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 0 0 0 10%;
    }

    .service-grid .service-list {
        margin-left: 15%;
        font-size: 1.1rem;
        text-align: center;
        width: 100%;
    }*/

    .service-grid .row {
        flex-direction: column; /* Cambia a columna en móviles */
        flex-wrap: wrap;
    }
    
    .service-grid .col-md-6:first-child,
    .service-grid .col-md-6:last-child {
        flex: 0 0 100%; /* Ambos ocupan 100% del ancho */
        max-width: 100%;
    }
    
    .service-grid .service-list {
        margin-left: 0; /* Elimina el margen izquierdo */
        font-size: 1.1rem;
        text-align: center;
        width: 100%; /* Ocupa todo el ancho */
        padding: 0 15px; /* Agrega padding lateral para respirar */
    }
    

    .text-container p {
        font-size: 0.85rem;
    }

    .my-gallery {
        height: 180px;
    }

    .center-text h1 {
        font-size: 2rem;
    }

    .center-text h2 {
        font-size: 1.5rem;
    }

    #clients h2 {
        font-size: 1.5rem;
    }

    .client-img {
        width: 50%;
    }

    .navbar-brand img {
        width: 50% !important;
        /* 50% más grande (30% original * 1.5 = 45%) */
        max-width: 200px !important;
        margin: 0 auto !important;
        display: block;
    }
}