/**
 * Lighthouse Klarna Gateway - Styles
 * Klarna Brand Colors: Pink #FFB3C7, Black #0A0B09
 */

/* Klarna Official Font */
@font-face {
    font-family: 'KlarnaHeadline';
    src: url('https://x.klarnacdn.net/ui/fonts/v1.2/KlarnaHeadline-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Payment Method Label - Universal Selectors */
.payment_method_lighthouse_klarna_gateway > label,
body .woocommerce-checkout #payment .wc_payment_methods .payment_method_lighthouse_klarna_gateway label,
label[for='payment_method_lighthouse_klarna_gateway'],
.payment_method_label[for='payment_method_lighthouse_klarna_gateway'] {
    display: flex !important;
    align-items: center;
    font-size: 15px !important;
    font-weight: 600 !important;
    gap: 8px;
    position: relative;
}

/* Klarna Icon/Badge Styling - Override all checkout plugin styles */
.payment_method_lighthouse_klarna_gateway .payment_method_icons img,
.payment_method_lighthouse_klarna_gateway img.klarna-gateway-icon,
.payment_method_lighthouse_klarna_gateway > label img,
label[for='payment_method_lighthouse_klarna_gateway'] img,
#cfw-checkout-before-order-review .payment_method_lighthouse_klarna_gateway img,
.cfw-module .payment_method_lighthouse_klarna_gateway img,
body .payment_method_lighthouse_klarna_gateway img {
    height: 30px !important;
    min-height: 30px !important;
    width: 75px !important;
    min-width: 75px !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 5px !important;
    vertical-align: middle !important;
    object-fit: contain !important;
}

/* Klarna Payment Container */
.klarna-payment-form {
    background: transparent !important;
}

.klarna-payment-container {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #fef7f9 0%, #fff5f8 100%);
    border-radius: 12px;
    border: 1px solid #FFB3C7;
}

/* Simple Redirect Style */
.klarna-payment-container.klarna-simple {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
}

.klarna-redirect-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.klarna-redirect-icon svg {
    opacity: 0.7;
}

.klarna-redirect-text {
    text-align: center;
}

.klarna-redirect-text p {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
    margin: 0 auto;
}

.klarna-header {
    text-align: center;
    margin-bottom: 15px;
}

.klarna-badge {
    height: 28px;
    max-width: 100px;
}

/* Plan Info */
.klarna-plan-info {
    text-align: center;
    margin-bottom: 20px;
}

.klarna-plan-title {
    font-size: 18px;
    font-weight: 700;
    color: #0A0B09;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.klarna-icon {
    font-size: 20px;
}

.klarna-plan-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Installments */
.klarna-installments {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(255, 179, 199, 0.2);
}

.klarna-installment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.klarna-installment-header span:first-child {
    font-size: 14px;
    color: #666;
}

.klarna-amount {
    font-size: 20px;
    font-weight: 700;
    color: #0A0B09;
}

/* Timeline */
.klarna-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.klarna-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.klarna-timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.klarna-timeline-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
    margin-bottom: 8px;
}

.klarna-timeline-dot.active {
    background: #FFB3C7;
    box-shadow: 0 0 0 1px #FFB3C7;
}

.klarna-timeline-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    white-space: nowrap;
}

.klarna-timeline-amount {
    font-size: 12px;
    font-weight: 600;
    color: #0A0B09;
}

/* Footer */
.klarna-footer {
    text-align: center;
}

.klarna-terms {
    margin: 0;
}

