/* ==========================================================================
   Flatsome B2B Bulk Variation Order Modal
   Theme Colors: Primary #0b2545 (Navy) & Secondary #fe6500 (Orange)
   ========================================================================== */

/* --- Modal Overlay & Dialog --- */
.b2b-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 37, 69, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.b2b-modal-overlay.b2b-active {
    opacity: 1;
    visibility: visible;
}

.b2b-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 600px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(11, 37, 69, 0.25);
    overflow: hidden;
    transform: translateY(-15px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.b2b-modal-overlay.b2b-active .b2b-modal-dialog {
    transform: translateY(0) scale(1);
}

/* --- Modal Header --- */
.b2b-modal-header {
    background: linear-gradient(135deg, #0b2545 0%, #163e72 100%);
    border-bottom: 2px solid #fe6500;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.b2b-modal-title {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    margin: 0 !important;
    text-transform: uppercase;
    text-align: center;
}

.b2b-modal-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.b2b-modal-close:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* --- Modal Body --- */
.b2b-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Loading Spinner */
.b2b-loading-spinner {
    text-align: center;
    padding: 35px 20px;
}

.b2b-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #fe6500;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    animation: b2b-spin 0.8s linear infinite;
}

@keyframes b2b-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.b2b-loading-spinner p {
    color: #64748b;
    font-size: 13.5px;
    margin: 0;
}

/* Product Info Bar */
.b2b-product-info-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
}

.b2b-product-thumb {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.b2b-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.b2b-product-meta {
    flex: 1;
}

.b2b-product-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0b2545 !important;
    margin: 0 0 3px 0 !important;
    text-transform: uppercase;
}

.b2b-product-desc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
}

/* Matrix Table */
.b2b-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.b2b-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.b2b-matrix-table th {
    background-color: #f8fafc;
    color: #0b2545;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    padding: 10px 8px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: capitalize;
}

.b2b-matrix-table th:first-child {
    text-align: left;
    padding-left: 14px;
}

.b2b-matrix-table td {
    padding: 10px 8px;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
}

.b2b-matrix-table td:first-child {
    text-align: left;
    padding-left: 14px;
    font-weight: 700;
    color: #0b2545;
}

.b2b-matrix-table tr:last-child td {
    border-bottom: none;
}

.b2b-matrix-table tr:hover td {
    background-color: #f8fafc;
}

/* Input Quantity */
.b2b-qty-input {
    width: 55px !important;
    height: 32px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
    text-align: center !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #0b2545 !important;
    margin: 0 !important;
    padding: 0 4px !important;
    outline: none !important;
    transition: border-color 0.2s;
}

.b2b-qty-input:focus {
    border-color: #fe6500 !important;
    box-shadow: 0 0 0 2px rgba(254, 101, 0, 0.2);
}

/* Action Steppers */
.b2b-action-steppers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.b2b-step-btn {
    width: 28px;
    height: 28px;
    border-radius: 50% !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.15s ease;
}

.b2b-step-minus {
    background-color: #f1f5f9 !important;
    color: #0b2545 !important;
}

.b2b-step-minus:hover:not(:disabled) {
    background-color: #e2e8f0 !important;
}

.b2b-step-plus {
    background-color: #fe6500 !important;
    color: #ffffff !important;
}

.b2b-step-plus:hover:not(:disabled) {
    background-color: #e05800 !important;
}

.b2b-step-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Modal Footer --- */
.b2b-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.b2b-footer-summary {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 13.5px;
    color: #475569;
}

.b2b-summary-label {
    font-weight: 500;
}

.b2b-summary-total {
    font-size: 18px;
    font-weight: 700;
    color: #fe6500;
}

.b2b-summary-count {
    color: #64748b;
    font-size: 12.5px;
}

/* Submit Add to Cart Button */
.b2b-btn-submit {
    background-color: #fe6500 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 9px 20px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 3px 8px rgba(254, 101, 0, 0.25);
    transition: all 0.2s ease;
    margin: 0 !important;
}

.b2b-btn-submit:hover:not(:disabled) {
    background-color: #e05800 !important;
    box-shadow: 0 4px 12px rgba(254, 101, 0, 0.35);
    transform: translateY(-1px);
}

.b2b-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Floating Success Notification on Body */
.b2b-floating-notice {
    position: fixed;
    top: 25px;
    right: 25px;
    background-color: #0b2545;
    color: #ffffff;
    border-left: 4px solid #fe6500;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(11, 37, 69, 0.35);
    z-index: 1000000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    animation: b2b-slide-in 0.3s ease;
}

.b2b-floating-notice a {
    color: #fe6500;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 5px;
}

.b2b-floating-notice a:hover {
    color: #ffa050;
}

