/* ========== CONTENEDOR PRINCIPAL ========== */
.main-boletos {
    padding: 40px 20px;
    background: linear-gradient(180deg, #e7eefa 0%, #e7eefa 70%, #d9e2f3 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin-top: 80px;
}

.contenedor-formulario {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-top: 4px solid #667eea;
}

.contenedor-formulario h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #224c7b;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== CAMPOS DEL FORMULARIO ========== */
.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.campo input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

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

.campo small {
    display: block;
    color: #999;
    margin-top: 5px;
    font-size: 12px;
}

/* Campos dobles */
.campo-doble {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .campo-doble {
        grid-template-columns: 1fr;
    }
}

/* ========== SECCIÓN DE PAGO ========== */
#pago-datos {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 2px solid #f0f0f0;
    display: none !important;
    flex-direction: column;
    gap: 30px;
}

#pago-datos.visible {
    display: flex !important;
}

/* ========== TARJETA VIRTUAL ========== */
.card-visualization-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    min-height: 250px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.credit-card {
    width: 100%;
    max-width: 400px;
    height: 220px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
    box-sizing: border-box;
}

.credit-card:hover {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    padding: 25px;
    box-sizing: border-box;
    border-radius: 15px;
}

.card-front {
    z-index: 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-back {
    transform: rotateY(180deg);
    z-index: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Logo de la tarjeta */
.card-logo-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin-bottom: 10px;
}

.card-logo-img {
    height: 45px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

/* Número de tarjeta */
.card-number-display {
    font-size: 20px;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 15px 0;
    word-break: break-all;
    min-height: 24px;
    font-weight: 500;
}

/* Info de la tarjeta */
.card-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    font-size: 11px;
}

.card-holder, .card-expiry {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-holder .label, .card-expiry .label {
    opacity: 0.7;
    font-size: 9px;
    margin-bottom: 3px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-holder .name, .card-expiry .date {
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dorso de la tarjeta */
.card-back-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
}

.magnetic-strip {
    width: 100%;
    height: 45px;
    background: #000;
    margin-bottom: 30px;
    border-radius: 3px;
    opacity: 0.8;
}

.cvv-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cvv-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 5px;
}

.cvv-value {
    font-size: 16px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

/* Media queries para tarjeta */
@media (max-width: 768px) {
    .credit-card {
        max-width: 100%;
        height: 200px;
        padding: 20px;
    }

    .card-front, .card-back {
        padding: 20px;
    }

    .card-number {
        font-size: 18px;
        letter-spacing: 1.5px;
    }

    .card-brand img {
        height: 28px;
    }

    .card-type-logo {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .credit-card {
        height: 180px;
        padding: 16px;
    }

    .card-front, .card-back {
        padding: 16px;
    }

    .card-number {
        font-size: 16px;
        letter-spacing: 1px;
        margin: 12px 0;
    }

    .card-info-row {
        font-size: 10px;
        gap: 10px;
    }

    .card-brand img {
        height: 24px;
    }
}

/* ========== RESUMEN DE COMPRA ========== */
.resumen-compra {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.resumen-compra h3 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #224c7b;
    font-weight: 700;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 15px;
    color: #555;
    line-height: 1.8;
}

.resumen-row:last-child {
    border-bottom: none;
}

.resumen-row strong {
    color: #333;
    font-weight: 700;
    font-size: 15px;
}

.resumen-row span:last-child {
    font-weight: 700;
    color: #667eea;
    min-width: 100px;
    text-align: right;
    font-size: 16px;
}

.resumen-total {
    padding: 20px 25px !important;
    border-top: 3px solid #667eea !important;
    border-bottom: none !important;
    margin-top: 15px !important;
    font-size: 17px !important;
    font-weight: bold !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 8px !important;
    color: white !important;
}

.resumen-total strong {
    color: white !important;
    font-size: 17px !important;
    font-weight: 700 !important;
}

.resumen-total span:last-child {
    font-size: 22px !important;
    color: white !important;
    font-weight: 700 !important;
    min-width: 120px !important;
    text-align: right !important;
}

/* ========== FORMULARIO DE TARJETA ========== */
.card-form-section {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-form-section h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

/* Elementos de Stripe */
.stripe-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #32325d;
    transition: border-color 0.3s;
}

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

.stripe-element.StripeElement--focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#card-errors {
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    min-height: 20px;
    font-size: 14px;
    margin-top: 10px;
}

/* ========== TÉRMINOS ========== */
.terminos {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    font-size: 13px;
    color: #666;
}

.terminos input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.terminos label {
    cursor: pointer;
    margin: 0;
}

.terminos a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.terminos a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ========== BOTÓN DE PAGO ========== */
.boton-comprar {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 20px;
}

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

.boton-comprar:active {
    transform: translateY(0);
}

.boton-comprar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

.modal-close-btn {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-content h3 {
    color: #333;
    margin-bottom: 15px;
    clear: both;
    font-size: 20px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.boton-modal {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.boton-modal-primary {
    background: #667eea;
    color: white;
}

.boton-modal-primary:hover {
    background: #764ba2;
}

.boton-modal-secondary {
    background: #f0f0f0;
    color: #333;
}

.boton-modal-secondary:hover {
    background: #e0e0e0;
}

#modalActions {
    text-align: right;
    margin-top: 20px;
}

/* ========== RESPONSIVE AJUSTMENTS ========== */
@media (max-width: 1024px) {
    .contenedor-formulario {
        max-width: 100%;
        padding: 30px;
    }

    #pago-datos {
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .main-boletos {
        padding: 20px 15px;
    }

    .contenedor-formulario {
        padding: 25px;
        border-radius: 10px;
    }

    .contenedor-formulario h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .resumen-compra {
        padding: 20px;
    }

    .card-form-section {
        padding: 20px;
    }

    .boton-comprar {
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .main-boletos {
        padding: 15px 10px;
    }

    .contenedor-formulario {
        padding: 20px;
    }

    .contenedor-formulario h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .campo-doble {
        gap: 15px;
    }

    #pago-datos {
        gap: 20px;
        margin-top: 30px;
    }

    .resumen-compra {
        padding: 15px;
        border-left-width: 4px;
    }

    .resumen-row {
        padding: 8px 0;
        font-size: 13px;
    }

    .card-form-section {
        padding: 15px;
    }

    .boton-comprar {
        padding: 12px;
        font-size: 14px;
    }

    .card-visualization-section {
        margin-bottom: 20px;
    }
}

