/* --- Buy Now Button --- */
.qbp_buy_now_button {
    background-color: #ff6600 !important;
    color: #ffffff !important;
    margin-left: 10px !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    border: none !important;
    line-height: 1.5 !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255,102,0,0.2);
}

.qbp_buy_now_button:hover {
    background-color: #e65c00 !important;
    box-shadow: 0 6px 16px rgba(255,102,0,0.3);
    transform: translateY(-2px);
}

/* --- Modal Overlay --- */
#qbp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Darker overlay */
    z-index: 100000;
}

/* --- Modal Wrapper --- */
#qbp-modal-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 850px; /* Wider modal */
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px; /* Softer radius */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 100001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Modal Content --- */
#qbp-modal-content {
    padding: 30px 40px; /* More padding */
    overflow-y: auto;
    flex-grow: 1;
}

/* --- Modal Close Button --- */
#qbp-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f0f0f0;
    border: none;
    font-size: 20px;
    color: #777;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
#qbp-modal-close:hover {
    color: #111;
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* --- Modal Header --- */
.qbp-modal-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 30px;
    padding-right: 30px; /* Space for close button */
}

/* --- Form Layout --- */
.qbp-form-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
}
.qbp-billing-fields,
.qbp-order-details {
    flex: 1;
    min-width: 300px;
}

/* --- Section Headers --- */
.qbp-billing-fields h4,
.qbp-shipping-methods h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* --- Form Fields Styling --- */
.qbp-form-row-wrapper .form-row {
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
}
.qbp-form-row-wrapper .woocommerce-input-wrapper {
    width: 100%;
}
/* Main Field Styles */
.qbp-form-row-wrapper input.input-text,
.qbp-form-row-wrapper textarea,
.qbp-form-row-wrapper .select2-container .select2-selection--single {
    border: 1px solid #ddd !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    width: 100% !important;
    box-shadow: none !important;
    font-size: 15px;
    background: #f9f9f9 !important;
    transition: all 0.2s ease-in-out;
}
.qbp-form-row-wrapper textarea {
    height: 90px;
}
/* Field Focus State */
.qbp-form-row-wrapper input.input-text:focus,
.qbp-form-row-wrapper textarea:focus,
.qbp-form-row-wrapper .select2-container--open .select2-selection--single {
    background: #fff !important;
    border-color: #ff6600 !important;
    box-shadow: 0 0 0 3px rgba(255,102,0,0.15) !important;
    outline: none;
}
/* Field Labels */
.qbp-form-row-wrapper label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px !important;
}
.qbp-form-row-wrapper label .required {
    color: red;
    font-weight: bold;
}
.qbp-form-row-wrapper.woocommerce-form-row--wide {
    padding-left: 0;
}
/* Select2 (Country/State) specific styles */
.qbp-form-row-wrapper .select2-container .select2-selection--single {
    height: 50px !important;
}
.qbp-form-row-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px !important;
    padding-left: 18px !important;
    padding-right: 30px !important;
}
.qbp-form-row-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 10px !important;
}

/* --- Shipping Methods --- */
.qbp-shipping-methods ul#shipping_method {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qbp-shipping-methods li {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    background: #fdfdfd;
    transition: all 0.2s ease;
    cursor: pointer;
}
.qbp-shipping-methods li:has(input:checked) {
    background: #fff;
    border-color: #ff6600;
    box-shadow: 0 2px 8px rgba(255,102,0,0.1);
}
.qbp-shipping-methods li input[type="radio"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}
.qbp-shipping-methods li label {
    flex-grow: 1;
    font-weight: 600;
    color: #333;
}
.qbp-shipping-methods li .amount {
    font-weight: 700;
    color: #000;
}

/* --- Coupon Form --- */
.qbp-coupon-form {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    margin-bottom: 25px;
}
.qbp-coupon-form input.input-text {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 15px;
    background: #f9f9f9;
}
.qbp-coupon-form button {
    background: #555;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s;
}
.qbp-coupon-form button:hover {
    background: #333;
}

