/**
 * Mamba Critical CSS - WooCommerce Checkout Page
 * 
 * Critical styles for the checkout page.
 * Covers billing/shipping forms, order review, and payment.
 * 
 * @package Mamba\Modules\CriticalCss
 * @since   1.1.0
 */

/* Checkout container */
.woocommerce-checkout .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
}

/* Checkout form layout */
.woocommerce form.checkout {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}

/* Billing/Shipping columns */
.woocommerce form.checkout .col2-set {
    flex: 1;
    min-width: 300px;
}

.woocommerce form.checkout .col2-set .col-1,
.woocommerce form.checkout .col2-set .col-2 {
    margin-bottom: 2em;
}

/* Order review section */
.woocommerce form.checkout #order_review_heading {
    flex-basis: 100%;
    font-size: 1.25em;
    font-weight: 700;
    margin: 0;
}

.woocommerce form.checkout #order_review {
    flex: 1;
    min-width: 300px;
}

/* Section headings */
.woocommerce form.checkout h3 {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 1em;
}

/* Form rows */
.woocommerce form .form-row {
    margin-bottom: 1em;
}

.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
    width: 48%;
    float: left;
}

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

.woocommerce form .form-row-wide {
    width: 100%;
    clear: both;
}

.woocommerce form .form-row::after {
    content: "";
    display: table;
    clear: both;
}

/* Labels */
.woocommerce form .form-row label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 500;
}

.woocommerce form .form-row label .required {
    color: #e00;
}

/* Input fields */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    outline: none;
    border-color: #999;
}

/* Select2 styling */
.woocommerce form .select2-container {
    width: 100% !important;
}

.woocommerce form .select2-container .select2-selection--single {
    height: auto;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Checkbox rows */
.woocommerce form .form-row.create-account,
.woocommerce form .form-row.woocommerce-validated {
    margin-top: 1em;
}

.woocommerce form .form-row input[type="checkbox"] {
    width: auto;
    margin-right: 0.5em;
}

/* Order review table */
.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.woocommerce table.shop_table thead th {
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.woocommerce table.shop_table .product-name {
    font-weight: 500;
}

.woocommerce table.shop_table .product-quantity {
    color: #666;
}

.woocommerce table.shop_table tfoot th {
    font-weight: 600;
}

.woocommerce table.shop_table tfoot .order-total th,
.woocommerce table.shop_table tfoot .order-total td {
    font-size: 1.1em;
    font-weight: 700;
}

/* Payment section */
.woocommerce #payment {
    background: #f7f7f7;
    padding: 1.5em;
    border-radius: 5px;
}

.woocommerce #payment ul.payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5em;
    border-bottom: 1px solid #ddd;
}

.woocommerce #payment ul.payment_methods li {
    padding: 1em 0;
    border-top: 1px solid #ddd;
}

.woocommerce #payment ul.payment_methods li:first-child {
    border-top: none;
}

.woocommerce #payment ul.payment_methods li input[type="radio"] {
    margin-right: 0.5em;
}

.woocommerce #payment ul.payment_methods li label {
    font-weight: 600;
    cursor: pointer;
}

.woocommerce #payment ul.payment_methods li label img {
    max-height: 24px;
    margin-left: 0.5em;
    vertical-align: middle;
}

.woocommerce #payment div.payment_box {
    padding: 1em;
    margin-top: 0.5em;
    background: #fff;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Terms and conditions */
.woocommerce #payment .woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 1.5em;
}

.woocommerce #payment .woocommerce-privacy-policy-text {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 1em;
}

/* Place order button */
.woocommerce #payment .place-order {
    padding-top: 1em;
}

.woocommerce #payment #place_order {
    width: 100%;
    padding: 1em;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.woocommerce #payment #place_order:hover {
    opacity: 0.9;
}

.woocommerce #payment #place_order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Coupon form */
.woocommerce form.checkout_coupon {
    margin-bottom: 2em;
    padding: 1em;
    background: #f7f7f7;
    border-radius: 3px;
}

.woocommerce form.checkout_coupon .form-row {
    display: flex;
    gap: 0.5em;
    align-items: flex-end;
}

.woocommerce form.checkout_coupon .form-row-first {
    flex: 1;
    width: auto;
    float: none;
    margin-right: 0;
}

.woocommerce form.checkout_coupon .form-row-last {
    width: auto;
    float: none;
}

/* Login form */
.woocommerce form.login {
    margin-bottom: 2em;
    padding: 1.5em;
    background: #f7f7f7;
    border-radius: 3px;
}

/* Notices */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    padding: 1em;
    margin-bottom: 1.5em;
    border-radius: 3px;
}

.woocommerce .woocommerce-error li {
    margin-bottom: 0.5em;
}

/* Loading overlay */
.woocommerce .blockUI.blockOverlay {
    position: relative;
}

.woocommerce .blockUI.blockOverlay::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: mamba-spin 0.8s linear infinite;
}

@keyframes mamba-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce form.checkout {
        flex-direction: column;
    }
    
    .woocommerce form.checkout .col2-set,
    .woocommerce form.checkout #order_review {
        min-width: 100%;
    }
    
    .woocommerce form .form-row-first,
    .woocommerce form .form-row-last {
        width: 100%;
        float: none;
        margin-right: 0;
    }
}
