/* Grabllo Stripe Embedded Checkout
 * The Stripe payment fields render inside Stripe's hosted element. Everything
 * in this file is scoped to the surrounding product/cart checkout modal.
 */

/* Keep WooCommerce Add to cart and add a distinct Buy now action beside it. */
.woocommerce.single-product form.cart .single_add_to_cart_button,
.woocommerce.single-product form.cart .cse-buy-now {
	flex: 1 1 0;
	min-width: 0;
	height: 54px;
	padding-inline: 16px;
	border: 0;
	border-radius: var(--r-sm, 8px);
	font-size: 0.9375rem;
	font-weight: 560;
	line-height: 1;
	white-space: nowrap;
}

.woocommerce.single-product form.cart .single_add_to_cart_button {
	background: var(--ink, #0a0b0d);
	color: #fff;
}

.woocommerce.single-product form.cart .single_add_to_cart_button:hover {
	background: var(--ink-2, #15171a);
}

.woocommerce.single-product form.cart .cse-buy-now,
.woocommerce.single-product form.cart .cse-buy-now.alt {
	background: var(--brand, #006dfb);
	color: #fff;
}

.woocommerce.single-product form.cart .cse-buy-now:hover,
.woocommerce.single-product form.cart .cse-buy-now.alt:hover {
	background: var(--brand-deep, #0052c9);
	color: #fff;
}

.woocommerce.single-product form.cart .cse-buy-now:focus-visible {
	outline: 3px solid rgba(0, 109, 251, 0.28);
	outline-offset: 2px;
}

.cse-modal[hidden] {
	display: none !important;
}

.cse-modal,
.cse-modal *,
.cse-modal *::before,
.cse-modal *::after {
	box-sizing: border-box;
}

html.cse-modal-open,
body.cse-modal-open {
	overflow: hidden !important;
	overscroll-behavior: none;
}

.cse-modal {
	--cse-ink: var(--ink, #0a0b0d);
	--cse-ink-2: var(--ink-2, #15171a);
	--cse-bone: var(--bone, #f5f3f0);
	--cse-paper: var(--paper, #ffffff);
	--cse-brand: var(--brand, #006dfb);
	--cse-brand-hi: var(--brand-hi, #3a8dff);
	--cse-brand-deep: var(--brand-deep, #0052c9);
	--cse-text: var(--text, #14161a);
	--cse-muted: var(--muted, #5f6570);
	--cse-line: var(--line, rgba(10, 11, 13, 0.10));
	--cse-line-strong: var(--line-strong, rgba(10, 11, 13, 0.18));
	--cse-r-lg: var(--r-lg, 16px);
	--cse-r-sm: var(--r-sm, 8px);
	--cse-font: var(--font, 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif);
	--cse-mono: var(--font-mono, 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace);
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
	background: rgba(10, 11, 13, 0.72);
	font-family: var(--cse-font);
	color: var(--cse-text);
	isolation: isolate;
}

.cse-shell {
	position: relative;
	display: grid;
	grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
	width: min(1120px, 100%);
	height: min(790px, calc(100dvh - 48px));
	min-height: min(660px, calc(100dvh - 48px));
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--cse-r-lg);
	background: var(--cse-paper);
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.30);
	animation: cse-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cse-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--cse-line);
	border-radius: 50%;
	background: var(--cse-paper);
	color: var(--cse-ink);
	cursor: pointer;
	transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.cse-close:hover {
	border-color: var(--cse-line-strong);
	background: var(--cse-bone);
}

.cse-close:active {
	transform: scale(0.96);
}

.cse-close:focus-visible,
.cse-button:focus-visible {
	outline: 3px solid rgba(0, 109, 251, 0.32);
	outline-offset: 2px;
}

.cse-close svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.8;
}

.cse-summary {
	display: flex;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	padding: clamp(32px, 4vw, 52px);
	background: var(--cse-ink);
	color: #fff;
	overflow: auto;
	scrollbar-width: thin;
}

.cse-eyebrow,
.cse-secure-label {
	margin: 0;
	font-family: var(--cse-mono);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.cse-eyebrow {
	color: rgba(255, 255, 255, 0.62);
}

.cse-product {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	align-items: center;
	gap: 18px;
	margin-top: 24px;
	padding-bottom: 26px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.cse-product img {
	display: block;
	width: 88px;
	height: 88px;
	object-fit: contain;
	border-radius: 10px;
	background: #fff;
}

.cse-product h2 {
	margin: 0;
	font-size: clamp(1rem, 1.3vw, 1.125rem);
	font-weight: 590;
	line-height: 1.32;
	color: #fff;
	overflow-wrap: anywhere;
}

.cse-cart-items {
	display: grid;
	gap: 0;
	max-height: 260px;
	margin-top: 22px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-block: 1px solid rgba(255, 255, 255, 0.14);
	scrollbar-width: thin;
}

.cse-cart-items[hidden] {
	display: none !important;
}

.cse-cart-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.cse-cart-item--with-image {
	grid-template-columns: 56px minmax(0, 1fr) auto;
}

.cse-cart-item:last-child {
	border-bottom: 0;
}

.cse-cart-item img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: 8px;
	background: #fff;
}

.cse-cart-item__details {
	min-width: 0;
}

.cse-cart-item__details h3 {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 570;
	line-height: 1.3;
	color: #fff;
	overflow-wrap: anywhere;
}

.cse-cart-item__details p {
	margin: 5px 0 0;
	font-size: 0.6875rem;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.62);
}

.cse-cart-item__total {
	font-family: var(--cse-mono);
	font-size: 0.75rem;
	font-weight: 560;
	white-space: nowrap;
	color: #fff;
}

.cse-rating {
	margin: 8px 0 0;
	font-size: 0.75rem;
	font-weight: 520;
	color: rgba(255, 255, 255, 0.68);
}

.cse-lines {
	display: grid;
	gap: 12px;
	padding: 26px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.cse-line,
.cse-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 18px;
}

.cse-line {
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.68);
}

.cse-line[hidden] {
	display: none !important;
}

.cse-line strong {
	font-weight: 560;
	color: #fff;
}

.cse-total {
	padding: 25px 0 27px;
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.78);
}

.cse-total strong {
	font-family: var(--cse-mono);
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	font-weight: 590;
	letter-spacing: -0.025em;
	color: #fff;
}

.cse-total strong .woocommerce-Price-currencySymbol {
	font: inherit;
}

.cse-trust {
	display: grid;
	gap: 14px;
	margin-top: auto;
	padding-top: 30px;
}

.cse-trust p {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	align-items: start;
	gap: 10px;
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.68);
}

.cse-trust svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: #77adff;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.55;
}

.cse-checkout {
	display: flex;
	min-width: 0;
	min-height: 0;
	flex-direction: column;
	padding: clamp(34px, 4vw, 54px) clamp(26px, 5vw, 64px) 28px;
	background: var(--cse-paper);
	overflow-y: auto;
	scrollbar-gutter: stable;
}

.cse-checkout__header {
	padding-right: 54px;
}

.cse-secure-label {
	color: var(--cse-brand-deep);
}

.cse-checkout__header h2 {
	margin: 8px 0 0;
	font-size: clamp(1.6rem, 2.3vw, 2.125rem);
	font-weight: 590;
	letter-spacing: -0.035em;
	line-height: 1.08;
	color: var(--cse-ink);
}

.cse-checkout__header p:last-child {
	max-width: 52ch;
	margin: 10px 0 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--cse-muted);
}

.cse-stage {
	position: relative;
	flex: 1 0 auto;
	min-height: 390px;
	margin-top: 24px;
}

#cse-embedded-checkout {
	min-height: 390px;
}

.cse-loading,
.cse-error {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	justify-items: center;
	min-height: 390px;
	padding: 28px;
	border: 1px solid var(--cse-line);
	border-radius: 12px;
	background: var(--cse-bone);
	text-align: center;
}

.cse-loading[hidden],
.cse-error[hidden] {
	display: none !important;
}

.cse-loading strong {
	margin-top: 16px;
	font-size: 0.875rem;
	font-weight: 570;
	color: var(--cse-ink);
}

.cse-spinner {
	width: 30px;
	height: 30px;
	border: 2px solid rgba(0, 109, 251, 0.18);
	border-top-color: var(--cse-brand);
	border-radius: 50%;
	animation: cse-spin 720ms linear infinite;
}

.cse-error h3 {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 590;
	color: var(--cse-ink);
}

.cse-error p {
	max-width: 42ch;
	margin: 10px 0 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--cse-muted);
}

.cse-error__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 20px;
}

.cse-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--cse-r-sm);
	font: 560 0.875rem/1 var(--cse-font);
	cursor: pointer;
	transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.cse-button:active {
	transform: scale(0.98);
}

.cse-button--primary {
	background: var(--cse-brand);
	color: #fff;
}

.cse-button--primary:hover {
	background: var(--cse-brand-deep);
}

.cse-button--secondary {
	border-color: var(--cse-line-strong);
	background: var(--cse-paper);
	color: var(--cse-ink);
}

.cse-button--secondary:hover {
	border-color: var(--cse-ink);
}

.cse-legal {
	margin: 22px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--cse-line);
	font-size: 0.6875rem;
	line-height: 1.55;
	color: var(--cse-muted);
}

