/* ============================================
   CHECKOUT MODAL CSS
   Modal moderno e responsivo para checkout
   ============================================ */

/* === VARIAVEIS === */
:root {
    --modal-z-index: 9999;
    --modal-backdrop-bg: rgba(0, 0, 0, 0.6);
    --modal-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === MODAL OVERLAY === */
.checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-backdrop-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--modal-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--modal-transition);
    padding: 1rem;
}

.checkout-modal-overlay.active,
.ip-modal-overlay.active,
#loadingModal.active {
    opacity: 1;
    visibility: visible;
}

/* === MODAL CONTENT === */
.checkout-modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: var(--modal-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.checkout-modal-overlay.active .checkout-modal-content {
    transform: translateY(0) scale(1);
}

/* === MODAL HEADER === */
.checkout-modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
}

.checkout-modal-icon {
    width: 64px;
    height: 64px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.checkout-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.checkout-modal-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* === MODAL BODY === */
.checkout-modal-body {
    padding: 1rem 2rem;
    overflow-y: auto;
    background: #ffffff;
}

.checkout-order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
}

.checkout-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #475569;
}

.checkout-summary-item:last-child {
    margin-bottom: 0;
}

.checkout-summary-label {
    font-weight: 500;
}

.checkout-summary-value {
    font-weight: 700;
    color: #1e293b;
    text-align: right;
    max-width: 60%;
}

.checkout-summary-price {
    color: var(--ip-primary, #4f46e5);
    font-size: 1.1rem;
}

.checkout-summary-divider {
    height: 1px;
    background: #cbd5e1;
    margin: 1rem 0;
    border: none;
}

.checkout-summary-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* === MODAL FOOTER === */
.checkout-modal-footer {
    padding: 1.5rem 2rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* === BUTTONS === */
.checkout-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.checkout-modal-btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.checkout-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}

.checkout-modal-btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #475569;
}

.checkout-modal-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.checkout-modal-btn-secondary.success {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}

.checkout-modal-btn-secondary.error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.checkout-modal-btn-ghost {
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
    padding: 0.5rem;
}

.checkout-modal-btn-ghost:hover {
    color: #64748b;
    text-decoration: underline;
}

/* === CLOSE BUTTON === */
.checkout-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.checkout-modal-close:hover {
    color: #64748b;
}

/* === SECURITY BADGE === */
.checkout-modal-security {
    text-align: center;
    padding: 0 0 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* === LOADING MODAL SPECIFIC === */
.ip-modal-overlay#loadingModal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
}

.loading-card {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}