/* SmartFlow checkout — mobile-first, scoped to .sfc-checkout. */

.sfc-checkout {
	--sfc-primary: #4f46e5;
	--sfc-primary-hover: #4338ca;
	--sfc-success: #15803d;
	--sfc-danger: #b91c1c;
	--sfc-text: #111827;
	--sfc-muted: #6b7280;
	--sfc-border: #e5e7eb;
	--sfc-surface: #ffffff;
	--sfc-bg: #f6f7f9;
	--sfc-radius: 12px;
	--sfc-field-radius: 8px;

	color: var(--sfc-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px; /* ≥16px stops iOS zooming into inputs */
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body.sfc-page { background: var(--sfc-bg, #f6f7f9); margin: 0; }
.sfc-checkout *, .sfc-checkout *::before, .sfc-checkout *::after { box-sizing: border-box; }

/* Brand bar (distraction-free mode) */
.sfc-brandbar {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	max-width: 1040px; margin: 0 auto; padding: 14px 16px;
}
.sfc-brandbar__name { color: var(--sfc-text); font-weight: 700; font-size: 18px; text-decoration: none; }
.sfc-brandbar__logo { max-height: 36px; width: auto; display: block; }
.sfc-brandbar__secure { display: inline-flex; align-items: center; gap: 6px; color: var(--sfc-success); font-size: 13px; font-weight: 600; }

.sfc-checkout__main { max-width: 1040px; margin: 0 auto; padding: 0 16px 120px; }

/* Layout: stacked on mobile, two columns on desktop with sticky summary */
.sfc-layout { display: grid; gap: 16px; }
@media (min-width: 900px) {
	.sfc-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 24px; }
	.sfc-summary { grid-column: 2; grid-row: 1; position: sticky; top: 24px; }
	.sfc-main { grid-column: 1; grid-row: 1; }
	.sfc-checkout__main { padding-bottom: 48px; }
}

/* Cards */
.sfc-card, .sfc-summary {
	background: var(--sfc-surface); border: 1px solid var(--sfc-border); border-radius: var(--sfc-radius);
	padding: 20px; margin: 0 0 16px;
}
.sfc-card__title { font-size: 18px; font-weight: 700; margin: 0 0 16px; line-height: 1.3; }

/* Summary */
.sfc-summary { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: start; }
.sfc-summary__media img, .sfc-summary__image { width: 100%; height: auto; border-radius: 8px; display: block; }
.sfc-summary__title { font-size: 18px; font-weight: 800; margin: 0 0 4px; line-height: 1.25; letter-spacing: -0.01em; }
.sfc-summary__headline { margin: 0 0 8px; color: var(--sfc-muted); font-size: 14px; }
.sfc-summary__price { margin: 0; font-size: 22px; font-weight: 800; }
.sfc-summary__price del { color: var(--sfc-muted); font-weight: 500; font-size: 15px; margin-right: 6px; }
.sfc-summary__price ins { text-decoration: none; }
@media (min-width: 900px) {
	.sfc-summary { grid-template-columns: 1fr; }
	.sfc-summary__title { font-size: 22px; }
}
.sfc-benefits { list-style: none; margin: 14px 0 0; padding: 0; grid-column: 1 / -1; }
.sfc-benefits li { position: relative; padding: 4px 0 4px 26px; font-size: 14px; }
.sfc-benefits li::before {
	content: ""; position: absolute; left: 2px; top: 9px; width: 14px; height: 8px;
	border-left: 2.5px solid var(--sfc-success); border-bottom: 2.5px solid var(--sfc-success); transform: rotate(-45deg);
}
.sfc-guarantee {
	grid-column: 1 / -1; margin: 14px 0 0; padding: 10px 12px; border-radius: 8px;
	background: #f0fdf4; color: #166534; font-size: 14px; font-weight: 600;
}
.sfc-variation { margin-top: 12px; }
.sfc-variation label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }

/* Form rows (WooCommerce markup) */
.sfc-checkout .form-row { margin: 0 0 14px; padding: 0; width: 100%; float: none; }
.sfc-checkout .form-row label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; line-height: 1.3; }
.sfc-checkout .form-row .required { color: var(--sfc-danger); text-decoration: none; border: 0; }
.sfc-checkout .form-row .optional { color: var(--sfc-muted); font-weight: 400; }
.sfc-checkout .form-row input.input-text,
.sfc-checkout .form-row textarea,
.sfc-checkout .form-row select,
.sfc-checkout .select2-container .select2-selection--single,
.sfc-checkout #sfc-variation {
	width: 100%; min-height: 48px; padding: 12px 14px; font-size: 16px; line-height: 1.3;
	color: var(--sfc-text); background: #fff; border: 1px solid #d1d5db; border-radius: var(--sfc-field-radius);
	box-shadow: none; appearance: none;
}
.sfc-checkout .form-row select, .sfc-checkout #sfc-variation {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.sfc-checkout .select2-container .select2-selection--single { display: flex; align-items: center; padding: 0 10px; }
.sfc-checkout .select2-container .select2-selection--single .select2-selection__arrow { height: 46px; }
.sfc-checkout .form-row textarea { min-height: 96px; }
.sfc-checkout .form-row input.input-text:focus,
.sfc-checkout .form-row textarea:focus,
.sfc-checkout .form-row select:focus {
	outline: none; border-color: var(--sfc-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}
.sfc-checkout .form-row.woocommerce-invalid input.input-text,
.sfc-checkout .form-row.woocommerce-invalid select { border-color: var(--sfc-danger); }
.sfc-checkout .form-row .description { display: block; margin-top: 4px; font-size: 13px; color: var(--sfc-muted); }
.sfc-checkout .form-row .woocommerce-input-wrapper { display: block; }
.sfc-checkout .form-row input[type="radio"] + label,
.sfc-checkout .form-row label.radio { display: inline-block; font-weight: 500; margin: 0 16px 0 6px; }
.sfc-checkout .form-row.sfc-conditional { transition: opacity .15s; }
.sfc-checkout .form-row.sfc-hidden { display: none; }

/* Checkboxes: consents, create account, terms */
.sfc-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; font-size: 14px; cursor: pointer; margin: 0 0 10px; }
.sfc-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--sfc-primary); }
.sfc-consents { border-top: 1px solid var(--sfc-border); margin-top: 6px; padding-top: 14px; }
.sfc-consent-notice { font-size: 13px; line-height: 1.5; color: var(--sfc-muted); margin: 0; }
.sfc-consent-notice a { color: inherit; text-decoration: underline; }
.sfc-fineprint, .sfc-note { font-size: 13px; color: var(--sfc-muted); margin: 4px 0 0; }
.sfc-note { margin: 0 0 12px; }
.sfc-account-choice div.create-account { margin-top: 10px; }

