/**
 * Checkout Widgets Styles - Modern Impeccable Design
 *
 * @package Magical_Shop_Builder
 * @since   2.0.0
 */

/* ==========================================================================
   Global Section Titles & Form Basics
   ========================================================================== */
.mpd-billing-form__title,
.mpd-shipping-form__title,
.mpd-order-review__title,
.mpd-payment-methods__title,
.mpd-order-notes__title,
.mpd-checkout-login__form-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* ==========================================================================
   Billing Form Widget
   ========================================================================== */
.mpd-billing-form {
    width: 100%;
}

.mpd-billing-form .form-row,
.mpd-billing-form .woocommerce-billing-fields .form-row {
    margin-bottom: 16px;
}

.mpd-billing-form .form-row label,
.mpd-billing-form .woocommerce-billing-fields label,
.mpd-billing-form .woocommerce-billing-fields .form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}

.mpd-billing-form .form-row .required,
.mpd-billing-form .woocommerce-billing-fields .required,
.mpd-shipping-form .form-row .required,
.mpd-shipping-form .woocommerce-shipping-fields .required {
    color: #ef4444;
    font-weight: 700;
    text-decoration: none;
    margin-left: 2px;
}

.mpd-billing-form .form-row input,
.mpd-billing-form .form-row select,
.mpd-billing-form .woocommerce-billing-fields input.input-text,
.mpd-billing-form .woocommerce-billing-fields select,
.mpd-billing-form .woocommerce-billing-fields textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.mpd-billing-form .form-row input:focus,
.mpd-billing-form .form-row select:focus,
.mpd-billing-form .woocommerce-billing-fields input.input-text:focus,
.mpd-billing-form .woocommerce-billing-fields select:focus,
.mpd-billing-form .woocommerce-billing-fields textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mpd-billing-form .form-row-first,
.mpd-billing-form .form-row-last {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.mpd-billing-form .form-row-first {
    margin-right: 4%;
}

.mpd-billing-form .form-row-wide {
    width: 100%;
}

/* ==========================================================================
   Shipping Form Widget
   ========================================================================== */
.mpd-shipping-form {
    width: 100%;
}

.mpd-shipping-form__toggle {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mpd-shipping-form__toggle:hover {
    background: #f1f5f9;
}

.mpd-shipping-form__toggle-checkbox {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
    cursor: pointer;
}

.mpd-shipping-form__toggle-label {
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.mpd-shipping-form__fields {
    display: none;
}

.mpd-shipping-form__fields--visible {
    display: block;
}

.mpd-shipping-form .form-row,
.mpd-shipping-form .woocommerce-shipping-fields .form-row {
    margin-bottom: 16px;
}

.mpd-shipping-form .form-row label,
.mpd-shipping-form .woocommerce-shipping-fields label,
.mpd-shipping-form .woocommerce-shipping-fields .form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}

.mpd-shipping-form .woocommerce-shipping-fields label {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
}

.mpd-shipping-form .form-row input,
.mpd-shipping-form .form-row select,
.mpd-shipping-form .woocommerce-shipping-fields input.input-text,
.mpd-shipping-form .woocommerce-shipping-fields select,
.mpd-shipping-form .woocommerce-shipping-fields textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.mpd-shipping-form .form-row input:focus,
.mpd-shipping-form .form-row select:focus,
.mpd-shipping-form .woocommerce-shipping-fields input.input-text:focus,
.mpd-shipping-form .woocommerce-shipping-fields select:focus,
.mpd-shipping-form .woocommerce-shipping-fields textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mpd-shipping-form .form-row-first,
.mpd-shipping-form .form-row-last {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.mpd-shipping-form .form-row-first {
    margin-right: 4%;
}

/* ==========================================================================
   Order Review Widget
   ========================================================================== */
.mpd-order-review {
    width: 100%;
}

.mpd-order-review__table,
.mpd-order-review .woocommerce-checkout-review-order-table,
.mpd-order-review table.shop_table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
}

.mpd-order-review__table th,
.mpd-order-review__table td,
.mpd-order-review .woocommerce-checkout-review-order-table th,
.mpd-order-review .woocommerce-checkout-review-order-table td,
.mpd-order-review table.shop_table th,
.mpd-order-review table.shop_table td {
    padding: 16px 20px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.mpd-order-review__table thead th,
.mpd-order-review .woocommerce-checkout-review-order-table thead th,
.mpd-order-review table.shop_table thead th {
    background-color: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.mpd-order-review__table thead th.product-total,
.mpd-order-review .woocommerce-checkout-review-order-table thead th.product-total,
.mpd-order-review table.shop_table thead th.product-total,
.mpd-order-review table.shop_table thead th:last-child {
    text-align: right !important;
}

.mpd-order-review__table tbody tr,
.mpd-order-review .woocommerce-checkout-review-order-table tbody tr {
    transition: background-color 0.15s ease;
}

.mpd-order-review__table tbody tr:hover,
.mpd-order-review .woocommerce-checkout-review-order-table tbody tr:hover {
    background-color: #f8fafc;
}

.mpd-order-review__table tbody td.product-total,
.mpd-order-review .woocommerce-checkout-review-order-table tbody td.product-total,
.mpd-order-review table.shop_table tbody td.product-total,
.mpd-order-review table.shop_table tbody td:last-child,
.mpd-order-review .product-total,
.mpd-order-review__product-total {
    text-align: right !important;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.mpd-order-review__table tfoot th,
.mpd-order-review .woocommerce-checkout-review-order-table tfoot th {
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}

.mpd-order-review__table tfoot td,
.mpd-order-review .woocommerce-checkout-review-order-table tfoot td,
.mpd-order-review table.shop_table tfoot td,
.mpd-order-review table.shop_table tfoot td:last-child {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    text-align: right !important;
    border-bottom: 1px solid #f1f5f9;
}

.mpd-order-review__table .order-total th,
.mpd-order-review__table .order-total td,
.mpd-order-review .woocommerce-checkout-review-order-table .order-total th,
.mpd-order-review .woocommerce-checkout-review-order-table .order-total td,
.mpd-order-review table.shop_table .order-total th,
.mpd-order-review table.shop_table .order-total td {
    font-size: 16px;
    font-weight: 700;
    background-color: #f8fafc;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    padding: 18px 20px;
    color: #0f172a;
}

.mpd-order-review__table .order-total td,
.mpd-order-review .woocommerce-checkout-review-order-table .order-total td,
.mpd-order-review table.shop_table .order-total td {
    font-size: 20px;
    font-weight: 800;
    text-align: right !important;
}

.mpd-order-review__product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    vertical-align: middle;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.mpd-order-review__product-name,
.mpd-order-review .woocommerce-checkout-review-order-table .product-name {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.4;
}

.mpd-order-review__product-qty,
.mpd-order-review .product-quantity {
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    margin-left: 6px;
}

/* ==========================================================================
   Payment Methods Widget
   ========================================================================== */
.mpd-payment-methods {
    width: 100%;
}

.mpd-payment-methods__list,
.mpd-payment-methods .wc_payment_methods,
.woocommerce-checkout #payment ul.payment_methods {
    list-style: none !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
}

.mpd-payment-methods__item,
.mpd-payment-methods .wc_payment_method,
.mpd-payment-methods .woocommerce-checkout-payment ul.payment_methods li,
.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method {
    margin-bottom: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
    list-style: none !important;
    position: relative !important;
    padding: 0 !important;
    display: block !important;
    float: none !important;
}

.mpd-payment-methods .wc_payment_method:hover {
    border-color: #cbd5e1 !important;
}

.mpd-payment-methods .wc_payment_method:last-child {
    margin-bottom: 0 !important;
}

.mpd-payment-methods .wc_payment_method:has(input[type="radio"]:checked),
.mpd-payment-methods .wc_payment_method.mpd-active {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 1px #0f172a, 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

/* Radio button positioned on the same line as title */
.mpd-payment-methods__radio,
.mpd-payment-methods .wc_payment_method > input[type="radio"],
.mpd-payment-methods .wc_payment_method input.input-radio,
.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method > input[type="radio"] {
    position: absolute !important;
    top: 17px !important;
    left: 18px !important;
    margin: 0 !important;
    width: 16px !important;
    height: 16px !important;
    accent-color: #0f172a !important;
    cursor: pointer !important;
    z-index: 3 !important;
    float: none !important;
}

/* Clickable Header Label on the same line */
.mpd-payment-methods__header,
.mpd-payment-methods .wc_payment_method > label,
.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method > label {
    display: flex !important;
    align-items: center !important;
    padding: 15px 18px 15px 44px !important;
    cursor: pointer !important;
    background: #f8fafc !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    transition: background 0.15s ease !important;
    gap: 10px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 50px !important;
    line-height: 1.4 !important;
}

.mpd-payment-methods__header:hover,
.mpd-payment-methods .wc_payment_method > label:hover {
    background: #f1f5f9 !important;
}

.mpd-payment-methods__label {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
    gap: 10px;
}

.mpd-payment-methods__icon,
.mpd-payment-methods .wc_payment_method img,
.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method img {
    max-height: 24px !important;
    width: auto !important;
    object-fit: contain !important;
    margin-left: auto !important;
    vertical-align: middle !important;
}

.mpd-payment-methods__name {
    font-weight: 600;
    color: #0f172a;
}

/* Payment description box */
.mpd-payment-methods__description,
.mpd-payment-methods .wc_payment_method .payment_box,
.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method .payment_box {
    padding: 16px 18px !important;
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.mpd-payment-methods__description p,
.mpd-payment-methods .wc_payment_method .payment_box p {
    margin: 0 !important;
}

/* Layout: Tabs */
.mpd-payment-methods--tabs .mpd-payment-methods__tabs,
.mpd-payment-layout-tabs .wc_payment_methods {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
    list-style: none;
    padding: 0;
}

.mpd-payment-methods--tabs .mpd-payment-methods__tab,
.mpd-payment-layout-tabs .wc_payment_method {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.mpd-payment-methods--tabs .mpd-payment-methods__tab,
.mpd-payment-layout-tabs .wc_payment_method > label {
    padding: 12px 20px !important;
    cursor: pointer;
    border: none;
    background: transparent !important;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    position: relative;
    transition: color 0.2s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.mpd-payment-layout-tabs .wc_payment_method > input[type="radio"] {
    display: none !important;
}

.mpd-payment-methods--tabs .mpd-payment-methods__tab--active,
.mpd-payment-layout-tabs .wc_payment_method input[type="radio"]:checked + label {
    color: #0f172a;
}

.mpd-payment-methods--tabs .mpd-payment-methods__tab--active::after,
.mpd-payment-layout-tabs .wc_payment_method input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0f172a;
}

.mpd-payment-methods--tabs .mpd-payment-methods__content,
.mpd-payment-layout-tabs .wc_payment_method .payment_box {
    padding: 20px 0;
    background: transparent;
    border: none;
}

/* Layout: Accordion */
.mpd-payment-methods--accordion .mpd-payment-methods__item,
.mpd-payment-layout-accordion .wc_payment_method {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0;
}

.mpd-payment-methods--accordion .mpd-payment-methods__header::after,
.mpd-payment-layout-accordion .wc_payment_method > label::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: #64748b;
    margin-left: auto;
}

.mpd-payment-methods--accordion .mpd-payment-methods__item--active .mpd-payment-methods__header::after,
.mpd-payment-layout-accordion .wc_payment_method input[type="radio"]:checked + label::after {
    content: '−';
}

/* ==========================================================================
   Checkout Coupon Widget
   ========================================================================== */
.mpd-checkout-coupon {
    width: 100%;
}

.mpd-checkout-coupon__toggle,
.mpd-checkout-coupon .woocommerce-form-coupon-toggle .woocommerce-info {
    position: relative !important;
    padding: 14px 18px 14px 48px !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    display: block !important;
}

.mpd-checkout-coupon__toggle::before,
.mpd-checkout-coupon .woocommerce-form-coupon-toggle .woocommerce-info::before {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    line-height: 1 !important;
    color: #2563eb !important;
    font-size: 16px !important;
}

.mpd-checkout-coupon__toggle-link,
.mpd-checkout-coupon .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon {
    text-decoration: none;
    font-weight: 600;
    color: #2563eb;
    margin-left: 4px;
    transition: color 0.2s;
}

.mpd-checkout-coupon__toggle-link:hover,
.mpd-checkout-coupon .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.mpd-checkout-coupon__form,
.mpd-checkout-coupon .checkout_coupon {
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.mpd-checkout-coupon__form--inline,
.mpd-coupon-layout-inline .checkout_coupon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mpd-checkout-coupon__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.mpd-checkout-coupon__input,
.mpd-checkout-coupon .checkout_coupon input.input-text {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.mpd-checkout-coupon__input:focus,
.mpd-checkout-coupon .checkout_coupon input.input-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mpd-checkout-coupon__form--inline .mpd-checkout-coupon__input {
    flex: 1;
}

.mpd-checkout-coupon__button,
.mpd-checkout-coupon .checkout_coupon button.button {
    padding: 11px 24px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mpd-checkout-coupon__button:hover,
.mpd-checkout-coupon .checkout_coupon button.button:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12);
}

.mpd-checkout-coupon__applied {
    margin-top: 16px;
}

.mpd-checkout-coupon__applied-title {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.mpd-checkout-coupon__applied-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mpd-checkout-coupon__applied-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 13px;
    color: #1d4ed8;
}

.mpd-checkout-coupon__applied-code {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mpd-checkout-coupon__remove {
    color: #ef4444;
    text-decoration: none;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.15s;
}

.mpd-checkout-coupon__remove:hover {
    color: #dc2626;
    transform: scale(1.15);
}

.mpd-checkout-coupon__message {
    padding: 12px 16px;
    margin-top: 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.mpd-checkout-coupon__message--success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.mpd-checkout-coupon__message--error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* ==========================================================================
   Place Order Widget
   ========================================================================== */
.mpd-place-order {
    width: 100%;
}

.mpd-place-order__terms {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.mpd-place-order__terms p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.mpd-place-order__terms a {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.mpd-place-order__terms a:hover {
    text-decoration: underline;
}

.mpd-place-order__checkbox-wrapper {
    margin-bottom: 16px;
}

.mpd-place-order__checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.mpd-place-order__checkbox {
    margin-right: 10px;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
    flex-shrink: 0;
    cursor: pointer;
}

.mpd-place-order__button,
.mpd-place-order #place_order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    text-decoration: none;
    box-sizing: border-box;
}

.mpd-place-order__button:hover,
.mpd-place-order #place_order:hover {
    background: #1e293b;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.mpd-place-order__button--full,
.mpd-place-order-full-width-yes #place_order,
.mpd-place-order-full-width-yes .mpd-place-order__button-wrapper button {
    width: 100%;
}

.mpd-place-order__privacy {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.mpd-place-order__privacy a {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.mpd-place-order__privacy a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Order Notes Widget
   ========================================================================== */
.mpd-order-notes {
    width: 100%;
}

.mpd-order-notes__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.mpd-order-notes__label .optional {
    color: #94a3b8;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

.mpd-order-notes__textarea,
.mpd-order-notes textarea.input-text {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    min-height: 100px;
}

.mpd-order-notes__textarea:focus,
.mpd-order-notes textarea.input-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mpd-order-notes__textarea::placeholder {
    color: #94a3b8;
}

.mpd-order-notes .gift-wrapping {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.mpd-order-notes .gift-wrapping label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.mpd-order-notes .gift-wrapping input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
}

/* ==========================================================================
   Checkout Login Widget
   ========================================================================== */
.mpd-checkout-login {
    width: 100%;
}

.mpd-checkout-login__toggle,
.mpd-checkout-login .woocommerce-form-login-toggle .woocommerce-info {
    position: relative !important;
    padding: 14px 18px 14px 48px !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    display: block !important;
}

.mpd-checkout-login__toggle::before,
.mpd-checkout-login .woocommerce-form-login-toggle .woocommerce-info::before {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    line-height: 1 !important;
    color: #2563eb !important;
    font-size: 16px !important;
}

.mpd-checkout-login__toggle-link,
.mpd-checkout-login .woocommerce-form-login-toggle .woocommerce-info a.showlogin {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    margin-left: 4px;
}

.mpd-checkout-login__toggle-link:hover,
.mpd-checkout-login .woocommerce-form-login-toggle .woocommerce-info a.showlogin:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.mpd-checkout-login__form {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.mpd-checkout-login .form-row {
    margin-bottom: 16px;
}

.mpd-checkout-login .form-row-first,
.mpd-checkout-login .form-row-last {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.mpd-checkout-login .form-row-first {
    margin-right: 4%;
}

.mpd-checkout-login__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.mpd-checkout-login__label .required {
    color: #ef4444;
}

.mpd-checkout-login__input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.mpd-checkout-login__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mpd-checkout-login__actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.mpd-checkout-login__button {
    padding: 11px 24px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mpd-checkout-login__button:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12);
}

.mpd-checkout-login__button--full {
    width: 100%;
}

.mpd-checkout-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.mpd-checkout-login__options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.mpd-checkout-login__options input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
}

.mpd-checkout-login__link {
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
}

.mpd-checkout-login__link:hover {
    text-decoration: underline;
}

.mpd-checkout-login--editor-notice {
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 4px;
    text-align: center;
}

.mpd-checkout-login--editor-notice p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
    .mpd-billing-form .form-row-first,
    .mpd-billing-form .form-row-last,
    .mpd-shipping-form .form-row-first,
    .mpd-shipping-form .form-row-last,
    .mpd-checkout-login .form-row-first,
    .mpd-checkout-login .form-row-last {
        width: 100%;
        display: block;
        margin-right: 0;
    }

    .mpd-checkout-coupon__form--inline {
        flex-direction: column;
    }

    .mpd-checkout-coupon__form--inline .mpd-checkout-coupon__input {
        width: 100%;
        margin-bottom: 10px;
    }

    .mpd-checkout-coupon__form--inline .mpd-checkout-coupon__button {
        width: 100%;
    }

    .mpd-checkout-login__options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mpd-order-review__table {
        font-size: 14px;
    }

    .mpd-order-review__table th,
    .mpd-order-review__table td {
        padding: 12px 14px;
    }

    .mpd-payment-methods--tabs .mpd-payment-methods__tabs {
        flex-wrap: wrap;
    }

    .mpd-payment-methods--tabs .mpd-payment-methods__tab {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ==========================================================================
   WooCommerce Select2 & Integration Fixes
   ========================================================================== */
.mpd-billing-form .select2-container,
.mpd-shipping-form .select2-container {
    width: 100% !important;
}

.mpd-billing-form .select2-container--default .select2-selection--single,
.mpd-shipping-form .select2-container--default .select2-selection--single {
    height: auto;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background-color: #ffffff;
}

.mpd-billing-form .select2-container--default .select2-selection--single .select2-selection__rendered,
.mpd-shipping-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: normal;
    color: #0f172a;
    font-size: 14px;
}

.mpd-billing-form .select2-container--default .select2-selection--single .select2-selection__arrow,
.mpd-shipping-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 10px;
}

/* Form validation styles */
.mpd-billing-form .woocommerce-invalid input,
.mpd-billing-form .woocommerce-invalid select,
.mpd-shipping-form .woocommerce-invalid input,
.mpd-shipping-form .woocommerce-invalid select,
.mpd-checkout-login__input.woocommerce-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12) !important;
}

.mpd-billing-form .woocommerce-validated input,
.mpd-billing-form .woocommerce-validated select,
.mpd-shipping-form .woocommerce-validated input,
.mpd-shipping-form .woocommerce-validated select {
    border-color: #10b981 !important;
}

/* Stacked & Inline Form Layouts */
[class*="mpd-billing-layout-stacked"] .woocommerce-billing-fields__field-wrapper .form-row,
[class*="mpd-billing-layout-stacked"] .woocommerce-billing-fields__field-wrapper .form-row-first,
[class*="mpd-billing-layout-stacked"] .woocommerce-billing-fields__field-wrapper .form-row-last,
[class*="mpd-billing-layout-stacked"] .mpd-billing-form .form-row,
[class*="mpd-billing-layout-stacked"] .mpd-billing-form .form-row-first,
[class*="mpd-billing-layout-stacked"] .mpd-billing-form .form-row-last,
.mpd-billing-layout-stacked .woocommerce-billing-fields__field-wrapper .form-row,
.mpd-billing-layout-stacked .woocommerce-billing-fields__field-wrapper .form-row-first,
.mpd-billing-layout-stacked .woocommerce-billing-fields__field-wrapper .form-row-last,
.mpd-billing-layout-stacked .mpd-billing-form .form-row,
.mpd-billing-layout-stacked .mpd-billing-form .form-row-first,
.mpd-billing-layout-stacked .mpd-billing-form .form-row-last {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-right: 0 !important;
    float: none !important;
    flex: 1 1 100% !important;
}

[class*="mpd-shipping-layout-stacked"] .woocommerce-shipping-fields__field-wrapper .form-row,
[class*="mpd-shipping-layout-stacked"] .woocommerce-shipping-fields__field-wrapper .form-row-first,
[class*="mpd-shipping-layout-stacked"] .woocommerce-shipping-fields__field-wrapper .form-row-last,
[class*="mpd-shipping-layout-stacked"] .mpd-shipping-form .form-row,
[class*="mpd-shipping-layout-stacked"] .mpd-shipping-form .form-row-first,
[class*="mpd-shipping-layout-stacked"] .mpd-shipping-form .form-row-last,
.mpd-shipping-layout-stacked .woocommerce-shipping-fields__field-wrapper .form-row,
.mpd-shipping-layout-stacked .woocommerce-shipping-fields__field-wrapper .form-row-first,
.mpd-shipping-layout-stacked .woocommerce-shipping-fields__field-wrapper .form-row-last,
.mpd-shipping-layout-stacked .mpd-shipping-form .form-row,
.mpd-shipping-layout-stacked .mpd-shipping-form .form-row-first,
.mpd-shipping-layout-stacked .mpd-shipping-form .form-row-last {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-right: 0 !important;
    float: none !important;
    flex: 1 1 100% !important;
}

[class*="mpd-billing-layout-inline"] .woocommerce-billing-fields__field-wrapper,
[class*="mpd-billing-layout-inline"] .mpd-billing-form .woocommerce-billing-fields__field-wrapper,
.mpd-billing-layout-inline .woocommerce-billing-fields__field-wrapper,
.mpd-billing-layout-inline .mpd-billing-form .woocommerce-billing-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px;
}

[class*="mpd-billing-layout-inline"] .woocommerce-billing-fields__field-wrapper .form-row,
[class*="mpd-billing-layout-inline"] .mpd-billing-form .form-row,
.mpd-billing-layout-inline .woocommerce-billing-fields__field-wrapper .form-row,
.mpd-billing-layout-inline .mpd-billing-form .form-row {
    flex: 1 1 calc(50% - 16px) !important;
    min-width: 200px;
    max-width: calc(50% - 8px);
    margin-bottom: 0 !important;
    float: none !important;
    width: auto !important;
}

[class*="mpd-billing-layout-inline"] .woocommerce-billing-fields__field-wrapper .form-row-wide,
[class*="mpd-billing-layout-inline"] .mpd-billing-form .form-row-wide,
.mpd-billing-layout-inline .woocommerce-billing-fields__field-wrapper .form-row-wide,
.mpd-billing-layout-inline .mpd-billing-form .form-row-wide {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

[class*="mpd-shipping-layout-inline"] .woocommerce-shipping-fields__field-wrapper,
[class*="mpd-shipping-layout-inline"] .mpd-shipping-form .woocommerce-shipping-fields__field-wrapper,
.mpd-shipping-layout-inline .woocommerce-shipping-fields__field-wrapper,
.mpd-shipping-layout-inline .mpd-shipping-form .woocommerce-shipping-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px;
}

[class*="mpd-shipping-layout-inline"] .woocommerce-shipping-fields__field-wrapper .form-row,
[class*="mpd-shipping-layout-inline"] .mpd-shipping-form .form-row,
.mpd-shipping-layout-inline .woocommerce-shipping-fields__field-wrapper .form-row,
.mpd-shipping-layout-inline .mpd-shipping-form .form-row {
    flex: 1 1 calc(50% - 16px) !important;
    min-width: 200px;
    max-width: calc(50% - 8px);
    margin-bottom: 0 !important;
    float: none !important;
    width: auto !important;
}

[class*="mpd-shipping-layout-inline"] .woocommerce-shipping-fields__field-wrapper .form-row-wide,
[class*="mpd-shipping-layout-inline"] .mpd-shipping-form .form-row-wide,
.mpd-shipping-layout-inline .mpd-shipping-form .form-row-wide {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* ==========================================================================
   BlockUI Loading Overlay
   ========================================================================== */
.woocommerce .blockUI.blockOverlay,
.woocommerce .loader {
    background-color: rgba(255, 255, 255, 0.75) !important;
    background-image: none !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.woocommerce .blockUI.blockOverlay::before,
.woocommerce .loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    border: 3px solid rgba(15, 23, 42, 0.1);
    border-top-color: #0f172a;
    animation: mpd-blockui-spin 0.7s linear infinite;
    box-sizing: border-box;
}

@keyframes mpd-blockui-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
