/**
 * MineListings Subscriptions - Cart & Checkout Styles
 * Extracted from WooCommerce CSS, standalone (no WC dependency)
 */

/* ===========================================
   CSS Variables (replaces WC variables)
   =========================================== */
:root {
    --mls-green: #7ad03a;
    --mls-red: #a00;
    --mls-blue: #1e85be;
    --mls-primary: #243875;
    --mls-primary-text: #fff;
    --mls-secondary: #e9e6ed;
    --mls-secondary-text: #515151;
    --mls-highlight: #958e09;
    --mls-subtext: #767676;
    --mls-content-bg: #fff;
    --mls-border-color: rgba(0, 0, 0, .1);
    --mls-form-border-color: rgba(32, 7, 7, 0.8);
    --mls-form-border-radius: 4px;
    --mls-form-border-width: 1px;
}

/* ===========================================
   Screen Reader Text
   =========================================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* ===========================================
   MLS Cart — Layout
   =========================================== */
.mls-cart-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1e1e1e;
}

.mls-cart-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.mls-cart-main {
    width: 65%;
    padding-right: 4.5%;
    box-sizing: border-box;
}

.mls-cart-sidebar {
    width: 35%;
    padding-left: 2.25%;
    box-sizing: border-box;
}

/* ===========================================
   MLS Cart — Items Table
   =========================================== */
.mls-cart-items {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.mls-cart-items__header th {
    text-transform: uppercase;
    font-size: .75em;
    font-weight: 400;
    color: #757575;
    letter-spacing: .5px;
    padding: 0 0 12px;
    border-bottom: 1px solid hsla(0, 0%, 7%, .11);
    text-align: left;
}

.mls-cart-items__header .mls-cart-items__header-total {
    text-align: right;
}

.mls-cart-items__row {
    border-bottom: 1px solid hsla(0, 0%, 7%, .11);
}

.mls-cart-items__row td {
    padding: 16px 0;
    vertical-align: top;
}

/* Image column */
.mls-cart-item__image {
    width: 80px;
    min-width: 80px;
    padding-right: 16px !important;
}

.mls-cart-item__image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* Product info column */
.mls-cart-item__product {
    padding-right: 16px !important;
}

.mls-cart-item__name {
    font-weight: 600;
    font-size: 1em;
    display: block;
    color: #1e1e1e;
    line-height: 1.4;
}

.mls-cart-item__prices {
    margin-top: 4px;
    color: #1e1e1e;
}

.mls-cart-item__price {
    font-weight: 600;
}

.mls-cart-item__interval {
    color: #757575;
    font-size: .9em;
}

.mls-cart-item__quantity-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mls-cart-item__qty-display {
    font-size: .875em;
    color: #757575;
}

.mls-cart-item__qty-display::before {
    content: "Qty: ";
}

.mls-cart-item__remove {
    font-size: .75em;
    color: #757575;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.mls-cart-item__remove:hover {
    color: #1e1e1e;
}

/* Total column */
.mls-cart-item__total {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.mls-cart-item__total-interval {
    color: #757575;
    font-weight: 400;
    font-size: .9em;
}

/* ===========================================
   MLS Cart — Sidebar Totals
   =========================================== */
.mls-cart-totals {
    background: #fafafa;
    border: 1px solid hsla(0, 0%, 7%, .11);
    border-radius: 4px;
    padding: 24px;
}

.mls-cart-totals__title {
    font-size: 1.125em;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid hsla(0, 0%, 7%, .11);
    color: #1e1e1e;
}

.mls-cart-totals__row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid hsla(0, 0%, 7%, .06);
}

.mls-cart-totals__row--total {
    border-bottom: none;
}

.mls-cart-totals__label {
    color: #757575;
    font-size: .9em;
}

.mls-cart-totals__value {
    text-align: right;
    font-size: .9em;
}

.mls-cart-totals__row--total .mls-cart-totals__value {
    font-size: 1em;
}

/* Recurring totals */
.mls-cart-totals__recurring {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid hsla(0, 0%, 7%, .11);
}

.mls-cart-totals__recurring-label {
    font-size: .85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #757575;
    margin-bottom: 8px;
}

.mls-cart-totals__renewal {
    margin-top: 4px;
}

.mls-cart-totals__renewal small {
    color: #757575;
    font-size: .85em;
}

/* Coupon */
.mls-cart-coupon {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid hsla(0, 0%, 7%, .11);
}

.mls-cart-coupon__toggle a {
    font-size: .875em;
    color: var(--mls-primary);
    text-decoration: underline;
}

.mls-cart-coupon__toggle a:hover {
    color: #1c2d5f;
}

.mls-cart-coupon__form {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.mls-cart-coupon__input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .875em;
    box-sizing: border-box;
}

.mls-cart-coupon__input:focus {
    border-color: var(--mls-primary);
    outline: none;
}

.mls-cart-coupon__btn {
    padding: 8px 16px;
    background: var(--mls-secondary);
    color: var(--mls-secondary-text);
    border: none;
    border-radius: 4px;
    font-size: .875em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.mls-cart-coupon__btn:hover {
    background: #dcd7e2;
}

/* Proceed to Checkout button */
.mls-cart-checkout {
    margin-top: 20px;
}

.mls-cart-checkout__btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--mls-primary);
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    font-size: 1.05em;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    transition: background-color .15s ease;
}

