/* Simplified Checkout Styles */

/* Hide payment wrapper but keep in DOM for WooCommerce to render */


/* Payment logos - Hidden by default on desktop */
.mobile-payment-logos {
    display: none;
}

/* Main checkout wrapper */
.simplified-checkout {
    padding: 20px 0;
}

/* Billing section styling */
.simplified-checkout .billing-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
}

/* Terms and conditions wrapper */
.simplified-checkout .checkout-terms-wrapper {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #e5e5e5;
}

.simplified-checkout .checkout-terms-wrapper .form-row {
    margin-bottom: 20px;
}

.simplified-checkout .checkout-terms-wrapper label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.6;
}

.simplified-checkout .checkout-terms-wrapper input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Checkout buttons */
.simplified-checkout .checkout-buttons-row {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.simplified-checkout .checkout-button {
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.simplified-checkout .cancel-button {
    background: #f0f0f0;
    color: #666;
}

.simplified-checkout .cancel-button:hover {
    background: #e0e0e0;
    color: #333;
}

.simplified-checkout .proceed-button {
    background: #187FD3 !important;
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 0, 224, 0.2);
}

.simplified-checkout .proceed-button:hover {
    background: #3800B0;
    box-shadow: 0 4px 12px rgba(74, 0, 224, 0.3);
    transform: translateY(-1px);
}

.simplified-checkout .proceed-button:active {
    transform: translateY(0);
}

/* Error styling */
.simplified-checkout .woocommerce-invalid input,
.simplified-checkout .error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

.simplified-checkout .field-error-message,
.simplified-checkout .terms-error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.simplified-checkout .error-highlight {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.2);
    padding: 20px;
    border-radius: 8px;
}

/* Form row improvements */
.simplified-checkout .form-row {
    margin-bottom: 20px;
}

.simplified-checkout .form-row label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

.simplified-checkout .form-row input[type="text"],
.simplified-checkout .form-row input[type="email"],
.simplified-checkout .form-row input[type="tel"],
.simplified-checkout .form-row select,
.simplified-checkout .form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.simplified-checkout .form-row input:focus,
.simplified-checkout .form-row select:focus,
.simplified-checkout .form-row textarea:focus {
    border-color: #4A00E0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 0, 224, 0.1);
}

/* Required field asterisk */
.simplified-checkout .required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 3px;
}

/* Hide WooCommerce place order button */
.simplified-checkout #place_order {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .simplified-checkout .checkout-buttons-row {
        flex-direction: column-reverse;
    }

    .simplified-checkout .checkout-button {
        width: 100%;
        text-align: center;
        padding: 16px 30px;
    }

    .simplified-checkout .checkout-terms-wrapper {
        padding: 20px 15px;
    }
}

/* RTL Support for Arabic */
.rtl .simplified-checkout .checkout-terms-wrapper input[type="checkbox"] {
    margin-left: 10px;
    margin-right: 0;
}

.rtl .simplified-checkout .checkout-buttons-row {
    justify-content: flex-start;
}

.rtl .simplified-checkout .required {
    margin-right: 3px;
    margin-left: 0;
}

/* Enhanced loading state for proceed button */
.simplified-checkout .proceed-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
    pointer-events: none;
}

.simplified-checkout .proceed-button.loading:after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 0.8s linear infinite;
}

.simplified-checkout .proceed-button.loading:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: button-loading-spinner 1.2s linear infinite reverse;
}

@keyframes button-loading-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Clean checkout title */
.simplified-checkout h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

/* Billing fields header */
.simplified-checkout .woocommerce-billing-fields h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #4A00E0;
    display: none;
}

/* Payment logos for mobile and iPad only */
@media only screen and (max-width: 1024px) {
    .mobile-payment-logos {
        display: block;
        margin-bottom: 25px;
        padding-bottom: 20px;
        border-bottom: 1px solid #e5e5e5;
    }

    .payment-logos-title {
        font-size: 14px;
        font-weight: 600;
        color: #666;
        margin-bottom: 12px;
        text-align: center;
    }

    .payment-logos-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        align-items: center;
    }

    .payment-logo-group {
        display: flex;
        gap: 10px;
        align-items: center;
        padding: 8px 12px;
        background: #fff;
        border-radius: 6px;
        border: 1px solid #e5e5e5;
    }

    .payment-logo-group img {
        height: 20px;
        width: auto;
        max-width: 60px;
        object-fit: contain;
        border-radius: 0 !important;
    }

    /* Apple Pay specific styling */
    .apple-pay-logo img {
        height: 24px;
    }

    /* Hide Apple Pay on non-Apple devices */
    .apple-pay-logo {
        display: none;
    }

    /* Show Apple Pay only on Apple devices */
    @supports (-webkit-touch-callout: none) {
        .apple-pay-logo {
            display: flex;
        }
    }
}

/* Specific styles for mobile phones */
@media only screen and (max-width: 480px) {
    .payment-logos-grid {
        flex-direction: column;
        gap: 10px;
    }

    .payment-logo-group {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .payment-logos-title {
        font-size: 13px;
    }
}

/* RTL support for payment logos */
.rtl .payment-logos-grid {
    direction: rtl;
}

.rtl .payment-logo-group {
    flex-direction: row-reverse;
}