/**
 * Estilos del frontend - Grid 2x2 y Popup
 */

.plugin-popup-shortcode {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.plugin-popup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0;
    aspect-ratio: 1 / 1;
    max-width: 800px;
    margin: 0 auto;
}

.plugin-popup-grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 2px solid transparent;
}

.plugin-popup-grid-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.plugin-popup-grid-item-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.plugin-popup-grid-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plugin-popup-grid-item:hover .plugin-popup-grid-item-image img {
    transform: scale(1.1);
}

.plugin-popup-grid-item-empty {
    background: #f0f0f0;
    cursor: default;
}

.plugin-popup-grid-item-empty:hover {
    transform: none;
}

/* Overlay del popup */
.plugin-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup */
.plugin-popup-popup {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.plugin-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.plugin-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.plugin-popup-popup-content {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.plugin-popup-popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.plugin-popup-popup-text p {
    margin-bottom: 15px;
}

.plugin-popup-popup-text p:last-child {
    margin-bottom: 0;
}

.plugin-popup-popup-text h1,
.plugin-popup-popup-text h2,
.plugin-popup-popup-text h3,
.plugin-popup-popup-text h4,
.plugin-popup-popup-text h5,
.plugin-popup-popup-text h6 {
    margin-top: 20px;
    margin-bottom: 15px;
}

.plugin-popup-popup-text h1:first-child,
.plugin-popup-popup-text h2:first-child,
.plugin-popup-popup-text h3:first-child,
.plugin-popup-popup-text h4:first-child,
.plugin-popup-popup-text h5:first-child,
.plugin-popup-popup-text h6:first-child {
    margin-top: 0;
}

.plugin-popup-popup-text ul,
.plugin-popup-popup-text ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.plugin-popup-popup-text a {
    color: #2271b1;
    text-decoration: underline;
}

.plugin-popup-popup-text a:hover {
    color: #135e96;
}

/* Responsive */
@media (max-width: 768px) {
    .plugin-popup-grid {
        gap: 2px;
        max-width: 100%;
    }
    
    .plugin-popup-popup {
        width: 95%;
        max-height: 90vh;
    }
    
    .plugin-popup-popup-content {
        padding: 30px 20px;
    }
    
    .plugin-popup-popup-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .plugin-popup-grid {
        aspect-ratio: 1 / 1;
    }
    
    .plugin-popup-popup-content {
        padding: 25px 15px;
    }
    
    .plugin-popup-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}
