/* ===== MODAL TECNOLÓGICO CONSOLIDADO - SIN CONFLICTOS ===== */

/* Bloquear scroll cuando hay modal tecnológico abierto - SIN MOVER POSICIÓN */
body.tech-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: none !important;
    -webkit-overscroll-behavior: none !important;
    /* NO usar position: fixed para evitar mover la posición */
    /* FORZAR que mantenga la posición actual */
    position: relative !important;
}

/* Prevenir scroll en dispositivos móviles - SIN MOVER POSICIÓN */
@media (max-width: 768px) {
    body.tech-modal-open {
        overflow: hidden !important;
        touch-action: none !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: none !important;
        -webkit-overscroll-behavior: none !important;
        /* NO usar position: fixed en móviles tampoco */
        /* FORZAR que mantenga la posición actual */
        position: relative !important;
    }
}

/* Modal tecnológico principal */
.modal-tech-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 15000;
    display: none;
    justify-content: center;
    align-items: center;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
}

.modal-tech-container {
    background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 25%, #0f0f0f 50%, #1a1a1a 75%, #0a0a0a 100%);
    border: 3px solid #C50039;
    border-radius: 25px;
    padding: 0;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(197, 0, 57, 0.3),
        0 0 50px rgba(197, 0, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(197, 0, 57, 0.1);
    position: relative;
    overflow: hidden;
}

/* Marco exterior simple y estable */
.modal-tech-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 28px;
    background: #C50039;
    z-index: -1;
}

/* Marco interior estable sin efectos */
.modal-tech-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 25px;
    padding: 3px;
    background: rgba(197, 0, 57, 0.2);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    z-index: -1;
}

/* Contenido del modal tecnológico */
.modal-tech-content {
    display: flex;
    align-items: center;
    padding: 40px;
    gap: 40px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* Efectos de partículas de fondo */
.modal-tech-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(197, 0, 57, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(197, 0, 57, 0.05) 0%, transparent 50%);
    animation: techParticles 8s ease-in-out infinite;
    pointer-events: none;
}

/* Sección del logo */
.modal-tech-logo-section {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.modal-tech-logo {
    width: 220px;
    height: 220px;
    border-radius: 25px;
    background: linear-gradient(145deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    border: 3px solid transparent;
    padding: 25px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(197, 0, 57, 0.4),
        0 0 40px rgba(197, 0, 57, 0.3),
        0 0 60px rgba(197, 0, 57, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(197, 0, 57, 0.15);
    position: relative;
    overflow: hidden;
}

/* Marco del logo estable */
.modal-tech-logo::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 28px;
    background: #C50039;
    z-index: -1;
}

/* Efecto sutil en el logo sin animación */
.modal-tech-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 25px;
    background: rgba(197, 0, 57, 0.05);
    z-index: 1;
    pointer-events: none;
}

.modal-tech-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: 
        drop-shadow(0 0 15px rgba(197, 0, 57, 0.4))
        drop-shadow(0 0 25px rgba(197, 0, 57, 0.2))
        brightness(1.1)
        contrast(1.1);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.modal-tech-logo:hover img {
    filter: 
        drop-shadow(0 0 20px rgba(197, 0, 57, 0.6))
        drop-shadow(0 0 35px rgba(197, 0, 57, 0.3))
        brightness(1.2)
        contrast(1.2);
    transform: scale(1.02);
}

/* Sección del texto */
.modal-tech-text-section {
    flex: 1;
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

.modal-tech-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #C50039;
    margin-bottom: 30px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(197, 0, 57, 0.5);
    position: relative;
    animation: techTitleGlow 2s ease-in-out infinite alternate;
}

.modal-tech-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #C50039, #FFD700, #C50039);
    border-radius: 2px;
    animation: techTitleUnderline 3s ease-in-out infinite;
}

.modal-tech-content-text {
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
    margin-bottom: 25px;
    position: relative;
}

.modal-tech-content-text::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #C50039, #FFD700, #C50039);
    border-radius: 2px;
    animation: techTextAccent 4s ease-in-out infinite;
}

.modal-tech-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #FFD700;
    margin: 30px 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.modal-tech-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: linear-gradient(135deg, #C50039 0%, #a4002e 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(197, 0, 57, 0.4);
    z-index: 10;
}

.modal-tech-close:hover {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
    color: #000;
}

/* Animaciones tecnológicas */
@keyframes techParticles {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes techTitleGlow {
    from {
        text-shadow: 0 0 20px rgba(197, 0, 57, 0.5);
    }
    to {
        text-shadow: 0 0 30px rgba(197, 0, 57, 0.8), 0 0 40px rgba(197, 0, 57, 0.3);
    }
}

@keyframes techTitleUnderline {
    0%, 100% {
        width: 100px;
        opacity: 0.8;
    }
    50% {
        width: 150px;
        opacity: 1;
    }
}

@keyframes techTextAccent {
    0%, 100% {
        opacity: 0.6;
        height: 100%;
    }
    50% {
        opacity: 1;
        height: 120%;
    }
}

/* Responsive para modal tecnológico */
@media only screen and (max-width: 768px) {
    .modal-tech-container {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .modal-tech-content {
        flex-direction: column;
        padding: 30px 25px;
        gap: 30px;
        text-align: center;
    }
    
    .modal-tech-logo-section {
        flex: none;
    }
    
    .modal-tech-logo {
        width: 150px;
        height: 150px;
    }
    
    .modal-tech-title {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 25px;
    }
    
    .modal-tech-content-text {
        font-size: 1rem;
        text-align: center;
    }
    
    .modal-tech-content-text::before {
        display: none;
    }
    
    .modal-tech-subtitle {
        font-size: 1.2rem;
        text-align: center;
    }
}

@media only screen and (max-width: 480px) {
    .modal-tech-container {
        width: 98%;
        margin: 10px;
        border-radius: 20px;
    }
    
    .modal-tech-content {
        padding: 25px 20px;
        gap: 25px;
    }
    
    .modal-tech-logo {
        width: 120px;
        height: 120px;
        padding: 15px;
    }
    
    .modal-tech-title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .modal-tech-content-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .modal-tech-subtitle {
        font-size: 1.1rem;
    }
    
    .modal-tech-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 15px;
        right: 20px;
    }
}
