/**
 * Buckaroo Hyva Checkout Components - Compiled Tailwind CSS
 *
 * This file contains compiled Tailwind CSS classes to avoid loading
 * the full Tailwind library in production. Classes are extracted and
 * scoped to .buckaroo-hyva-components.
 */

/* Override Hyva's default primary color for Buckaroo payment methods */
#payment-method-option-buckaroo_magento2_creditcards.bg-primary,
#payment-method-option-buckaroo_magento2_creditcard.bg-primary,
#payment-method-option-buckaroo_magento2_giftcards.bg-primary,
#payment-method-option-buckaroo_magento2_voucher.bg-primary,
#payment-method-option-buckaroo_magento2_mrcash.bg-primary,
#payment-method-option-buckaroo_magento2_applepay.bg-primary,
#payment-method-option-buckaroo_magento2_afterpay.bg-primary,
#payment-method-option-buckaroo_magento2_afterpay2.bg-primary,
#payment-method-option-buckaroo_magento2_afterpay20.bg-primary,
#payment-method-option-buckaroo_magento2_billink.bg-primary,
#payment-method-option-buckaroo_magento2_klarna.bg-primary,
#payment-method-option-buckaroo_magento2_sepadirectdebit.bg-primary,
#payment-method-option-buckaroo_magento2_payperemail.bg-primary,
#payment-method-option-buckaroo_magento2_paybybank.bg-primary,
#payment-method-option-buckaroo_magento2_capayablein3.bg-primary,
#payment-method-option-buckaroo_magento2_zakelijkoprekening.bg-primary {
    background-color: #f8fafc !important; /* Light gray instead of blue */
}

#payment-method-option-buckaroo_magento2_creditcards.border-primary,
#payment-method-option-buckaroo_magento2_creditcard.border-primary,
#payment-method-option-buckaroo_magento2_giftcards.border-primary,
#payment-method-option-buckaroo_magento2_voucher.border-primary,
#payment-method-option-buckaroo_magento2_mrcash.border-primary,
#payment-method-option-buckaroo_magento2_applepay.border-primary,
#payment-method-option-buckaroo_magento2_afterpay.border-primary,
#payment-method-option-buckaroo_magento2_afterpay2.border-primary,
#payment-method-option-buckaroo_magento2_afterpay20.border-primary,
#payment-method-option-buckaroo_magento2_billink.border-primary,
#payment-method-option-buckaroo_magento2_klarna.border-primary,
#payment-method-option-buckaroo_magento2_sepadirectdebit.border-primary,
#payment-method-option-buckaroo_magento2_payperemail.border-primary,
#payment-method-option-buckaroo_magento2_paybybank.border-primary,
#payment-method-option-buckaroo_magento2_capayablein3.border-primary,
#payment-method-option-buckaroo_magento2_zakelijkoprekening.border-primary {
    border-color: #374151 !important; /* Dark gray border instead of blue */
}

/* Info tooltip next to a payment method (e.g. Zakelijk op rekening) */
.buckaroo-info-tooltip {
    width: 16rem;
    max-width: calc(100vw - 2rem);
    white-space: normal;
}

/* Tailwind CSS Reset and Base Styles for Buckaroo Components */
.buckaroo-hyva-components *,
.buckaroo-hyva-components ::after,
.buckaroo-hyva-components ::before {
    --tw-border-spacing-x: 0;
    --tw-border-spacing-y: 0;
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-color: rgba(59, 130, 246, 0.5);
    --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
    --tw-shadow-colored: 0 0 #0000;
    box-sizing: border-box;
    border: 0 solid #e5e7eb;
}

/* Modal Backdrop */
.buckaroo-hyva-components .fixed {
    position: fixed;
}

.buckaroo-hyva-components .top-0 {
    top: 0px;
}

.buckaroo-hyva-components .left-0 {
    left: 0px;
}

.buckaroo-hyva-components .right-0 {
    right: 0px;
}

.buckaroo-hyva-components .z-50 {
    z-index: 50;
}

.buckaroo-hyva-components .flex {
    display: flex;
}

.buckaroo-hyva-components .hidden {
    display: none;
}

.buckaroo-hyva-components .justify-center {
    justify-content: center;
}

.buckaroo-hyva-components .items-center {
    align-items: center;
}

.buckaroo-hyva-components .w-full {
    width: 100%;
}

.buckaroo-hyva-components .h-full {
    height: 100%;
}

