.cse-product-add-to-cart {
    --cse-atc-blue: #257aff;
    --cse-atc-dark: #0d1b3f;
    --cse-atc-white: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    width: auto;
    max-width: 100%;
    direction: rtl;
}

.cse-product-add-to-cart.is-full-width { width: 100%; }
.cse-product-add-to-cart.is-full-width .cse-product-add-to-cart-button { width: 100%; }
.cse-product-add-to-cart.is-inline { display: inline-flex; }

.cse-product-add-to-cart-button {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    margin: 0 !important;
    padding: 14px 22px !important;
    border: 1px solid var(--cse-atc-blue) !important;
    border-radius: 12px;
    background: var(--cse-atc-blue);
    color: var(--cse-atc-white);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 9px 24px rgba(37, 122, 255, .16) !important;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cse-product-add-to-cart-button::before,
.cse-product-add-to-cart-button::after { content: none !important; }

.cse-product-add-to-cart-button:hover,
.cse-product-add-to-cart-button:focus {
    background: var(--cse-atc-dark);
    border-color: var(--cse-atc-dark) !important;
    color: var(--cse-atc-white);
    box-shadow: 0 12px 30px rgba(13, 27, 63, .2) !important;
    transform: translateY(-1px);
    outline: none;
}

.cse-product-add-to-cart-button:focus-visible {
    outline: 3px solid rgba(37, 122, 255, .24) !important;
    outline-offset: 3px;
}

/* A disabled native button does not provide useful feedback by itself.
   Keep pointer interaction on the wrapper so the reason tooltip can be shown. */
.cse-product-add-to-cart.is-disabled { cursor: not-allowed; }
.cse-product-add-to-cart.is-disabled .cse-product-add-to-cart-button,
.cse-product-add-to-cart-button:disabled,
.cse-product-add-to-cart-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Keep the legacy disabled appearance when the similar-products action is off. */
.cse-product-add-to-cart.is-out-of-stock:not(.is-similar-products) .cse-product-add-to-cart-button,
.cse-product-add-to-cart.is-out-of-stock:not(.is-similar-products) .cse-product-add-to-cart-button:hover,
.cse-product-add-to-cart.is-out-of-stock:not(.is-similar-products) .cse-product-add-to-cart-button:focus {
    color: #6b7280 !important;
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
    opacity: 1;
    transform: none !important;
    box-shadow: none !important;
}

/* Similar products is an actionable state with a distinct palette. */
.cse-product-add-to-cart.is-similar-products .cse-product-add-to-cart-button {
    color: #fff !important;
    background: #b45309 !important;
    border-color: #b45309 !important;
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 9px 24px rgba(180, 83, 9, .18) !important;
}
.cse-product-add-to-cart.is-similar-products .cse-product-add-to-cart-button:hover,
.cse-product-add-to-cart.is-similar-products .cse-product-add-to-cart-button:focus {
    color: #fff !important;
    background: #92400e !important;
    border-color: #92400e !important;
    box-shadow: 0 12px 30px rgba(146, 64, 14, .2) !important;
    transform: translateY(-1px) !important;
}
.cse-product-add-to-cart.is-similar-products .cse-product-quantity {
    display: none !important;
}

.cse-product-add-to-cart-button.is-loading { cursor: wait; }
.cse-product-add-to-cart-button.is-loading .cse-product-add-to-cart-icon { opacity: 0; }

.cse-product-add-to-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex: 0 0 auto;
    transition: opacity .16s ease;
}
.cse-product-add-to-cart-icon i { font-size: 20px; line-height: 1; color: inherit; }
.cse-product-add-to-cart-icon svg { display: block; width: 20px; height: 20px; color: inherit; fill: currentColor; stroke: currentColor; }
.cse-product-add-to-cart-label { display: block; white-space: normal; text-align: center; }

.cse-product-add-to-cart-spinner {
    position: absolute;
    right: 22px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .38);
    border-top-color: currentColor;
    opacity: 0;
    visibility: hidden;
    animation: cseAtcSpin .7s linear infinite;
}
.cse-icon-left .cse-product-add-to-cart-spinner { right: auto; left: 22px; }
.cse-product-add-to-cart-button.is-loading .cse-product-add-to-cart-spinner { opacity: 1; visibility: visible; }

.cse-product-add-to-cart-disabled-tooltip {
    position: absolute;
    z-index: 40;
    right: 50%;
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: min(280px, 90vw);
    padding: 8px 11px;
    border-radius: 8px;
    background: #0d1b3f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    text-align: right;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(13, 27, 63, .22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(50%, 5px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.cse-product-add-to-cart-disabled-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 50%;
    margin-right: -5px;
    border: 5px solid transparent;
    border-top-color: #0d1b3f;
}
.cse-product-add-to-cart.is-disabled[data-disabled-reason]:not([data-disabled-reason=""]):hover .cse-product-add-to-cart-disabled-tooltip,
.cse-product-add-to-cart.is-disabled[data-disabled-reason]:not([data-disabled-reason=""]):focus .cse-product-add-to-cart-disabled-tooltip,
.cse-product-add-to-cart.is-disabled[data-disabled-reason]:not([data-disabled-reason=""]):focus-within .cse-product-add-to-cart-disabled-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(50%, 0);
}

