/* Silvercity Moneris Checkout: Review + Pay steps.
   Uses the colour tokens from the booking redesign (cart-expiry 1.12),
   with fallbacks so it also looks right without it. */

body.scm-flow {
	/* superdesign brief 2026-11-02: soft off-white light theme */
	--scm-ink: #1f2933;
	--scm-head: #14202b;
	--scm-muted: #4a5561;
	--scm-line: #ddd6c8;
	--scm-soft: #efebe2;
	--scm-card: #fbf9f4;
	--scm-brand: #0b6e8e;
	--scm-brand-d: #0a6a87;
	--scm-brand-l: #e3f1f4;
	--scm-ticket: #0d7a9c;
	--scm-go: #e8590c;
	--scm-go-d: #c2410c;
	--scm-ok: #1e7b4a;
	--scm-ok-bg: #e3f3ea;
	--scm-bad: #b42318;
	--scm-bad-bg: #fdecea;
	--scm-shadow: 0 6px 18px rgba(20, 32, 43, .08);
}
/* Calm Slate dark (Silvercity Dark Mode sets html[data-scdm="dark"]) */
html[data-scdm="dark"] body.scm-flow, html[data-theme="dark"] body.scm-flow {
	--scm-ink: #eef2f5;
	--scm-head: #eef2f5;
	--scm-muted: #b9c4ce;
	--scm-line: #334253;
	--scm-soft: #26323f;
	--scm-card: #1e2832;
	--scm-brand: #7fd4f0;
	--scm-brand-d: #7fd4f0;
	--scm-brand-l: #20363f;
	--scm-ok: #7ee2a8;
	--scm-ok-bg: #16301f;
	--scm-bad: #ff8a80;
	--scm-bad-bg: #2e1716;
	--scm-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

/* ---------- Review step: tickets first, then details, policies, button */

body.scm-flow form.checkout {
	display: flex;
	flex-direction: column;
}
body.scm-flow form.checkout > * { order: 10; }
body.scm-flow form.checkout #order_review_heading { order: 1; margin-top: 0 !important; }
body.scm-flow form.checkout .scm-review-intro { order: 2; }
body.scm-flow form.checkout #order_review { display: contents; }
body.scm-flow form.checkout .woocommerce-checkout-review-order-table { order: 3; }
body.scm-flow form.checkout #customer_details { order: 4; margin-top: 28px; }
body.scm-flow form.checkout #order_review > *:not(.woocommerce-checkout-review-order-table):not(#payment) { order: 5; }
body.scm-flow form.checkout #payment { order: 6; }
body.scm-flow form.checkout #customer_details,
body.scm-flow form.checkout #customer_details .col-1,
body.scm-flow form.checkout #customer_details .col-2,
body.scm-flow form.checkout #order_review_heading,
body.scm-flow form.checkout #payment { width: 100% !important; float: none !important; margin-left: 0; margin-right: 0; }

.scm-review-intro {
	margin: -6px 0 16px !important;
	color: var(--scm-muted);
	font-size: 17px;
}

/* the "you'll pay next" note in the payment box */
.scm-next-note { font-size: 17px; line-height: 1.5; color: var(--scm-ink); }
.scm-next-note p { margin: 0 0 8px; }
.scm-next-note .scm-next-title { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.scm-next-note .scm-cards { color: var(--scm-muted); font-size: 15px; margin: 0; }
.scm-test-banner {
	background: #fff4d6; border: 1px solid #e9b94e; color: #5c3b00;
	border-radius: 10px; padding: 10px 14px; font-size: 15px; margin: 0 0 12px !important;
}

/* one payment method: no radio button, no grey method row */
body.scm-single-method #payment .wc_payment_methods > li > input[type="radio"],
body.scm-single-method #payment .wc_payment_methods > li > label { display: none !important; }
body.scm-single-method #payment .wc_payment_methods > li { background: var(--scm-card) !important; border-bottom: 0 !important; padding: 18px 20px 4px !important; }
body.scm-single-method #payment .payment_box { display: block !important; padding: 0 !important; margin: 0 !important; background: transparent !important; }

/* lock + tick icons drawn in CSS so there is nothing to download */
.scm-lock {
	display: inline-block; width: 14px; height: 11px; border-radius: 2px;
	background: currentColor; position: relative; margin: 6px 3px 0 3px; flex: 0 0 auto;
}
.scm-lock::before {
	content: ""; position: absolute; left: 2px; top: -7px; width: 10px; height: 9px;
	border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; box-sizing: border-box;
}
.scm-tick {
	display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--scm-ok);
	position: relative; flex: 0 0 auto;
}
.scm-tick::after {
	content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px;
	border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* ---------- Pay step ---------- */

body.scm-paying:not(.scm-orderpay):not(.scm-onepage) form.checkout,
body.scm-paying:not(.scm-orderpay) .woocommerce-form-coupon-toggle,
body.scm-paying:not(.scm-orderpay) .woocommerce-form-coupon,
body.scm-paying:not(.scm-orderpay) .woocommerce-NoticeGroup,
body.scm-paying:not(.scm-orderpay) .woocommerce-notices-wrapper { display: none !important; }

body.scm-orderpay.scm-paying #place_order { display: none !important; }
/* 1.0.5, one page on computers: the details stay above the card form,
   dimmed and locked while paying. */
body.scm-paying.scm-onepage form.checkout { opacity: .6; pointer-events: none; user-select: none; }
body.scm-paying.scm-onepage form.checkout #payment,
body.scm-paying.scm-onepage form.checkout #place_order,
body.scm-paying.scm-onepage form.checkout .scm-next-note,
body.scm-paying.scm-onepage form.checkout .woocommerce-terms-and-conditions-wrapper,
body.scm-paying.scm-onepage form.checkout #scp-policy-wrap { display: none !important; }
body.scm-paying.scm-onepage #scm-pay { margin-top: 24px; scroll-margin-top: 90px; }
/* 1.0.4: the pay page is the Pay step. One way to pay, so no radio row,
   and policies already accepted at checkout are not asked again. */
body.scm-orderpay.scm-paying .wc_payment_methods > li:only-child > input.input-radio,
body.scm-orderpay.scm-paying .wc_payment_methods > li:only-child > label { display: none !important; }
body.scm-orderpay.scm-paying.scm-agreed #scp-policy-wrap,
body.scm-orderpay.scm-paying.scm-agreed .woocommerce-terms-and-conditions-wrapper { display: none !important; }

.scm-pay[hidden] { display: none !important; }
.scm-pay { font-size: 18px; line-height: 1.5; color: var(--scm-ink); }
.scm-pay-card {
	position: relative; background: var(--scm-card); border: 1px solid var(--scm-line); border-radius: 16px;
	padding: 24px 24px 20px; box-shadow: var(--scm-shadow);
}
.scm-pay-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.scm-pay h2 { font-size: 26px !important; margin: 0 0 4px !important; line-height: 1.2; outline: none; }
.scm-pay-sum { margin: 0; color: var(--scm-muted); font-size: 17px; }
.scm-pay-sum strong { color: var(--scm-ink); }
.scm-pay-sum [data-scm="total"] { color: var(--scm-brand-d); font-size: 20px; }

.scm-back {
	background: transparent !important; color: var(--scm-brand-d) !important; border: 2px solid var(--scm-brand) !important;
	border-radius: 999px !important; padding: 8px 16px !important; font: inherit; font-size: 16px !important;
	font-weight: 700 !important; cursor: pointer; min-height: 44px; text-transform: none !important; letter-spacing: 0 !important;
}
.scm-back:hover { background: var(--scm-brand-l) !important; }

.scm-held {
	display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; padding: 10px 14px;
	background: var(--scm-ok-bg); border-radius: 12px; font-size: 16px; color: var(--scm-ok);
}

.scm-msg {
	border: 2px solid var(--scm-bad); background: var(--scm-bad-bg); border-radius: 14px;
	padding: 14px 16px; margin: 0 0 14px;
}
.scm-msg[hidden] { display: none !important; }
.scm-msg p { margin: 0 0 6px; }
.scm-msg-title { font-weight: 800; color: var(--scm-bad); font-size: 19px; }
.scm-retry {
	margin-top: 6px; background: var(--scm-go) !important; color: #fff !important; border: 0 !important;
	border-radius: 12px !important; padding: 12px 22px !important; font: inherit; font-weight: 800 !important;
	font-size: 18px !important; cursor: pointer; min-height: 48px; text-transform: none !important;
}
.scm-retry:hover { background: var(--scm-go-d) !important; }
.scm-retry[hidden] { display: none !important; }
.scm-alt { margin: 10px 0 0 !important; font-size: 17px; }
.scm-alt a { color: var(--scm-brand-d); font-weight: 700; }

.scm-frame { position: relative; min-height: 120px; }
#scm-mco { width: 100%; }
/* Moneris' real form (Google Pay, card logos, fields, button) is about
   900px tall (more with an error message); give the frame that room so there's no scroll bar inside it. */
#scm-mco:not(:empty) { min-height: 1000px; }
#scm-mco > div { height: auto !important; max-height: none !important; overflow: visible !important; }
#scm-mco iframe { width: 100% !important; height: 1000px !important; min-height: 1000px; max-height: none !important; border: 0; display: block; }

.scm-loading {
	display: flex; align-items: center; justify-content: center; gap: 12px; padding: 34px 12px;
	border: 2px dashed var(--scm-line); border-radius: 14px; color: var(--scm-muted); background: var(--scm-soft);
}
.scm-loading[hidden] { display: none !important; }

.scm-spinner {
	width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--scm-brand-l);
	border-top-color: var(--scm-brand); animation: scm-spin .8s linear infinite; flex: 0 0 auto;
}
@keyframes scm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scm-spinner { animation-duration: 2.4s; } }

