/* ============================================
   Magacin Checkout - Custom Styling
   Only loaded for users seeing the new pricing.
   Overrides default WooCommerce checkout styles.
   ============================================ */

/* General cleanup */
.woocommerce-checkout {
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Order review section */
.woocommerce-checkout-review-order-table {
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100%;
}

.woocommerce-checkout-review-order-table thead {
    display: none;
}

.woocommerce-checkout-review-order-table .cart_item td {
    border: none;
    padding: 16px 0;
    vertical-align: top;
}

/* Product name with thumbnail */
.woocommerce-checkout-review-order-table .cart_item .product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2e2e2e;
    padding-right: 16px;
}

.mc-checkout-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mc-checkout-product img.mc-checkout-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.woocommerce-checkout-review-order-table .cart_item .product-total {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #2e2e2e;
    text-align: right;
    white-space: nowrap;
}

/* Subtotal, shipping, tax rows */
.woocommerce-checkout-review-order-table .cart-subtotal td,
.woocommerce-checkout-review-order-table .cart-subtotal th,
.woocommerce-checkout-review-order-table .shipping td,
.woocommerce-checkout-review-order-table .shipping th,
.woocommerce-checkout-review-order-table .tax-rate td,
.woocommerce-checkout-review-order-table .tax-rate th,
.woocommerce-checkout-review-order-table .fee td,
.woocommerce-checkout-review-order-table .fee th {
    border: none;
    border-top: 1px solid #f0f0f0;
    padding: 12px 0;
    font-size: 0.875rem;
    color: #666;
    font-weight: 400;
}

.woocommerce-checkout-review-order-table .cart-subtotal td,
.woocommerce-checkout-review-order-table .shipping td,
.woocommerce-checkout-review-order-table .tax-rate td,
.woocommerce-checkout-review-order-table .fee td {
    text-align: right;
}

/* Order total */
.woocommerce-checkout-review-order-table .order-total td,
.woocommerce-checkout-review-order-table .order-total th {
    border: none;
    border-top: 2px solid #2e2e2e;
    padding: 16px 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #2e2e2e;
}

.woocommerce-checkout-review-order-table .order-total td {
    text-align: right;
}

/* Recurring totals (WooCommerce Subscriptions) */
.woocommerce-checkout-review-order-table .recurring-totals th,
.woocommerce-checkout-review-order-table .recurring-totals td {
    border: none;
    border-top: 1px solid #f0f0f0;
    padding: 12px 0;
    font-size: 0.875rem;
}

/* Coupon / discount row */
.woocommerce-checkout-review-order-table .cart-discount td,
.woocommerce-checkout-review-order-table .cart-discount th {
    border: none;
    border-top: 1px solid #f0f0f0;
    padding: 12px 0;
    font-size: 0.875rem;
    color: #cb1627;
}

.woocommerce-checkout-review-order-table .cart-discount td {
    text-align: right;
}

/* ============================================
   Checkout Form Fields
   ============================================ */

.woocommerce-checkout .form-row label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    border: 2px solid #ccc !important;
    border-radius: 10px !important;
    padding: 16px 24px !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #2e2e2e !important;
    min-height: 56px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
    border-color: #2e2e2e;
    box-shadow: 0 0 0 2px rgba(46, 46, 46, 0.08);
    outline: none;
}

/* Select2 dropdowns (WooCommerce uses these) */
.woocommerce-checkout .select2-container--default .select2-selection--single {
    border: 2px solid #ccc;
    border-radius: 10px;
    height: 52px;
    padding: 8px 16px;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    color: #2e2e2e;
    font-size: 1.0625rem;
    font-weight: 600;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px;
}

.woocommerce-checkout .select2-container--default.select2-container--focus .select2-selection--single,
.woocommerce-checkout .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #2e2e2e;
    box-shadow: 0 0 0 2px rgba(46, 46, 46, 0.08);
}

/* ============================================
   Checkout Sections
   ============================================ */

.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
    margin-bottom: 24px;
}

.woocommerce-checkout #order_review {
    background-color: #fafafa;
    padding: 30px 60px 60px 60px;
    border-radius: 5px;
}

.woocommerce-checkout #order_review_heading {
    background-color: #fafafa;
    padding: 60px 60px 0 60px;
    border-radius: 5px;
    margin-bottom: 0;
    font-size: 30px;
}

.woocommerce-checkout .woocommerce-billing-fields > h3:first-child {
    display: none;
}

.woocommerce-checkout h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2e2e2e;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: none !important;
}

/* ============================================
   Payment Methods
   ============================================ */

.woocommerce-checkout #payment {
    background: #fafafa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #eee;
}

.woocommerce-checkout #payment ul.payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
    border: none;
}

.woocommerce-checkout #payment ul.payment_methods li {
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.woocommerce-checkout #payment ul.payment_methods li:hover {
    border-color: #ccc;
}

