/* ==============================
            ESTILOS PARA LAS PÁGINAS DE SERVICIOS
============================== */

/* Estilos generales para el contenedor principal */
.servicios-container {
    position: relative;
    width: 100%;
    height: 100vh; /* Altura completa de la ventana */
    overflow: hidden;
    margin-top: 0;
    padding: 0;
}

/* Contenedor del video de fondo */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Estilos para el video de fondo */
.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que el video cubra todo el contenedor */
    filter: brightness(40%); /* Oscurece el video para mejor legibilidad del texto */
}

/* Capa de superposición para darle un color al video */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 34, 17, 0.5); /* Superposición verde oscuro semi-transparente */
    z-index: 2;
}

/* Contenedor del texto principal */
.servicios-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
    padding: 20px;
    text-align: center;
    color: #ffffff;
}

/* Estilos para el título principal - actualizado para coincidir con la imagen */
.servicios-title {
    font-family: 'Merriweather', serif;
    font-size: 2.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    color: #ffffff;
    letter-spacing: 3px;
    line-height: 1.2;
}

/* Estilos para el subtítulo - actualizado para coincidir con la imagen */
.servicios-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* Responsive para pantallas medianas */
@media only screen and (max-width: 991px) {
    .servicios-title {
        font-size: 2.4rem;
    }
    
    .servicios-subtitle {
        font-size: 1.6rem;
    }
}

/* Responsive para pantallas pequeñas */
@media only screen and (max-width: 767px) {
    .servicios-title {
        font-size: 1.7rem;
        letter-spacing: 2px;
    }
    
    .servicios-subtitle {
        font-size: 1.4rem;
    }
}

/* Responsive para pantallas muy pequeñas */
@media only screen and (max-width: 480px) {
    .servicios-title {
        font-size: 1.7rem;
        letter-spacing: 1.5px;
    }
    
    .servicios-subtitle {
        font-size: 1rem;
    }
}

/* Animaciones para el texto */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.5s;
}

.animate-delay-2 {
    animation-delay: 1s;
}

/* ==============================
   ESTILOS PARA LAS TARJETAS DE SERVICIOS
============================== */

/* Contenedor de tarjetas de servicios */
.servicios-cards-container {
    background-color: #ffffff;
    padding: 4rem 0;
    position: relative;
    z-index: 5;
    background-image: url('../images/servicios-nuevo/accidentes/FRANJA.png');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: auto 80%;
    overflow: hidden;
    min-height: 800px;
}

/* Título de la sección de tarjetas */
.servicios-cards-title {
    font-family: 'Merriweather', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #333333;
    text-align: center;
    margin-bottom: 3rem;
}

/* Grid de tarjetas */
.servicios-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==============================
   ESTILOS PARA TARJETAS CON EFECTO FLIP
============================== */

/* Contenedor principal de la tarjeta con perspectiva */
.servicio-card {
    width: calc(25% - 1.5rem);
    min-width: 250px;
    height: 320px; /* Altura fija para mantener consistencia */
    margin-bottom: 1.5rem;
    perspective: 1000px; /* Añade perspectiva para el efecto 3D */
    position: relative;
    transition: transform 0.3s ease;
}

.servicio-card:hover .servicio-card-inner {
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.3);
    margin-top: -5px;
}

/* Contenedor interno que gira */
.servicio-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s, box-shadow 0.3s, margin-top 0.3s;
    transform-style: preserve-3d;
    border-radius: 15px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    border: 1.5px solid #106B40;
    background-color: white;
}

/* Clase que se agrega con JS para voltear la tarjeta */
.servicio-card.flipped .servicio-card-inner {
    transform: rotateY(180deg);
}

