/* JD Add To Cart Reset Wrapper */
.jd-add-to-cart-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

/* Core Elementor Button Styles */
.jd-add-to-cart-button,
.jd-add-to-cart-wrapper .button,
.jd-add-to-cart-wrapper .single_add_to_cart_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

/* Icon Spacing */
.jd-add-to-cart-wrapper .jd-atc-icon-left {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}
.jd-add-to-cart-wrapper .jd-atc-icon-right {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
}
.jd-add-to-cart-wrapper svg {
    width: 1em;
    height: auto;
    fill: currentColor;
}

/* ── Quantity Integration & Variable Products ── */
.jd-add-to-cart-wrapper form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: 0 !important;
    padding: 0 !important;
}

/* Variable product tables */
.jd-add-to-cart-wrapper table.variations {
    width: 100%;
    margin-bottom: 15px;
}
.jd-add-to-cart-wrapper .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Quantity input styling bypass */
.jd-add-to-cart-wrapper .quantity .qty {
    width: 60px;
    height: 44px;
    padding: 0 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

/* ── Full Width Mode ── */
.elementor-widget-jd-add-to-cart .jd-add-to-cart-button,
.elementor-widget-jd-add-to-cart .jd-add-to-cart-wrapper .button {
    width: 100%;
}

.elementor-widget-jd-add-to-cart[data-widget_type="jd-add-to-cart.default"] .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    flex: 1; /* Takes up remaining space beside quantity box */
}

/* ── Reset Native WooCommerce Spinner Overlay Overlap ── */
.jd-add-to-cart-wrapper .button.loading::after {
    display: none !important;
}

.jd-add-to-cart-wrapper .button.loading {
    opacity: 0.65 !important;
    pointer-events: none !important;
    cursor: wait !important;
}

/* Optional: Make the user's custom icon spin while loading */
.jd-add-to-cart-wrapper .button.loading .jd-atc-icon-left svg,
.jd-add-to-cart-wrapper .button.loading .jd-atc-icon-right svg,
.jd-add-to-cart-wrapper .button.loading i {
    animation: jd-btn-spin 1.2s linear infinite;
}

@keyframes jd-btn-spin {
    100% { transform: rotate(360deg); }
}
