/**
 * Satmo Express Checkout Styles
 * 
 * Styles for the "Pay with Satmo" express checkout button
 * that appears above payment methods on the checkout page
 */

/* Express Checkout Container */
.satmo-express-checkout-container {
    margin: 20px 0 !important;
    text-align: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Position at top of checkout form for classic themes */
.woocommerce-checkout form.checkout .satmo-express-checkout-container {
    margin: 0 0 30px 0 !important;
    padding: 20px 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Product page express checkout container spacing */
.single-product .satmo-express-checkout-container {
    margin: 20px 0 !important;
    padding: 15px 0 !important;
    clear: both !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Shopkeeper theme specific product page spacing */
.theme-shopkeeper .single-product .satmo-express-checkout-container,
.shopkeeper .single-product .satmo-express-checkout-container {
    margin: 25px 0 30px 0 !important;
    padding: 20px 0 !important;
    clear: both !important;
    position: relative !important;
    z-index: 1 !important;
    border-top: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Ensure it appears before billing details */
.woocommerce-checkout .col2-set .satmo-express-checkout-container {
    margin-bottom: 30px !important;
}

/* Force position at the very top of checkout form */
.woocommerce-checkout form.checkout > .satmo-express-checkout-container {
    margin: 0 0 30px 0 !important;
    padding: 20px 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    order: -1 !important;
}

/* Shopkeeper theme specific positioning */
.theme-shopkeeper .woocommerce-checkout form.checkout .satmo-express-checkout-container,
.shopkeeper .woocommerce-checkout form.checkout .satmo-express-checkout-container {
    margin: 0 0 30px 0 !important;
    padding: 20px 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Separator */
.satmo-express-checkout-separator {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.satmo-express-checkout-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
    z-index: 1;
}

.satmo-express-checkout-separator-text {
    position: relative;
    background-color: #ffffff;
    color: #666666;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 400;
    z-index: 2;
}

/* Button Wrapper */
.satmo-express-checkout-button-wrapper {
    margin: 15px 0;
}

/* Express Checkout Button */
.satmo-express-checkout-button {
    width: 100% !important;
    max-width: 343px !important;
    min-width: 150px !important; /* Minimum width to maintain readability */
    height: 50px !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    padding: 8px 16px !important;
    margin: 0 auto !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 8px; /* Default rounded - will be overridden for square */
    background: rgba(255, 255, 255, 1) !important;
    color: #000 !important;
    text-decoration: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Full width on checkout pages */
.woocommerce-checkout .satmo-express-checkout-button,
.woocommerce-checkout-page .satmo-express-checkout-button {
    width: 100% !important;
    max-width: 100% !important;
}

/* Cart-specific button styling - match proceed to checkout width */
.wc-block-cart__payment-options .satmo-express-checkout-button {
    max-width: none !important;
    width: 100% !important;
}

/* Desktop cart button - match proceed to checkout button height */
@media screen and (min-width: 769px) {
    .wc-block-cart__payment-options .satmo-express-checkout-button {
        max-height: 57.2px !important;
        height: auto !important;
        min-height: 50px !important;
    }
}

/* Hover and active states - subtle color changes */

/* Light button hover/active states - make darker */
.satmo-express-checkout-button.satmo-light-button:hover,
.satmo-express-checkout-button.satmo-light-button:active {
    background: rgba(235, 235, 235, 1) !important;
    border: 1px solid rgba(0, 0, 0, 0.65) !important;
}

/* Dark button hover/active states - make lighter */
.satmo-express-checkout-button.satmo-dark-button:hover,
.satmo-express-checkout-button.satmo-dark-button:active {
    background: rgba(60, 60, 60, 1) !important;
    border: 1px solid rgba(60, 60, 60, 1) !important;
}

.satmo-express-checkout-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Button Content - SVG Logo */
.satmo-express-checkout-button-content {
    height: 28px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.satmo-express-checkout-button-content svg {
    height: 28px;
    width: auto;
    display: block;
}

/* Processing State - maintain visual consistency */
.satmo-express-checkout-button.processing {
    pointer-events: none;
    /* No visual changes - maintain original appearance */
}

/* Button Styles */
.satmo-express-checkout-button.satmo-light-button {
    background: rgba(255, 255, 255, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
}

.satmo-express-checkout-button.satmo-dark-button {
    background: rgba(0, 0, 0, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    background-color: rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
}

/* Override any theme-specific button styles - but preserve dark/light customization */
.woocommerce .satmo-express-checkout-button:not(.satmo-dark-button),
.single-product .satmo-express-checkout-button:not(.satmo-dark-button),
.woocommerce-page .satmo-express-checkout-button:not(.satmo-dark-button),
.woocommerce-cart .satmo-express-checkout-button:not(.satmo-dark-button),
.woocommerce-checkout .satmo-express-checkout-button:not(.satmo-dark-button),
.shop .satmo-express-checkout-button:not(.satmo-dark-button),
.archive .satmo-express-checkout-button:not(.satmo-dark-button) {
    background: rgba(255, 255, 255, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #000 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Ensure dark buttons maintain their dark styling */
.woocommerce .satmo-express-checkout-button.satmo-dark-button,
.single-product .satmo-express-checkout-button.satmo-dark-button,
.woocommerce-page .satmo-express-checkout-button.satmo-dark-button,
.woocommerce-cart .satmo-express-checkout-button.satmo-dark-button,
.woocommerce-checkout .satmo-express-checkout-button.satmo-dark-button,
.shop .satmo-express-checkout-button.satmo-dark-button,
.archive .satmo-express-checkout-button.satmo-dark-button {
    background: rgba(0, 0, 0, 1) !important;
    background-color: rgba(0, 0, 0, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Override Shopkeeper theme specific styles - but preserve dark/light customization */
.theme-shopkeeper .satmo-express-checkout-button:not(.satmo-dark-button),
.shopkeeper .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .woocommerce .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .single-product .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .woocommerce-page .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .woocommerce-cart .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .woocommerce-checkout .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .shop .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-shopkeeper .archive .satmo-express-checkout-button:not(.satmo-dark-button) {
    background: rgba(255, 255, 255, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #000 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Ensure dark buttons work on Shopkeeper theme */
.theme-shopkeeper .satmo-express-checkout-button.satmo-dark-button,
.shopkeeper .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .woocommerce .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .single-product .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .woocommerce-page .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .woocommerce-cart .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .woocommerce-checkout .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .shop .satmo-express-checkout-button.satmo-dark-button,
.theme-shopkeeper .archive .satmo-express-checkout-button.satmo-dark-button {
    background: rgba(0, 0, 0, 1) !important;
    background-color: rgba(0, 0, 0, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Ensure dark buttons work on Twenty Twenty-Five theme */
.theme-twentytwentyfive .satmo-express-checkout-button.satmo-dark-button,
.twentytwentyfive .satmo-express-checkout-button.satmo-dark-button,
.wp-theme-twentytwentyfive .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .woocommerce .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .single-product .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .woocommerce-page .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .woocommerce-cart .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .woocommerce-checkout .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .shop .satmo-express-checkout-button.satmo-dark-button,
.theme-twentytwentyfive .archive .satmo-express-checkout-button.satmo-dark-button {
    background: rgba(0, 0, 0, 1) !important;
    background-color: rgba(0, 0, 0, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Ensure light buttons work on Twenty Twenty-Five theme */
.theme-twentytwentyfive .satmo-express-checkout-button:not(.satmo-dark-button),
.twentytwentyfive .satmo-express-checkout-button:not(.satmo-dark-button),
.wp-theme-twentytwentyfive .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .woocommerce .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .single-product .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .woocommerce-page .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .woocommerce-cart .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .woocommerce-checkout .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .shop .satmo-express-checkout-button:not(.satmo-dark-button),
.theme-twentytwentyfive .archive .satmo-express-checkout-button:not(.satmo-dark-button) {
    background: rgba(255, 255, 255, 1) !important;
    background-color: rgba(255, 255, 255, 1) !important;
    border: 1px solid rgba(0, 0, 0, 1) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: #000 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: all 0.2s ease !important;
}

/* Responsive width logic: stretch to max available width when < 343px, cap at 343px when ≥ 343px */
@media screen and (max-width: 342px) {
    .satmo-express-checkout-button {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 150px !important; /* Ensure minimum readability */
    }
}

/* For screens between 343px and 400px, allow natural width but cap at 343px */
@media screen and (min-width: 343px) and (max-width: 400px) {
    .satmo-express-checkout-button {
        width: 100% !important;
        max-width: 343px !important;
    }
}

/* Button Shapes */
.satmo-express-checkout-button.satmo-rounded-button {
    border-radius: 8px !important;
}

.satmo-express-checkout-button.satmo-square-button {
    border-radius: 0 !important;
}

/* Error Notice */
.satmo-express-checkout-notice {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 4px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    line-height: 1.4;
}

/* Blocks Checkout Specific Styles */
.wp-block-woocommerce-checkout .satmo-express-checkout-container {
    margin: 15px 0;
}

.wp-block-woocommerce-checkout .satmo-express-checkout-separator {
    margin: 15px 0;
}

.wp-block-woocommerce-checkout .satmo-express-checkout-button {
    max-width: 100%;
    width: 100%;
}

/* Classic Checkout Specific Styles */
.woocommerce-checkout .satmo-express-checkout-container {
    margin: 20px 0;
}

.woocommerce-checkout .satmo-express-checkout-separator {
    margin: 20px 0;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .satmo-express-checkout-button {
        /* Maintain width logic: stretch when < 343px, cap at 343px when ≥ 343px */
        width: 100% !important;
        max-width: 343px !important;
        min-width: 150px !important;
        height: 48px;
        padding: 6px 12px;
    }
    
    .satmo-express-checkout-button-content {
        height: 26px;
    }
    
    .satmo-express-checkout-button-content svg {
        height: 26px;
    }
    
    .satmo-express-checkout-separator-text {
        font-size: 13px;
        padding: 0 10px;
    }
}

@media screen and (max-width: 480px) {
    .satmo-express-checkout-container {
        margin: 15px 0;
    }
    
    .satmo-express-checkout-separator {
        margin: 15px 0;
    }
    
    .satmo-express-checkout-button {
        /* Maintain width logic: stretch when < 343px, cap at 343px when ≥ 343px */
        width: 100% !important;
        max-width: 343px !important;
        min-width: 150px !important;
        height: 44px;
        padding: 6px 10px;
    }
    
    .satmo-express-checkout-button-content {
        height: 24px;
    }
    
    .satmo-express-checkout-button-content svg {
        height: 24px;
    }
    
    .satmo-express-checkout-separator-text {
        font-size: 12px;
        padding: 0 8px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .satmo-express-checkout-button:focus {
        outline: 3px solid #000000;
        outline-offset: 2px;
    }
    
    .satmo-express-checkout-separator::before {
        background-color: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .satmo-express-checkout-button {
        transition: none;
    }
    
    .satmo-express-checkout-button-content svg {
        transition: none;
    }
    
    .satmo-express-checkout-button.loading .satmo-express-checkout-button-content {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .satmo-express-checkout-container {
        display: none;
    }
}

/* Hide duplicate reopen buttons - show only the first one */
.satmo-reopen-modal-duplicate {
    display: none !important;
}


