/* ══════════════════════════════════════════════
   BLING GIRL - QUANTITY SELECTOR MODAL
   Beautiful wholesale quantity picker UI
   ══════════════════════════════════════════════ */

/* ═══ MODAL OVERLAY ═══ */
.bg-qty-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 8, 46, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bg-qty-overlay.bg-qty-active {
    opacity: 1;
    visibility: visible;
}

/* ═══ MODAL CONTAINER ═══ */
.bg-qty-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 80px rgba(144, 48, 135, 0.25), 0 0 0 1px rgba(144, 48, 135, 0.05);
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

.bg-qty-overlay.bg-qty-active .bg-qty-modal {
    transform: scale(1) translateY(0);
}

/* ═══ MODAL HEADER ═══ */
.bg-qty-modal-header {
    background: linear-gradient(135deg, #903087 0%, #6e2568 50%, #4a1a45 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.bg-qty-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 140px;
    height: 140px;
    background: rgba(215, 202, 73, 0.1);
    border-radius: 50%;
}

.bg-qty-modal-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 100px;
    height: 100px;
    background: rgba(215, 202, 73, 0.06);
    border-radius: 50%;
}

.bg-qty-product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(215, 202, 73, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.bg-qty-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-qty-product-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.bg-qty-product-name {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-qty-product-price {
    color: #d7ca49;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
}

.bg-qty-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
    line-height: 1;
}

.bg-qty-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: rotate(90deg);
}

/* ═══ MODAL BODY ═══ */
.bg-qty-modal-body {
    padding: 24px;
}

/* Min qty badge */
.bg-qty-min-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border: 1px solid rgba(144, 48, 135, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.bg-qty-min-badge i {
    color: #903087;
    font-size: 14px;
}

.bg-qty-min-badge span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #6e2568;
    font-weight: 500;
}

.bg-qty-min-badge strong {
    color: #903087;
    font-weight: 700;
}

/* Quantity label */
.bg-qty-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a1a45;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    display: block;
}

/* ═══ QUANTITY CONTROL ═══ */
.bg-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f6fa;
    border-radius: 14px;
    padding: 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.bg-qty-control:focus-within {
    border-color: rgba(144, 48, 135, 0.3);
    box-shadow: 0 0 0 4px rgba(144, 48, 135, 0.08);
}

.bg-qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.bg-qty-btn-minus {
    background: #fff;
    color: #903087;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bg-qty-btn-minus:hover:not(:disabled) {
    background: #903087;
    color: #fff;
    box-shadow: 0 4px 12px rgba(144, 48, 135, 0.3);
}

.bg-qty-btn-minus:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.bg-qty-btn-plus {
    background: #fff;
    color: #903087;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bg-qty-btn-plus:hover {
    background: #903087;
    color: #fff;
    box-shadow: 0 4px 12px rgba(144, 48, 135, 0.3);
}

.bg-qty-input-wrap {
    flex: 1;
    text-align: center;
    position: relative;
}

.bg-qty-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a0a2e;
    padding: 6px 0;
    outline: none;
    -moz-appearance: textfield;
}

.bg-qty-input::-webkit-outer-spin-button,
.bg-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bg-qty-input-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: -2px;
}

/* ═══ QUICK QTY BUTTONS ═══ */
.bg-qty-quick-picks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.bg-qty-quick-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 6px;
    border: 1.5px solid #e8e2ee;
    border-radius: 10px;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6e2568;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.2;
}

.bg-qty-quick-btn span {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: #999;
    margin-top: 2px;
}

.bg-qty-quick-btn:hover,
.bg-qty-quick-btn.active {
    background: linear-gradient(135deg, #903087, #6e2568);
    color: #fff;
    border-color: #903087;
    box-shadow: 0 4px 12px rgba(144, 48, 135, 0.25);
}

.bg-qty-quick-btn:hover span,
.bg-qty-quick-btn.active span {
    color: rgba(255, 255, 255, 0.7);
}

/* ═══ TOTAL PRICE ═══ */
.bg-qty-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(144, 48, 135, 0.08);
}

.bg-qty-total-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #6e2568;
    font-weight: 500;
}

.bg-qty-total-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    color: #903087;
    font-weight: 700;
}

/* ═══ WHOLESALE NOTE ═══ */
.bg-qty-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(215, 202, 73, 0.2);
}

.bg-qty-note i {
    color: #bfb33a;
    font-size: 16px;
    flex-shrink: 0;
}

.bg-qty-note span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    color: #7c6f1a;
    font-weight: 500;
}

/* ═══ ACTION BUTTONS ═══ */
.bg-qty-actions {
    display: flex;
    gap: 10px;
}

