/* ==========================================================================
   MateLoop Stripe Connect, Billing & Direct Checkout Theme Styles (`ml_stripe_billing.css`)
   Matches MateLoop's warm cream, terracotta accent, and espresso ink palette.
   ========================================================================== */

/* ---------- 1. Billing Cards (listing_payment.php & listing_payment_success.php) ---------- */
.ml-billing-page-wrap {
    padding: 3rem 1rem;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-billing-card {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 2.75rem 2.5rem;
    border-radius: var(--ml-radius, 22px);
    border: 1px solid var(--ml-card-border, rgba(62, 39, 35, 0.08));
    box-shadow: var(--ml-shadow, 0 8px 28px rgba(62, 39, 35, 0.08));
    color: var(--ml-ink, #3e2723);
}

.ml-billing-card__header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.ml-billing-card__icon-ring {
    width: 68px;
    height: 68px;
    background: var(--ml-accent-soft, #fff0e6);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--ml-accent, #e68a45);
}

.ml-billing-card__icon-ring--success {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.ml-billing-card__icon-ring--error {
    background: rgba(198, 40, 40, 0.12);
    color: #c62828;
}

.ml-billing-card__title {
    font-family: var(--ml-font-display, "Fraunces", Georgia, serif);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    margin-bottom: 0.5rem;
}

.ml-billing-card__title--success {
    color: #2e7d32;
}

.ml-billing-card__title--error {
    color: #c62828;
}

.ml-billing-card__lead {
    color: var(--ml-ink-muted, #6d4c41);
    font-size: 1.05rem;
    line-height: 1.55;
}

.ml-billing-card__summary-box {
    background: var(--ml-cream, #fffaf5);
    border: 1px solid var(--ml-price-strip-border, rgba(62, 39, 35, 0.14));
    border-radius: var(--ml-radius-sm, 14px);
    padding: 1.5rem;
    margin-bottom: 2.25rem;
}

.ml-billing-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    font-size: 1.02rem;
}

.ml-billing-card__row:last-child {
    margin-bottom: 0;
}

.ml-billing-card__label {
    color: var(--ml-ink-muted, #6d4c41);
    font-weight: 500;
}

.ml-billing-card__value {
    color: var(--ml-ink, #3e2723);
    font-weight: 600;
    max-width: 320px;
    text-align: right;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.ml-billing-card__value--capitalize {
    text-transform: capitalize;
}

.ml-billing-card__value--mono {
    font-family: monospace;
    font-size: 0.92rem;
}

.ml-billing-card__divider {
    border: 0;
    border-top: 1px dashed var(--ml-price-strip-border, rgba(62, 39, 35, 0.14));
    margin: 1.15rem 0;
}

.ml-billing-card__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.ml-billing-card__total-price {
    color: var(--ml-accent, #e68a45);
    font-size: 1.35rem;
    font-weight: 700;
}

.ml-billing-card__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ml-billing-card__actions--horizontal {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ml-billing-btn--stripe {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--ml-radius-sm, 14px);
    background: var(--ml-accent, #e68a45);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(230, 138, 69, 0.28);
    transition: all 0.2s ease;
}

.ml-billing-btn--stripe:hover {
    background: var(--ml-accent-hover, #d6742e);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(230, 138, 69, 0.38);
}

.ml-billing-btn--sandbox {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--ml-radius-sm, 14px);
    background: var(--ml-bg-soft, #ffeedd);
    color: var(--ml-ink, #3e2723);
    border: 1px dashed var(--ml-ink-muted, #6d4c41);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ml-billing-btn--sandbox:hover {
    background: var(--ml-price-strip-bg, #dfcfc2);
}

.ml-billing-card__footer {
    text-align: center;
    margin-top: 1.75rem;
}

.ml-billing-card__back-link {
    color: var(--ml-ink-muted, #6d4c41);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ml-billing-card__back-link:hover {
    color: var(--ml-ink, #3e2723);
    text-decoration: underline;
}

/* ---------- 2. Renewal & Expiry Alert Banners (ml_listing_lifecycle.php) ---------- */
.ml-renewal-banner {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: var(--ml-radius-sm, 14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--ml-font-body, "Nunito Sans", system-ui, sans-serif);
    line-height: 1.5;
}

.ml-renewal-banner--pending {
    background: var(--ml-accent-soft, #fff0e6);
    border: 1.5px solid var(--ml-accent, #e68a45);
    color: var(--ml-ink, #3e2723);
}

.ml-renewal-banner--expired {
    background: #fff3e0;
    border: 1.5px solid #ff9800;
    color: var(--ml-ink, #3e2723);
}

.ml-renewal-banner--reminder {
    background: var(--ml-cream, #fffaf5);
    border: 1.5px solid var(--ml-logo-sage, #7c9a7e);
    color: var(--ml-ink, #3e2723);
}

.ml-renewal-banner__text {
    flex: 1;
    min-width: 240px;
    font-size: 0.96rem;
}

.ml-renewal-banner__strong {
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
}

.ml-renewal-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--ml-accent, #e68a45);
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(230, 138, 69, 0.25);
    transition: all 0.2s ease;
}

.ml-renewal-banner__btn:hover {
    background: var(--ml-accent-hover, #d6742e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 138, 69, 0.35);
}

/* ---------- 3. Pending Payment Dashboard Section (dashboard_pending_payment_section.php) ---------- */
.ml-dash-post-section--pending-payment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--ml-cream, #fffaf5);
    border: 2px solid var(--ml-accent, #e68a45);
    border-radius: var(--ml-radius, 22px);
    box-shadow: var(--ml-shadow, 0 8px 28px rgba(62, 39, 35, 0.08));
}

.ml-dash-pending__title {
    font-family: var(--ml-font-display, "Fraunces", Georgia, serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ml-accent, #e68a45);
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.ml-dash-pending__lead {
    color: var(--ml-ink-muted, #6d4c41);
    font-size: 0.96rem;
    margin-bottom: 1.35rem;
    line-height: 1.5;
}

.ml-dash-pending-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ml-dash-pending-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--ml-card-border, rgba(62, 39, 35, 0.08));
    border-radius: var(--ml-radius-sm, 14px);
    box-shadow: 0 4px 16px rgba(62, 39, 35, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ml-dash-pending-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--ml-shadow, 0 8px 28px rgba(62, 39, 35, 0.08));
}

.ml-dash-pending-row__thumb {
    flex: 0 0 140px;
    width: 140px;
    height: 105px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ml-bg-soft, #ffeedd);
}

.ml-dash-pending-row__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ml-dash-pending-row__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.ml-dash-pending-row__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.ml-dash-pending-row__title {
    font-family: var(--ml-font-display, "Fraunces", Georgia, serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ml-ink, #3e2723);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.ml-dash-pending-row__title:hover {
    color: var(--ml-accent, #e68a45);
}

.ml-dash-pending-row__price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ml-accent, #e68a45);
    white-space: nowrap;
    flex: 0 0 auto;
}

.ml-dash-pending-row__snippet {
    margin: 0;
    color: var(--ml-ink-muted, #6d4c41);
    font-size: 0.92rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.ml-dash-pending-row__action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.ml-dash-pending-row__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--ml-accent, #e68a45);
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(230, 138, 69, 0.25);
    transition: all 0.2s ease;
}

.ml-dash-pending-row__btn:hover {
    background: var(--ml-accent-hover, #d6742e);
    box-shadow: 0 6px 16px rgba(230, 138, 69, 0.35);
    transform: translateY(-1px);
}

}

/* ---------- 5. Direct Buy Panel & Quantity Selector (listing.php) ---------- */
.ml-direct-buy-panel {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fffaf5 0%, #fff0e6 100%);
    border: 1.5px solid rgba(230, 138, 69, 0.35);
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(230, 138, 69, 0.08);
}

.ml-direct-buy-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.ml-direct-buy-qty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ml-direct-buy-qty__label {
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    font-size: 1rem;
}

.ml-qty-spinner {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(62, 39, 35, 0.2);
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
    height: 42px;
}

.ml-qty-spinner__btn {
    width: 38px;
    height: 100%;
    border: none;
    background: #fdfbf7;
    color: var(--ml-ink, #3e2723);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-qty-spinner__btn:hover {
    background: var(--ml-accent-soft, #fff0e6);
    color: var(--ml-accent, #e68a45);
}

.ml-qty-spinner__input {
    width: 52px;
    height: 100%;
    border: none;
    border-left: 1px solid rgba(62, 39, 35, 0.1);
    border-right: 1px solid rgba(62, 39, 35, 0.1);
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    background: #ffffff;
    -moz-appearance: textfield;
}

.ml-qty-spinner__input::-webkit-outer-spin-button,
.ml-qty-spinner__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ml-direct-buy-stock {
    font-size: 0.88rem;
    color: var(--ml-ink-muted, #6d4c41);
    font-weight: 600;
}

.ml-direct-buy-stock--low {
    color: #c62828;
    background: rgba(198, 40, 40, 0.1);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.ml-direct-buy-btn {
    flex: 1 1 auto;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-accent, #e68a45) 0%, #d6742e 100%);
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(230, 138, 69, 0.32);
    transition: all 0.2s ease;
    text-decoration: none;
}

.ml-direct-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230, 138, 69, 0.42);
    background: linear-gradient(135deg, #d6742e 0%, #c46322 100%);
}

/* ---------- 6. Shopify-Style Direct Checkout Page (direct_checkout.php) ---------- */
.ml-checkout-wrap {
    max-width: 1140px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.ml-checkout-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(62, 39, 35, 0.1);
    padding-bottom: 1.25rem;
}

.ml-checkout-header__title {
    font-family: var(--ml-font-display, "Fraunces", Georgia, serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    margin: 0 0 0.35rem 0;
}

.ml-checkout-header__sub {
    color: var(--ml-ink-muted, #6d4c41);
    font-size: 1.05rem;
    margin: 0;
}

.ml-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .ml-checkout-grid {
        grid-template-columns: 1fr;
    }
}

.ml-checkout-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(62, 39, 35, 0.1);
    box-shadow: 0 8px 28px rgba(62, 39, 35, 0.06);
    padding: 2.25rem;
    margin-bottom: 2rem;
}

.ml-checkout-card:last-child {
    margin-bottom: 0;
}

.ml-checkout-card__title {
    font-family: var(--ml-font-display, "Fraunces", Georgia, serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ml-checkout-form-group {
    margin-bottom: 1.35rem;
}

.ml-checkout-form-group label {
    display: block;
    font-weight: 600;
    color: var(--ml-ink, #3e2723);
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
}

.ml-checkout-form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(62, 39, 35, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--ml-ink, #3e2723);
    background: #fdfbf7;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ml-checkout-form-control:focus {
    outline: none;
    border-color: var(--ml-accent, #e68a45);
    box-shadow: 0 0 0 3px rgba(230, 138, 69, 0.15);
    background: #ffffff;
}

.ml-checkout-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .ml-checkout-form-row {
        grid-template-columns: 1fr;
    }
}

.ml-fulfillment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ml-fulfillment-option {
    border: 1.5px solid rgba(62, 39, 35, 0.15);
    border-radius: 14px;
    padding: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fdfbf7;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ml-fulfillment-option:hover {
    border-color: var(--ml-accent, #e68a45);
}

.ml-fulfillment-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--ml-accent, #e68a45);
}

.ml-fulfillment-option__label {
    font-weight: 700;
    color: var(--ml-ink, #3e2723);
    display: block;
    margin-bottom: 0.2rem;
}

.ml-fulfillment-option__desc {
    font-size: 0.85rem;
    color: var(--ml-ink-muted, #6d4c41);
    line-height: 1.4;
}

.ml-checkout-summary {
    background: #ffffff;
    border-radius: 20px;
    border: 1.5px solid rgba(230, 138, 69, 0.28);
    box-shadow: 0 10px 32px rgba(62, 39, 35, 0.08);
    padding: 2.25rem;
    position: sticky;
    top: 100px;
}

.ml-checkout-item {
    display: flex;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(62, 39, 35, 0.1);
    margin-bottom: 1.5rem;
}

.ml-checkout-item__img {
    width: 86px;
    height: 86px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(62, 39, 35, 0.1);
}

.ml-checkout-item__info {
    flex: 1 1 auto;
}

.ml-checkout-item__title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ml-ink, #3e2723);
    margin: 0 0 0.35rem 0;
}

.ml-checkout-item__meta {
    font-size: 0.88rem;
    color: var(--ml-ink-muted, #6d4c41);
    margin: 0 0 0.45rem 0;
}

.ml-checkout-item__price {
    font-weight: 700;
    color: var(--ml-accent, #e68a45);
    font-size: 1.05rem;
}

.ml-checkout-lines {
    margin-bottom: 1.75rem;
}

.ml-checkout-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    color: var(--ml-ink-muted, #6d4c41);
}

.ml-checkout-line--total {
    border-top: 1px solid rgba(62, 39, 35, 0.12);
    padding-top: 1.15rem;
    margin-top: 1.15rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--ml-ink, #3e2723);
}

.ml-checkout-split-box {
    background: #fffaf5;
    border: 1px dashed rgba(230, 138, 69, 0.4);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--ml-ink-muted, #6d4c41);
    margin-bottom: 1.75rem;
}

.ml-checkout-submit-btn {
    width: 100%;
    padding: 1.05rem 1.5rem;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-accent, #e68a45) 0%, #d6742e 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(230, 138, 69, 0.35);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.ml-checkout-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(230, 138, 69, 0.45);
    background: linear-gradient(135deg, #d6742e 0%, #c46322 100%);
}
