/* ============================= */
/* MODALES Y EXPANSIÓN DE SERVICIOS */
/* ============================= */

/* Overlay principal (ya no se usa para expansión) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ============================= */
/* EXPANSIÓN DENTRO DEL CARRUSEL */
/* ============================= */

.service-panel.expanded {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 90% !important;
    max-width: 900px;
    height: 90%;
    max-height: 500px;
    z-index: 100 !important;
    background: rgba(20, 18, 30, 0.9);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(166, 107, 211, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: expandInPlace 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    padding: 35px !important;
    overflow-y: auto;
}

.service-panel.expanded.left,
.service-panel.expanded.right {
    left: 50% !important;
    right: auto !important;
}

/* Asegurar que todo el contenido sea visible */
.service-panel.expanded * {
    color: white;
    visibility: visible;
    opacity: 1;
}

.service-panel.expanded .modal-title {
    font-size: 28px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #a66bd3, #5267D9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-right: 40px;
}

.service-panel.expanded > p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}



.close-expanded {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(166, 107, 211, 0.5) !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1100 !important;
}

.close-expanded:hover {
    background: rgba(166, 107, 211, 0.3) !important;
    transform: rotate(90deg);
}

/* Contenido expandido */
.expanded-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.expanded-section {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
}

.expanded-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #a66bd3;
    position: relative;
    display: inline-block;
}

.expanded-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #a66bd3, #5267D9);
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.modal-features li:last-child {
    border-bottom: none;
}

.modal-features li::before {
    content: "✓";
    color: #a66bd3;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

/* Estadísticas */
.expanded-stats {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 40px;
    border: 1px solid rgba(166, 107, 211, 0.2);
}

.expanded-stat {
    text-align: center;
}

.expanded-stat .number {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #a66bd3, #5267D9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 3px;
}

.expanded-stat .label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animación */
@keyframes expandInPlace {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Estado del carrusel cuando hay panel expandido */
.servicios-carousel.panel-expanded .slide:not(.active) {
    opacity: 0;
    visibility: hidden;
}

.servicios-carousel.panel-expanded .slide.active img {
    filter: brightness(0.4) blur(2px);
    transition: filter 0.3s ease;
}

.servicios-carousel.panel-expanded .carousel-arrow {
    opacity: 0.3;
    pointer-events: none;
}

.servicios-carousel.panel-expanded .carousel-tabs {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================= */
/* ESTILOS ORIGINALES DEL MODAL */
/* ============================= */

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(25, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(166, 107, 211, 0.3);
    border-radius: 24px;
    padding: 40px;
    color: white;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 28px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #a66bd3, #5267D9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-tech {
    background: rgba(166, 107, 211, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #a66bd3;
}

/* Estado del body cuando hay modal abierto */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .service-panel.expanded {
        width: 95% !important;
        max-height: 80vh;
        padding: 25px !important;
    }
    
    .expanded-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .expanded-section {
        padding: 15px;
    }
    
    .expanded-stats {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px;
    }
    
    .expanded-stat .number {
        font-size: 24px;
    }
}