/* Base button styles */
.wcwc-checkout-button {
    display: flex !important; /* Consolidated display style */
    width: 100% !important;
    padding: 1em 2em !important; /* Combine padding definitions */
    text-align: center;
    align-items: center;
    justify-content: center;
    line-height: 1.5 !important;
    background-color: #25d366 !important;
    color: #ffffff !important;
    font-size: 1.15em !important; /* Consistent font size */
    border: none !important;
    border-radius: 4px !important; /* Standardized border-radius */
    cursor: pointer;
    transition: background-color 0.3s ease !important;
    margin: 0.5em 0 !important; /* Consolidated margin */
}

/* Hover effect */
.wcwc-checkout-button:hover {
    background-color: #128c7e !important;
    color: #ffffff !important;
    text-decoration: none !important;
    filter: brightness(0.95); /* Added to a single hover selector */
}

/* Icon styles */
.wcwc-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

/* Hover icon scale effect */
.wcwc-checkout-button:hover .wcwc-icon {
    transform: scale(1.1);
}

/* Before pseudo-element for the icon */
.wcwc-checkout-button::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Text styles */
.wcwc-button-text {
    display: inline-block;
    line-height: inherit;
}

/* RTL support */
[dir="rtl"] .wcwc-button-content {
    flex-direction: row-reverse;
}

/* Mobile optimization */
@media screen and (max-width: 768px) {
    .wcwc-checkout-button {
        padding: 1em !important; /* Ensuring padding is uniform on mobile */
        font-size: 1em !important; /* Font size adjustment on mobile */
    }
    
    .wcwc-icon {
        width: 16px;
        height: 16px;
    }
}

/* Confirmation Modal Styles */
.wcwc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999999;
}

.wcwc-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 2em;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wcwc-modal-buttons {
    margin-top: 1.5em;
    display: flex;
    justify-content: center;
    gap: 1em;
}

.wcwc-modal-button {
    padding: 0.5em 1.5em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wcwc-modal-confirm {
    background-color: #25d366;
    color: #ffffff;
}

.wcwc-modal-cancel {
    background-color: #f1f1f1;
    color: #333333;
}

/* Force button to full width on cart page */
.wc-proceed-to-checkout .wcwc-checkout-button {
    display: block;
    width: 100%;
    text-align: center;
}

/* Disabled & loading state */
.wcwc-checkout-button:disabled,
.wcwc-checkout-button.disabled,
.wcwc-checkout-button.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.wcwc-checkout-button.loading {
    opacity: 0.25;
}

/* Theme-specific overrides */
.theme-twentytwentytwo .wcwc-checkout-button,
.theme-twentytwentythree .wcwc-checkout-button {
    font-family: inherit;
}

/* WooCommerce standard layout compatibility */
.wcwc-button-wrapper {
    display: block;
    width: 100%;
    clear: both;
}

.wc-proceed-to-checkout .wcwc-button-wrapper {
    padding: 1em 0;
}

/* Button content wrapper */
.wcwc-button-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Icon alignment */
.wcwc-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

/* Base button styles */
.wcwc-checkout-button {
    width: 100% !important;
    margin: 0.5em 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: normal !important;
    text-decoration: none;
    background-color: #25d366 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 1em 2em !important;
    min-height: 48px;
}

/* Button content wrapper */
.wcwc-button-content {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Icon styles */
.wcwc-icon {
    flex-shrink: 0;
    margin-right: 8px;
}

/* Block theme compatibility */
.wc-block-cart__submit-container .wcwc-button-wrapper {
    width: 100%;
    margin: 0.5em 0;
}

.wc-block-cart__submit-container .wcwc-checkout-button {
    width: 100%;
    margin: 0;
}

/* Fix for block themes layout */
.wp-block-woocommerce-cart .wcwc-button-wrapper {
    margin: 1em 0;
}

/* Prevent duplicate margins */
.wc-block-cart__submit-container .wcwc-button-wrapper + .wcwc-button-wrapper {
    display: none;
}