.klarna-terms small {
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

.klarna-terms a {
    color: #FFB3C7;
    text-decoration: underline;
}

.klarna-terms a:hover {
    color: #ff8fab;
}

/* Payment Button - Klarna Style */
.woocommerce-checkout-payment .place-order .klarna_payment_btn {
    background: linear-gradient(135deg, #FFB3C7 0%, #ff8fab 100%) !important;
    background-color: #FFB3C7 !important;
    color: #0A0B09 !important;
    border-color: transparent !important;
    min-height: 52px;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
}

.woocommerce-checkout-payment .place-order .klarna_payment_btn:hover {
    background: linear-gradient(135deg, #ff8fab 0%, #FFB3C7 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 179, 199, 0.4) !important;
}

.woocommerce-checkout-payment .place-order .klarna_payment_btn::before {
    content: '' !important;
    display: none !important;
}

.woocommerce-checkout-payment .place-order .button {
    width: 100% !important;
}

/* Payment Method Styling */
.payment_method_lighthouse_klarna_gateway {
    padding-top: 20px !important;
}

/* ===========================================
   HIDE BLACK DOT/BULLET IN KLARNA PAYMENT METHOD
   =========================================== */

/* Hide any bullet point in payment method */
.payment_method_lighthouse_klarna_gateway,
.payment_method_lighthouse_klarna_gateway li,
#cfw-billing-methods .payment_method_lighthouse_klarna_gateway {
    list-style: none !important;
    list-style-type: none !important;
}

/* Hide any extra text/dots inside payment_method_icons */
.payment_method_lighthouse_klarna_gateway .payment_method_icons,
#cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    list-style: none !important;
}

.payment_method_lighthouse_klarna_gateway .payment_method_icons img,
#cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img {
    display: inline-block !important;
    font-size: 14px !important;
}

/* Hide the bullet/dot character between title and icon */
.payment_method_lighthouse_klarna_gateway .cfw-radio-reveal-label > div {
    font-size: 0 !important;
}

.payment_method_lighthouse_klarna_gateway .cfw-radio-reveal-label > div > * {
    font-size: 15px !important;
}

.payment_method_lighthouse_klarna_gateway .cfw-radio-reveal-label > div .payment_method_icons {
    font-size: 0 !important;
}

.payment_method_lighthouse_klarna_gateway img {
    float: right !important;
    padding: 0;
    border: 0;
}

.payment_method_lighthouse_klarna_gateway .payment-title-icon > img {
    max-height: 25px;
}

/* Iframe Container */
#klarna-payment-iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 9, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.5s ease;
}

#klarna-payment-iframe-container iframe {
    width: 450px !important;
    height: 580px !important;
    border-radius: 12px;
    border: none;
    background: #fff;
}

@media (max-width: 768px) {
    #klarna-payment-iframe-container iframe {
        width: 95% !important;
        height: 88% !important;
    }
    
    .klarna-timeline {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .klarna-timeline::before {
        display: none;
    }
    
    .klarna-timeline-item {
        flex: 0 0 45%;
    }
    
    .klarna-installment-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Force show Klarna icon on ALL screen sizes - Override CheckoutWC hiding */
/* Target the exact CheckoutWC selector: #cfw-billing-methods .payment_method_icons */
#cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons,
#cfw-billing-methods.cfw-module .payment_method_lighthouse_klarna_gateway .payment_method_icons,
html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    max-height: none !important;
}

#cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img,
#cfw-billing-methods.cfw-module .payment_method_lighthouse_klarna_gateway .payment_method_icons img,
html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 28px !important;
    width: auto !important;
    max-height: none !important;
}

/* Mobile specific - Override CheckoutWC @media(max-width:991.98px) rule */
@media screen and (max-width: 992px) {
    #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons,
    html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons,
    body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img,
    html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img,
    body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img {
        display: block !important;
        visibility: visible !important;
        height: 26px !important;
    }
}

/* Extra small screens */
@media screen and (max-width: 576px) {
    #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons,
    html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img,
    html body #cfw-billing-methods .payment_method_lighthouse_klarna_gateway .payment_method_icons img {
        display: block !important;
        visibility: visible !important;
        height: 24px !important;
    }
}

/* Close Button */
.klarna-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 36px;
    height: 36px;
    opacity: 0.8;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.klarna-close-btn:hover {
    opacity: 1;
    background: rgba(255, 179, 199, 0.3);
}

.klarna-close-btn:before,
.klarna-close-btn:after {
    position: absolute;
    content: '';
    height: 16px;
    width: 2px;
    background-color: #fff;
}

.klarna-close-btn:before {
    transform: rotate(45deg);
}

.klarna-close-btn:after {
    transform: rotate(-45deg);
}

/* Loading Animation */
.klarna-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.klarna-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 179, 199, 0.3);
    border-top-color: #FFB3C7;
    border-radius: 50%;
    animation: klarna-spin 1s linear infinite;
}

@keyframes klarna-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth animations */
.klarna-payment-container {
    animation: klarna-fade-in 0.3s ease;
}

@keyframes klarna-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}