@keyframes b2b-slide-in {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loop button style */
.b2b-loop-btn-wrap {
    margin-top: 6px;
}

.b2b-open-modal-btn {
    width: 100%;
    margin-bottom: 0 !important;
    border-radius: 5px !important;
    background-color: #fe6500 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    padding: 7px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-transform: none !important;
    border: none !important;
    transition: background-color 0.2s, transform 0.1s !important;
    cursor: pointer;
}

.b2b-open-modal-btn:hover {
    background-color: #0b2545 !important;
    color: #ffffff !important;
}

/* Single product trigger button */
.b2b-single-btn-wrap .b2b-open-modal-btn {
    width: auto;
    font-size: 13.5px !important;
    padding: 9px 18px !important;
    border-radius: 6px !important;
    background-color: #0b2545 !important;
}

.b2b-single-btn-wrap .b2b-open-modal-btn:hover {
    background-color: #fe6500 !important;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .b2b-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .b2b-btn-submit {
        justify-content: center;
        width: 100%;
    }
    .b2b-footer-summary {
        justify-content: space-between;
    }
    .b2b-matrix-table th, 
    .b2b-matrix-table td {
        padding: 8px 5px;
        font-size: 12.5px;
    }
    .b2b-qty-input {
        width: 44px !important;
        height: 30px !important;
        font-size: 12.5px !important;
    }
    .b2b-step-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

/* Sold count styling */
span._da_ban {
    display: inline-block !important;
    font-size: 12px !important;
    color: #fe6500 !important;
    font-weight: 700 !important;
    margin-left: auto;
}
.hpt-single-sold {
    color: #fe6500 !important;
    font-weight: 600 !important;
}


/* ==========================================================================
   B2B Private Pricing (Guest Login to View Price & Order)
   ========================================================================== */

/* Price notice on loops and single products */
.b2b-login-price-notice {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #fe6500 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
    cursor: pointer !important;
}

.b2b-login-price-notice i {
    font-size: 12px;
}

.b2b-login-price-notice:hover {
    color: #0b2545 !important;
    text-decoration: underline !important;
}

/* Loop button for guests */
.b2b-loop-login-btn-wrap {
    margin-top: 6px;
    display: block;
}

.b2b-login-trigger-btn {
    border-radius: 5px !important;
    border: 1.5px solid #0b2545 !important;
    background-color: transparent !important;
    color: #0b2545 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-transform: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.b2b-login-trigger-btn:hover {
    background-color: #0b2545 !important;
    color: #ffffff !important;
    border-color: #0b2545 !important;
}

/* Single Product B2B Login Box */
.b2b-login-box-single {
    margin: 15px 0 20px 0;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
}

.b2b-login-box-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.b2b-login-box-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff3eb;
    color: #fe6500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.b2b-login-box-info h4 {
    margin: 0 0 4px 0 !important;
    color: #0b2545 !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
}

.b2b-login-box-info p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.5;
}

.b2b-sizes-preview {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.b2b-sizes-title {
    font-size: 12px;
    font-weight: 600;
    color: #0b2545;
}

.b2b-size-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #0b2545;
    font-size: 11px;
    font-weight: 700;
}

.b2b-single-login-btn {
    background-color: #fe6500 !important;
    border-color: #fe6500 !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 10px 18px !important;
    text-transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    transition: background-color 0.2s, border-color 0.2s !important;
}

.b2b-single-login-btn:hover {
    background-color: #0b2545 !important;
    border-color: #0b2545 !important;
    color: #ffffff !important;
}


/* ==========================================================================
   Flatsome Login Form Popup Modern B2B Styling
   Theme Colors: #0b2545 (Navy Primary) & #fe6500 (Orange Secondary)
   ========================================================================== */

#login-form-popup {
    max-width: 440px !important;
    width: 95% !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(11, 37, 69, 0.3) !important;
    overflow: hidden !important;
    margin: 20px auto !important;
    position: relative !important;
}

#login-form-popup .lightbox-inner,
#login-form-popup .account-login-inner {
    padding: 0 !important;
    margin: 0 !important;
}

/* Header Banner with Navy gradient & Orange accent border */
#login-form-popup .account-login-inner h2.uppercase.h3 {
    background: linear-gradient(135deg, #0b2545 0%, #163e72 100%) !important;
    border-bottom: 3px solid #fe6500 !important;
    color: #ffffff !important;
    padding: 22px 20px 18px 20px !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 16.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    position: relative !important;
}

#login-form-popup .account-login-inner h2.uppercase.h3::after {
    content: "Đăng nhập tài khoản đại lý để xem giá sỉ & đặt hàng";
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: #cbd5e1;
    margin-top: 5px;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
}

/* Close Button (Magnific Popup) */
#login-form-popup button.mfp-close,
.mfp-wrap #login-form-popup + button.mfp-close,
.mfp-wrap .lightbox-white .mfp-close {
    color: #ffffff !important;
    top: 6px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    font-size: 26px !important;
    opacity: 0.85 !important;
    transition: opacity 0.2s, transform 0.2s !important;
    background: transparent !important;
}

#login-form-popup button.mfp-close:hover,
.mfp-wrap #login-form-popup + button.mfp-close:hover,
.mfp-wrap .lightbox-white .mfp-close:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Form Container */
#login-form-popup form.woocommerce-form-login {
    padding: 22px 26px 22px 26px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border: none !important;
}

