:root {
    --morado-oscuro: #452956;
    --morado-claro: #633082;
    --texto-gris: #555;
    --fondo-gris: #e8e8e8;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url('../img/fondo_1.webp'); 
    background-repeat: repeat;
    margin: 0;
    padding: 0;
}

.servicios-hero {
    width: 100%;
    padding: 0;
    line-height: 0;
    overflow: hidden;
}

.hero-image-container {
    width: 100%;
}

.justice-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.servicios-grid-section {
    width: 100%;
    padding: 80px 20% 100px 20%; 
}

.cards-wrapper {
    display: flex;
    gap: 30px;
    align-items: stretch; 
}

.big-card {
    flex: 1; 
    display: flex;
    flex-direction: column;
    min-height: 0; 
}

.big-card .card-body {
    padding-bottom: 90px; 
}

.big-card .card-image {
    flex: 1; 
    display: flex;
    overflow: hidden; 
}

.big-card .card-body h3 {
    margin-top: 30px; 
    margin-bottom: 20px;
}

.big-card .card-image img {
    width: 100%;
    height: 100% !important; 
    display: block;
    object-fit: cover; 
}

.right-column-stack {
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: space-between; 
    height: auto; 
    min-height: 0; 
}

.card-image-small img {
    width: 100%;
    height: 200px; 
    display: block;
    object-fit: cover;
}

.card {
    background-color: #dcdcdc; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    overflow: hidden; 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body {
    padding: 30px 45px; 
    text-align: left; 
    flex: 0 0 auto; 
}

.card-body h3 {
    color: #333;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 22px;
    line-height: 1.3;
    hyphens: none; 
}

.card-body p {
    color: #666;
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 400;
    text-align: justify;
    text-justify: inter-word;
    letter-spacing: 0.3px; /* Junta un poco las letras para ganar espacio */   /* Reduce el espacio base entre palabras */
    hyphens: none; 
    word-spacing: normal;
}

.right-column-stack .card-body p {
    line-height: 1.5;
    font-size: 1.25rem; 
    letter-spacing: 0.2px;
    word-spacing: -2.5px;
}

.video-carousel-section {
    width: 100%;
    background-image: url('../img/fondovideo.webp'); 
    background-size: cover;
    background-position: center;
    background-color: var(--morado-oscuro); 
    padding: 80px 52%;
    color: white;
}

.carousel-container {
    width: 100%;
    max-width: 1400px; 
    padding: 0 5%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.video-wrapper {
    flex: 0 0 500px; 
    aspect-ratio: 16/9;
    background: #000;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 5px solid white; 
    overflow: hidden; 
    line-height: 0;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block; /* Esto elimina el espacio extra inferior */
    border: none;
}

.arrow-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    flex-shrink: 0;
}

.arrow-btn:hover {
    transform: scale(1.1);
}

.arrow-btn img {
    width: 40px; 
    height: auto;
}

.video-title-content {
    flex: 0 0 550px;
    text-align: left;
    padding-left: 20px;
}

.video-title-content h2 {
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.t-small {
    font-size: 1.9rem; 
    display: block;   
    margin-bottom: 5px;
    font-weight: 500;
}

.t-large {
    font-size: 4.2rem; 
    display: block;    
    line-height: 0.9;  
    letter-spacing: 0.2rem;
}

.services-list-section {
    background-color: #e0e0e0; 
    background-image: url('../img/fondo_1.webp'); 
    padding: 80px 22%; 
    text-align: center;
}

.services-header {
    margin-bottom: 50px;
}

.video-title-content h2 .t-large {
    font-size: 4.2rem; 
}

#videoTitle:contains("SOMOS") .t-large {
    font-size: 5.5rem; 
}

.title-large-alt {
    font-size: 5.8rem !important; 
}

.t-xlarge {
    font-size: 5.8rem !important; 
    letter-spacing: 0.1rem;
}

.services-header .small-title {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: 14px;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.services-header h2 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--morado-oscuro);
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 2px;
    line-height: 1;
}

.services-purple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
}

