/* Modal Wrapper */
#pcm-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#pcm-modal-wrapper.show,
#pcm-modal-wrapper[style*="display: block"],
#pcm-modal-wrapper[style*="display:block"] {
    opacity: 1;
    pointer-events: all;
}

#pcm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000000;
}

#pcm-modal-content {
    position: relative;
    z-index: 1000001;
    background: #fff;
    border-radius: 12px;
    width: 92%;
    max-width: 800px;
    height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#pcm-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

#pcm-modal-close:hover {
    color: #000;
    background: rgba(0,0,0,0.05);
}

#pcm-checkout-container {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch; /* Critical for iOS */
}

.pcm-loader {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3em;
    color: #666;
}

#pcm-checkout-container .woocommerce {
    padding: 0;
}

/* macOS-style Toast */
.pcm-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    color: #333;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999999;
    font-size: 15px;
    line-height: 1.5;
    max-width: 350px;
    animation: slideInRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Optional: Hide WooCommerce notices for our custom ones */
.woocommerce-error,
.woocommerce-message {
    /* Leave visible unless overridden by JS */
}