/**
 * Estilos para el efecto de enfoque en servicios
 */

/* Transición suave para todos los service boxes */
.service-icon-box {
    transition: all 0.5s ease-in-out;
}

/* Cuando un servicio está activo, ocultar los demás */
.services-grid.has-active .service-icon-box:not(.active) {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    visibility: hidden;
}

/* El servicio activo se centra */
.services-grid.has-active .service-icon-box.active {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 150 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* Animación de entrada para el servicio activo */
@keyframes serviceFocusIn {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

/* Animación de salida para servicios no activos */
@keyframes serviceFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Aplicar animaciones */
.services-grid.has-active .service-icon-box.active {
    animation: serviceFocusIn 0.3s ease-out forwards;
}

.services-grid.has-active .service-icon-box:not(.active) {
    animation: serviceFadeOut 0.3s ease-out forwards;
}

/* Asegurar que el servicio centrado sea clickeable */
.services-grid.has-active .service-icon-box.active {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ajustes para móvil */
@media (max-width: 768px) {
    .service-close-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .service-close-btn i {
        font-size: 1.2rem;
    }
}

/* Botón para volver (X) */
.service-close-btn {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 2px solid #ff0000 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 99999 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeInScale 0.3s ease-out forwards !important;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación de pulso para hacer el botón más visible */
@keyframes closeBtnPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 1);
    }
}


.service-close-btn:hover {
    background: rgba(255, 0, 0, 0.8) !important;
    border-color: #ffffff !important;
    transform: scale(1.1) rotate(90deg) !important;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8) !important;
}

.service-close-btn i {
    color: #ff0000 !important;
    font-size: 1.1rem !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-weight: bold !important;
}