.scm-secure { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 15px; color: var(--scm-muted); }

.scm-busy {
	position: absolute; inset: 0; background: color-mix(in srgb, var(--scm-card) 94%, transparent); border-radius: 16px;
	display: flex; align-items: flex-start; justify-content: center; padding-top: 120px; z-index: 5;
}
.scm-busy[hidden] { display: none !important; }
.scm-busy-box { text-align: center; max-width: 420px; padding: 0 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scm-busy-box p { margin: 0; font-weight: 800; font-size: 20px; }
.scm-busy-box .scm-busy-sub { font-weight: 400; font-size: 16px; color: var(--scm-muted); }

/* order-pay page: the card form sits in the payment box */
body.scm-orderpay .scm-pay-card { border: 0; padding: 0; box-shadow: none; }
body.scm-orderpay:not(.scm-can-edit) .scm-back { display: none; }

@media (max-width: 600px) {
	.scm-pay-card { padding: 16px 12px 14px; border-radius: 14px; }
	.scm-pay h2 { font-size: 23px !important; }
	.scm-back { width: 100%; }
	#scm-mco:not(:empty) { min-height: 1150px; }
	#scm-mco iframe { height: 1150px !important; min-height: 1150px; }
	.scm-busy { padding-top: 80px; }
}

/* ---------- Review step, superdesign layout ---------- */

body.scm-flow form.checkout #order_review_heading { font-size: 22px !important; color: var(--scm-head); }
body.scm-flow #customer_details h3 { color: var(--scm-head); }

/* The ticket cards themselves come from the booking redesign
   (Group Booking / Cart Expiry styles); only the totals box and the
   button are styled here. */
body.scm-flow .woocommerce-checkout-review-order-table tfoot { display: block; background: var(--scm-card); border: 1px solid var(--scm-line); border-radius: 16px; padding: 8px 18px; }
body.scm-flow .woocommerce-checkout-review-order-table tfoot tr { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--scm-line); }
body.scm-flow .woocommerce-checkout-review-order-table tfoot tr:last-child { border-bottom: 0; }
body.scm-flow .woocommerce-checkout-review-order-table tfoot th,
body.scm-flow .woocommerce-checkout-review-order-table tfoot td { background: transparent !important; border: 0 !important; padding: 10px 0 !important; color: var(--scm-ink); font-weight: 400; }
body.scm-flow .woocommerce-checkout-review-order-table tfoot .order-total th,
body.scm-flow .woocommerce-checkout-review-order-table tfoot .order-total td { font-size: 22px; font-weight: 800; color: var(--scm-head); }

