/* Custom WooCommerce Checkout Styles
 * WFH Lead Premium Design
 */

.woocommerce-checkout {
    padding: 0 0 100px 0;
}

/* ── Section cards ──────────────────────────────────────────────── */
.wfh-checkout-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.wfh-checkout-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Order summary card ─────────────────────────────────────────── */
.wfh-order-summary-card {
    border-top: 3px solid #2563eb;
}

.wfh-order-summary-heading {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #9ca3af !important;
    margin-bottom: 20px !important;
}

/* ── Sticky right column ────────────────────────────────────────── */
.wfh-order-review-card {
    position: sticky;
    top: 100px;
}

/* ── Form fields ────────────────────────────────────────────────── */
.woocommerce-checkout .form-row {
    margin-bottom: 18px;
}

.woocommerce-checkout label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #374151;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.01em;
}

.woocommerce-checkout input.input-text,
.woocommerce-checkout textarea,
.woocommerce-checkout select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.18s, background 0.18s;
    outline: none;
}

.woocommerce-checkout input.input-text:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus {
    border-color: #93c5fd;
    background: #ffffff;
    box-shadow: none !important;
}

/* ── Review order table ─────────────────────────────────────────── */
#order_review_heading {
    display: none;
}

.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 4px;
}

.woocommerce-checkout-review-order-table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    padding: 0 0 12px;
    border-bottom: 1px solid #f0f1f3;
    text-align: left;
}

.woocommerce-checkout-review-order-table thead th:last-child,
.woocommerce-checkout-review-order-table td:last-child {
    text-align: right;
}

.woocommerce-checkout-review-order-table tbody td {
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #374151;
    vertical-align: middle;
}

.woocommerce-checkout-review-order-table .product-name {
    font-weight: 600;
    color: #111827;
}

.woocommerce-checkout-review-order-table .product-quantity {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.82rem;
}

.woocommerce-checkout-review-order-table tfoot tr th,
.woocommerce-checkout-review-order-table tfoot tr td {
    padding: 10px 0;
    font-size: 0.88rem;
    color: #6b7280;
    border-bottom: none;
}

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

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111827;
    padding-top: 18px;
    border-top: 1.5px solid #e5e7eb;
}

/* ── Payment section inside merged card ─────────────────────────── */
#payment {
    border-top: 1px solid #f0f1f3;
    margin-top: 8px;
    padding-top: 24px;
}

/* ── Payment methods ────────────────────────────────────────────── */
#payment {
    background: transparent !important;
    margin-top: 16px;
}

#payment ul.payment_methods {
    border: none !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
}

#payment ul.payment_methods li {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px !important;
    margin-bottom: 10px;
    transition: border-color 0.15s, background 0.15s;
}

#payment ul.payment_methods li:has(input[type="radio"]:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

#payment ul.payment_methods li label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

#payment ul.payment_methods li input[type="radio"] {
    margin-right: 10px;
    accent-color: #2563eb;
}

/* ── Place Order button ─────────────────────────────────────────── */
#place_order {
    width: 100%;
    padding: 16px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    background: #2563eb !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.20) !important;
    transition: background 0.18s, box-shadow 0.18s !important;
    letter-spacing: 0.01em;
}

#place_order:hover {
    background: #1d4ed8 !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.30) !important;
    transform: none;
    filter: none;
}

#place_order:active {
    background: #1e40af !important;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.20) !important;
}

/* ── Coupon field ───────────────────────────────────────────────── */
.wfh-coupon-wrap {
    border-top: 1px solid #f0f1f3;
    padding-top: 16px;
    margin-top: 16px;
}

.wfh-coupon-form {
    display: flex;
    gap: 8px;
}

.wfh-coupon-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.18s, background 0.18s;
    outline: none;
}

.wfh-coupon-input:focus {
    border-color: #93c5fd;
    background: #fff;
}

.wfh-coupon-input::placeholder { color: #9ca3af; }

.wfh-coupon-btn {
    padding: 9px 16px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.wfh-coupon-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* ── WPSwings renewal row ───────────────────────────────────────── */
tr.wps_recurring_bifurcation_wrapper {
    display: none !important;
}

/* ── Stripe mandate / authorization text ───────────────────────── */
.wc-stripe-mandate-text,
.payment_box .wc-stripe-mandate-text,
#payment .payment_box p,
.stripe-mandate-text,
.woocommerce-terms-and-conditions-wrapper p {
    font-size: 0.72rem !important;
    color: #9ca3af !important;
    line-height: 1.5 !important;
}

tr.wps_recurring_bifurcation_wrapper th,
tr.wps_recurring_bifurcation_wrapper td {
    padding: 12px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    vertical-align: middle !important;
}

tr.wps_recurring_bifurcation_wrapper th h4,
tr.wps_recurring_bifurcation_wrapper th h3,
tr.wps_recurring_bifurcation_wrapper th {
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
}

tr.wps_recurring_bifurcation_wrapper td {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    text-align: right !important;
}

/* Hide the inner subtotal row — only show the total/month line */
tr.wps_recurring_bifurcation_wrapper td table tr:first-child {
    display: none !important;
}

tr.wps_recurring_bifurcation_wrapper td table tr td {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    text-align: right !important;
    padding: 0 !important;
    border: none !important;
}

/* Hide standalone WooCommerce subtotal row — redundant for flat subscriptions */
tr.cart-subtotal {
    display: none !important;
}

/* ── Error notices ──────────────────────────────────────────────── */
.woocommerce-checkout .woocommerce-error,
.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 10px !important;
    color: #991b1b !important;
    padding: 14px 18px !important;
    font-size: 0.88rem !important;
    margin-bottom: 24px !important;
    list-style: none !important;
}

.woocommerce-checkout .woocommerce-error li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    color: #991b1b !important;
    font-size: 0.88rem !important;
}