/* Order review table (WooCommerce) */
.sfc-checkout .woocommerce-checkout-review-order-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 15px; border: 0; }
.sfc-checkout .woocommerce-checkout-review-order-table th,
.sfc-checkout .woocommerce-checkout-review-order-table td { padding: 8px 0; border: 0; border-bottom: 1px solid var(--sfc-border); text-align: left; background: none; }
.sfc-checkout .woocommerce-checkout-review-order-table td:last-child,
.sfc-checkout .woocommerce-checkout-review-order-table th:last-child { text-align: right; }
.sfc-checkout .woocommerce-checkout-review-order-table thead { display: none; }
.sfc-checkout .woocommerce-checkout-review-order-table .order-total th,
.sfc-checkout .woocommerce-checkout-review-order-table .order-total td { font-size: 18px; font-weight: 800; border-bottom: 0; }
.sfc-checkout .woocommerce-shipping-methods { list-style: none; margin: 0; padding: 0; }

/* Payment methods */
.sfc-checkout #payment { background: none; border-radius: 0; }
.sfc-checkout #payment ul.payment_methods { list-style: none; margin: 0 0 12px; padding: 0; border: 0; }
.sfc-checkout #payment ul.payment_methods li {
	border: 1px solid var(--sfc-border); border-radius: var(--sfc-field-radius); padding: 12px 14px; margin: 0 0 8px; background: #fff; line-height: 1.4;
}
.sfc-checkout #payment ul.payment_methods li:has(input:checked) { border-color: var(--sfc-primary); box-shadow: 0 0 0 1px var(--sfc-primary); }
.sfc-checkout #payment ul.payment_methods li > label { font-weight: 600; cursor: pointer; display: inline; margin-left: 6px; }
.sfc-checkout #payment ul.payment_methods li img { max-height: 24px; vertical-align: middle; margin-left: 6px; display: inline; }
.sfc-checkout #payment div.payment_box { background: var(--sfc-bg); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; font-size: 14px; color: var(--sfc-text); }
.sfc-checkout #payment div.payment_box::before { display: none; }
.sfc-checkout #payment div.payment_box p:last-child { margin-bottom: 0; }
.sfc-checkout #payment .place-order { padding: 0; margin: 0; }
.sfc-checkout .woocommerce-terms-and-conditions-wrapper { font-size: 14px; margin: 0 0 12px; }
.sfc-checkout .woocommerce-privacy-policy-text p { font-size: 13px; color: var(--sfc-muted); }

