/* ==========================================================================
   FlexPresets — Checkout Test (Shopify-style)
   Scoped by body.page-template-page-checkout-test or .fp-checkout-page
   ========================================================================== */

:root {
	--fp-fg: #171717;
	--fp-muted-fg: #737373;
	--fp-border: #d4d4d4;
	--fp-border-soft: #e5e5e5;
	--fp-bg: #ffffff;
	--fp-bg-soft: #fafafa;
	--fp-accent: #1773b0;
	--fp-accent-soft: #f5faff;
	--fp-focus: #9b835a;
	--fp-radius: 5px;
}

body.fp-checkout-page {
	margin: 0 !important;
	padding: 0 !important;
	background: #fff !important;
	color: var(--fp-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}
body.fp-checkout-page #wpadminbar { display: none !important; }
html:has(body.fp-checkout-page) { margin-top: 0 !important; background: #fff !important; }

/* ---------- Layout ---------- */
.fp-checkout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 100vh;
}
.fp-checkout__form-col {
	display: flex;
	justify-content: flex-end;
	border-right: 1px solid var(--fp-border-soft);
}
.fp-checkout__inner {
	width: 100%;
	max-width: 560px;
	padding: 48px 48px 64px 32px;
}
.fp-checkout__summary-col { background: var(--fp-bg-soft); }
.fp-checkout__summary-inner {
	max-width: 560px;
	padding: 48px 32px 64px 48px;
	position: sticky;
	top: 0;
}

@media (max-width: 900px) {
	.fp-checkout { grid-template-columns: 1fr; }
	.fp-checkout__form-col { justify-content: stretch; border-right: 0; }
	.fp-checkout__inner,
	.fp-checkout__summary-inner { max-width: 100%; padding: 24px 20px; }
	.fp-checkout__summary-inner { position: static; }
}

/* ---------- Gate shell (single centered column) ---------- */
.fp-gate-shell {
	min-height: 100vh;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}
.fp-gate-shell__inner {
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
}
/* Variant used by the my-account page: gate sits inside the themed page wrapper
   (header + footer remain), but the form is vertically centered in a full
   viewport so the layout breathes like a standalone auth screen. */
.fp-gate-shell--account { min-height: 100vh; padding: 60px 20px; }

/* Tabbed login/register switcher (used on my-account gate).
   Pill container with a single white card that slides between tabs.
   The slide is CSS-only via :has() — the JS just toggles .is-active. */
.fp-gate__tabs {
	position: relative;
	display: flex;
	padding: 4px;
	margin-bottom: 20px;
	border-radius: 12px;
	background: var(--fp-muted, #f5f5f5);
}
.fp-gate__tabs::before {
	content: "";
	position: absolute;
	top: 4px; bottom: 4px; left: 4px;
	width: calc(50% - 4px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: transform .3s ease-out;
	pointer-events: none;
	z-index: 0;
}
.fp-gate__tabs:has(.fp-gate__tab:nth-child(2).is-active)::before {
	transform: translateX(100%);
}
/* Override Flatsome's default button sizing (large min-height + padding) so
   the tab is a tight pill row. */
.fp-gate__tab,
.fp-gate .fp-gate__tabs button.fp-gate__tab {
	position: relative;
	z-index: 1;
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: 38px !important;
	line-height: 1 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: var(--fp-muted-fg) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: color .2s;
}
.fp-gate__tab:hover { color: var(--fp-fg) !important; }
.fp-gate__tab.is-active { color: var(--fp-fg) !important; }

/* Gate-only size overrides — tighter heights / smaller text than the logged-in
   checkout fields. Applies to both checkout guest gate (.fp-checkout--gate)
   and my-account gate (.fp-gate-shell--account) via the shared .fp-gate. */
.fp-gate .fp-sso { height: 42px; font-size: 14px; }
.fp-gate .fp-field input[type="text"],
.fp-gate .fp-field input[type="email"],
.fp-gate .fp-field input[type="password"] {
	height: 46px;
	padding: 0 14px !important;
	font-size: 14px;
	transition: padding .15s, border-color .15s;
}
/* When the field has focus or a value, the label floats to the top — make
   room for it by adding top padding (otherwise the input text would overlap
   the floated label). Empty + unfocused stays symmetric so the placeholder
   sits vertically centered. */
.fp-gate .fp-field:has(> input:focus) input,
.fp-gate .fp-field:has(> input:not(:placeholder-shown)) input {
	padding-top: 14px !important;
}
.fp-gate .fp-form .fp-field > label { font-size: 14px; }
.fp-gate .fp-form .fp-field:has(> input:focus) > label,
.fp-gate .fp-form .fp-field:has(> input:not(:placeholder-shown)) > label {
	top: 8px;
	font-size: 11px;
}
.fp-gate .fp-btn-primary {
	height: 46px;
	font-size: 14px;
	margin-top: 12px;
}

/* Guest gate reuses the 2-col .fp-checkout grid (form left, summary right).
   On mobile the summary is hidden entirely for guests — no collapsible bar. */
@media (max-width: 900px) {
	.fp-checkout--gate .fp-checkout__summary-col { display: none !important; }
}

/* ---------- Logo ---------- */
.fp-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 32px;
}
.fp-logo img { height: 36px; width: auto; }

/* ---------- Sections ---------- */
.fp-section { margin-bottom: 32px; }
.fp-section__title {
	font-size: 18px;
	font-weight: 500;
	margin: 0 0 16px;
	color: var(--fp-fg);
}

/* ---------- Fields (Shopify floating label) ---------- */
.fp-form .fp-field { position: relative; margin-bottom: 12px; }
.fp-field input[type="text"],
.fp-field input[type="email"],
.fp-field input[type="password"] {
	width: 100%;
	height: 53px;
	padding: 16px 14px 0;
	border: 1px solid var(--fp-border);
	border-radius: var(--fp-radius);
	background: #fff;
	font-size: 15px;
	color: var(--fp-fg);
	outline: none;
	box-shadow: none;
	margin: 0;
	transition: border-color .15s, box-shadow .15s;
}
.fp-field input[type="text"]:focus,
.fp-field input[type="email"]:focus,
.fp-field input[type="password"]:focus {
	border-color: var(--fp-focus) !important;
	box-shadow: none !important;
}
.fp-form .fp-field > label {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 15px;
	color: var(--fp-muted-fg);
	font-weight: 400;
	pointer-events: none;
	transition: top .15s, font-size .15s, transform .15s;
	margin: 0;
}
/* Float label up on focus or when the field has a value */
.fp-form .fp-field:has(> input:focus) > label,
.fp-form .fp-field:has(> input:not(:placeholder-shown)) > label {
	top: 9px;
	transform: none;
	font-size: 11px;
}

.fp-req { color: var(--fp-muted-fg); }

.fp-field__hint-right {
	text-align: right;
	margin: -4px 0 12px;
}
.fp-field__hint-right a {
	font-size: 13px;
	color: var(--fp-fg);
	text-decoration: none;
}
.fp-field__hint-right a:hover { text-decoration: underline; }

.fp-row--two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.fp-row--two .fp-field { margin-bottom: 0; }
@media (max-width: 540px) {
	.fp-row--two { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.fp-btn-primary {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	padding: 0 24px;
	border-radius: var(--fp-radius);
	background: var(--fp-fg);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	border: 0;
	cursor: pointer;
	letter-spacing: 0;
	text-transform: none;
	transition: background .15s;
	text-decoration: none;
}
.fp-btn-primary:hover { background: #404040; color: #fff; }

/* Woo's native place-order button + its wrapper row */
.fp-checkout-page .form-row.place-order {
	margin: 24px 0 0;
	padding: 0;
}
.fp-checkout-page #payment .form-row.place-order::after,
.fp-checkout-page #payment .form-row.place-order::before { content: none; }
.fp-checkout-page #place_order { height: 46px !important; font-size: 14px !important;
	display: block;
	width: 100%;
	height: 54px;
	margin: 20px 0 0;
	border-radius: var(--fp-radius);
	background: var(--fp-fg);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	border: 0;
	cursor: pointer;
	letter-spacing: 0;
	text-transform: none;
	transition: background .15s;
	float: none;
}
.fp-checkout-page #place_order:hover { background: #404040; color: #fff; }

/* ---------- Gate ---------- */
.fp-gate__subtitle {
	font-size: 19px;
	font-weight: 600;
	margin: 0 0 20px;
	color: var(--fp-fg);
}

.fp-gate__sso {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 20px;
}
@media (max-width: 540px) {
	.fp-gate__sso { grid-template-columns: 1fr; }
}
/* When Google is hidden (in-app webview), Facebook spans the row */
.fp-gate__sso--single { grid-template-columns: 1fr; }

/* Gated SSO buttons stay hidden until JS reveals them */
.fp-sso[hidden] { display: none !important; }

.fp-sso {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 50px;
	padding: 0 16px;
	border: 1px solid var(--fp-border);
	border-radius: 9999px;
	background: #fff;
	font-size: 15px;
	font-weight: 500;
	color: var(--fp-fg);
	text-decoration: none;
	transition: background .15s, border-color .15s;
}
.fp-sso:hover { background: var(--fp-bg-soft); border-color: #a3a3a3; color: var(--fp-fg); }
.fp-sso svg { width: 18px; height: 18px; flex-shrink: 0; }

.fp-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
}
.fp-divider::before, .fp-divider::after {
	content: ""; flex: 1; height: 1px; background: var(--fp-border-soft);
}
.fp-divider span { font-size: 13px; color: var(--fp-muted-fg); }

.fp-gate__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	margin-top: 16px;
	gap: 14px;
}
.fp-gate__switch {
	align-self: flex-end;
	text-align: right;
	font-size: 14px; color: var(--fp-fg); text-decoration: none;
}
.fp-gate__switch:hover { text-decoration: underline; }
.fp-gate__hint {
	font-size: 13px; color: var(--fp-muted-fg);
	margin: 0 0 16px;
}
.fp-form[hidden],
.fp-gate__subtitle[hidden] { display: none !important; }

/* ---------- Payment block (Woo-native #payment markup) ---------- */
.fp-checkout-page #payment {
	background: transparent;
	border: 0;
	padding: 0;
}
.fp-checkout-page #payment ul.payment_methods {
	border: 1px solid var(--fp-border);
	border-radius: 8px;
	background: #fff;
	padding: 0;
	margin: 0;
	list-style: none;
	overflow: hidden;
}
.fp-checkout-page #payment ul.payment_methods li.wc_payment_method {
	padding: 14px 16px;
	border-bottom: 1px solid var(--fp-border-soft);
	list-style: none;
	margin: 0;
	background: transparent;
}
.fp-checkout-page #payment ul.payment_methods li.wc_payment_method:last-child { border-bottom: 0; }
.fp-checkout-page #payment .payment_box {
	background: transparent;
	margin: 8px 0 0;
	padding: 0;
	font-size: 13px;
	color: var(--fp-muted-fg);
}
.fp-checkout-page #payment .payment_box::before { display: none; }
/* Selected payment row + accent radio */
.fp-checkout-page #payment ul.payment_methods li.wc_payment_method:has(> input:checked) {
	background: var(--fp-accent-soft);
}
.fp-checkout-page #payment ul.payment_methods input.input-radio { accent-color: var(--fp-accent); }