.mls-cart-checkout__btn:hover {
    background-color: #1c2d5f;
    color: #fff !important;
    text-decoration: none;
}

/* ===========================================
   MLS Cart — Empty State
   =========================================== */
.mls-cart-empty {
    text-align: center;
    padding: 40px 20px;
}

.mls-cart-empty__title {
    font-size: 1.5em;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 12px;
}

.mls-cart-empty a {
    color: var(--mls-primary);
    text-decoration: underline;
}

.mls-cart-empty a:hover {
    color: #1c2d5f;
}

/* ===========================================
   MLS Cart — Responsive (max-width: 768px)
   =========================================== */
@media only screen and (max-width: 768px) {
    .mls-cart-layout {
        flex-direction: column;
    }

    .mls-cart-main {
        width: 100%;
        padding-right: 0;
    }

    .mls-cart-sidebar {
        width: 100%;
        padding-left: 0;
        margin-top: 24px;
    }

    .mls-cart-item__image {
        width: 64px;
        min-width: 64px;
    }

    .mls-cart-item__image img {
        width: 64px;
        height: 64px;
    }

    .mls-cart-items__header .mls-cart-items__header-total {
        display: none;
    }

    .mls-cart-item__total {
        display: none;
    }

    .mls-cart-items__row {
        display: flex;
        align-items: flex-start;
    }

    .mls-cart-items__row td {
        padding: 12px 0;
    }
}

/* ===========================================
   MLS Checkout — Wrapper
   =========================================== */
.mls-checkout-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1e1e1e;
}

/* ===========================================
   MLS Checkout — Notices
   =========================================== */
.mls-checkout-notice {
    padding: 1em 2em;
    margin: 0 0 2em;
    background-color: #f6f5f8;
    color: var(--mls-secondary-text);
    border-top: 3px solid var(--mls-blue);
    word-wrap: break-word;
}

.mls-checkout-notice a {
    color: var(--mls-blue);
}

.mls-checkout-notice--error {
    border-top-color: #b81c23;
}

.mls-checkout-notice--success {
    border-top-color: #8fae1b;
}

.mls-checkout-notice--info {
    border-top-color: var(--mls-blue);
}

/* ===========================================
   MLS Checkout — Coupon
   =========================================== */
.mls-checkout-coupon {
    border: 1px solid #cfc8d8;
    padding: 20px;
    margin: 0 0 2em;
    border-radius: 5px;
}

