
/* ===== LAYOUT GENERAL ===== */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #000c06;
}

.main-serv-calidad {
    width: 100%;
    min-height: 100vh;
}

/* ===== CONTENEDOR HERO GENERAL ===== */
.calidad-hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--color-dark); /* Fondo oscuro base para que contraste con el panel verde */
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.hero-content-grid {
    position: relative;
    display: grid;
    /* 38% Izquierda para el panel sesgado verde, 62% Derecha para carruseles interactivos */
    grid-template-columns: 38% 62%; 
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* ===== LADO IZQUIERDO: PANEL GEOMÉTRICO VERDE SESGADO ===== */
.skewed-calidad-panel {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12% 0 40px; /* Margen derecho extra por la inclinación de la diagonal */
    /* Inclinación hacia la derecha, invirtiendo la estructura de consultores */
    clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%); 
    box-shadow: 15px 0 30px rgba(105, 11, 14, 0.5);
    overflow: hidden;
}

.panel-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Capa verde corporativa semi-transparente */
.panel-green-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(105, 11, 14, .9) 0%, rgba(107, 12, 12, 0.75) 100%);
    z-index: 2;
}

/* Envoltura interna del contenido (Título arriba, Texto abajo) */
.panel-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 310px;
    margin-right: 2em;
}

.title-area {
    margin-bottom: 25px;
}

.title-area h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    line-height: 1.1;
    margin: 0;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.title-underline {
    width: 80%;
    height: 5px;
    background-color: #ffffff;
    margin-top: 15px;
    border-radius: 2px;
}

.info-description-box {
    width: 100%;
    text-align: justify;
}

.info-description-box p {
    font-size: 1em;
    text-align: left;
    line-height: 1.6;
    color: #ffffff;
    margin: 0;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

/* ===== LADO DERECHO: BOTONES Y CARRUSEL DE VIDEOS ===== */
.dynamic-right-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 40px 40px 40px 0px; 
}

/* Botones superiores */
.btn-nav-servicios {
    display: inline-block;
    padding: 10px 28px;
    background-color: #ad3d3d;
    color: #ffffff;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 12px;
    height: 40px;
}

.btn-nav-servicios:hover, 
.btn-nav-servicios.active {
    background-color: #ffefef;
    color: #790b0b;
    box-shadow: 0 0 15px rgba(255, 151, 151, 0.6);
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Tarjetas de videos individuales */
.video-box-card {
    position: relative;
    width: 100%;
    max-width: 200px; /* Tamaño optimizado para encajar perfectamente de 3 en 3 */
    height: 250px;    
    background-color: #000000;
    margin: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.video-box-card:hover {
    transform: translateY(-5px);
}

.video-box-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Capa de texto blanca inferior en el video */
.video-overlay-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%; 
    background: linear-gradient(to top, rgba(45, 1, 1, 0.95) 0%, rgba(71, 4, 4, 0.4) 65%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    padding: 0 20px 35px; 
    z-index: 10;
    text-align: center;
}

.video-overlay-caption h5 {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin: 0;
}

.rounded-circle-custom {
    border-radius: 10px;
    overflow: hidden;
}

/* Controles de flechas abajo */
.carousel-controls-bottom {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.btn-control-bottom {
    background-color: var(--color-base);
    border: none;
    box-shadow: 0 0 10px var(--color-medium);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control-bottom img{
    height: 100%;
    object-fit: scale-down;
}

.btn-control-bottom:hover img{
    filter: invert(1);
}

.btn-control-bottom .btn-rev{
    transform: rotate(180deg);
}

.btn-control-bottom:hover {
    box-shadow: 0 0 50px var(--color-text);
    background-color: #ffffff;
    border-color: #ffffff;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Pantallas medianas / Laptops pequeñas (Menos de 1100px) */
@media (max-width: 1100px) {
    .hero-content-grid { 
        grid-template-columns: 42% 58%; 
    }
    .skewed-calidad-panel {
        padding: 0 8% 0 25px;
    }
    .video-box-card { 
        max-width: 160px; /* Reducción ligera para pantallas medianas */
        height: 220px; 
    }
    .title-area h1 { 
        font-size: 1.6rem; 
    }
}

/* Tabletas y Celulares (Menos de 991px) */
@media (max-width: 991px) {
    /* Permitir que el contenedor crezca si el contenido lo requiere */
    .calidad-hero-container {
        height: auto;
        min-height: 100vh;
    }

    .hero-content-grid {
        grid-template-columns: 1fr; /* Pasa a ser una sola columna */
        height: auto;
    }

    /* Modificación del sesgo para que sea horizontal inferior */
    .skewed-calidad-panel {
        height: auto;
        width: 100%;
        padding: 80px 40px 100px 40px;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    }

    .panel-content-wrapper {
        max-width: 100%;
        width: 100%;
        align-items: center;
        text-align: center;
        margin-right: 0;
    }

    .title-area {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .title-underline {
        width: 50%;
    }

    .info-description-box p { 
        text-align: center; 
    }

    /* Ajustes del panel derecho (Carrusel) */
    .dynamic-right-panel {
        padding: 40px 20px;
        align-items: center;
    }

    .dynamic-right-panel .row {
        justify-content: center !important;
        padding-left: 0 !important;
    }

    .carousel-container-area {
        width: 100%;
    }
}

/* Celulares Pequeños (Menos de 480px) */
@media (max-width: 480px) {
    .skewed-calidad-panel {
        padding: 60px 20px 80px 20px;
    }

    .title-area h1 {
        font-size: 1.4rem;
    }

    .btn-nav-servicios { 
        padding: 8px 16px; 
        font-size: 11px; 
        height: auto;
    }
    
    .video-box-card {
        max-width: 140px;
        height: 190px;
    }
}