/**
 * Easy Baltics Checkout - Express Checkout Styles
 */

/* ==========================================================================
   Express Checkout Button Wrapper
   ========================================================================== */

.easybc-express-checkout-wrapper {
    margin: 15px 0;
    text-align: center;
    width: 100%;
}

.easybc-express-checkout-wrapper--cart {
    margin-top: 10px;
    padding: 0;
}

.easybc-express-checkout-wrapper--product {
    margin-top: 15px;
    clear: both;
}

.easybc-express-checkout-wrapper--mini-cart {
    margin: 10px 0 0 0;
    padding: 0;
}

/* ==========================================================================
   Express Checkout Button - Main Styles
   ========================================================================== */

.easybc-express-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    text-decoration: none !important;
    text-transform: none;
    letter-spacing: normal;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.easybc-express-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.easybc-express-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: #fff !important;
}

.easybc-express-btn:hover::before {
    left: 100%;
}

.easybc-express-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.easybc-express-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 4px 14px rgba(99, 102, 241, 0.4) !important;
}

.easybc-express-btn:disabled,
.easybc-express-btn--loading {
    opacity: 0.8;
    cursor: wait;
    transform: none !important;
    pointer-events: none;
}

/* Button Icon */
.easybc-express-btn__icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

/* Button Text */
.easybc-express-btn__text {
    line-height: 1.2;
    flex-grow: 1;
}

/* Button Spinner */
.easybc-express-btn__spinner {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.easybc-express-btn__spinner .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: easybc-spin 0.8s linear infinite;
    margin: 0;
    background: none;
    float: none;
    vertical-align: middle;
}

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

/* Loading State */
.easybc-express-btn--loading {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
}

.easybc-express-btn--loading .easybc-express-btn__spinner {
    display: inline-flex;
}

/* ==========================================================================
   Express Checkout Note
   ========================================================================== */

.easybc-express-checkout-note {
    margin: 10px 0 0 0;
    padding: 0;
    font-size: 13px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* ==========================================================================
   Error Message
   ========================================================================== */

.easybc-express-error {
    margin: 15px 0 10px 0;
    padding: 12px 15px;
    font-size: 14px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    text-align: center;
}

/* ==========================================================================
   Cart Page Specific - Replace Proceed to Checkout
   ========================================================================== */

/* Target WooCommerce cart totals area */
.wc-proceed-to-checkout .easybc-express-checkout-wrapper {
    margin: 0;
    padding: 0;
}

.wc-proceed-to-checkout .easybc-express-btn {
    margin-bottom: 10px;
}

/* Hide any residual proceed to checkout buttons when our button is present */
.wc-proceed-to-checkout .easybc-express-checkout-wrapper ~ .checkout-button,
.wc-proceed-to-checkout .easybc-express-checkout-wrapper ~ a.checkout-button {
    display: none !important;
}

/* ==========================================================================
   Mini Cart Specific Styles
   ========================================================================== */

.easybc-express-checkout-wrapper--mini-cart .easybc-express-btn {
    padding: 12px 15px;
    font-size: 14px;
    border-radius: 6px;
}

.easybc-express-checkout-wrapper--mini-cart .easybc-express-btn__icon {
    font-size: 18px;
}

/* Widget area adjustments */
.widget_shopping_cart .easybc-express-checkout-wrapper,
.woocommerce-mini-cart__buttons .easybc-express-checkout-wrapper {
    margin-top: 10px;
}

/* ==========================================================================
   Product Page Specific Styles
   ========================================================================== */

.easybc-express-checkout-wrapper--product {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.easybc-express-checkout-wrapper--product .easybc-express-btn {
    max-width: 100%;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .easybc-express-checkout-note {
        color: #aaa;
    }
    
    .easybc-express-checkout-wrapper--product {
        border-top-color: #444;
    }
    
    .easybc-express-error {
        background-color: #4a1c1c;
        border-color: #6b2c2c;
        color: #f5c6cb;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .easybc-express-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .easybc-express-btn__icon {
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .easybc-express-btn {
        padding: 12px 15px;
        font-size: 14px;
        gap: 8px;
    }
    
    .easybc-express-btn__icon {
        font-size: 18px;
    }
}

/* ==========================================================================
   WooCommerce Theme Compatibility
   ========================================================================== */

/* Ensure button appears above any following elements */
.woocommerce-cart .wc-proceed-to-checkout {
    display: flex;
    flex-direction: column;
}

/* Storefront Theme */
.storefront .easybc-express-checkout-wrapper--cart {
    margin-top: 15px;
}

/* Astra Theme */
.ast-woocommerce-container .easybc-express-btn {
    border-radius: 4px;
}

/* OceanWP Theme */
.oceanwp-theme .easybc-express-btn {
    font-family: inherit;
}

/* Flatsome Theme */
.flatsome .easybc-express-btn {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Divi Theme */
.et_divi_theme .easybc-express-btn {
    font-family: inherit;
}

/* Kadence Theme */
.kadence-theme .easybc-express-btn {
    font-family: inherit;
}

/* Blocksy Theme */
.ct-container .easybc-express-btn {
    font-family: inherit;
}

/* GeneratePress Theme */
.generate-inside-article .easybc-express-btn {
    font-family: inherit;
}
