/**
 * Payrexx Modal - Mobile First
 */

.rg-payrexx-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.rg-payrexx-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rg-payrexx-modal {
    background: #fff;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.rg-payrexx-overlay.active .rg-payrexx-modal {
    transform: translateY(0);
}

.rg-payrexx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.rg-payrexx-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #141412;
}

.rg-payrexx-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    transition: color 0.2s;
}

.rg-payrexx-close:hover {
    color: #141412;
}

.rg-payrexx-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rg-payrexx-body iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

.rg-payrexx-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 0.95rem;
}

.rg-payrexx-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #07a1e2;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: rg-spin 0.8s linear infinite;
}

@keyframes rg-spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimierung */
@media (max-width: 600px) {
    .rg-payrexx-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .rg-payrexx-header {
        padding: 12px 16px;
    }

    .rg-payrexx-body iframe {
        min-height: 70vh;
        min-height: 70dvh;
    }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
    .rg-payrexx-modal {
        width: 85%;
        max-width: 550px;
    }
}