/* place order: one orange button */
body.scm-flow #place_order {
	background: var(--scm-go) !important; color: #fff !important; border: 0 !important; border-radius: 12px !important;
	min-height: 56px; width: 100%; font-size: 19px !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important;
}
body.scm-flow #place_order:hover { background: var(--scm-go-d) !important; }
body.scm-flow #payment { background: var(--scm-card) !important; border: 1px solid var(--scm-line); border-radius: 16px; }
body.scm-flow #payment .place-order { background: transparent !important; }

/* Two columns when there is room: details on the left; tickets, total,
   policies and the button on the right, staying in view. Measured on the
   checkout's own width, so a theme sidebar doesn't squeeze it. */
body.scm-flow .woocommerce:has(> form.checkout) { container-type: inline-size; }
@container (min-width: 900px) {
	body.scm-flow form.checkout {
		display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); column-gap: 40px; align-items: start;
		/* the details column spans every row; the last row is flexible so
		   its height doesn't stretch the summary rows on the right */
		grid-template-rows: repeat(8, min-content) 1fr;
	}
	body.scm-flow form.checkout > *,
	body.scm-flow form.checkout #order_review > * { grid-column: 2; }
	body.scm-flow form.checkout > .woocommerce-NoticeGroup { grid-column: 1 / -1; grid-row: 1; }
	body.scm-flow form.checkout #customer_details { grid-column: 1; grid-row: 2 / -1; margin-top: 0 !important; }
	body.scm-flow form.checkout #order_review_heading { margin-top: 0 !important; }
	body.scm-flow form.checkout #payment { margin-top: 16px; }
}

/* Step strip: the booking redesign's colours aren't defined on every
   page, so give the dots their own colours here. */
body.scm-flow .sce-steps li span { background: var(--scm-card) !important; border-color: var(--scm-line) !important; color: var(--scm-muted) !important; font-size: 14px !important; }
body.scm-flow .sce-steps li.is-done span { background: #0a6a87 !important; border-color: #0a6a87 !important; color: #fff !important; font-size: 0 !important; }
body.scm-flow .sce-steps li.is-done span::before { content: "\2713"; font-size: 14px; color: #fff; }
html[data-scdm="dark"] body.scm-flow .sce-steps li.is-done span { background: #0d7a9c !important; border-color: #0d7a9c !important; }
body.scm-flow .sce-steps li.is-current span { background: #e8590c !important; border-color: #e8590c !important; color: #fff !important; }