/* Estilos para ambas caras */
.servicio-card-front, .servicio-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Cara frontal (posición por defecto) */
.servicio-card-front {
    background-color: white;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.servicio-card-front .servicio-card-image {
    flex-shrink: 0;
}

.servicio-card-front .servicio-card-title {
    flex-shrink: 0;
}

.servicio-card-front .servicio-card-button {
    margin-top: auto;
    margin-bottom: 1.5rem;
}

/* Cara trasera (volteada 180 grados) */
.servicio-card-back {
    background-color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

/* Contenedor de imagen se mantiene igual */
.servicio-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.servicio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Título de la tarjeta se mantiene igual */
.servicio-card-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: #333333;
    padding: 1rem 0.5rem;
    margin: 0;
    text-transform: uppercase;
}

/* Estilo específico para el título en la cara frontal */
.servicio-card-front .servicio-card-title {
    font-size: 1.2rem;
    line-height: 1.3;
    height: 62px; /* Altura fija para todos los títulos */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Espaciador automático para empujar el botón hacia el final */
.servicio-card-front::after {
    content: "";
    flex-grow: 1;
}

/* Botón de más información se mantiene igual, pero con margen fijo */
.servicio-card-button {
    display: block;
    width: 80%;
    margin: 0 auto 1.5rem;
    padding: 0.7rem 0.5rem;
    background-color: #106B40;
    color: white;
    text-align: center;
    border-radius: 30px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #106B40;
    cursor: pointer;
}

.servicio-card-button:hover {
    background-color: white;
    color: #106B40;
    border: 1px solid #106B40;
    box-shadow: 0 4px 8px rgba(16, 107, 64, 0.3);
}

/* Estilos para la información en el reverso */
.servicio-card-info {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555555;
    text-align: left;
    margin-bottom: 1rem;
    overflow-y: auto;
    flex: 1;
}

.servicio-card-info p {
    margin-bottom: 0.8rem;
}

/* Botón para volver al frente */
.servicio-card-back-button {
    display: block;
    width: 80%;
    margin: 0 auto;
    padding: 0.7rem 0.5rem;
    background-color: #106B40;
    color: white;
    text-align: center;
    border-radius: 30px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #106B40;
    cursor: pointer;
}

.servicio-card-back-button:hover {
    background-color: white;
    color: #106B40;
    border: 1px solid #106B40;
    box-shadow: 0 4px 8px rgba(16, 107, 64, 0.3);
}

/* Ajustes responsivos para tarjetas */
@media only screen and (max-width: 1200px) {
    .servicios-cards-grid {
        gap: 1.2rem;
    }
    
    .servicio-card {
        width: calc(25% - 1.2rem);
        min-width: 220px;
    }
}

@media only screen and (max-width: 991px) {
    .servicios-cards-grid {
        gap: 1rem;
    }
    
    .servicio-card {
        width: calc(33.333% - 1rem);
        min-width: 220px;
    }
}

@media only screen and (max-width: 767px) {
    .servicios-cards-title {
        font-size: 1.8rem;
    }
    
    .servicios-cards-grid {
        gap: 1rem;
    }
    
    .servicio-card {
        width: calc(50% - 1rem);
        min-width: 200px;
    }
    
    .servicios-cards-container {
        background-size: auto 60%;
    }
}

@media only screen and (max-width: 480px) {
    .servicios-cards-title {
        font-size: 1.5rem;
    }
    
    .servicio-card {
        width: 100%;
        max-width: 280px;
        min-width: auto;
    }
}

/* Franja verde */
.green-stripe {
    background-color: #00000000;
    background-image: 
        url('../images/servicios-nuevo/accidentes/BLANCO\ FORMA.png'),
        url('../images/servicios-nuevo/accidentes/VERDE\ FORMA.png');
    background-repeat: no-repeat, no-repeat;
    background-position: center bottom, center top;
    background-size: 100% 150px, 100% auto;
    height: 300px;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3; /* Encima del video (z-index: 1) y la superposición (z-index: 2) */
}

/* Para dispositivos móviles */
@media only screen and (max-width: 767px) {
    .green-stripe {
        height: 90px; /* Un poco más pequeña en móviles */
        background-size: 100% 80px, 100% auto; /* Ajuste para la imagen en móviles */
    }
}