.service-box {
    background-color: var(--morado-oscuro); 
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.service-box:hover {
    transform: translateY(-5px); 
}

.service-box img {
    height: 180px; 
    width: auto;
    filter: brightness(0) invert(1); 
}

.service-box p {
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

@media (max-width: 768px) {
    /* --- 1. SECCIÓN TARJETAS (Apilado perfecto) --- */
    .servicios-grid-section { 
        padding: 50px 5%; /* Márgenes de seguridad laterales */
    }
    .cards-wrapper {
        flex-direction: column; /* Apila las tarjetas verticalmente */
        gap: 30px;
    }
    .big-card .card-body{
        padding-bottom: 30px;
    }
    .big-card .card-body h3 {
        margin-top: -5px;
        margin-bottom: 15px;
    }
    .big-card, .right-column-stack { 
        flex: auto; 
        width: 100%;
    }
    .big-card .card-image { 
        display: block; 
    }
    .big-card .card-image img { 
        height: 250px !important; /* Altura controlada para el móvil */
    }
    .card-image-small img { 
        height: 200px; 
    }
    .card-body {
        padding: 25px 20px;
    }
    .card-body h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    .card-body p {
        font-size: 1.02rem;
        letter-spacing: 0.25px;
        word-spacing: -2px;
        text-align: justify;
        display: flex;
    }
    
    .right-column-stack .card-body p {
        font-size: 1rem; 
        word-spacing: -2px;/* Letra un poco más chica para que fluya bien */
    }

    /* --- 2. SECCIÓN VIDEO CAROUSEL (Título y Flechas fusionados) --- */
    .hide-mobile {
        display: none !important;
    }

    .video-carousel-section {
        padding: 50px 5%; 
    }
    .carousel-container {
        flex-direction: column;
        padding: 50px 0 0 0; /* Creamos un "techo" vacío de 50px para el título */
        position: relative; /* Clave para anclar las flechas y el título */
    }
    
    .video-title-content {
        position: absolute; /* Mandamos el título arriba del todo */
        top: 0;
        left: 0;
        width: 100%;
        text-align: center;
        padding: 0;
        margin: 0;
    }

    /* Convertimos el título en una sola línea compacta */
    .video-title-content h2 {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 0;
    }
    
    /* Reseteamos todas tus clases de texto grande a un mismo tamaño para la línea */
    .video-title-content h2 span {
        font-size: 1.3rem !important; /* Tamaño exacto para que no choque con las flechas */
        letter-spacing: 0 !important;
        margin: 0 !important;
        line-height: 1;
        font-weight: 800;
    }

    /* Rescatamos las flechas (antes las tenías en display:none) */
    .arrow-btn {
        display: block; 
        position: absolute;
        top: -10px; /* Las alineamos con el texto */
        padding: 10px;
        z-index: 10;
    }
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }
    
    .arrow-btn img {
        width: 25px; /* Flechas más sutiles */
    }

    .video-wrapper {
        width: 100%;
        flex: auto;
    }

    /* --- 3. SECCIÓN CUADRÍCULA MORADA (2 Columnas exactas) --- */
    .services-list-section {
        padding: 50px 5%;
    }
    
    .services-header {
        margin-bottom: 30px;
    }
    
    .services-header .small-title {
        font-size: 1.1rem;
        letter-spacing: 6px; /* Menos espacio para que quepa */
    }
    
    .services-header h2 {
        font-size: 2.8rem; /* Título principal encogido */
    }

    .services-purple-grid {
        grid-template-columns: repeat(2, 1fr); /* AQUÍ ESTÁ LA MAGIA: 2 Columnas */
        gap: 15px; /* Separación entre cajas */
    }
    
    .service-box {
        padding: 25px 10px;
        gap: 15px; /* Acercamos el ícono al texto */
    }
    
    .service-box img {
        height: 55px; /* Íconos reducidos para que quepan en 2 columnas */
    }
    
    .service-box p {
        font-size: 0.85rem; /* Texto compacto */
        text-align: center;
    }
}