.buckaroo-hyva-components .p-4 {
    padding: 1rem;
}

.buckaroo-hyva-components .overflow-x-hidden {
    overflow-x: hidden;
}

.buckaroo-hyva-components .overflow-y-auto {
    overflow-y: auto;
}

.buckaroo-hyva-components .max-h-full {
    max-height: 100%;
}

/* Modal Content */
.buckaroo-hyva-components .relative {
    position: relative;
}

.buckaroo-hyva-components .max-w-md {
    max-width: 28rem;
}

.buckaroo-hyva-components .bg-white {
    background-color: #ffffff;
}

.buckaroo-hyva-components .rounded-lg {
    border-radius: 0.5rem;
}

.buckaroo-hyva-components .shadow-xl {
    --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 10px 10px -5px var(--tw-shadow-color);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

/* Modal Header */
.buckaroo-hyva-components .items-start {
    align-items: flex-start;
}

.buckaroo-hyva-components .justify-between {
    justify-content: space-between;
}

.buckaroo-hyva-components .border-b {
    border-bottom-width: 1px;
}

.buckaroo-hyva-components .border-gray-200 {
    border-color: #e5e7eb;
}

.buckaroo-hyva-components .rounded-t {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.buckaroo-hyva-components .text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.buckaroo-hyva-components .font-semibold {
    font-weight: 600;
}

.buckaroo-hyva-components .text-gray-900 {
    color: #111827;
}

/* Close Button */
.buckaroo-hyva-components .text-gray-400 {
    color: #9ca3af;
}

.buckaroo-hyva-components .bg-transparent {
    background-color: transparent;
}

.buckaroo-hyva-components .hover\:bg-gray-100:hover {
    background-color: #f3f4f6;
}

.buckaroo-hyva-components .hover\:text-gray-600:hover {
    color: #4b5563;
}

.buckaroo-hyva-components .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.buckaroo-hyva-components .p-1\.5 {
    padding: 0.375rem;
}

.buckaroo-hyva-components .ml-auto {
    margin-left: auto;
}

.buckaroo-hyva-components .inline-flex {
    display: inline-flex;
}

.buckaroo-hyva-components .rounded {
    border-radius: 0.25rem;
}

.buckaroo-hyva-components .transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Modal Body */
.buckaroo-hyva-components .p-6 {
    padding: 1.5rem;
}

.buckaroo-hyva-components .space-y-4 > * + * {
    margin-top: 1rem;
}

.buckaroo-hyva-components .text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.buckaroo-hyva-components .leading-relaxed {
    line-height: 1.625;
}

.buckaroo-hyva-components .text-gray-600 {
    color: #4b5563;
}

/* Modal Footer */
.buckaroo-hyva-components .p-3 {
    padding: 0.75rem;
}

.buckaroo-hyva-components .space-x-3 > * + * {
    margin-left: 0.75rem;
}

.buckaroo-hyva-components .border-t {
    border-top-width: 1px;
}

.buckaroo-hyva-components .rounded-b {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.buckaroo-hyva-components .justify-end {
    justify-content: flex-end;
}

/* Button Styles */
.buckaroo-hyva-components .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.buckaroo-hyva-components .btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
    --tw-ring-color: rgba(59, 130, 246, 0.5);
}

/* Primary Button - Clean gray style instead of blue */
.buckaroo-hyva-components .btn-primary {
    background-color: #374151;
    color: #ffffff;
    border-color: #374151;
}

.buckaroo-hyva-components .btn-primary:hover {
    background-color: #1f2937;
    border-color: #1f2937;
}

/* Secondary Button */
.buckaroo-hyva-components .btn-secondary {
    background-color: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.buckaroo-hyva-components .btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Icon Styles */
.buckaroo-hyva-components .w-4 {
    width: 1rem;
}

.buckaroo-hyva-components .h-4 {
    height: 1rem;
}

.buckaroo-hyva-components .w-5 {
    width: 1.25rem;
}

.buckaroo-hyva-components .h-5 {
    height: 1.25rem;
}

/* Screen Reader Only */
.buckaroo-hyva-components .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Backdrop */
.buckaroo-hyva-components .backdrop-blur-sm {
    --tw-backdrop-blur: blur(4px);
    backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}

.buckaroo-hyva-components .bg-black\/50 {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive Utilities */
@media (min-width: 768px) {
    .buckaroo-hyva-components .md\:inset-0 {
        top: 0px;
        right: 0px;
        bottom: 0px;
        left: 0px;
    }
}

/**
 * Buckaroo Components CSS for Hyva Checkout
 * CSP-compliant styles for notifications and components
 */

/* Notification Banner Styles */
.buckaroo-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 400px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.buckaroo-notification[data-type="success"] {
    background-color: #10b981;
}

.buckaroo-notification[data-type="error"] {
    background-color: #ef4444;
}

.buckaroo-notification-show {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}

.buckaroo-notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.buckaroo-notification-message {
    display: flex;
    align-items: center;
}

.buckaroo-notification-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    fill: currentColor;
}

.buckaroo-notification-close {
    margin-left: 16px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.buckaroo-notification-close:hover {
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .buckaroo-notification {
        left: 10px;
        right: 10px;
        transform: translateY(-20px);
        max-width: none;
    }

    .buckaroo-notification-show {
        transform: translateY(0) !important;
    }
}

/* HyvaCheckout PayPal Express Product Page */
#paypal-express-button-component-hyva {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

#paypal-express-button-component-hyva .buckaroo-paypal-express {
    width: min(70%, 240px) !important;
    max-width: 240px !important;
    margin-left: auto;
}

/* HyvaCheckout PayPal Express Cart Page */
#paypal-express-cart-hyva {
    margin-left: auto;
    margin-right: auto;
}

#paypal-express-cart-hyva .buckaroo-paypal-express {
    width: 100%;
    margin-bottom: 2rem;
    max-width: 100%;
}

/* The shared express CSS stretches the PayPal frame to its container; give the
   Hyvä containers the same fixed height that is passed to the PayPal button */
#paypal-express-cart-hyva .buckaroo-paypal-express .paypal-buttons,
#paypal-express-button-component-hyva .buckaroo-paypal-express .paypal-buttons {
    height: 40px !important;
    min-height: 40px !important;
}