.cse-product-add-to-cart-feedback {
    display: block;
    min-height: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}
.cse-product-add-to-cart-feedback.is-success { color: #15803d; }
.cse-product-add-to-cart-feedback.is-error { color: #dc2626; }

.cse-product-add-to-cart-editor-note {
    padding: 14px 16px;
    border: 1px dashed #93c5fd;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.8;
    text-align: right;
}

.cse-product-add-to-cart > .added_to_cart.wc-forward,
.cse-product-add-to-cart .cse-product-add-to-cart-button ~ .added_to_cart.wc-forward { display: none !important; }

@keyframes cseAtcSpin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
    .cse-product-add-to-cart-button { min-height: 50px; padding: 13px 18px !important; font-size: 14px; }
    .cse-product-add-to-cart-disabled-tooltip { max-width: min(250px, 86vw); }
}

@media (prefers-reduced-motion: reduce) {
    .cse-product-add-to-cart-button,
    .cse-product-add-to-cart-icon,
    .cse-product-add-to-cart-disabled-tooltip { transition: none; }
    .cse-product-add-to-cart-spinner { animation: none; }
}
.cse-native-variation-form{position:absolute!important;inset:0 auto auto 0!important;width:1px!important;max-width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;opacity:0!important;pointer-events:none!important}

.cse-product-add-to-cart{max-width:100%;box-sizing:border-box}.cse-product-add-to-cart-disabled-tooltip{width:min(280px,calc(100vw - 24px));max-width:calc(100vw - 24px);box-sizing:border-box}

/* Integrated quantity selector ------------------------------------------------
 * Uses WooCommerce's real quantity input, but keeps the visual wrapper local
 * to this widget. No viewport/off-canvas hacks are used, so it cannot create
 * horizontal page scroll. */
.cse-product-add-to-cart-main {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}
.cse-product-add-to-cart.has-quantity .cse-product-add-to-cart-main {
    direction: ltr;
}
.cse-product-add-to-cart.has-quantity .cse-product-add-to-cart-button {
    direction: rtl;
}
.cse-product-add-to-cart.cse-qty-position-top .cse-product-add-to-cart-main,
.cse-product-add-to-cart.cse-qty-position-bottom .cse-product-add-to-cart-main {
    flex-direction: column;
    align-items: flex-start;
}
.cse-product-add-to-cart.is-full-width .cse-product-add-to-cart-main {
    width: 100%;
}
.cse-product-add-to-cart.is-full-width.has-quantity.cse-qty-position-left .cse-product-add-to-cart-button,
.cse-product-add-to-cart.is-full-width.has-quantity.cse-qty-position-right .cse-product-add-to-cart-button {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}
.cse-product-add-to-cart.is-full-width.has-quantity.cse-qty-position-top .cse-product-add-to-cart-button,
.cse-product-add-to-cart.is-full-width.has-quantity.cse-qty-position-bottom .cse-product-add-to-cart-button {
    width: 100%;
}

.cse-product-add-to-cart .cse-product-quantity {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    flex: 0 0 auto;
    width: 126px;
    max-width: 100%;
    min-height: 52px;
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    direction: ltr;
    overflow: hidden;
}
.cse-product-add-to-cart .cse-product-quantity .quantity {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0 !important;
}
.cse-product-add-to-cart .cse-product-quantity input.qty {
    appearance: textfield;
    -moz-appearance: textfield;
    display: block;
    width: 42px !important;
    min-width: 0;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #111827;
    box-shadow: none !important;
    outline: 0;
    font: inherit;
    font-weight: 800;
    text-align: center;
    box-sizing: border-box;
}
.cse-product-add-to-cart .cse-product-quantity input.qty::-webkit-outer-spin-button,
.cse-product-add-to-cart .cse-product-quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cse-product-add-to-cart .cse-product-quantity-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #111827;
    box-shadow: none !important;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s ease, opacity .16s ease;
}
.cse-product-add-to-cart .cse-product-quantity-btn:hover,
.cse-product-add-to-cart .cse-product-quantity-btn:focus-visible {
    background: rgba(15, 23, 42, .055) !important;
    outline: 0;
}
.cse-product-add-to-cart .cse-product-quantity-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .cse-product-add-to-cart.has-quantity.cse-qty-position-left .cse-product-add-to-cart-main,
    .cse-product-add-to-cart.has-quantity.cse-qty-position-right .cse-product-add-to-cart-main {
        width: 100%;
    }
    .cse-product-add-to-cart .cse-product-quantity { min-height: 50px; }
}
