/**
 * RPS Quantity Guard — large-order confirmation modal + disabled Add-to-Cart
 * state when quantity < 1. Shared by the product page and the cart/checkout.
 */

/* Add to Cart disabled because quantity is 0/empty/invalid. Uses a class (not
   the disabled property) so it layers cleanly on top of the shipping gate
   without fighting over the button's disabled state. */
.single_add_to_cart_button.rps-qty-blocked {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    filter: grayscale(0.2);
}

/* ---- modal ---- */
.rps-qg-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 20, 33, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: rps-qg-fade 0.18s ease;
}
body.rps-qg-open { overflow: hidden; }

.rps-qg-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 26px 26px 22px;
    box-shadow: 0 24px 60px -18px rgba(12, 20, 33, 0.55);
    font-family: inherit;
    text-align: left;
    animation: rps-qg-pop 0.22s cubic-bezier(0.34, 1.56, 0.5, 1);
}

.rps-qg-x {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #8a97a6;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}
.rps-qg-x:hover { background: #f1f4f7; color: #41505f; }

.rps-qg-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #0c1421;
    padding-right: 24px;
}
.rps-qg-msg {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.5;
    color: #41505f;
}

.rps-qg-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.rps-qg-actions button {
    appearance: none;
    border: 0;
    border-radius: 9px;
    /* flex-center the label so it stays centered regardless of the theme's
       global button line-height / min-height. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2px;
    text-align: center;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.rps-qg-cancel {
    background: #eef1f5;
    color: #41505f;
}
.rps-qg-cancel:hover { background: #e2e7ee; }
.rps-qg-confirm {
    background: var(--rps-qg-brand, #00b9ff);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(0, 150, 210, 0.8);
}
.rps-qg-confirm:hover { background: var(--rps-qg-brand-hover, #00a3e0); }
.rps-qg-confirm:focus-visible,
.rps-qg-cancel:focus-visible {
    outline: 2px solid var(--rps-qg-brand, #00b9ff);
    outline-offset: 2px;
}

@keyframes rps-qg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rps-qg-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rps-qg-overlay, .rps-qg-box { animation: none; }
}
