/* Standalone checkout (Backwater-style layout, Hat Bar tokens) */
.hb-co-pay-outer,
.hb-co-pay-outer * {
	box-sizing: border-box;
}

.hb-co-pay-outer {
	padding: 1.5rem clamp(16px, 4vw, 48px) 4rem;
	font-family: var(--hatbar-sans, "DM Sans", system-ui, sans-serif);
	background: #f5f0e8;
	color: var(--hatbar-ink, #1c1712);
}

.hb-co-pay-inner {
	max-width: 1100px;
	margin: 0 auto;
}

.hb-ch-breadcrumb {
	padding: 12px 0 8px;
	font-size: 0.78rem;
	color: var(--hatbar-ink3, #6b5f4e);
}

.hb-ch-breadcrumb a {
	color: var(--hatbar-copper, #b8763a);
	text-decoration: none;
	font-weight: 500;
}

.hb-ch-breadcrumb a:hover {
	text-decoration: underline;
}

.hb-ch-wrap {
	max-width: 100%;
	min-width: 0;
}

/*
 * Do not use overflow-x: hidden on `.hb-ch-wrap`: with overflow-y: visible it computes to
 * overflow-y: auto and creates a scrollport, which breaks `position: sticky` for the summary.
 * Horizontal overflow is contained on the steps row instead.
 */
.hb-ch-steps {
	display: flex;
	align-items: center;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 0 28px;
	width: 100%;
	box-sizing: border-box;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.hb-ch-step-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hb-ch-step-num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 700;
}

.hb-ch-step-num--done {
	background: #3d7a4a;
	color: #fff;
}

.hb-ch-step-num--active {
	background: var(--hatbar-ink, #1c1712);
	color: #fff;
}

.hb-ch-step-num--pending {
	background: var(--hatbar-sand3, #d8ccb4);
	color: var(--hatbar-ink3, #6b5f4e);
}

.hb-ch-step-label {
	font-size: 0.78rem;
	font-weight: 600;
}

.hb-ch-step-label--active {
	color: var(--hatbar-ink, #1c1712);
}

.hb-ch-step-label--done {
	color: #3d7a4a;
}

.hb-ch-step-label--pending {
	color: var(--hatbar-ink3, #6b5f4e);
}

.hb-ch-step-conn {
	flex: 1;
	height: 1px;
	background: var(--hatbar-sand3, #d8ccb4);
	margin: 0 12px;
	min-width: 16px;
}

.hb-ch-step-item:has(.hb-ch-step-num--done) + .hb-ch-step-conn {
	background: #3d7a4a;
}

@media (max-width: 560px) {
	.hb-co-pay-outer {
		padding: 1rem max(12px, env(safe-area-inset-left)) 2.5rem max(12px, env(safe-area-inset-right));
	}

	.hb-ch-steps {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 10px 0 16px;
	}

	.hb-ch-step-conn {
		display: none;
	}

	.hb-ch-step-item {
		width: 100%;
		box-sizing: border-box;
	}

	.hb-ch-step-label {
		font-size: 0.72rem;
	}

	.hb-ch-step-num {
		width: 24px;
		height: 24px;
		font-size: 0.68rem;
	}
}

@media (min-width: 561px) and (max-width: 720px) {
	.hb-ch-steps {
		flex-wrap: wrap;
		row-gap: 10px;
		padding-left: max(8px, env(safe-area-inset-left));
		padding-right: max(8px, env(safe-area-inset-right));
	}

	.hb-ch-step-conn {
		flex: 1 1 40px;
		min-width: 8px;
		margin: 0 6px;
	}

	.hb-ch-step-label {
		font-size: 0.72rem;
	}
}

.hb-ch-checkout-grid {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 32px;
	align-items: start;
	padding-bottom: 3rem;
	min-width: 0;
}

@media (max-width: 900px) {
	.hb-ch-checkout-grid {
		grid-template-columns: 1fr;
	}
}

.hb-ch-card {
	background: #fff;
	border: 1px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 12px;
	padding: 28px 28px;
	margin-bottom: 16px;
	box-shadow: 0 4px 24px rgba(28, 23, 18, 0.06);
}

@media (max-width: 600px) {
	.hb-ch-card {
		padding: 20px 16px;
	}
}

.hb-ch-card-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--hatbar-sand2, #ede6d6);
}

.hb-ch-badge {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--hatbar-ink, #1c1712);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 700;
	flex-shrink: 0;
}

.hb-ch-card-head h3 {
	margin: 0;
	font-family: var(--hatbar-serif, "Playfair Display", Georgia, serif);
	font-size: 1.05rem;
	font-weight: 600;
}

.hb-ch-fields {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

.hb-ch-fields > * + * {
	margin-top: 1.25rem;
}

.hb-ch-address-choice {
	display: grid;
	gap: 12px;
	margin-bottom: 18px;
}

.hb-ch-address-choice__buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.hb-ch-address-choice__button {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 14px 16px;
	border: 1px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 12px;
	background: #fff;
	color: var(--hatbar-ink, #1c1712);
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.hb-ch-address-choice__button:hover,
.hb-ch-address-choice__button:focus-visible {
	border-color: var(--hatbar-copper, #b8763a);
	box-shadow: 0 0 0 3px rgba(184, 118, 58, 0.1);
	outline: none;
}

.hb-ch-address-choice__button.is-active {
	background: var(--hatbar-ink, #1c1712);
	border-color: var(--hatbar-ink, #1c1712);
	color: #fff;
}

.hb-ch-address-choice__button strong,
.hb-ch-address-choice__preview small,
.hb-ch-address-choice__button small {
	display: block;
}

.hb-ch-address-choice__button strong {
	font-size: 0.9rem;
}

.hb-ch-address-choice__preview {
	padding: 14px 16px;
	border: 1px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 12px;
	background: #fffaf2;
}

.hb-ch-address-choice__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hatbar-ink3, #6b5f4e);
}

.hb-ch-address-choice__preview small,
.hb-ch-address-choice__button small {
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--hatbar-ink3, #6b5f4e);
}

.hb-ch-address-choice__button.is-active small {
	color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 520px) {
	.hb-ch-address-choice__buttons {
		grid-template-columns: 1fr;
	}
}

.hb-ch-field-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: start;
	column-gap: 1.5rem;
	row-gap: 1.25rem;
	width: 100%;
}

@media (max-width: 520px) {
	.hb-ch-field-row {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 1rem;
	}
}

.hb-ch-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
	width: 100%;
	flex: none;
}

.hb-ch-field label {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hatbar-ink2, #3d3529);
}

.hb-ch-field input,
.hb-ch-field select {
	margin: 0;
	min-height: 2.75rem;
	padding: 10px 14px;
	border: 1.5px solid var(--hatbar-sand3, #d8ccb4);
	font-size: 0.9rem;
	font-family: var(--hatbar-sans, "DM Sans", system-ui, sans-serif);
	color: var(--hatbar-ink, #1c1712);
	background: #fff;
	border-radius: 8px;
	outline: none;
	width: 100%;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.hb-ch-field input:focus,
.hb-ch-field select:focus {
	border-color: var(--hatbar-copper, #b8763a);
	box-shadow: 0 0 0 3px rgba(184, 118, 58, 0.15);
}

.hb-ch-field input[readonly] {
	background: var(--hatbar-sand, #f5f0e8);
	color: var(--hatbar-ink3, #6b5f4e);
	cursor: default;
}

.hb-ch-field-error {
	border-color: #c0392b !important;
}

#hb-ch-card-element {
	padding: 12px 14px;
	border: 1.5px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

#hb-ch-card-element.StripeElement--focus {
	border-color: var(--hatbar-copper, #b8763a);
	box-shadow: 0 0 0 3px rgba(184, 118, 58, 0.15);
}

#hb-ch-card-element.StripeElement--invalid {
	border-color: #c0392b;
}

.hb-ch-card-errors {
	font-size: 0.8rem;
	color: #8a2828;
	min-height: 1.2em;
	margin-top: 6px;
}

/* Sticky column: `top` tuned for fixed header + steps on canvas checkout. */
.hb-ch-summary {
	align-self: start;
	min-width: 0;
	width: 100%;
	position: sticky;
	top: 123px;
}

.hb-ch-summary-inner {
	background: var(--hatbar-ink, #1c1712);
	color: #f5f0e8;
	border: none;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(28, 23, 18, 0.25);
}

@media (max-width: 900px) {
	.hb-ch-summary {
		position: static;
	}
}

.hb-ch-summary-head {
	padding: 22px 26px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hb-ch-summary-head h3 {
	margin: 0;
	font-family: var(--hatbar-serif, "Playfair Display", Georgia, serif);
	font-size: 0.98rem;
	font-weight: 700;
	color: #fff;
}

.hb-ch-summary-body {
	padding: 18px 26px 8px;
	max-height: 380px;
	overflow-y: auto;
}

.hb-ch-summary-placeholder {
	margin: 0;
	color: rgba(245, 240, 232, 0.45);
	font-size: 0.9rem;
}

.hb-ch-sum-line {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hb-ch-sum-line--item {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 12px;
	border-bottom: none;
}

.hb-ch-sum-line:last-of-type.hb-ch-sum-line--item {
	margin-bottom: 8px;
}

.hb-ch-sum-line-main {
	min-width: 0;
}

.hb-ch-sum-name {
	display: block;
	font-weight: 600;
	font-size: 0.88rem;
	color: #fff;
}

.hb-ch-sum-sub {
	display: block;
	font-size: 0.72rem;
	color: rgba(245, 240, 232, 0.45);
	margin-top: 3px;
	line-height: 1.35;
}

.hb-ch-sum-price {
	font-size: 0.88rem;
	white-space: nowrap;
	color: #f5f0e8;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.hb-ch-sum-meta {
	padding: 4px 0 2px;
}

.hb-ch-sum-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.84rem;
	margin-bottom: 10px;
}

.hb-ch-sum-row:last-child {
	margin-bottom: 0;
}

.hb-ch-sum-row-label {
	color: rgba(245, 240, 232, 0.5);
}

.hb-ch-sum-row-value {
	font-weight: 600;
	color: #f5f0e8;
	font-variant-numeric: tabular-nums;
}

.hb-ch-summary-divider--inset {
	height: 1px;
	background: rgba(255, 255, 255, 0.1);
	margin: 14px 0 16px;
}

.hb-ch-summary-grand {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding-bottom: 8px;
}

.hb-ch-summary-grand-label {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: rgba(245, 240, 232, 0.5);
}

.hb-ch-summary-grand-amount {
	font-size: 1.85rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.hb-ch-summary-foot {
	padding: 8px 26px 26px;
}

.hb-ch-pay-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 18px;
	background: var(--hatbar-copper, #b8763a);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-transform: none;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
	box-shadow: 0 4px 22px rgba(184, 118, 58, 0.45);
}

.hb-ch-pay-btn:hover:not(:disabled) {
	background: #9d622e;
	transform: translateY(-1px);
	box-shadow: 0 6px 26px rgba(184, 118, 58, 0.5);
}

.hb-ch-pay-btn:active:not(:disabled) {
	transform: translateY(0);
}

.hb-ch-pay-btn:disabled {
	cursor: wait;
	opacity: 0.85;
	transform: none;
}

.hb-ch-pay-btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.hb-ch-card-logos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 14px;
}

.hb-ch-card-logo {
	font-size: 0.58rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 4px;
	padding: 4px 8px;
	color: rgba(245, 240, 232, 0.35);
	text-transform: uppercase;
}

.hb-ch-secure-note {
	margin: 12px 0 0;
	font-size: 0.72rem;
	color: rgba(245, 240, 232, 0.38);
	text-align: center;
}

.hb-ch-empty {
	text-align: center;
	padding: clamp(48px, 10vw, 80px) 1.5rem;
	max-width: 480px;
	margin: 0 auto;
	min-height: calc(100vh - 220px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hb-ch-empty-icon {
	font-size: 3rem;
	line-height: 1;
	margin-bottom: 1rem;
}

.hb-ch-empty-title {
	font-family: var(--hatbar-serif, "Playfair Display", Georgia, serif);
	font-size: 1.5rem;
	margin: 0 0 0.5rem;
}

.hb-ch-empty-sub {
	color: var(--hatbar-ink3, #6b5f4e);
	margin: 0 0 1.5rem;
	line-height: 1.5;
}

.hb-ch-empty-btn {
	display: inline-block;
	padding: 12px 24px;
	background: var(--hatbar-ink, #1c1712);
	color: #f5f0e8 !important;
	text-decoration: none;
	border-radius: 8px;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hb-ch-success-wrap {
	max-width: 560px;
	margin: 48px auto 80px;
	text-align: center;
	padding: 0 clamp(16px, 5vw, 40px);
	min-height: calc(100vh - 220px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hb-ch-success-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #3d7a4a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 22px;
	flex-shrink: 0;
}

.hb-ch-success-title {
	font-family: var(--hatbar-serif, "Playfair Display", Georgia, serif);
	font-size: 1.85rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 12px;
	color: var(--hatbar-ink, #1c1712);
}

.hb-ch-success-sub {
	font-size: 0.95rem;
	color: var(--hatbar-ink3, #6b5f4e);
	line-height: 1.65;
	margin: 0 0 36px;
	max-width: 440px;
}

.hb-ch-success-steps {
	width: 100%;
	max-width: 480px;
	background: #fff;
	border: 1px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 14px;
	padding: 8px 22px;
	text-align: left;
	margin-bottom: 32px;
	box-shadow: 0 4px 24px rgba(28, 23, 18, 0.06);
}

.hb-ch-success-step {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--hatbar-sand2, #ede6d6);
}

.hb-ch-success-step:last-child {
	border-bottom: none;
}

.hb-ch-success-step-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(61, 122, 74, 0.15);
	color: #2d5c38;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	flex-shrink: 0;
	font-weight: 700;
}

.hb-ch-success-step-icon--muted {
	background: var(--hatbar-sand, #f5f0e8);
	color: var(--hatbar-ink2, #3d3529);
	font-weight: 500;
}

.hb-ch-success-step-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.hb-ch-success-step-text strong {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--hatbar-ink, #1c1712);
}

.hb-ch-success-step-text span {
	font-size: 0.8rem;
	color: var(--hatbar-ink3, #6b5f4e);
	line-height: 1.45;
}

.hb-ch-success-btn {
	display: inline-block;
	padding: 14px 28px;
	background: var(--hatbar-ink, #1c1712);
	color: #f5f0e8 !important;
	text-decoration: none;
	border-radius: 10px;
	font-weight: 700;
	font-size: 0.9rem;
	transition: background 0.15s, transform 0.1s;
}

.hb-ch-success-btn:hover {
	background: #2a2219;
}

.hb-ch-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 100200;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.hb-ch-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	max-width: 360px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid var(--hatbar-sand3, #d8ccb4);
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(28, 23, 18, 0.15);
	font-size: 0.85rem;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.35s, transform 0.35s;
	pointer-events: auto;
}

.hb-ch-toast--visible {
	opacity: 1;
	transform: translateY(0);
}

.hb-ch-toast--error {
	border-left: 4px solid #c0392b;
}

.hb-ch-toast--success {
	border-left: 4px solid #3d7a4a;
}

.hb-ch-toast__icon {
	flex-shrink: 0;
	line-height: 1.2;
}

.hb-pay-muted {
	margin: 0;
	color: var(--hatbar-ink3, #6b5f4e);
	line-height: 1.5;
}