/* Labels */
#login-form-popup form.woocommerce-form-login label {
    color: #0b2545 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    display: block !important;
}

#login-form-popup form.woocommerce-form-login label span.required {
    color: #ef4444 !important;
    font-weight: 700;
}

/* Input Fields */
#login-form-popup form.woocommerce-form-login input.input-text {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    padding: 10px 14px !important;
    height: 44px !important;
    font-size: 14px !important;
    color: #0f172a !important;
    box-shadow: none !important;
    margin-bottom: 12px !important;
    width: 100% !important;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s !important;
}

#login-form-popup form.woocommerce-form-login input.input-text:focus {
    border-color: #fe6500 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(254, 101, 0, 0.15) !important;
    outline: none !important;
}

/* Remember me row */
#login-form-popup .woocommerce-form-login__rememberme {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    margin-bottom: 10px !important;
}

#login-form-popup .woocommerce-form-login__rememberme input[type="checkbox"] {
    margin: 0 !important;
    cursor: pointer;
    accent-color: #fe6500;
}

/* Submit Button */
#login-form-popup button.woocommerce-form-login__submit {
    width: 100% !important;
    height: 44px !important;
    background-color: #fe6500 !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    margin: 8px 0 12px 0 !important;
    box-shadow: 0 4px 14px rgba(254, 101, 0, 0.28) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#login-form-popup button.woocommerce-form-login__submit:hover {
    background-color: #0b2545 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(11, 37, 69, 0.25) !important;
}

/* Lost Password Link */
#login-form-popup .lost_password {
    text-align: center !important;
    margin: 0 0 14px 0 !important;
}

#login-form-popup .lost_password a {
    color: #64748b !important;
    font-size: 13px !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

#login-form-popup .lost_password a:hover {
    color: #fe6500 !important;
    text-decoration: underline !important;
}

/* Register Footer CTA */
.b2b-login-footer-cta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.b2b-login-footer-cta .b2b-register-now-link {
    color: #fe6500 !important;
    font-weight: 700 !important;
    margin-left: 5px;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.b2b-login-footer-cta .b2b-register-now-link:hover {
    color: #0b2545 !important;
    text-decoration: underline !important;
}

/* WooCommerce error notice in popup */
#login-form-popup .woocommerce-notices-wrapper .woocommerce-error {
    margin: 14px 26px 0 26px !important;
    padding: 10px 14px !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fee2e2 !important;
    border-left: 4px solid #ef4444 !important;
    border-radius: 6px !important;
    color: #b91c1c !important;
    font-size: 13px !important;
}


/* ==========================================================================
   B2B Loop Size & Stock Badges (Chips)
   ========================================================================== */

.b2b-loop-stock-wrap {
    margin: 6px 0 8px 0;
    width: 100%;
}

.b2b-loop-stock-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.b2b-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0b2545;
    transition: all 0.15s ease;
}

.b2b-stock-pill:hover {
    border-color: #0b2545;
    background-color: #ffffff;
}

.b2b-pill-size {
    font-weight: 700;
    color: #0b2545;
}

.b2b-pill-qty {
    color: #fe6500;
    font-weight: 600;
}

.b2b-stock-pill.is-out {
    background-color: #f1f5f9;
    border-color: #f1f5f9;
    color: #94a3b8;
    text-decoration: line-through;
    opacity: 0.7;
}

.b2b-stock-pill.is-out .b2b-pill-size,
.b2b-stock-pill.is-out .b2b-pill-qty {
    color: #94a3b8;
}

/* ==========================================================================
   B2B Dual Pricing Display (Giá Sỉ & Giá Lẻ)
   ========================================================================== */

.b2b-dual-price {
    margin: 4px 0 8px 0;
    width: 100%;
}

.b2b-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}

.b2b-retail-row .b2b-price-tag {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 500;
}

.b2b-retail-row .b2b-retail-amt {
    color: #0b2545;
    font-size: 13px;
    font-weight: 600;
}

.b2b-wholesale-row .b2b-wholesale-tag {
    color: #0b2545;
    font-size: 11.5px;
    font-weight: 700;
    background: #fff3eb;
    border: 1px solid #fed7aa;
    padding: 1px 6px;
    border-radius: 3px;
}

.b2b-wholesale-row .b2b-wholesale-amt {
    color: #fe6500;
    font-size: 14.5px;
    font-weight: 700;
}

/* Modal Pricing styles */
.b2b-matrix-price-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.b2b-matrix-ws-price {
    font-weight: 700;
    color: #fe6500;
    font-size: 13px;
}

.b2b-matrix-rt-price {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
}

.b2b-modal-pricing-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff8f3;
    border: 1px dashed #fe6500;
    border-radius: 4px;
    font-size: 12px;
    color: #0b2545;
    margin-top: 6px;
}

.b2b-modal-pricing-tip .b2b-tip-icon {
    color: #fe6500;
}

.b2b-tier-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
}

.b2b-tier-wholesale {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.b2b-tier-retail {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.b2b-summary-row-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}