/* --- Order Review Section --- */
#qbp-order-details .woocommerce-checkout-review-order {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e5e5;
}
.woocommerce-checkout-review-order table.shop_table {
    width: 100%;
    border-radius: 0;
    border: none;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0;
}
.woocommerce-checkout-review-order table.shop_table th,
.woocommerce-checkout-review-order table.shop_table td {
    padding: 14px 0; /* Remove side padding */
    border-top: 1px solid #e0e0e0;
    text-align: left;
}
.woocommerce-checkout-review-order table.shop_table thead th {
    border-top: none;
    font-size: 16px;
    color: #111;
    padding-top: 0;
}
.woocommerce-checkout-review-order table.shop_table tbody {
    font-size: 15px;
}
.woocommerce-checkout-review-order table.shop_table .product-name {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #333;
}
.woocommerce-checkout-review-order table.shop_table .product-name .product-thumbnail {
    width: 45px;
    height: 45px;
    margin-right: 12px;
}
.woocommerce-checkout-review-order table.shop_table .product-name .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.woocommerce-checkout-review-order table.shop_table .product-total {
    text-align: right;
    font-weight: 600;
}
/* Totals (Footer) */
.woocommerce-checkout-review-order table.shop_table tfoot tr:first-child th,
.woocommerce-checkout-review-order table.shop_table tfoot tr:first-child td {
    border-top: 2px solid #d0d0d0;
    padding-top: 15px;
}
.woocommerce-checkout-review-order table.shop_table tfoot th,
.woocommerce-checkout-review-order table.shop_table tfoot .amount {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}
.woocommerce-checkout-review-order table.shop_table tfoot tr.order-total th,
.woocommerce-checkout-review-order table.shop_table tfoot tr.order-total .amount {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

/* --- Order Notes --- */
.qbp-order-notes {
    margin-top: 25px;
}
.qbp-order-notes textarea {
    width: 100%;
    padding-left: 18px !important;
}
.qbp-order-notes label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px !important;
}


/* --- Submit Button --- */
.qbp-submit-wrapper {
    text-align: center;
    margin-top: 30px;
}
.qbp-submit-wrapper #qbp-place-order-btn {
    width: 100%;
    background: #ff6600;
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255,102,0,0.25);
}
.qbp-submit-wrapper #qbp-place-order-btn:hover {
    background: #e65c00;
    box-shadow: 0 6px 20px rgba(255,102,0,0.35);
    transform: translateY(-2px);
}
.qbp-submit-wrapper #qbp-place-order-btn.qbp-processing {
    opacity: 0.7;
    cursor: wait;
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255,102,0,0.25);
}
.qbp-submit-wrapper .qbp-helper-text {
    font-size: 14px;
    color: #555;
    margin-top: 12px;
    font-weight: 500;
}

/* --- Loader --- */
.qbp-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6600;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: qbp-spin 1s linear infinite;
    margin: 120px auto;
}
@keyframes qbp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Error/Success Messages --- */
#qbp-checkout-messages .woocommerce-error,
#qbp-checkout-messages .woocommerce-message,
#qbp-checkout-messages .woocommerce-info {
    background: #fde8e8;
    color: #c00;
    border: 1px solid #f9c9c9;
    padding: 15px 20px;
    border-radius: 10px;
    list-style: none;
    margin: 0 0 20px 0;
    font-size: 14px;
    font-weight: 500;
}
#qbp-checkout-messages .woocommerce-message {
    background: #eafbea;
    color: #008a00;
    border-color: #c9f9ca;
}
#qbp-checkout-messages .woocommerce-info {
    background: #e8f5fd;
    color: #005a8a;
    border-color: #c9e8f9;
}


/* --- Responsive --- */
@media (max-width: 768px) {
    #qbp-modal-wrapper {
        width: 95%;
        max-height: 95vh;
        top: 50%;
        border-radius: 12px;
    }
    #qbp-modal-content {
        padding: 25px 20px;
    }
    .qbp-modal-title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    .qbp-form-columns {
        flex-direction: column;
        gap: 25px;
    }
    .qbp-billing-fields,
    .qbp-order-details {
        min-width: 100%;
    }
    .qbp-submit-wrapper #qbp-place-order-btn {
        font-size: 16px;
        padding: 14px;
    }
    #qbp-order-details .woocommerce-checkout-review-order {
        padding: 20px;
    }
}