/* Primary button */
.sfc-checkout #place_order,
.sfc-checkout .sfc-btn,
.sfc-sticky-cta button {
	display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 54px;
	padding: 14px 20px; border: 0; border-radius: var(--sfc-button-radius, 10px); background: var(--sfc-primary); color: #fff;
	font-size: 17px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
	transition: background .15s, transform .05s; float: none;
}
.sfc-checkout #place_order:hover, .sfc-checkout .sfc-btn:hover, .sfc-sticky-cta button:hover { background: var(--sfc-primary-hover); color: #fff; }
.sfc-checkout #place_order:active, .sfc-sticky-cta button:active { transform: translateY(1px); }
.sfc-checkout #place_order:focus-visible, .sfc-checkout .sfc-btn:focus-visible { outline: 3px solid var(--sfc-primary); outline-offset: 2px; }
.sfc-checkout .sfc-btn { width: auto; min-width: 220px; }

/* Trust strip */
.sfc-trust { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; color: var(--sfc-muted); font-size: 13px; }
.sfc-trust li::before { content: "✓ "; color: var(--sfc-success); font-weight: 700; }

/* Notices */
.sfc-checkout .woocommerce-error,
.sfc-checkout .woocommerce-message,
.sfc-checkout .woocommerce-info,
.sfc-checkout .woocommerce-NoticeGroup .woocommerce-error {
	list-style: none; margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; font-size: 14px; border: 1px solid;
}
.sfc-checkout .woocommerce-error { background: #fef2f2; border-color: #fecaca; color: var(--sfc-danger); }
.sfc-checkout .woocommerce-message { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.sfc-checkout .woocommerce-info { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.sfc-checkout .woocommerce-error::before, .sfc-checkout .woocommerce-message::before, .sfc-checkout .woocommerce-info::before { display: none; }
.sfc-checkout .woocommerce-form-coupon, .sfc-checkout .woocommerce-form-login { background: #fff; border: 1px solid var(--sfc-border); border-radius: var(--sfc-radius); padding: 16px; margin: 0 0 16px; }
.sfc-checkout .blockUI.blockOverlay { border-radius: var(--sfc-radius); }

/* Sticky mobile CTA */
.sfc-sticky-cta {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, .96); border-top: 1px solid var(--sfc-border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
	transform: translateY(110%); transition: transform .2s ease;
}
.sfc-sticky-cta.is-visible { transform: translateY(0); }
@media (min-width: 900px) { .sfc-sticky-cta { display: none; } }
@media (prefers-reduced-motion: reduce) { .sfc-sticky-cta { transition: none; } }

/* Thank-you */
.sfc-thanks { max-width: 640px; margin: 24px auto 0; }
.sfc-thanks__hero {
	background: var(--sfc-surface); border: 1px solid var(--sfc-border); border-radius: var(--sfc-radius);
	padding: 32px 20px; text-align: center; margin-bottom: 16px;
}
.sfc-thanks__hero h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; font-weight: 800; letter-spacing: -0.01em; }
.sfc-thanks__hero p { margin: 0 0 16px; }
.sfc-thanks__hero.is-error h1 { color: var(--sfc-danger); }
.sfc-thanks__eyebrow { color: var(--sfc-success); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.sfc-downloads { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 16px; }
.sfc-muted { color: var(--sfc-muted); font-size: 14px; }
.sfc-address { text-align: left; background: var(--sfc-bg); border-radius: 8px; padding: 12px 14px; margin-top: 8px; }
.sfc-address h2 { font-size: 14px; margin: 0 0 4px; }
.sfc-address address { font-style: normal; font-size: 14px; }
.sfc-receipt {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 16px; padding: 16px 20px;
	background: var(--sfc-surface); border: 1px solid var(--sfc-border); border-radius: var(--sfc-radius);
}
@media (min-width: 600px) { .sfc-receipt { grid-template-columns: repeat(4, 1fr); } }
.sfc-receipt dt { font-size: 12px; color: var(--sfc-muted); text-transform: uppercase; letter-spacing: .04em; }
.sfc-receipt dd { margin: 2px 0 0; font-weight: 700; }
.sfc-thanks__gateway:empty { display: none; }
.sfc-thanks__gateway { font-size: 14px; }
.sfc-checkout--embedded .sfc-thanks { margin-top: 0; }

/* Checkout designs (SmartFlow → Checkouts → Designs) */
@media (min-width: 900px) {
	.sfc-layout--summary-left { grid-template-columns: 380px minmax(0, 1fr); }
	.sfc-layout--summary-left .sfc-summary { grid-column: 1; }
	.sfc-layout--summary-left .sfc-main { grid-column: 2; }
}
.sfc-layout--single { grid-template-columns: minmax(0, 1fr) !important; max-width: 680px; margin: 0 auto; }
.sfc-layout--single .sfc-summary, .sfc-layout--single .sfc-main { grid-column: 1 !important; grid-row: auto !important; position: static; }
.sfc-design--single .sfc-brandbar { max-width: 680px; }

.sfc-announcement { background: var(--sfc-primary); color: #fff; text-align: center; font-size: 14px; font-weight: 600; padding: 9px 16px; }
.sfc-preview-banner { position: sticky; top: 0; z-index: 50; background: #111827; color: #fff; text-align: center; font-size: 13px; padding: 6px 12px; }
.sfc-preview-banner ~ .sfc-checkout__main #place_order { opacity: .6; pointer-events: none; }

.sfc-summary__media:empty { display: none; }
.sfc-summary:not(:has(.sfc-summary__media)) { grid-template-columns: 1fr; }

.sfc-testimonials { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 14px; }
.sfc-testimonial { margin: 0; padding: 12px 14px; background: var(--sfc-bg); border-radius: var(--sfc-field-radius); }
.sfc-testimonial blockquote { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sfc-text); }
.sfc-testimonial blockquote::before { content: "\201C"; color: var(--sfc-primary); font-weight: 800; margin-right: 2px; }
.sfc-testimonial figcaption { margin-top: 6px; font-size: 13px; color: var(--sfc-muted); font-weight: 600; }

.sfc-countdown { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--sfc-radius); background: var(--sfc-surface); border: 1px dashed var(--sfc-primary); }
.sfc-countdown__label { font-size: 14px; color: var(--sfc-muted); }
.sfc-countdown__clock { font-size: 20px; font-weight: 800; color: var(--sfc-primary); font-variant-numeric: tabular-nums; }

.sfc-faq__item { border-top: 1px solid var(--sfc-border); padding: 10px 0; }
.sfc-faq__item:first-of-type { border-top: 0; padding-top: 0; }
.sfc-faq__item summary { cursor: pointer; font-weight: 600; }
.sfc-faq__item p { margin: 8px 0 0; color: var(--sfc-muted); font-size: 15px; }

.sfc-checkout-footer { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; text-align: center; font-size: 13px; color: var(--sfc-muted); }
.sfc-admin-reason { margin: 16px auto; max-width: 520px; text-align: left; font-size: 14px; line-height: 1.5; background: #fff8e1; border: 1px solid #f0c36d; border-radius: 8px; padding: 12px 14px; }
.sfc-admin-reason p { margin: 0 0 6px; }
.sfc-admin-reason p:last-child { margin: 0; }

/*
 * Theme guard: many themes (Astra, OceanWP, Storefront, Flatsome…) style WooCommerce's
 * #order_review_heading / #order_review / #customer_details as floated, fixed-width, bordered
 * columns for their own checkout. Inside a SmartFlow checkout those blocks belong to our cards.
 */
.sfc-checkout form.checkout #order_review_heading,
.sfc-checkout form.checkout #order_review,
.sfc-checkout form.checkout #customer_details,
.sfc-checkout form.checkout .col2-set,
.sfc-checkout form.checkout .col2-set .col-1,
.sfc-checkout form.checkout .col2-set .col-2 {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	position: static !important;
	clear: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	transform: none !important;
}
.sfc-checkout form.checkout #order_review,
.sfc-checkout form.checkout #order_review_heading { padding-left: 0 !important; padding-right: 0 !important; }
.sfc-checkout form.checkout #order_review { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; }
.sfc-checkout form.checkout { display: block !important; width: auto !important; float: none !important; }
.sfc-checkout .sfc-card--payment { overflow: visible; }
.sfc-checkout .sfc-card--payment::after { content: ""; display: table; clear: both; }
.sfc-checkout form.checkout #payment { float: none !important; width: auto !important; background: transparent !important; border-radius: 0; }
.sfc-checkout form.checkout #payment .place-order,
.sfc-checkout form.checkout #place_order { float: none !important; width: 100% !important; }
.sfc-checkout form.checkout #order_review table.shop_table { width: 100% !important; float: none !important; margin-left: 0 !important; margin-right: 0 !important; }