/* Apple Pay express button on the product and cart page */
.buckaroo-apple-pay-express {
    width: 100%;
    margin-top: 0.75rem;
}

.buckaroo-apple-pay-express-product {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.buckaroo-apple-pay-express apple-pay-button {
    --apple-pay-button-width: 100%;
    --apple-pay-button-height: 40px;
    --apple-pay-button-border-radius: 20px;
    display: block;
    width: 100%;
}

.buckaroo-apple-pay-express-product apple-pay-button {
    width: min(70%, 240px);
}

.buckaroo-apple-pay-express-error {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dc2626;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.875rem;
}

/* iDEAL Fast Checkout button on the product and cart page (image and colours: express-payments.css) */
.buckaroo-ideal-fast-checkout {
    width: 100%;
    margin-top: 0.75rem;
}

.buckaroo-ideal-fast-checkout-product {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.buckaroo-ideal-fast-checkout #fast-checkout-ideal-btn-component {
    width: 100%;
    margin: 0;
}

.buckaroo-ideal-fast-checkout-product #fast-checkout-ideal-btn-component {
    width: min(70%, 240px);
}

.buckaroo-ideal-fast-checkout #fast-checkout-ideal-btn {
    height: 40px;
    cursor: pointer;
}

.buckaroo-ideal-fast-checkout #fast-checkout-ideal-btn:disabled {
    cursor: wait;
}

.buckaroo-ideal-fast-checkout-error {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dc2626;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.875rem;
}

/* Hosted Fields: the SDK sizes its iframe to this box, so the size is set here and not
   with Tailwind classes that the theme build may not contain. Border, radius and
   background come from the payment method settings (creditcards.js styleWrappers). */
.buckaroo-hosted-field {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 10px;
    overflow: hidden;
    border: 1px solid #d6d6d6;
    border-radius: 5px;
    background: #fefefe;
    box-shadow: none;
}

.buckaroo-hosted-field iframe {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

/* iDIN age verification step (Magewire/Checkout/Idin). Layout rules live here instead of
   Tailwind classes, so the step looks the same on themes whose CSS build does not include them. */
.buckaroo-idin-verification {
    background-color: #f9fafb;
}

.buckaroo-idin-verification__row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.buckaroo-idin-verification__bank {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.buckaroo-idin-verification__button {
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .buckaroo-idin-verification__row {
        flex-direction: row;
        align-items: flex-end;
    }
}

/* Payment methods stay hidden until the iDIN verification is done, as in the Magento 2 checkout */
#buckaroo-idin-verification.buckaroo-idin-required ~ #payment-methods {
    display: none;
}