/* ── Privacy policy text ────────────────────────────────────────── */
.woocommerce-privacy-policy-text,
.woocommerce-privacy-policy-text p {
    font-size: 0.72rem !important;
    color: #9ca3af !important;
    line-height: 1.5;
}

.woocommerce-privacy-policy-text a {
    color: #6b7280 !important;
}

/* ── Trust line ─────────────────────────────────────────────────── */
.wfh-checkout-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
    margin: 12px 0 0;
    text-align: center;
}

.wfh-checkout-trust svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* ── Notices ────────────────────────────────────────────────────── */
.woocommerce-info,
.woocommerce-error,
.woocommerce-message {
    border-radius: 10px !important;
    border: none !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    padding: 14px 20px !important;
    font-size: 0.9rem !important;
}

.woocommerce-error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

/* Remove focus rings */
*:focus,
*:active {
    outline: none !important;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wfh-checkout-section {
        padding: 22px 20px;
    }
}

/* =============================================
   Thank You / Order Received Page
   ============================================= */

.woocommerce-order {
    max-width: 100%;
    margin: 0;
}

.woocommerce-thankyou-order-received {
    display: none !important;
}

/* ── Success Hero ─────────────────────────────── */
.wfh-thankyou-hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 28px;
}

.wfh-thankyou-hero .wfh-success-icon {
    width: 60px;
    height: 60px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

.wfh-thankyou-hero .wfh-success-icon svg {
    width: 30px;
    height: 30px;
    color: #fff;
    stroke: #fff;
}

.wfh-thankyou-hero h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.wfh-thankyou-hero p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

/* ── Order Meta Chips ────────────────────────── */
.wfh-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    list-style: none !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.wfh-order-meta__chip {
    flex: 1 1 160px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.wfh-order-meta__chip .label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 6px;
}

.wfh-order-meta__chip .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

/* ── Order Detail Card ───────────────────────── */
.wfh-order-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.wfh-order-card__header {
    padding: 14px 24px;
    border-bottom: 1px solid #f0f1f3;
    background: #f9fafb;
}

.wfh-order-card__header h2 {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #9ca3af !important;
    margin: 0 !important;
}

/* ── Items Table ─────────────────────────────── */
.wfh-order-table {
    width: 100%;
    border-collapse: collapse;
}

.wfh-order-table thead th {
    padding: 11px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    border-bottom: 1px solid #f0f1f3;
    background: #fafafa;
}

.wfh-order-table thead th:last-child { text-align: right; }

.wfh-order-table tbody tr { border-bottom: 1px solid #f3f4f6; }
.wfh-order-table tbody tr:last-child { border-bottom: none; }

.wfh-order-table td {
    padding: 16px 24px;
    vertical-align: middle;
    color: #374151;
    font-size: 0.95rem;
}

.wfh-order-table .product-name { font-weight: 600; color: #111827; }
.wfh-order-table .product-name a { color: #111827; text-decoration: none; }
.wfh-order-table .product-name a:hover { color: #2563eb; }
.wfh-order-table .product-quantity { font-weight: 400; color: #9ca3af; font-size: 0.85rem; }
.wfh-order-table .product-total { text-align: right; font-weight: 600; color: #111827; }

/* ── Totals ──────────────────────────────────── */
.wfh-order-totals tr th,
.wfh-order-totals tr td {
    padding: 11px 24px;
    font-size: 0.9rem;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
}

.wfh-order-totals tr td { text-align: right; }

.wfh-order-totals tr:last-child th,
.wfh-order-totals tr:last-child td {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    border-top: 2px solid #e5e7eb;
    padding-top: 16px;
    padding-bottom: 18px;
}

/* ── Address Grid ────────────────────────────── */
.wfh-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 20px 24px;
}

.wfh-address-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.wfh-address-card h2 {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #9ca3af !important;
    margin: 0 0 10px !important;
}

.wfh-address-card address {
    font-style: normal;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.65;
}

.wfh-address-card .woocommerce-customer-details--phone,
.wfh-address-card .woocommerce-customer-details--email {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: #6b7280;
}

/* ── Failed Order ────────────────────────────── */
.wfh-order-failed {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    color: #991b1b;
    font-size: 0.95rem;
}

.wfh-order-failed a {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    margin-right: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    background: #fff;
    border: 1px solid #fca5a5;
    color: #991b1b;
    transition: background 0.15s;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 600px) {
    .wfh-thankyou-hero { padding: 28px 20px; }
    .wfh-order-meta__chip { flex: 1 1 130px; }
    .wfh-order-table td,
    .wfh-order-table thead th,
    .wfh-order-totals tr th,
    .wfh-order-totals tr td {
        padding-left: 16px;
        padding-right: 16px;
    }
}
