/* ==============================================
   Buy Now Button Styles
   ============================================== */

.buynow-button-wrapper {
    display: inline-block;
    vertical-align: middle;
}

.button-buynow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 50px;
    padding: 0 28px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #3BB77E 0%, #2d9a68 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(59, 183, 126, 0.3);
    text-transform: none;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    line-height: 1;
    margin-left: 8px;
}

.button-buynow:hover {
    background: linear-gradient(135deg, #2d9a68 0%, #238c5c 100%);
    box-shadow: 0 4px 16px rgba(59, 183, 126, 0.45);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.button-buynow:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 183, 126, 0.3);
}

.button-buynow:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-buynow.loading {
    pointer-events: none;
}

.button-buynow.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: buynow-spin 0.6s linear infinite;
}

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

/* Integration with Muathuoc247 theme */
.product-extra-link2 .buynow-button-wrapper {
    margin-left: 8px;
}

.detail-extralink .product-extra-link2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Cart icon hidden on desktop, shown on mobile */
.cart-icon-mobile {
    display: none;
}

/* Hide sticky-cart on mobile (mobile already has its own cart icon) */
@media (max-width: 991px) {
    .sticky-cart.header-action-right {
        display: none !important;
    }
}

/* Responsive - product detail page */
@media (max-width: 768px) {
    /* Put quantity + buttons all on one row */
    .detail-extralink {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .detail-extralink .detail-qty {
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .product-extra-link2 {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        flex: 1;
    }

    /* Add-to-cart: icon only */
    .button-add-to-cart .add-to-cart-text {
        display: none;
    }

    .button-add-to-cart .cart-icon-mobile {
        display: inline-block;
    }

    .button-add-to-cart {
        min-width: 46px !important;
        width: 46px !important;
        height: 46px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Buy Now: take remaining space */
    .buynow-button-wrapper {
        flex: 1;
        margin-left: 0;
    }

    .button-buynow {
        width: 100%;
        min-width: unset;
        height: 46px;
        font-size: 15px;
        margin-left: 0;
        padding: 0 12px;
    }

    .product-extra-link2 .buynow-button-wrapper {
        margin-left: 0;
    }
}
