/**
 * Popup Styles - Estilos base para pop-ups
 * 
 * @package OnlyCard_Theme
 * @version 1.0.0
 */

/* Container principal */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none; /* Oculto por defecto, se mostrará con JS */
    align-items: center;
    justify-content: center;
}

.popup-container[style*="display: block"] {
    display: flex !important;
}

/* Overlay - Mismo estilo que quickview */
.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    display: block;
}

/* Modal - Tamaño base estándar para todos los modelos */
.popup-modal {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    width: 800px;
    height: 450px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Botón cerrar */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.popup-close i {
    font-size: 18px;
    color: #333;
}

/* Contenido */
.popup-content {
}

.popup-title {
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.popup-subtitle {
    font-size: 16px;
    text-align: center;
    color: #666;
    margin: 0 0 20px 0;
}

.popup-body {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
}

/* Botón CTA */
.popup-cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.popup-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

/* Formulario (Modelo 2) */
.popup-lead-form {
    margin-top: 25px;
}

.popup-form-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.popup-form-field > input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.popup-form-field input:focus {
    outline: none;
    border-color: #0073aa;
}

.popup-submit-button {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.popup-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.popup-form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.popup-form-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.popup-form-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.popup-success-message {
    margin-top: 20px;
    padding: 20px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

/* Modelo 1 - Simple (sin imagen) - Mismo tamaño estándar */
.popup-model-1 {
    width: 800px;
    height: 450px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-model-1 .popup-content {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Modelo 2 - Con imagen (split layout) - Mismo tamaño estándar */
.popup-model-2 {
    width: 800px;
    height: 450px;
}

.popup-model-2 .popup-content-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
}

.popup-model-2 .popup-image-column {
    background: #ff6b35;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 350px;
    height: 100%;
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
}

.popup-model-2 .popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default, puede ser sobrescrito por inline style */
    display: block;
}

.popup-model-2 .popup-content-column {
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: auto;
    overflow-y: auto;
}

/* Si no hay imagen, el contenido ocupa todo el ancho */
.popup-model-2:not(:has(.popup-image-column)) .popup-content-column {
    width: 100%;
}

/* Checkbox términos */
.popup-form-terms {
    margin-top: 10px;
}

.popup-form-terms label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.popup-form-terms input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.popup-form-terms span {
    color: #555;
}

/* Responsive */
@media (max-width: 900px) {
    /* En tablets y móviles, ajustar tamaño del modal */
    .popup-modal {
        width: 95vw !important;
        height: auto !important;
        max-height: 90vh;
    }
    
    .popup-model-1,
    .popup-model-2 {
        width: 95vw !important;
        height: auto !important;
        max-height: 90vh;
    }
    
    .popup-content {
        padding: 30px 20px;
    }
    
    .popup-title {
        font-size: 24px;
    }
    
    .popup-subtitle {
        font-size: 14px;
    }
    
    /* Modelo 1 responsive */
    .popup-model-1 {
        min-height: 300px;
    }
    
    /* Modelo 2 responsive: apilar columnas */
    .popup-model-2 .popup-content-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .popup-model-2 .popup-image-column {
        width: 100%;
        height: 250px;
        aspect-ratio: 16 / 9;
        flex-shrink: 0;
    }
    
    .popup-model-2 .popup-content-column {
        width: 100%;
        padding: 30px 20px;
        height: auto;
        flex: 1;
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .popup-modal {

    }
    
    .popup-model-1,
    .popup-model-2 {

    }
    
    .popup-content {
        padding: 20px 15px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-subtitle {
        font-size: 14px;
    }
    
    .popup-model-2 .popup-image-column {
        height: 200px;
    }
}

/* Scrollbar personalizado para contenido */
.popup-content::-webkit-scrollbar,
.popup-model-2 .popup-content-column::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track,
.popup-model-2 .popup-content-column::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb,
.popup-model-2 .popup-content-column::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover,
.popup-model-2 .popup-content-column::-webkit-scrollbar-thumb:hover {
    background: #999;
}

