/* ============================================================
   Button Style Variations (Icon, Text, Both)
   ============================================================ */

/* Button with icon + text (default) */
.woocommerce .button.button-style-both svg,
.woocommerce a.button.button-style-both svg,
.woocommerce button.button.button-style-both svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Icon-only button - Square and right-aligned */
.woocommerce .button.button-style-icon,
.woocommerce a.button.button-style-icon,
.woocommerce button.button.button-style-icon {
    padding: 12px !important;
    min-width: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* Right align icon-only buttons in product cards */
.woocommerce ul.products li.product .button.button-style-icon,
.woocommerce ul.products li.product a.button.button-style-icon {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

/* Ensure product card has relative positioning */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce .button.button-style-icon svg,
.woocommerce a.button.button-style-icon svg,
.woocommerce button.button.button-style-icon svg {
    margin: 0;
}

/* Text-only button */
.woocommerce .button.button-style-text,
.woocommerce a.button.button-style-text,
.woocommerce button.button.button-style-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure SVG icons are properly sized */
.woocommerce .button svg,
.woocommerce a.button svg,
.woocommerce button.button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {

    /* On mobile, icon-only buttons are slightly smaller */
    .woocommerce .button.button-style-icon,
    .woocommerce a.button.button-style-icon,
    .woocommerce button.button.button-style-icon {
        min-width: 40px;
        width: 40px;
        height: 40px;
        padding: 10px !important;
    }

    /* Adjust position on mobile */
    .woocommerce ul.products li.product .button.button-style-icon,
    .woocommerce ul.products li.product a.button.button-style-icon {
        bottom: 12px;
        right: 12px;
    }

    /* Icon + text: reduce spacing */
    .woocommerce .button.button-style-both svg,
    .woocommerce a.button.button-style-both svg,
    .woocommerce button.button.button-style-both svg {
        margin-right: 6px;
    }
}

/* ============================================================
   Added to Cart Checkmark
   ============================================================ */

/* Hide the shopping cart SVG when product is added */
.woocommerce a.button.added svg,
.woocommerce button.button.added svg {
    display: none;
}

/* Show checkmark SVG instead of cart icon */
.woocommerce a.button.added::after,
.woocommerce button.button.added::after {
    content: "";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: checkmark-pop 0.3s ease;
    filter: brightness(0) invert(1);
    /* Make it white on colored buttons */
}

/* Animation for checkmark appearance */
@keyframes checkmark-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* For icon-only buttons, ensure checkmark is centered */
.woocommerce a.button.button-style-icon.added::after,
.woocommerce button.button.button-style-icon.added::after {
    width: 20px;
    height: 20px;
}

/* For icon+text buttons, add spacing */
.woocommerce a.button.button-style-both.added::after,
.woocommerce button.button.button-style-both.added::after {
    margin-right: 8px;
}