/**
 * EK PayPal Gateway - Clean American-Style Checkout
 * Inspired by Amazon, Shopify, Best Buy
 */

/* ============================================
   Loading Overlay
   ============================================ */
.ek-paypal-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.ek-paypal-loading::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
}

.ek-paypal-loading::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e5e5e5;
    border-top-color: #0070ba;
    border-radius: 50%;
    z-index: 10000;
    animation: ek-paypal-spin 0.8s linear infinite;
}

@keyframes ek-paypal-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Express Checkout Container
   ============================================ */
.ek-express-checkout-container {
    margin: 20px 0;
    padding: 0;
}

.ek-express-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
    color: #565959;
    font-size: 13px;
    font-weight: 400;
}

.ek-express-divider::before,
.ek-express-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e7e7e7;
}

.ek-express-divider span {
    padding: 0 16px;
    white-space: nowrap;
}

.ek-express-buttons {
    max-width: 400px;
}

/* Cart page express - full width */
.ek-express-cart .ek-express-buttons {
    max-width: 100%;
}

/* Product page express - inline with add to cart */
.ek-express-product {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e7e7e7;
}

.ek-express-product .ek-express-buttons {
    max-width: 100%;
}

.ek-express-product .ek-express-divider span {
    font-weight: 600;
    color: #0f1111;
    font-size: 14px;
}

/* Mini cart express */
.ek-express-minicart {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid #e7e7e7;
}

.ek-express-minicart .ek-express-buttons {
    max-width: 100%;
}

.ek-express-minicart .ek-express-divider {
    display: none;
}

/* ============================================
   Checkout Page - PayPal Button
   ============================================ */
#ek-paypal-button-container {
    margin: 15px 0;
    min-height: 50px;
}

/* ============================================
   Card Fields - Clean Style
   ============================================ */
#ek-paypal-card-container {
    margin: 15px 0;
}

.ek-paypal-card-icons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
}

.ek-paypal-card-icons img {
    height: 24px;
    width: auto;
}

#ek-paypal-card-number,
#ek-paypal-card-expiry,
#ek-paypal-card-cvv {
    padding: 10px 12px;
    border: 1px solid #a6a6a6;
    border-radius: 4px;
    background: #fff;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(15,17,17,.15) inset;
}

#ek-paypal-card-number:focus-within,
#ek-paypal-card-expiry:focus-within,
#ek-paypal-card-cvv:focus-within {
    border-color: #e77600;
    box-shadow: 0 0 0 3px rgba(228, 121, 17, 0.5), 0 1px 2px rgba(15,17,17,.15) inset;
    outline: none;
}

#ek-paypal-card-number {
    margin-bottom: 12px;
}

.ek-paypal-card-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.ek-paypal-card-row > div {
    flex: 1;
}

#ek-paypal-card-errors {
    color: #c40000;
    font-size: 13px;
    margin-top: 8px;
    display: none;
    padding: 8px 10px;
    background: #fff8f8;
    border: 1px solid #c40000;
    border-radius: 4px;
}

/* Privacy notice */
.ek-paypal-privacy {
    font-size: 12px;
    color: #565959;
    margin-top: 15px;
    line-height: 1.5;
}

.ek-paypal-privacy a {
    color: #0066c0;
    text-decoration: none;
}

.ek-paypal-privacy a:hover {
    color: #c45500;
    text-decoration: underline;
}

/* Secured badge */
.ek-paypal-secured {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #067d62;
    margin-top: 12px;
}

.ek-paypal-secured svg {
    width: 14px;
    height: 14px;
    fill: #067d62;
}

/* ============================================
   WooCommerce Integration
   ============================================ */
.woocommerce-checkout #payment .payment_method_ek_paypal .payment_box,
.woocommerce-checkout #payment .payment_method_ek_paypal_card .payment_box {
    padding: 15px;
    background: #f7f7f7;
    border-radius: 4px;
}

/* Payment method labels */
.woocommerce-checkout #payment ul.payment_methods li label {
    font-weight: 500;
    color: #0f1111;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .ek-paypal-card-row {
        flex-direction: column;
        gap: 12px;
    }

    .ek-express-buttons {
        max-width: 100%;
    }

    .ek-express-divider span {
        font-size: 12px;
        padding: 0 10px;
    }
}

/* ============================================
   Trust Badges (Optional)
   ============================================ */
.ek-trust-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e7e7e7;
}

.ek-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #565959;
}

.ek-trust-badge svg {
    width: 16px;
    height: 16px;
    fill: #067d62;
}