.cse-legal a {
	color: var(--cse-brand-deep);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

@keyframes cse-enter {
	from { opacity: 0; transform: translateY(12px) scale(0.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cse-spin {
	to { transform: rotate(1turn); }
}

@media (max-width: 760px) {
	.cse-modal {
		display: block;
		padding: 0;
		background: var(--cse-paper);
	}

	.cse-shell {
		display: block;
		width: 100%;
		height: 100dvh;
		min-height: 100dvh;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow-y: auto;
	}

	.cse-close {
		position: fixed;
		top: max(12px, env(safe-area-inset-top));
		right: max(12px, env(safe-area-inset-right));
	}

	.cse-summary {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 0 20px;
		padding: max(24px, env(safe-area-inset-top)) max(68px, calc(20px + env(safe-area-inset-right))) 24px max(20px, env(safe-area-inset-left));
		overflow: visible;
	}

	.cse-eyebrow {
		grid-column: 1 / -1;
	}

	.cse-product {
		grid-column: 1 / -1;
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 14px;
		margin-top: 16px;
		padding-bottom: 18px;
	}

	.cse-product img {
		width: 64px;
		height: 64px;
	}

	.cse-product h2 {
		font-size: 0.9375rem;
	}

	.cse-cart-items {
		grid-column: 1 / -1;
		width: 100%;
		max-height: 190px;
		margin-top: 16px;
	}

	.cse-cart-item {
		gap: 10px;
		padding: 11px 0;
	}

	.cse-cart-item--with-image {
		grid-template-columns: 48px minmax(0, 1fr) auto;
	}

	.cse-cart-item img {
		width: 48px;
		height: 48px;
	}

	.cse-cart-item__details h3 {
		font-size: 0.75rem;
	}

	.cse-lines {
		padding: 18px 0 0;
		border: 0;
	}

	.cse-line {
		font-size: 0.75rem;
	}

	.cse-total {
		align-self: end;
		padding: 18px 0 0;
	}

	.cse-total {
		display: grid;
		justify-items: end;
		gap: 3px;
	}

	.cse-total strong {
		font-size: 1.125rem;
	}

	.cse-trust {
		grid-column: 1 / -1;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 10px;
		margin-top: 18px;
		padding-top: 18px;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.cse-trust p {
		grid-template-columns: 16px minmax(0, 1fr);
		gap: 7px;
		font-size: 0.625rem;
	}

	.cse-trust svg {
		width: 16px;
		height: 16px;
	}

	.cse-checkout {
		overflow: visible;
		padding: 28px max(18px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
	}

	.cse-checkout__header {
		padding-right: 0;
	}

	.cse-checkout__header h2 {
		font-size: 1.5rem;
	}

	.cse-stage,
	#cse-embedded-checkout,
	.cse-loading,
	.cse-error {
		min-height: 360px;
	}

	.cse-stage {
		margin-top: 20px;
	}
}

@media (max-width: 480px) {
	.cse-trust {
		grid-template-columns: 1fr;
	}

	.cse-trust p {
		font-size: 0.6875rem;
	}

	.cse-error__actions {
		width: 100%;
		flex-direction: column;
	}

	.cse-button {
		width: 100%;
	}
}

@media (max-width: 360px) {
	.woocommerce.single-product form.cart {
		gap: 8px;
	}

	.woocommerce.single-product form.cart .quantity input[type='number'] {
		width: 72px;
	}

	.woocommerce.single-product form.cart .single_add_to_cart_button,
	.woocommerce.single-product form.cart .cse-buy-now {
		padding-inline: 8px;
		font-size: 0.8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cse-shell,
	.cse-close,
	.cse-button {
		animation: none !important;
		transition-duration: 0.01ms !important;
	}

	.cse-spinner {
		animation: none !important;
	}
}