.mls-checkout-coupon__fields {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.mls-checkout-coupon__input {
    flex: 1;
    padding: .5em;
    border: 1px solid rgba(32, 7, 7, 0.8);
    border-radius: var(--mls-form-border-radius);
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
}

.mls-checkout-coupon__input:focus {
    border-color: var(--mls-primary);
    outline: none;
}

.mls-checkout-coupon__btn {
    padding: .618em 1em;
    background-color: var(--mls-secondary);
    color: var(--mls-secondary-text);
    border: 0;
    border-radius: 3px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    white-space: nowrap;
}

.mls-checkout-coupon__btn:hover {
    background-color: #dcd7e2;
}

/* ===========================================
   MLS Checkout — Two-Column Layout
   =========================================== */
.mls-checkout-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* ===========================================
   MLS Checkout — Section Titles
   =========================================== */
.mls-checkout-section__title {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 20px;
    color: #1e1e1e;
}

/* ===========================================
   MLS Checkout — Billing Fields
   =========================================== */
.mls-checkout-billing {
    min-width: 0;
}

.mls-checkout-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mls-field {
    display: flex;
    flex-direction: column;
}

.mls-field label {
    display: block;
    line-height: 2;
    font-weight: 400;
}

.mls-field__required {
    color: var(--mls-red);
    font-weight: 700;
    border: 0 !important;
    text-decoration: none;
}

.mls-field__optional {
    color: var(--mls-subtext);
    font-size: .9em;
}

.mls-field__input,
.mls-field__select {
    font-family: inherit;
    font-weight: 400;
    letter-spacing: normal;
    padding: .5em;
    display: block;
    background-color: #fff;
    border: var(--mls-form-border-width) solid var(--mls-form-border-color);
    border-radius: var(--mls-form-border-radius);
    color: #000;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    line-height: normal;
    height: auto;
}

.mls-field__input:focus,
.mls-field__select:focus {
    border-color: var(--mls-primary);
    outline: none;
}

.mls-field__input[readonly] {
    background-color: #f5f5f5;
    color: #666;
}

.mls-field__select {
    cursor: pointer;
    appearance: none;
    padding-right: 3em;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hldnJvbi1kb3duIj48cG9seWxpbmUgcG9pbnRzPSI2IDkgMTIgMTUgMTggOSI+PC9wb2x5bGluZT48L3N2Zz4=");
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: calc(100% - .5em) 50%;
}

/* Half-width row (first/last name, state/zip) */
.mls-checkout-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Validation states */
.mls-field--invalid label {
    color: var(--mls-red);
}

.mls-field--invalid .mls-field__input,
.mls-field--invalid .mls-field__select {
    border-color: var(--mls-red);
}

/* ===========================================
   MLS Checkout — Order Review Table
   =========================================== */
.mls-checkout-order {
    min-width: 0;
}

.mls-order-table {
    width: 100%;
    border: 1px solid var(--mls-border-color);
    border-collapse: separate;
    border-radius: 5px;
    margin-bottom: 24px;
    text-align: left;
}

.mls-order-table th {
    font-weight: 700;
    padding: 9px 12px;
    line-height: 1.5em;
}

.mls-order-table td {
    border-top: 1px solid var(--mls-border-color);
    padding: 9px 12px;
    vertical-align: middle;
    line-height: 1.5em;
}

.mls-order-table thead th {
    border-bottom: 1px solid var(--mls-border-color);
}

.mls-order-table__product {
    text-align: left;
}

.mls-order-table__total {
    text-align: right;
}

.mls-order-table__qty {
    font-size: .9em;
}

.mls-order-table tfoot th {
    border-top: 1px solid var(--mls-border-color);
}

.mls-order-table tfoot td {
    text-align: right;
}

.mls-price {
    font-weight: 600;
}

.mls-price__interval {
    color: var(--mls-subtext);
    font-weight: 400;
    font-size: .9em;
}

.mls-order-table__recurring-header th {
    font-size: 1.05em;
    padding-top: 1em !important;
    border-top: 2px solid var(--mls-border-color) !important;
}

.mls-order-table__renewal {
    margin-top: 5px;
}

.mls-order-table__renewal small {
    color: var(--mls-subtext);
}

/* ===========================================
   MLS Checkout — Order Bump
   =========================================== */
.mls-order-bump {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.mls-order-bump__badge {
    position: absolute;
    top: 10px;
    right: -35px;
    background: #28a745;
    color: #fff;
    padding: 5px 40px;
    font-size: 12px;
    font-weight: 700;
    transform: rotate(45deg);
}

.mls-order-bump__title {
    margin: 0 0 10px;
    color: #243875;
    font-size: 18px;
}

.mls-order-bump__desc {
    margin: 0 0 15px;
    color: #333;
    font-size: 14px;
}

.mls-order-bump__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    border: 2px solid #ddd;
    transition: border-color .15s, background .15s;
}

.mls-order-bump__label:has(input:checked) {
    border-color: #28a745;
    background: #f0fff4;
}

.mls-order-bump__label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.mls-order-bump__label-text {
    flex: 1;
}

.mls-order-bump__pricing {
    font-size: 13px;
    color: #666;
}

.mls-order-bump__pricing del {
    color: #999;
}

.mls-order-bump__sale-price {
    color: #28a745;
    font-weight: 700;
    margin-left: 5px;
}

.mls-order-bump__savings {
    color: #28a745;
    font-size: 12px;
}

.mls-order-bump__features {
    margin: 15px 0 0;
    font-size: 12px;
    color: #666;
}

/* ===========================================
   MLS Checkout — Payment Section
   =========================================== */
.mls-checkout-payment {
    background: rgba(129, 110, 153, .14);
    border-radius: 5px;
    overflow: hidden;
}

.mls-checkout-payment__method {
    padding: 1em;
    border-bottom: 1px solid rgba(104, 87, 125, .14);
}

.mls-checkout-payment__method input[type="radio"] {
    margin: 0 1em 0 0;
    vertical-align: middle;
}

.mls-checkout-payment__method > label {
    font-weight: 600;
    vertical-align: middle;
}

.mls-checkout-payment__box {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    padding: 1em;
    margin: 1em 0 0;
    font-size: .92em;
    border-radius: 2px;
    line-height: 1.5;
    background-color: #dcd7e2;
    color: var(--mls-secondary-text);
}

.mls-checkout-payment__box::before {
    content: "";
    display: block;
    border: 1em solid #dcd7e2;
    border-right-color: transparent;
    border-left-color: transparent;
    border-top-color: transparent;
    position: absolute;
    top: -.75em;
    left: 0;
    margin: -1em 0 0 2em;
}

.mls-checkout-payment__box p:last-of-type {
    margin-bottom: .5em;
}

/* ===========================================
   MLS Checkout — Place Order
   =========================================== */
.mls-checkout-place-order {
    padding: 1em;
}

.mls-checkout-privacy {
    font-size: .9em;
    color: var(--mls-subtext);
    line-height: 1.5;
    margin: 0 0 1em;
}

.mls-checkout-privacy a {
    color: var(--mls-blue);
}

.mls-checkout-terms {
    margin-bottom: 1em;
}

.mls-checkout-terms__label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    line-height: 1.5;
}