/* ---------- Collapsible mobile summary (between info & payment) ------------
   Desktop: bar hidden, summary shows in the right column normally.
   Mobile: JS moves the summary into .fp-msummary-mount (between the info and
   payment sections); it collapses behind a toggle bar. */
.fp-msummary-bar { display: none; }

@media (max-width: 900px) {
	.fp-checkout { display: flex; flex-direction: column; }
	/* The right column is emptied by JS on mobile — hide the husk */
	.fp-checkout__summary-col:empty { display: none; }

	/* Tighten the gap between logo and the summary bar */
	.fp-checkout__inner { padding-top: 12px; }
	.fp-logo { margin-bottom: 16px; }

	/* The moved summary block, full-bleed within the 20px-padded column */
	.fp-msummary-mount > .fp-checkout__summary-inner {
		margin: 0 -20px 28px;
		padding: 0;
		max-width: none;
		position: static;
		background: var(--fp-bg-soft);
		border-top: 1px solid var(--fp-border-soft);
		border-bottom: 1px solid var(--fp-border-soft);
	}

	.fp-msummary-bar {
		display: flex;
		width: 100%;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 16px 20px;
		margin: 0;
		background: none;
		border: 0;
		box-shadow: none;
		cursor: pointer;
		line-height: 1.2;
	}
	.fp-msummary-bar__label { display: inline-flex; align-items: center; gap: 8px; color: var(--fp-focus); font-size: 14px; }
	.fp-msummary-bar__label > svg { width: 18px; height: 18px; }
	.fp-msummary-bar__chevron { width: 16px; height: 16px; transition: transform .2s; }
	.fp-checkout__summary-inner.is-open .fp-msummary-bar__chevron { transform: rotate(180deg); }
	.fp-msummary-bar__total { font-size: 17px; font-weight: 600; }

	/* Collapsed by default; expand when the bar is toggled */
	.fp-msummary-body { display: none; padding: 4px 20px 24px; }
	.fp-checkout__summary-inner.is-open .fp-msummary-body { display: block; }
}

