/* Columna Izquierda */

.servicios-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.servicio-item {
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.servicio-item img {
    max-width: 200px;
    max-height: 75px;
    width: auto;
    display: block;
    object-fit: cover;;
}

.servicio-item:hover,
.servicio-item.active {
    background: #00b6c9;
}


/* Contenido Derecho */

.servicio-panel {
    display: none;
}

.servicio-panel.active {
    display: block;
}

.panel-scroll {
    max-height: 380px;
    position: relative;
    display: flex;
    gap: 25px;
    padding: 25px;
    overflow: hidden;
}
    
.panel-img {
    width: 220px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* 🔥 clave para que no se mueva */
    position: sticky;
    top: 25px;
}

.panel-text {
    flex: 1;
    text-align: justify;
    max-height: 330px;
    overflow-y: auto;
    padding-right: 10px;
}

.panel-scroll::before,
.panel-scroll::after {
    content: "";
    position: sticky;
    left: 0;
    right: 0;
    height: 25px;
    pointer-events: none;
    z-index: 5;
}

.panel-scroll::before {
    top: 0;
    background: linear-gradient(#fff, transparent);
}

.panel-scroll::after {
    bottom: 0;
    background: linear-gradient(transparent, #fff);
}


/* .panel-scroll img{
    height: 300px;
    width: 350px;
    object-fit: cover;
} */

.service-title {
    font-size: 18px;
    font-weight: 550;
    color: #1f2f46;
    margin-bottom: 35px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
}

.service-title::after {
    content: "";
    width: 80px;
    height: 2px;
    background-color: #c82333; /* rojo corporativo */
    position: absolute;
    left: 0;
    bottom: -12px;
}

.service-parrafo{
    font-size: 12px;
}

/* PANEL PREVIEW AL PASAR EL MOUSE SOBRE LOS TEXTOS PARA QUE MUESTRE LAS IMAGENES */

#component-trigger {
    cursor: pointer;
}

#preview-box {
    position: absolute;
    top: -70%;
    left: 75%; 
    width: 320px;
    z-index: 20000 !important; /* Súbelo para que esté por encima de todo */
    display: none;
    padding: 15px;
    background: #fff; /* Asegura fondo blanco */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 8px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(10px);
}

#preview-box.preview-visible {
    opacity: 1;
    display: block; /* El JS se encarga del display, pero esto ayuda */
    transform: translateX(0);
}

#preview-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: -30px; 
    width: 35px;
    height: 100%;
    background: transparent;
}

.thumb-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    cursor: pointer;
    transition: 0.2s;
}

.thumb-img:hover {
    border-color: #004a99 !important;
    transform: scale(1.1);
}

#main-preview-img {
    width: 100% !important;
    height: 220px !important;
    object-fit: contain;
    background-color: #ffffff;
}



/* FIN */

.row.g-2, .row.g-4 {
    display: flex;
    flex-wrap: wrap;
}
/* Forzamos a la tarjeta a ser un contenedor Flex vertical */
.card.h-100 {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between; /* Empuja el contenido a los extremos */
    height: 100%;
}

.card-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto; /* Esto hace que el body sea elástico */
}

/* El cuerpo de la tarjeta debe crecer para ocupar el espacio vacío */
.card-body.p-4 {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Esto hace que el cuerpo ocupe todo el espacio sobrante */
}

/* El párrafo debe tener un margen inferior automático para empujar lo que sigue */
.card-body.p-4 p.text-muted {
    flex-grow: 1; /* El texto se estira para llenar el vacío, empujando el botón */
    margin-bottom: 1.5rem;
}

/* El botón o el contenedor del botón se quedará siempre al fondo */
.btn-outline-primary {
    margin-top: auto; /* Anclaje final */
}

.card-body .btn {
    margin-top: auto; 
}





@media (max-width: 991px) {

    /* layout general */
    .servicios-layout .row {
        flex-direction: column;
    }

    /* SELECTORES ARRIBA */
    .servicios-menu {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        margin-bottom: 15px;
    }

    .servicio-item img {
        max-width: 90px;
        max-height: 45px;
    }

    /* PANEL: imagen + texto lado a lado */
    .panel-scroll {
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
        padding: 12px;
        max-height: none;
    }

    /* IMAGEN MÁS CHICA */
    .panel-img {
        width: 90px;
        height: 180px;
        position: relative; /* sin sticky */
        top: auto;
        flex-shrink: 0;
    }

    /* TEXTO CON SCROLL */
    .panel-text {
        flex: 1;
        max-height: 220px;
        overflow-y: auto;
        padding-right: 6px;
    }

    .panel-img {
        width: 110px;     /* 🔥 más angosto */
        height: 160px;
        flex-shrink: 0;
    }

    .panel-text {
        flex: 1;
        max-height: 220px;
        overflow-y: auto;
        padding-right: 6px;
    }

    #preview-box {
        left: 0;
        top: 105%;
    }

    #preview-box {
        top: -300px !important;
        left: 100px !important; 
    }
}

@media (min-width: 768px) and (max-width: 991px) {

    .panel-img {
        width: 180px;
        height: 220px;
    }

    .panel-text {
        max-height: 260px;
    }
}


/* Invitacion a contactenos  */



.servicio-invitacion {
    position: relative;
    height: 420px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-video-servicio {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180%;
    height: 180%;
    transform: translate(-50%, -50%) scale(0.6);
    object-fit: cover;
    z-index: 1; /* 🔥 CLAVE */
}

.servicio-invitacion .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.79);
    z-index: 2;
    pointer-events: none;
}

.contenido-invitacion {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #fff;
}

.contenido-invitacion h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
}

.contenido-invitacion p {
    font-size: 15px;
    max-width: 620px;
    margin: 0 auto 30px;
}

.btn-contacto {
    display: inline-block;
    padding: 12px 35px;
    background: #c82333;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 30px;
    transition: background 0.3s ease;
}

.btn-contacto:hover {
    background: #a61d2a;
}


@media (max-width: 768px) {
    .servicio-invitacion {
        height: 320px;
    }

    .contenido-invitacion h2 {
        font-size: 22px;
    }

    .contenido-invitacion p {
        font-size: 13px;
    }
}