/**
 * WooCommerce Elementor Direct Checkout Button Styles
 */

.wedc-button-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Quantity Selector Styles */
.wedc-quantity-wrapper {
    display: inline-block;
}

.wedc-quantity {
    width: 80px;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.wedc-quantity:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.wedc-quantity::-webkit-inner-spin-button,
.wedc-quantity::-webkit-outer-spin-button {
    opacity: 1;
    height: 30px;
}

/* Button Styles */
.wedc-checkout-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    box-sizing: border-box;
    flex-grow: 1;
}

.wedc-checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wedc-checkout-button:active {
    transform: translateY(0);
}

.wedc-checkout-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Alignment Styles */
.wedc-button-wrapper[style*="text-align: left"],
.wedc-button-wrapper[style*="text-align:left"] {
    justify-content: flex-start;
}

.wedc-button-wrapper[style*="text-align: center"],
.wedc-button-wrapper[style*="text-align:center"] {
    justify-content: center;
}

.wedc-button-wrapper[style*="text-align: right"],
.wedc-button-wrapper[style*="text-align:right"] {
    justify-content: flex-end;
}

.wedc-button-wrapper[style*="text-align: justify"],
.wedc-button-wrapper[style*="text-align:justify"] .wedc-checkout-button {
    width: 100%;
    flex-grow: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wedc-checkout-button {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .wedc-quantity {
        font-size: 14px;
        padding: 8px 10px;
        width: 70px;
    }
}

@media (max-width: 480px) {
    .wedc-button-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wedc-quantity-wrapper {
        width: 100%;
    }
    
    .wedc-quantity {
        width: 100%;
    }
    
    .wedc-checkout-button {
        width: 100%;
    }
}

/* Loading state */
.wedc-checkout-button.loading {
    position: relative;
    color: transparent !important;
}

.wedc-checkout-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wedc-spinner 0.6s linear infinite;
}

@keyframes wedc-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* RTL Support */
body.rtl .wedc-button-wrapper {
    direction: rtl;
}

/* Editor Preview */
.elementor-editor-active .wedc-checkout-button {
    pointer-events: none;
}

/* WooLentor Checkout Form Highlighting (Optional) */
.wedc-checkout-highlight {
    animation: wedc-highlight 1s ease-in-out;
}

@keyframes wedc-highlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 115, 170, 0);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(0, 115, 170, 0.3);
    }
}