/* ---------- Order summary ---------- */
.fp-summary { font-size: 14px; }
.fp-summary--empty { color: var(--fp-muted-fg); }

.fp-summary__items { list-style: none; margin: 0 0 20px; padding: 0; }
.fp-summary__item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 12px;
	align-items: center;
	margin-bottom: 16px;
}
.fp-summary__thumb { position: relative; width: 64px; height: 64px; }
.fp-summary__thumb img {
	width: 64px; height: 64px;
	object-fit: cover;
	border: 1px solid var(--fp-border-soft);
	border-radius: 8px;
	background: #fff;
	display: block;
}
.fp-summary__qty {
	position: absolute; top: -8px; right: -8px;
	min-width: 20px; height: 20px; padding: 0 6px;
	background: var(--fp-muted-fg);
	color: #fff;
	font-size: 11px; font-weight: 600;
	border-radius: 9999px;
	display: grid; place-items: center;
}
.fp-summary__name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.fp-summary__col-right {
	display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.fp-summary__price { font-size: 14px; font-weight: 500; white-space: nowrap; }
.fp-summary__remove {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 12px;
	color: var(--fp-muted-fg);
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}
.fp-summary__remove svg { width: 14px; height: 14px; }
.fp-summary__remove:hover { color: var(--fp-fg); }

/* Coupon form */
.fp-summary__coupon {
	display: flex;
	gap: 8px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--fp-border-soft);
	margin: 0 0 20px;
	position: relative;
}
.fp-summary__coupon-icon {
	position: absolute;
	left: 14px; top: 14px;
	width: 16px; height: 16px;
	color: var(--fp-muted-fg);
	pointer-events: none;
}
.fp-summary__coupon input[type="text"] {
	flex: 1;
	height: 44px;
	padding: 0 12px 0 38px;
	border: 1px solid var(--fp-border);
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
	outline: none;
	box-shadow: none;
}
.fp-summary__coupon input[type="text"]:focus { border-color: var(--fp-focus) !important; box-shadow: none !important; }
.fp-summary__coupon button {
	height: 44px;
	padding: 0 20px;
	border: 1px solid var(--fp-border);
	border-radius: 6px;
	background: #fff;
	color: #404040;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
.fp-summary__coupon button:hover { background: #f5f5f5; }

.fp-summary__totals { padding-top: 4px; }
.fp-summary__row {
	display: flex;
	justify-content: space-between;
	color: var(--fp-fg);
	margin-bottom: 10px;
}
.fp-summary__row--coupon {
	color: var(--fp-fg);
	overflow: hidden;
	max-height: 40px; opacity: 1;
	transition: max-height .22s ease, opacity .18s ease, margin .22s ease, padding .22s ease;
}
.fp-summary__row--coupon.is-removing {
	max-height: 0; opacity: 0;
	margin-top: 0; margin-bottom: 0;
	padding-top: 0; padding-bottom: 0;
}
.fp-summary__coupon-code {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--fp-fg);
}
.fp-summary__coupon-code svg { width: 14px; height: 14px; }
.fp-summary__coupon-remove {
	color: var(--fp-accent); margin-left: 6px;
	text-decoration: none;
}
.fp-summary__coupon-remove:hover { text-decoration: underline; }

.fp-summary__row--total {
	padding-top: 16px;
	border-top: 1px solid var(--fp-border-soft);
	margin-top: 8px;
	font-size: 16px;
	font-weight: 600;
	color: var(--fp-fg);
}
.fp-summary__row--total span:last-child { font-size: 22px; }

/* ---------- AJAX loading state ---------- */
.fp-checkout-page .blockUI,
.fp-checkout-page .blockOverlay { display: none !important; }
.fp-summary { transition: opacity .2s ease; }
.fp-summary.processing { opacity: 0.55; pointer-events: none; position: relative; }
.fp-summary.processing::after {
	content: ""; position: absolute; top: 12px; right: 12px;
	width: 16px; height: 16px;
	border: 2px solid var(--fp-border); border-top-color: var(--fp-fg);
	border-radius: 50%;
	animation: fp-spin .7s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }

/* Hide only the "added to cart" success banner; KEEP error notices visible so
   the customer sees validation / payment errors from checkout.js. */
.fp-checkout-page .woocommerce-message { display: none !important; }

/* ==========================================================================
   WooCommerce native checkout elements (real form — Woo owns the logic).
   Billing fields use our floating-label markup (form-billing.php override) so
   the .fp-field / .fp-field--float rules above already style them. The order
   summary uses .fp-summary markup (review-order.php override). Only the bits
   below are WC-specific glue.
   ========================================================================== */

/* Hide stray WC headings the overrides don't emit (belt-and-suspenders) */
.fp-checkout-page .woocommerce-billing-fields > h3,
.fp-checkout-page #ship-to-different-address,
.fp-checkout-page .woocommerce-additional-fields > h3 { display: none; }

/* Kill the theme/Woo divider line under the section heading + billing wrapper */
.fp-checkout-page .fp-section__title,
.fp-checkout-page #customer_details,
.fp-checkout-page .woocommerce-billing-fields,
.fp-checkout-page .woocommerce-billing-fields__field-wrapper,
.fp-checkout-page .woocommerce-additional-fields {
	border: 0 !important;
	box-shadow: none !important;
	padding-top: 0 !important;
}

/* Billing field rows render through .fp-field--float; neutralise WC's .form-row
   defaults so they don't fight the floating-label positioning. */
.fp-checkout-page .woocommerce-checkout .form-row.fp-field { margin: 0; padding: 0; }

/* The review-order fragment root carries the WC class but renders as our
   .fp-summary list — all visuals come from the existing .fp-summary CSS above. */
.fp-checkout-page .woocommerce-checkout-review-order-table { display: block; width: 100%; }

/* The coupon form is now .fp-summary__coupon (existing CSS styles it); the WC
   coupon-discount amount renders through wc_cart_totals_coupon_html() with a
   .woocommerce-remove-coupon link inside the totals row. */
.fp-checkout-page .woocommerce-remove-coupon {
	color: var(--fp-accent);
	margin-left: 6px;
	text-decoration: none;
	font-size: 13px;
}
.fp-checkout-page .woocommerce-remove-coupon:hover { text-decoration: underline; }

/* Checkout error notices */
.fp-checkout-page .woocommerce-NoticeGroup,
.fp-checkout-page .woocommerce-error {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: var(--fp-radius);
	background: #fff4f4;
	border: 1px solid #f3c2c2;
	color: #a33;
	font-size: 14px;
	list-style: none;
}

/* Empty cart panel */
.fp-empty {
	max-width: 480px;
	margin: 0 auto;
	padding: 80px 24px;
	text-align: center;
}
.fp-empty__logo { display: flex; justify-content: center; margin-bottom: 40px; }
.fp-empty__logo img { height: 40px; }
.fp-empty h1 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.fp-empty p { color: var(--fp-muted-fg); margin: 0 0 24px; }

.fp-gate-shell--account .fp-gate__tabs { margin-bottom: 36px; }


/* Account gate: pin to top so tab position doesn't shift between panels. */
.fp-gate-shell--account { align-items: flex-start; }
.fp-gate-shell--account .fp-gate-shell__inner { padding-top: 8%; }

.fp-gate__head { text-align: center; margin-bottom: 28px; }
.fp-gate__head .fp-gate__eyebrow {
	margin: 0 0 8px;
	font-size: 12px; letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--fp-muted-fg, #737373);
}
.fp-gate__head .fp-gate__title {
	margin: 0;
	font-size: 28px; font-weight: 600;
	letter-spacing: -.02em; line-height: 1.1;
	color: var(--fp-fg, #171717);
}
