/**
 * Adyen Express Checkout Sidecart Styles
 * Styles for Apple Pay and Google Pay buttons in the CheckoutWC sidecart
 */

/* Main container for express checkout in sidecart */
.periExpressCheckoutSidecart {
    padding: 0rem 1rem 0rem 1rem;
    margin: 0;
    min-height: 9.5rem;
    background-color: transparent;
}

/* Wrapper for payment buttons */
.periWrapperButtonsExpressCheckout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

/* Individual payment method containers */
#applepay-container,
#googlepay-container {
    width: 100%;
    min-height: 3rem;
}

/* Hide empty containers */
#applepay-container:empty,
#googlepay-container:empty {
    display: none;
}

/* Adyen component iframe styling */
.periWrapperButtonsExpressCheckout iframe {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 3rem;
}

/* Apple Pay button specific styling */
#applepay-container .adyen-checkout__applepay__button {
    width: 100%;
    height: 3rem;
    border-radius: 0.25rem;
}

/* Google Pay button specific styling */
#googlepay-container .adyen-checkout__googlepay__button,
#googlepay-container .adyen-checkout__paywithgoogle {
    width: 100%;
    min-height: 3rem;
    border-radius: 0.25rem;
}

/* Loading state */
.periExpressCheckoutSidecart.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Loading spinner */
.periExpressCheckoutSidecart.loading::after {
    content: '';
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.625rem auto;
    border: 0.1875rem solid #f3f3f3;
    border-top: 0.1875rem solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error state (when express checkout not available) */
.periExpressCheckoutSidecart.not-available {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 48rem) {
    .periExpressCheckoutSidecart {
        padding: 0.625rem 0.75rem;
        min-height: 6.875rem;
    }
    
    .periWrapperButtonsExpressCheckout {
        gap: 0.5rem;
    }
}

/* CheckoutWC specific adjustments */
.cfw-side-cart-header + .periExpressCheckoutSidecart {
    border-top: none;
    margin-top: 0;
}

/* Ensure buttons are above other elements */
.periWrapperButtonsExpressCheckout {
    position: relative;
    z-index: 10;
}

/* Adyen component styling overrides */
.periWrapperButtonsExpressCheckout .adyen-checkout__payment-method {
    margin: 0;
    padding: 0;
}

.periWrapperButtonsExpressCheckout .adyen-checkout__payment-method__header {
    display: none;
}

.periWrapperButtonsExpressCheckout .adyen-checkout__payment-method__details {
    padding: 0;
}

/* Fix for Adyen iframe height issues */
.periWrapperButtonsExpressCheckout .adyen-checkout__googlepay,
.periWrapperButtonsExpressCheckout .adyen-checkout__applepay {
    min-height: 3rem;
}

/* Ensure proper button sizing in sidecart */
.cfw-side-cart .periWrapperButtonsExpressCheckout button,
.cfw-side-cart .periWrapperButtonsExpressCheckout .adyen-checkout__button {
    width: 100%;
    height: 3rem;
}

