/**
 * Static WooCommerce Cart Checkout
 * 
 * Styles for the iframe-based checkout popup system
 */

/* ==================== */
/* CHECKOUT POPUP */
/* ==================== */

.d40-checkout-popup {
    position: fixed;
    top: 0;
    left: auto;
    right: -100%; /* Start off-screen to the right */
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 999999; /* Extremely high z-index to be above everything */
    display: block; /* Always display it, just off-screen */
    opacity: 1;
    visibility: visible;
    transition: right 0.5s ease-in-out;
    overflow: hidden;
}

.d40-checkout-popup.active {
    right: 0; /* Slide in from right */
    display: flex;
    flex-direction: column;
}

.d40-checkout-header {
    position: relative;
    width: 100%;
    padding: 15px 20px;
    background: #242424;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.d40-checkout-popup .d40-checkout-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

.d40-checkout-close {
    color: white;
    font-size: 38px;
    cursor: pointer;
    line-height: 0;
}

.d40-checkout-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.d40-checkout-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
    background: transparent;
}

.d40-checkout-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    padding: 20px;
}

.d40-checkout-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: checkout-spin 1s linear infinite;
    margin-bottom: 20px;
}

.d40-checkout-message-container {
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d40-checkout-message {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

@keyframes checkout-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Checkout overlay */
.d40-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998; /* Just below the checkout popup */
    display: block;
    visibility: visible;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, visibility 0s linear 0.5s;
    pointer-events: none; /* Default state doesn't capture clicks */
}

.d40-checkout-overlay.active {
    opacity: 1;
    pointer-events: all; /* Active state captures clicks */
    transition: opacity 0.5s ease-in-out, visibility 0s linear;
}

.d40-checkout-overlay.hidden {
    display: none; /* Completely remove from DOM flow */
    visibility: hidden;
}