.mls-checkout-terms__checkbox {
    margin-top: 3px;
    flex-shrink: 0;
}

.mls-checkout-submit {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--mls-primary);
    color: #fff;
    text-align: center;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    transition: background-color .15s ease;
}

.mls-checkout-submit:hover {
    background-color: #1c2d5f;
}

.mls-checkout-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===========================================
   MLS Checkout — Return Status
   =========================================== */
.mls-checkout-return {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.mls-checkout-loading {
    text-align: center;
    padding: 40px;
}

.mls-checkout-result {
    text-align: center;
    padding: 20px;
}

.mls-checkout-result__icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    margin: 0 auto 15px;
}

.mls-checkout-result__icon--success {
    background: #28a745;
}

.mls-checkout-result__icon--failed {
    background: #dc3545;
}

.mls-checkout-result__title--success {
    color: #28a745;
}

.mls-checkout-result__title--failed {
    color: #dc3545;
}

.mls-checkout-result__btn {
    display: inline-block;
    padding: .618em 1.5em;
    background-color: var(--mls-primary);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    border-radius: 3px;
    margin-top: 10px;
    -webkit-font-smoothing: antialiased;
}

.mls-checkout-result__btn:hover {
    background-color: #1c2d5f;
    color: #fff !important;
    text-decoration: none;
}

/* ===========================================
   Subscription / Recurring Styles
   =========================================== */
.subscription-details {
    color: var(--mls-subtext);
    font-size: .9em;
}

.subscription-price {
    display: inline;
}

.recurring-totals th {
    font-size: 1.05em;
    padding-top: 1em !important;
    border-top: 2px solid var(--mls-border-color) !important;
}

.recurring-total td,
.recurring-total th {
    font-style: normal;
}

.first-payment-date {
    margin-top: 5px;
}

.first-payment-date small {
    color: var(--mls-subtext);
}

/* ===========================================
   Stripe Payment Element
   =========================================== */
#mls-payment-element {
    min-height: 80px;
    margin: 15px 0;
}

#mls-payment-errors {
    color: #dc3545;
    font-size: 14px;
    padding: 10px 15px;
    background: #fdf0f0;
    border-radius: 4px;
    margin-top: 10px;
}

/* ===========================================
   Spinner
   =========================================== */
.mls-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--mls-primary);
    border-radius: 50%;
    animation: mlsSpin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes mlsSpin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   MLS Checkout — Responsive (max-width: 768px)
   =========================================== */
@media only screen and (max-width: 768px) {
    .mls-checkout-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .mls-checkout-row--half {
        grid-template-columns: 1fr;
    }

    .mls-checkout-coupon__fields {
        flex-direction: column;
    }

    .mls-checkout-coupon__btn {
        width: 100%;
    }

    .mls-checkout-submit {
        font-size: 1em;
    }
}