.bg-qty-add-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #903087, #6e2568);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.bg-qty-add-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #d7ca49, #bfb33a);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bg-qty-add-btn:hover::before {
    opacity: 1;
}

.bg-qty-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(144, 48, 135, 0.35);
    color: #1a0a2e;
}

.bg-qty-add-btn i,
.bg-qty-add-btn span {
    position: relative;
    z-index: 1;
}

.bg-qty-add-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none !important;
}

.bg-qty-add-btn.bg-qty-loading i {
    animation: bgSpin 0.8s linear infinite;
}

@keyframes bgSpin {
    to { transform: rotate(360deg); }
}

/* ═══ SUCCESS STATE ═══ */
.bg-qty-success {
    text-align: center;
    padding: 30px 24px;
}

.bg-qty-success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: bgPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bg-qty-success-icon i {
    color: #fff;
    font-size: 28px;
}

@keyframes bgPop {
    0% { transform: scale(0); }
    80% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.bg-qty-success-msg {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.bg-qty-success-sub {
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    color: #8a8a8a;
    margin-bottom: 24px;
}

.bg-qty-success-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.bg-qty-success-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.bg-qty-success-btn-primary {
    background: linear-gradient(135deg, #903087, #6e2568);
    color: #fff;
}

.bg-qty-success-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(144, 48, 135, 0.3);
    color: #fff;
}

.bg-qty-success-btn-secondary {
    background: #f3e8ff;
    color: #6e2568;
}

.bg-qty-success-btn-secondary:hover {
    background: #e8d5f5;
}

.bg-qty-success-btn-ghost {
    background: transparent;
    color: #8a8a8a;
    font-weight: 500;
}

.bg-qty-success-btn-ghost:hover {
    color: #903087;
}

/* ═══ SHOW MIN QTY BADGE ON PRODUCT CARDS ═══ */
.bg-min-qty-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, rgba(144, 48, 135, 0.92), rgba(74, 26, 69, 0.95));
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 5;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bg-min-qty-tag i {
    font-size: 9px;
    color: #d7ca49;
}

/* ═══ PRODUCT CARD ADD TO CART BUTTON OVERRIDE ═══ */
.bg-product-card .bg-product-overlay .add_to_cart_button,
.bg-product-card .bg-product-overlay .button,
.bg-qty-trigger {
    cursor: pointer;
}

/* ═══ CUSTOM SELECT-QUANTITY TRIGGER BUTTON (replaces <a> for min-qty products) ═══ */
button.bg-qty-trigger {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(135deg, #d7ca49 0%, #bfb33a 100%) !important;
    color: #1a0a2e !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    line-height: 1.4 !important;
    min-height: 46px;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    margin: 0 !important;
}
button.bg-qty-trigger:hover {
    box-shadow: 0 6px 20px rgba(215, 202, 73, 0.45) !important;
    transform: translateY(-2px) !important;
}

/* Fix height consistency for ALL overlay buttons */
.bg-wc-card .bg-product-overlay .button,
.bg-wc-card .bg-product-overlay .add_to_cart_button,
.bg-wc-card .bg-product-overlay a.added_to_cart,
.bg-wc-card .bg-product-overlay .bg-product-overlay-btn,
.bg-wc-card .bg-product-overlay button.bg-qty-trigger {
    min-height: 46px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ═══ TOAST NOTIFICATION ═══ */
.bg-qty-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #fff;
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(144, 48, 135, 0.08);
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 360px;
}

.bg-qty-toast.bg-qty-toast-show {
    transform: translateX(0);
}

.bg-qty-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bg-qty-toast-icon.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.bg-qty-toast-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.bg-qty-toast-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.4;
}

.bg-qty-toast-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    margin-left: auto;
    flex-shrink: 0;
}

.bg-qty-toast-close:hover {
    color: #333;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    .bg-qty-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .bg-qty-modal {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        transform: translateY(100%);
    }

    .bg-qty-overlay.bg-qty-active .bg-qty-modal {
        transform: translateY(0);
    }

    .bg-qty-modal-header {
        padding: 18px 20px;
    }

    .bg-qty-product-thumb {
        width: 56px;
        height: 56px;
    }

    .bg-qty-modal-body {
        padding: 20px;
    }

    .bg-qty-btn {
        width: 40px;
        height: 40px;
    }

    .bg-qty-input {
        font-size: 1.3rem;
    }

    .bg-qty-quick-picks {
        gap: 5px;
    }

    .bg-qty-quick-btn {
        min-width: 55px;
        padding: 7px 4px;
        font-size: 0.72rem;
    }

    .bg-qty-toast {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

@media (max-width: 360px) {
    .bg-qty-quick-picks {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}
