/* ==========================================
   Buy Now Popup — Quick Order v1.2
   ========================================== */

/* Overlay — hidden by default via CSS (+ JS safety on ready) */
#buy-now-popup-overlay {
    display: none;
}

.bnp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
    animation: bnpFadeIn 0.2s ease;
}

@keyframes bnpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bnp-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 28px 28px 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: bnpSlideUp 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes bnpSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.bnp-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.bnp-close:hover {
    background: #f3f3f3;
    color: #333;
}

/* Product row */
.bnp-product-row {
    display: flex;
    gap: 18px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.bnp-image-wrap {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ebebeb;
}

.bnp-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bnp-product-info {
    flex: 1;
    min-width: 0;
}

.bnp-product-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    line-height: 1.35 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    border: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.bnp-price-wrap {
    margin-bottom: 8px;
}
.bnp-price-wrap .price {
    font-size: 16px !important;
    font-weight: 700 !important;
}
.bnp-price-wrap .price del {
    font-size: 13px !important;
    color: #aaa !important;
    font-weight: 400 !important;
    text-decoration: line-through;
    margin-right: 6px;
}
.bnp-price-wrap .price ins {
    color: #e03e3e !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

/* Size */
.bnp-size-tag {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

/* Form */
.bnp-form-wrap {
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.bnp-label {
    display: block;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #444 !important;
    margin-bottom: 8px !important;
    letter-spacing: 0.01em;
}

.bnp-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px !important;
    border: 1.5px solid #d8d8d8 !important;
    border-radius: 10px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.18s;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}
.bnp-input:focus {
    border-color: #1a1a1a !important;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08) !important;
}
.bnp-input.bnp-input-error {
    border-color: #e03e3e !important;
}

.bnp-error {
    color: #e03e3e;
    font-size: 12px;
    margin-top: 5px;
}

/* Submit */
.bnp-submit {
    display: block !important;
    width: 100% !important;
    margin-top: 16px !important;
    height: 52px;
    background: #1a1a1a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.18s, transform 0.1s !important;
    letter-spacing: 0.01em;
    font-family: inherit;
}
.bnp-submit:hover    { background: #333 !important; }
.bnp-submit:active   { transform: scale(0.98); }
.bnp-submit:disabled { background: #999 !important; cursor: not-allowed !important; }

/* Success */
.bnp-success {
    margin-top: 16px;
    background: #edfaf3;
    border: 1px solid #a8dfc0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    color: #1a6e42;
    font-weight: 500;
    line-height: 1.5;
}

/* Skeleton loader */
.bnp-skeleton {
    background: #f0f0f0;
    border-radius: 6px;
    animation: bnpPulse 1.2s ease-in-out infinite;
}
@keyframes bnpPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* Body scroll lock */
body.bnp-body-lock {
    overflow: hidden !important;
}

/* Mobile */
@media (max-width: 480px) {
    .bnp-modal {
        padding: 20px 18px 24px;
        border-radius: 14px;
    }
    .bnp-image-wrap {
        width: 86px;
        height: 86px;
    }
    .bnp-product-title {
        font-size: 14px !important;
    }
}
