/* ============================================
   ESTILOS DEL MODAL DE COMPRA - QSORTEOS
   Incluir en todas las páginas con el modal
   ============================================ */

/* FORZAR modal oculto por defecto */
#modal-compra-overlay {
    display: none !important;
}

/* Solo mostrar cuando tenga la clase show */
#modal-compra-overlay.show {
    display: flex !important;
}

/* Modal Overlay - Fondo oscuro */
.modal-overlay,
.modal-compra-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show,
.modal-compra-overlay.show {
    display: flex !important;
}

/* Modal Container */
.modal-compra,
.modal-compra-container {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

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

/* Modal Header */
.modal-header,
.modal-compra-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2,
.modal-compra-header h2,
.modal-title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: white;
}

.modal-header p,
.modal-compra-header p,
.modal-subtitle {
    margin: 10px 0 0 0;
    opacity: 0.95;
    font-size: 16px;
    color: white;
}

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #718096;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Modal Body */
.modal-body {
    padding: 30px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Planes Grid */
.planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Plan Card */
.plan-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.plan-card.popular {
    border-color: #48bb78;
    box-shadow: 0 5px 20px rgba(72, 187, 120, 0.2);
}

.plan-card.premium {
    border-color: #f6ad55;
    box-shadow: 0 5px 20px rgba(246, 173, 85, 0.2);
}

/* Plan Badge */
.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan-badge.popular {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.plan-badge.premium {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.popular-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.plan-emoji {
    font-size: 48px;
    margin-bottom: 15px;
}

.plan-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 36px;
    font-weight: 900;
    color: #667eea;
    margin-bottom: 10px;
}

.plan-price small,
.price-period {
    font-size: 16px;
    color: #718096;
    font-weight: 400;
}

.price-amount {
    font-size: 36px;
    font-weight: 900;
    color: #667eea;
}

.plan-description {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 14px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.plan-features li,
.feature-item {
    padding: 8px 0;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.plan-features li:before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
    font-size: 16px;
}

.btn-comprar-plan {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
}

.btn-comprar-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-comprar-plan:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Código de Activación */
.codigo-section {
    background: #f7fafc;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.codigo-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 20px;
}

.codigo-input-group {
    display: flex;
    gap: 10px;
    max-width: 450px;
    margin: 0 auto 20px;
}

.codigo-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
}

.codigo-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-activar {
    padding: 12px 30px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-activar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-activar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal Footer */
.modal-footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-radius: 0 0 20px 20px;
}

.payment-methods {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.payment-methods span {
    color: #718096;
    font-size: 14px;
}

.payment-methods img {
    height: 30px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.payment-methods img:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-compra,
    .modal-compra-container {
        width: 95%;
        max-height: 95vh;
    }

    .planes-grid {
        grid-template-columns: 1fr;
    }

    .modal-header h2,
    .modal-title {
        font-size: 24px;
    }

    .modal-header p,
    .modal-subtitle {
        font-size: 14px;
    }

    .plan-price,
    .price-amount {
        font-size: 28px;
    }

    .codigo-input-group {
        flex-direction: column;
    }

    .btn-activar {
        width: 100%;
    }

    .modal-body {
        padding: 20px;
    }

    .payment-methods {
        gap: 10px;
    }

    .modal-tabs {
        flex-direction: column;
    }

    .tab-button {
        border-bottom: 1px solid #e2e8f0;
        border-left: 3px solid transparent;
    }

    .tab-button.active {
        border-left-color: #667eea;
        border-bottom-color: transparent;
    }
}

/* Custom scrollbar para el modal */
.modal-compra::-webkit-scrollbar,
.modal-compra-container::-webkit-scrollbar {
    width: 8px;
}

.modal-compra::-webkit-scrollbar-track,
.modal-compra-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 20px 20px 0;
}

.modal-compra::-webkit-scrollbar-thumb,
.modal-compra-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.modal-compra::-webkit-scrollbar-thumb:hover,
.modal-compra-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
