* {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    margin: 0;
    padding: 0;
    font-size: 22px;
}

body {
    background: url('img/fondo\ gris.jpg') no-repeat center center fixed;
    background-size: 900px 850px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

/* ================= HEADER ================= */
.header {
    position: relative;
    width: 100%;
    min-height: 100px;
    background-color: #8B0000;
    overflow: hidden;
}


.header-layer {
    position: absolute;
    width: 120%;
    height: 60px;
    transform: skewY(-5deg);
}

.header .layer1 {
    background: linear-gradient(to right, #5C0000, #8B0000);
    top: 0;
    left: 0;
}

.header .layer2 {
    background: linear-gradient(to right, #A00000, #C00000);
    top: 20px;
    left: -10px;
}

.header .layer3 {
    background: linear-gradient(to right, #D02020, #FF3030);
    top: 40px;
    left: -20px;
}

/* ================= NAVBAR ================= */
.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px;
}

.logo img {
    height: 70px;
    border-radius: 50%;
    margin-left: -50px;
    margin-right: 300px;
    transition: transform 0.3s ease-in-out;
    background: white;
}

.logo img:hover {
    transform: scale(1.1);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-grow: 1;
    justify-content: center;
    gap: 40px;
    padding: 0;
}

.nav-links li {
    display: inline-block;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 10px 15px;
    font-size: 16px;
    transition: background 0.3s ease-in-out;
}

.nav-links li:last-child {
    margin-left: auto;
    margin-right: 40px;
}

.nav-links a:hover {
    background-color: rgba(0, 0, 0, 0.1); /* Hover casi transparente (10% de opacidad) */
    border-radius: 10px;
}

/* ================= MAIN ================= */
main {
    flex: 1;
}

/* ================= SERVICIOS ================= */
.servicios {
    padding-top: 40px;
}

.servicios h2 {
    font-size: 40px;
    text-align: center;
    margin: 50px auto;
    width: fit-content;
    color: black;
}

.grid-servicios {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 80px auto;
    align-items: center;
    justify-content: center; /* Centra las tarjetas dentro del grid */
}

.servicio {
    position: relative;
    perspective: 1000px;
    width: 300px;
    height: 350px;
    margin: auto;
    display: flex;
    justify-content: center; /* Centra el contenido dentro de la tarjeta */
}

.servicio-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
}

.servicio:hover .servicio-inner {
    transform: rotateY(180deg);
}

.servicio-front,
.servicio-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.servicio-front {
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.servicio-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.servicio-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #8B0000, #006400);
    color: #ffffff;
    padding: 15px;
    box-sizing: border-box;
    width: 93%;
    height: 95%;
    text-align: center;
    border-radius: 15px;
}

.servicio-back h3 {
    font-size: 1em;
}

.servicio-back p {
    font-size: 0.9em;
    font-weight: 400;
}

/* NUEVO: tarjeta doble */
.servicio-doble {
    grid-column: span 2;
}

/* ================= FOOTER ================= */
.footer {
    position: relative;
    width: 100%;
    height: 100px;
    background-color: #1b3d0f;
    overflow: hidden;
    margin-top: auto;
}

.footer-layer {
    position: absolute;
    width: 120%;
    height: 60px;
    transform: skewY(-5deg);
}

.footer .layer1 {
    background: linear-gradient(to right, #0d330d, #136c13);
    bottom: 0;
    left: 0;
}

.footer .layer2 {
    background: linear-gradient(to right, #1f7a1f, #3ea93e);
    bottom: 20px;
    left: -10px;
}

.footer .layer3 {
    background: linear-gradient(to right, #3ca73c, #5cc75c);
    bottom: 40px;
    left: -20px;
}

.infofooter {
    font-size: 15px;
    font-weight: bold; /* Cambiado de 300 a bold */
    color: white;
    text-align: center;
    display: block;
    width: 100%;
    position: relative;
    z-index: 10;
    line-height: 15px;
}

.servicio-destacado {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrado de los elementos dentro del contenedor */
    gap: 25px;
    background: linear-gradient(to bottom, #8B0000, #006400);
    color: white;
    padding: 25px;
    margin: 40px auto 80px auto; /* Esto asegura que el contenedor se centre horizontalmente */
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    text-align: center; /* Centrado del contenido textual */
}

.servicio-destacado img {
    width: 400px; /* antes 350px */
    height: 240px; /* opcional: un poco más de alto */
    object-fit: cover;
    border-radius: 15px;
    flex-shrink: 0;
}

.servicio-destacado-info {
    flex: 1;
    min-width: 250px;
}

.servicio-destacado h3 {
    font-size: 1.3em; /* antes 1.8em */
    margin-bottom: 8px;
}

.servicio-destacado p {
    font-size: 0.95em; /* antes 1.1em */
    font-weight: 400;
    line-height: 1.4;
}


/* ================= RESPONSIVE ================= */
@media screen and (max-width: 600px) {
    .grid-servicios {
        grid-template-columns: 1fr;
    }

    @media (max-width: 768px) {
        * {
            font-size: 16px;
        }
    
        body {
            font-size: 16px;
        }
    
        .header {
            height: auto; /* Permite que la altura se ajuste al contenido */
            padding-bottom: 3px; /* Reducimos el padding inferior del header */
            position: relative;
        }
    
        .header-layer {
            height: 15px; /* Reducimos la altura de las capas */
            position: absolute;
            width: 100%;
            left: 0;
            transform: skewY(-5deg);
        }
    
        .header .layer1 {
            background: linear-gradient(to right, #5C0000, #8B0000);
            top: 0;
        }
    
        .header .layer2 {
            background: linear-gradient(to right, #A00000, #C00000);
            top: 3px; /* Ajustamos la posición de la capa */
            left: -2px; /* Ajustamos la posición de la capa */
        }
    
        .header .layer3 {
            background: linear-gradient(to right, #D02020, #FF3030);
            top: 6px; /* Ajustamos la posición de la capa */
            left: -2px; /* Ajustamos la posición de la capa */
        }
    
        .logo img {
            height: 35px; /* Reducimos la altura del logo */
            margin-left: 0;
            margin-right: 0;
            display: block;
            margin: 3px auto; /* Reducimos los márgenes */
        }
    
        .navbar {
            flex-direction: column;
            align-items: stretch;
            padding: 3px; /* Reducimos el padding del navbar */
            position: relative;
            z-index: 100;
        }
    
        .nav-links {
            flex-direction: column;
            align-items: stretch;
            width: 100%;
            padding: 0;
            gap: 2px; /* Reducimos el espacio entre los enlaces */
        }
    
        .nav-links li {
            width: 100%;
            text-align: center;
        }
    
        .nav-links a {
            display: block;
            width: 100%;
            padding: 8px 0; /* Reducimos el padding vertical de los enlaces */
            box-sizing: border-box;
            font-size: 14px; /* Reducimos el tamaño de la fuente */
            font-weight: bold;
            text-decoration: none;
            color: white;
            border-radius: 2px;
            transition: background-color 0.3s ease;
        }
    
        .nav-links a:hover {
            background-color: rgba(0, 0, 0, 0.1); /* Mantenemos el hover */
            border-radius: 5px; /* Reducimos el radio del borde */
        }
    }
    .servicio-destacado {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .servicio-destacado img {
        width: 100%;
        height: auto;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .servicio-destacado-info {
        width: 100%;
    }

    .servicio-destacado h3 {
        font-size: 1.1em;
    }

    .servicio-destacado p {
        font-size: 0.9em;
    }
    
}


.mensaje-interactivo {
    text-align: center;
    font-size: 18px;
    color: #000000;
    font-weight: bold;
    margin-top: -40px;  /* para acercarlo más al servicio destacado */
    margin-bottom: 40px;
    padding: 10px 20px;
}