.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method input[type="radio"] {
    margin-right: 8px;
}

.woocommerce-checkout #payment ul.payment_methods li input {
    margin: 10px 1em 0 0 !important;
}

.woocommerce-checkout #payment ul.payment_methods li label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2e2e2e;
    cursor: pointer;
}

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

.woocommerce-checkout #payment div.payment_box {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.5;
}

/* ============================================
   Place Order Button
   ============================================ */

.woocommerce-checkout .form-row.place-order {
    padding-top: 0;
}

.woocommerce-checkout #place_order {
    background: #2e2e2e;
    line-height: 3rem !important;
    color: #fff;
    border: 1px solid #2e2e2e;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    width: 100%;
    text-transform: none;
    letter-spacing: 0;
}

.woocommerce-checkout #place_order:hover {
    background: #1a1a1a;
}

.woocommerce-checkout #place_order:active {
    transform: scale(0.99);
}

/* ============================================
   WooCommerce Notices
   ============================================ */

.woocommerce-checkout .woocommerce-info {
    border-top-color: #2e2e2e;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 16px 12px 45px;
    font-size: 0.875rem;
    color: #555;
}

.woocommerce-checkout .woocommerce-info::before {
    color: #2e2e2e;
}

.woocommerce-checkout .woocommerce-error {
    border-top-color: #cb1627;
    border-radius: 8px;
}

.woocommerce-checkout .woocommerce-message {
    border-top-color: #cb1627;
    border-radius: 8px;
}

/* ============================================
   Privacy & Terms
   ============================================ */

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.5;
    margin-top: 12px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper a {
    color: #2e2e2e;
    text-decoration: underline;
}

/* ============================================
   Hide clutter: subscription checkout totals
   Keep only: product line, discount, total
   Hide: subtotal, recurring totals, shipping, fees
   ============================================ */

.woocommerce-checkout-review-order-table .cart-subtotal,
.woocommerce-checkout-review-order-table .shipping,
.woocommerce-checkout-review-order-table .tax-rate,
.woocommerce-checkout-review-order-table .fee,
.woocommerce-checkout-review-order-table .recurring-totals,
.woocommerce-checkout-review-order-table tr.recurring-total,
.woocommerce-checkout-review-order-table .recurring-totals .cart-subtotal {
    display: none !important;
}

/* Remove default WooCommerce table borders */
.woocommerce-checkout table.shop_table tbody th,
.woocommerce-checkout table.shop_table tfoot td,
.woocommerce-checkout table.shop_table tfoot th {
    border-top: unset;
}

/* Hide "Total" label in order total row */
.woocommerce-checkout #order_review .order-total th {
    opacity: 0;
}

/* Hide Reepay logos */
.woocommerce-checkout .reepay-logos {
    display: none !important;
}

/* Hide "save payment method" checkbox on all gateways */
.woocommerce-SavedPaymentMethods-saveNew {
    display: none !important;
}

/* ============================================
   Responsive
   ============================================ */

@media screen and (max-width: 640px) {
    .woocommerce-checkout #order_review_heading {
        padding: 20px 20px 0 20px;
        font-size: 22px;
    }

    .woocommerce-checkout #order_review {
        padding: 10px 20px 20px 20px;
    }

    .woocommerce-checkout #payment {
        padding: 16px;
        border-radius: 10px;
    }

    .woocommerce-checkout #place_order {
        padding: 14px 24px;
    }

    .woocommerce-checkout .form-row input.input-text,
    .woocommerce-checkout .form-row select {
        padding: 10px 12px;
    }

    /* All form fields full width on mobile */
    .woocommerce-checkout .form-row.form-row-first,
    .woocommerce-checkout .form-row.form-row-last {
        float: none;
        width: 100% !important;
    }

    /* Stack product row vertically on mobile */
    .woocommerce-checkout-review-order-table .cart_item td {
        display: block;
        width: 100% !important;
        text-align: left !important;
    }

    .woocommerce-checkout-review-order-table .cart_item .product-name {
        padding-right: 0;
    }

    .woocommerce-checkout-review-order-table .cart_item .product-total {
        text-align: left;
        padding-top: 4px;
        padding-bottom: 16px;
    }

    /* Totals rows: keep th + td side by side */
    .woocommerce-checkout-review-order-table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 8px 0;
    }

    .woocommerce-checkout-review-order-table tfoot th,
    .woocommerce-checkout-review-order-table tfoot td {
        display: inline;
        width: auto !important;
        padding: 0;
        text-align: right;
    }

    .woocommerce-checkout-review-order-table tfoot th {
        text-align: left;
    }

    /* Stack thumbnail + title vertically */
    .mc-checkout-product {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mc-checkout-product img.mc-checkout-thumb {
        display: none;
    }

    /* Plan toggle: full width */
    .mc-plan-toggle {
        margin-top: 10px;
    }
}
