/**
 * WopCart storefront styles.
 *
 * Deliberately low-opinion. The theme owns typography, colour and button shape;
 * this file owns layout, alignment and the handful of structures a theme has no
 * reason to know about (a totals block, a star bar, a gateway panel).
 *
 * Every value a theme is likely to disagree with is a custom property declared
 * once on .wopcart-scope-holder below. Overriding one property restyles the whole
 * store, which is a far kinder extension point than out-specifying selectors.
 *
 * Selectors are kept to a single class wherever possible for exactly that
 * reason: a theme should win with one class of its own, not need three.
 *
 * @package WopCart
 */

/* -------------------------------------------------------------------------
 * Tokens
 *
 * Colours are expressed as alpha channels over the theme's own background
 * rather than as fixed greys, so the store does not turn into a light-mode
 * island inside a dark theme.
 * ---------------------------------------------------------------------- */

:root {
	--wopcart-accent: currentColor;
	--wopcart-accent-contrast: Canvas;
	--wopcart-border: rgba(0, 0, 0, 0.12);
	--wopcart-border-strong: rgba(0, 0, 0, 0.24);
	--wopcart-muted: rgba(0, 0, 0, 0.06);
	--wopcart-text-muted: rgba(0, 0, 0, 0.62);
	--wopcart-radius: 3px;
	--wopcart-gap: 1rem;
	--wopcart-gap-lg: 2rem;
	--wopcart-success: #1a7f37;
	--wopcart-warning: #9a6700;
	--wopcart-error: #b42318;
}

/*
 * The alpha greys above vanish against a dark background, so they are re-stated
 * as light-on-dark when the theme declares a dark scheme. Themes that do not
 * declare one keep the defaults, which is the safe direction to fail in.
 */
@media (prefers-color-scheme: dark) {
	:root {
		--wopcart-border: rgba(255, 255, 255, 0.18);
		--wopcart-border-strong: rgba(255, 255, 255, 0.32);
		--wopcart-muted: rgba(255, 255, 255, 0.08);
		--wopcart-text-muted: rgba(255, 255, 255, 0.68);
		--wopcart-success: #3fb950;
		--wopcart-warning: #d29922;
		--wopcart-error: #f85149;
	}
}

/* -------------------------------------------------------------------------
 * Primitives
 * ---------------------------------------------------------------------- */

.wopcart-money {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.wopcart-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.wopcart-center {
	text-align: center;
}

.wopcart-tiny {
	font-size: 0.8125em;
	color: var(--wopcart-text-muted);
}

.wopcart-danger {
	color: var(--wopcart-error);
}

.wopcart-hint {
	display: block;
	margin-top: 0.35em;
	font-size: 0.8125em;
	color: var(--wopcart-text-muted);
}

.wopcart-empty {
	padding: var(--wopcart-gap-lg);
	border: 1px dashed var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	text-align: center;
	color: var(--wopcart-text-muted);
}

/* -------------------------------------------------------------------------
 * Buttons
 *
 * Font, weight and radius are inherited so a store button looks like a theme
 * button. Only the states the theme cannot guess at are set here.
 * ---------------------------------------------------------------------- */

.wopcart-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.6em 1.2em;
	border: 1px solid var(--wopcart-border-strong);
	border-radius: var(--wopcart-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.wopcart-button:hover,
.wopcart-button:focus-visible {
	border-color: currentColor;
	text-decoration: none;
}

.wopcart-button:disabled,
.wopcart-button[aria-disabled="true"] {
	opacity: 0.55;
	cursor: default;
}

.wopcart-button--primary {
	border-color: var(--wopcart-accent);
	background: var(--wopcart-accent);
	color: var(--wopcart-accent-contrast);
}

.wopcart-button--ghost {
	border-color: var(--wopcart-border);
}

.wopcart-button--small {
	padding: 0.35em 0.75em;
	font-size: 0.875em;
}

.wopcart-button--large {
	padding: 0.85em 1.6em;
	font-size: 1.0625em;
	width: 100%;
}

.wopcart-button__price {
	opacity: 0.85;
	font-weight: normal;
}

/*
 * A visible focus ring is restored explicitly because resetting outline is one
 * of the most common things themes do, and a checkout that cannot be tabbed
 * through is an accessibility failure the store owner will never see.
 */
.wopcart-button:focus-visible,
.wopcart-cart__remove:focus-visible,
.wopcart-review__vote:focus-visible {
	outline: 2px solid var(--wopcart-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Notices
 * ---------------------------------------------------------------------- */

.wopcart-notice {
	margin: 0 0 var(--wopcart-gap);
	padding: 0.75em 1em;
	border: 1px solid var(--wopcart-border);
	border-left-width: 3px;
	border-radius: var(--wopcart-radius);
	background: var(--wopcart-muted);
}

.wopcart-notice ul {
	margin: 0;
	padding-left: 1.25em;
}

.wopcart-notice--error {
	border-left-color: var(--wopcart-error);
}

.wopcart-notice--success {
	border-left-color: var(--wopcart-success);
}

.wopcart-notice--warning {
	border-left-color: var(--wopcart-warning);
}

.wopcart-notice--info {
	border-left-color: var(--wopcart-accent);
}

.wopcart-badge {
	display: inline-block;
	padding: 0.15em 0.55em;
	border: 1px solid var(--wopcart-border);
	border-radius: 999px;
	font-size: 0.75em;
	line-height: 1.6;
	white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Product grid
 * ---------------------------------------------------------------------- */

.wopcart-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: var(--wopcart-gap-lg) var(--wopcart-gap);
	margin: 0 0 var(--wopcart-gap-lg);
	padding: 0;
	list-style: none;
}

.wopcart-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
}

.wopcart-card__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wopcart-radius);
}

.wopcart-card__title {
	margin: 0;
	font-size: 1.0625em;
	line-height: 1.3;
}

.wopcart-card__title a {
	text-decoration: none;
}

.wopcart-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	flex: 1 1 auto;
}

.wopcart-card__excerpt {
	margin: 0;
	color: var(--wopcart-text-muted);
	font-size: 0.9375em;
}

.wopcart-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: auto;
}

/* The AI's stated reason for a recommendation, which reads as a caption. */
.wopcart-card__reason {
	margin: 0;
	color: var(--wopcart-text-muted);
	font-size: 0.8125em;
	font-style: italic;
}

.wopcart-pagination {
	display: flex;
	gap: 0.35rem;
	flex-wrap: wrap;
	margin: var(--wopcart-gap-lg) 0;
}

.wopcart-pagination .page-numbers {
	padding: 0.35em 0.7em;
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	text-decoration: none;
}

.wopcart-pagination .page-numbers.current {
	border-color: var(--wopcart-accent);
	background: var(--wopcart-muted);
}

/* -------------------------------------------------------------------------
 * Prices and the buy button
 * ---------------------------------------------------------------------- */

.wopcart-price,
.wopcart-simple-price {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.wopcart-purchase {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.wopcart-purchase__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.wopcart-purchase__qty {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.wopcart-purchase__qty input {
	width: 5rem;
}

.wopcart-purchase__owned,
.wopcart-purchase__soldout,
.wopcart-purchase__unavailable {
	margin: 0;
	color: var(--wopcart-text-muted);
}

.wopcart-prices,
.wopcart-variable-prices {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-prices__option {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.6em 0.75em;
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	cursor: pointer;
}

.wopcart-prices__option:has(input:checked) {
	border-color: var(--wopcart-accent);
	background: var(--wopcart-muted);
}

.wopcart-prices__label {
	flex: 1 1 auto;
}

.wopcart-prices__amount {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.wopcart-price__regular {
	font-weight: 400;
	color: var(--wopcart-text-muted);
}

.wopcart-price__sale {
	text-decoration: none;
	background: none;
}

.wopcart-price__omnibus,
.wopcart-price__ends {
	display: block;
	font-size: 0.8125em;
	font-weight: 400;
	color: var(--wopcart-text-muted);
}

/* Tax suffix ("excl. VAT"), the other figure in brackets, and the unit price.
   Smaller and lighter than the price, but not hidden: the unit price and the
   tax basis are part of the price indication, not fine print. */
.wopcart-price__tax,
.wopcart-price__alt,
.wopcart-price__unit {
	font-size: 0.8125em;
	font-weight: 400;
	color: var(--wopcart-text-muted);
	white-space: nowrap;
}

.wopcart-price__unit {
	display: inline-block;
}

.wopcart-prices__trial {
	display: block;
	font-size: 0.8125em;
	color: var(--wopcart-text-muted);
}

/* -------------------------------------------------------------------------
 * Bundles
 * ---------------------------------------------------------------------- */

.wopcart-bundle {
	margin: var(--wopcart-gap) 0;
	padding: var(--wopcart-gap);
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
}

.wopcart-bundle__title {
	margin: 0 0 0.75rem;
	font-size: 1em;
}

.wopcart-bundle__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-bundle__item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.wopcart-bundle__image {
	flex: 0 0 auto;
	border-radius: var(--wopcart-radius);
}

.wopcart-bundle__name {
	font-size: 0.875em;
	overflow-wrap: anywhere;
}

.wopcart-bundle__saving {
	margin-top: 0.75rem;
	color: var(--wopcart-success);
	font-weight: 600;
}

.wopcart-bundle__value {
	text-decoration: line-through;
	color: var(--wopcart-text-muted);
}

/* -------------------------------------------------------------------------
 * Cart
 * ---------------------------------------------------------------------- */

.wopcart-cart {
	margin: 0 0 var(--wopcart-gap-lg);
}

.wopcart-cart__table {
	width: 100%;
	margin: 0 0 var(--wopcart-gap);
	border-collapse: collapse;
}

.wopcart-cart__table th,
.wopcart-cart__table td {
	padding: 0.65rem 0.5rem;
	border-bottom: 1px solid var(--wopcart-border);
	vertical-align: middle;
	text-align: left;
}

.wopcart-cart__table th {
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wopcart-text-muted);
}

.wopcart-cart__media {
	width: 56px;
}

.wopcart-cart__media img {
	display: block;
	border-radius: var(--wopcart-radius);
}

.wopcart-cart__table input[type="number"] {
	width: 4.5rem;
	text-align: right;
}

.wopcart-cart__recurring {
	display: block;
	color: var(--wopcart-text-muted);
	font-size: 0.8125em;
}

.wopcart-cart__remove {
	padding: 0.15em 0.5em;
	border: 0;
	background: none;
	color: var(--wopcart-text-muted);
	font-size: 1.25em;
	line-height: 1;
	cursor: pointer;
}

.wopcart-cart__remove:hover {
	color: var(--wopcart-error);
}

.wopcart-cart__actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-bottom: var(--wopcart-gap);
}

.wopcart-cart__checkout {
	margin: var(--wopcart-gap) 0 0;
}

.wopcart-cart--empty {
	padding: var(--wopcart-gap-lg);
	border: 1px dashed var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	text-align: center;
	color: var(--wopcart-text-muted);
}

.wopcart-cart-icon {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	text-decoration: none;
}

.wopcart-cart-icon__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5em;
	height: 1.5em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: var(--wopcart-accent);
	color: var(--wopcart-accent-contrast);
	font-size: 0.75em;
	font-variant-numeric: tabular-nums;
}

.wopcart-discount {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin: 0 0 var(--wopcart-gap);
}

.wopcart-discount label {
	display: block;
	font-size: 0.8125em;
	color: var(--wopcart-text-muted);
}

.wopcart-discount input {
	min-width: 12rem;
}

/* -------------------------------------------------------------------------
 * Totals
 * ---------------------------------------------------------------------- */

.wopcart-totals {
	width: 100%;
	margin: 0 0 var(--wopcart-gap);
	border-collapse: collapse;
}

.wopcart-totals th,
.wopcart-totals td {
	padding: 0.4rem 0;
	text-align: left;
	font-weight: normal;
}

.wopcart-totals td {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.wopcart-totals__discount td,
.wopcart-totals__discount th {
	color: var(--wopcart-success);
}

.wopcart-totals__grand th,
.wopcart-totals__grand td {
	padding-top: 0.65rem;
	border-top: 1px solid var(--wopcart-border-strong);
	font-size: 1.125em;
	font-weight: 600;
}

.wopcart-totals__recurring th,
.wopcart-totals__recurring td,
.wopcart-totals__note {
	color: var(--wopcart-text-muted);
	font-size: 0.875em;
}

.wopcart-totals__note {
	margin: 0.5rem 0 0;
}

/* -------------------------------------------------------------------------
 * Checkout
 * ---------------------------------------------------------------------- */

.wopcart-checkout__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wopcart-gap-lg);
	align-items: start;
}

/*
 * The summary only becomes a sidebar when there is genuinely room for two
 * columns. Below this the buyer gets one column in source order, which puts the
 * form first and the summary above the submit button.
 */
@media (min-width: 56rem) {
	.wopcart-checkout__grid {
		grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
	}

	.wopcart-checkout__summary {
		position: sticky;
		top: 2rem;
	}
}

.wopcart-checkout__main {
	min-width: 0;
}

.wopcart-checkout__summary {
	padding: var(--wopcart-gap);
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
}

.wopcart-checkout__summary h2 {
	margin: 0 0 0.75rem;
	font-size: 1em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wopcart-text-muted);
}

.wopcart-summary__items {
	margin: 0 0 var(--wopcart-gap);
	padding: 0;
	list-style: none;
}

.wopcart-summary__items li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-summary__amount {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.wopcart-checkout__submit {
	margin: var(--wopcart-gap-lg) 0 0;
}

/* Fields */

.wopcart-fieldset {
	margin: 0 0 var(--wopcart-gap-lg);
	padding: 0;
	border: 0;
}

.wopcart-fieldset legend {
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 1.0625em;
	font-weight: 600;
}

.wopcart-field {
	margin: 0 0 var(--wopcart-gap);
}

.wopcart-field label {
	display: block;
	margin-bottom: 0.3em;
	font-weight: 600;
	font-size: 0.9375em;
}

.wopcart-field input[type="text"],
.wopcart-field input[type="email"],
.wopcart-field input[type="number"],
.wopcart-field input[type="password"],
.wopcart-field select,
.wopcart-field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.wopcart-field--check label {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	font-weight: normal;
}

.wopcart-field--check input {
	margin-top: 0.2em;
	flex: 0 0 auto;
}

.wopcart-field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0 var(--wopcart-gap);
}

.wopcart-field--half {
	display: inline-block;
	width: calc(50% - 0.5rem);
	vertical-align: top;
}

.wopcart-field--half + .wopcart-field--half {
	margin-left: 1rem;
}

/* State classes set by frontend.js while the VAT number is being checked. */
.wopcart-field--checking .wopcart-hint {
	opacity: 0.6;
}

.wopcart-field--valid input {
	border-color: var(--wopcart-success);
}

.wopcart-field--invalid input {
	border-color: var(--wopcart-error);
}

.wopcart-field--valid .wopcart-hint {
	color: var(--wopcart-success);
}

.wopcart-field--invalid .wopcart-hint {
	color: var(--wopcart-error);
}

/* Gateways */

.wopcart-gateways {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: var(--wopcart-gap);
}

.wopcart-gateway {
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	overflow: hidden;
}

.wopcart-gateway:has(input:checked) {
	border-color: var(--wopcart-accent);
}

.wopcart-gateway__choice {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75em 1em;
	margin: 0;
	font-weight: 600;
	cursor: pointer;
}

.wopcart-gateway__fields {
	padding: 0 1em 1em;
	border-top: 1px solid var(--wopcart-border);
}

.wopcart-gateway__fields[hidden] {
	display: none;
}

.wopcart-card-fields {
	padding-top: 1em;
}

.wopcart-card-fields__notice {
	margin: 0;
	color: var(--wopcart-text-muted);
	font-size: 0.8125em;
}

.wopcart-applepay {
	padding-top: 1em;
}

/*
 * Apple's own button is rendered into this element by Stripe.js. The minimum
 * height stops the panel collapsing and jumping while the sheet initialises.
 */
.wopcart-applepay__button {
	min-height: 44px;
}

.wopcart-applepay__hint {
	margin: 0.5em 0 0;
	color: var(--wopcart-text-muted);
	font-size: 0.8125em;
}

/* -------------------------------------------------------------------------
 * Card layout: checkout, cart and confirmation
 *
 * Colours come from the custom properties printed by CheckoutAppearance
 * (brand mint and ink by default, the block theme's palette when "Use theme
 * colours" is on). Fonts are always the theme's.
 * ---------------------------------------------------------------------- */

.wopcart-surface {
	--wopcart-card-pad: clamp(1.1rem, 3vw, 1.75rem);
	box-sizing: border-box;
	padding: var(--wopcart-card-pad);
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	background: var(--wopcart-surface, transparent);
	color: var(--wopcart-ink, inherit);
}

.wopcart-checkout--stacked {
	max-width: 42rem;
	margin-inline: auto;
}

.wopcart-checkout__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin: 0 0 1.25rem;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-checkout__title {
	margin: 0;
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	font-weight: 750;
	line-height: 1.15;
	letter-spacing: -0.03em;
}

.wopcart-secure {
	color: var(--wopcart-text-muted);
	font-size: 0.875em;
	white-space: nowrap;
}

/* Summary before the form in one column; beside it when split and wide. */
.wopcart-checkout--stacked .wopcart-checkout__grid {
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

.wopcart-checkout--stacked .wopcart-checkout__summary,
.wopcart-checkout--split .wopcart-checkout__summary {
	order: -1;
	position: static;
}

.wopcart-checkout--stacked .wopcart-checkout__summary {
	padding: 0;
	border: 0;
}

@media (min-width: 56rem) {
	.wopcart-checkout--split .wopcart-checkout__grid {
		grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr);
		gap: 2.5rem;
	}

	.wopcart-checkout--split .wopcart-checkout__summary {
		order: 0;
		position: sticky;
		top: 2rem;
	}
}

.wopcart-summary__item {
	align-items: center;
}

.wopcart-summary__product {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	min-width: 0;
}

.wopcart-cover {
	display: grid;
	flex: 0 0 auto;
	width: 3.5rem;
	height: 4rem;
	overflow: hidden;
	border-radius: 3px;
	/* Brand tile in every mode: mint on ink is 7:1 regardless of theme. */
	background: #102a2e;
	color: #18c99a;
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	place-items: center;
}

.wopcart-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wopcart-summary__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wopcart-summary__option {
	color: var(--wopcart-text-muted);
	font-size: 0.85em;
}

.wopcart-checkout__summary .wopcart-summary__amount {
	font-weight: 700;
}

/* Fields: calmer boxes, visible focus, clear invalid state. */
.wopcart-surface .wopcart-field input[type="text"],
.wopcart-surface .wopcart-field input[type="email"],
.wopcart-surface .wopcart-field input[type="tel"],
.wopcart-surface .wopcart-field input[type="number"],
.wopcart-surface .wopcart-field input[type="password"],
.wopcart-surface .wopcart-field select,
.wopcart-surface .wopcart-field textarea,
.wopcart-surface .wopcart-discount input {
	min-height: 2.9rem;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--wopcart-border-strong);
	border-radius: var(--wopcart-radius);
	font: inherit;
}

.wopcart-surface input:focus-visible,
.wopcart-surface select:focus-visible,
.wopcart-surface textarea:focus-visible {
	outline: 2px solid var(--wopcart-accent);
	outline-offset: 1px;
	border-color: var(--wopcart-accent);
}

.wopcart-surface .wopcart-field input:user-invalid,
.wopcart-surface .wopcart-field select:user-invalid {
	border-color: var(--wopcart-error);
}

.wopcart-surface .wopcart-fieldset legend {
	font-size: 1em;
	font-weight: 700;
}

/* Payment methods as tiles; the selected method's fields sit below the row. */
.wopcart-gateways--tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
	gap: 0.5rem;
}

.wopcart-gateways--tiles .wopcart-gateway {
	display: contents;
}

.wopcart-gateways--tiles .wopcart-pay-tile {
	position: relative;
	justify-content: center;
	min-height: 3rem;
	padding: 0.65rem 0.5rem;
	border: 1px solid var(--wopcart-border-strong);
	border-radius: var(--wopcart-radius);
	font-size: 0.9em;
	font-weight: 700;
	text-align: center;
}

.wopcart-gateways--tiles .wopcart-pay-tile input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.wopcart-gateways--tiles .wopcart-pay-tile:has(input:checked) {
	border-color: var(--wopcart-accent);
	box-shadow: inset 0 0 0 1px var(--wopcart-accent);
}

.wopcart-gateways--tiles .wopcart-pay-tile:has(input:checked)::after {
	position: absolute;
	top: 0.3rem;
	right: 0.4rem;
	color: var(--wopcart-accent);
	content: "✓";
	font-size: 0.8em;
}

.wopcart-gateways--tiles .wopcart-pay-tile:has(input:focus-visible) {
	outline: 2px solid var(--wopcart-accent);
	outline-offset: 2px;
}

.wopcart-gateways--tiles .wopcart-gateway__fields {
	grid-column: 1 / -1;
	order: 1;
	padding: 0;
	border-top: 0;
}

/* The pay button: full width, accent fill, contrast text chosen server side. */
.wopcart-pay-button {
	width: 100%;
	min-height: 3.25rem;
	border-color: var(--wopcart-accent);
	background: var(--wopcart-accent);
	color: var(--wopcart-accent-contrast);
	font-weight: 750;
}

.wopcart-pay-button:hover:not(:disabled) {
	filter: brightness(0.95);
}

.wopcart-pay-button:focus-visible {
	outline: 3px solid var(--wopcart-ink, currentColor);
	outline-offset: 2px;
}

.wopcart-checkout .wopcart-checkout__submit {
	margin-top: 1rem;
}

.wopcart-surface .wopcart-confirm {
	border-color: var(--wopcart-border);
	background: var(--wopcart-muted);
}

/* Cart and confirmation cards. */
.wopcart-cart.wopcart-surface .wopcart-cart__checkout .wopcart-button,
.wopcart-confirmation.wopcart-surface .wopcart-button--primary {
	width: 100%;
}

.wopcart-confirmation.wopcart-surface .wopcart-confirmation__head h2 {
	margin-top: 0;
	font-weight: 750;
	letter-spacing: -0.03em;
}

.wopcart-surface .wopcart-cart__table th,
.wopcart-surface .wopcart-order-table th {
	color: var(--wopcart-text-muted);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.wopcart-surface .wopcart-totals__grand th,
.wopcart-surface .wopcart-totals__grand td {
	font-size: 1.2em;
	font-weight: 750;
}

/* -------------------------------------------------------------------------
 * Confirmation, downloads, account
 * ---------------------------------------------------------------------- */

.wopcart-confirmation__head {
	margin-bottom: var(--wopcart-gap-lg);
}

.wopcart-confirmation__order,
.wopcart-confirmation__downloads,
.wopcart-confirmation__licenses {
	margin-bottom: var(--wopcart-gap-lg);
}

.wopcart-order-table,
.wopcart-table {
	width: 100%;
	border-collapse: collapse;
}

.wopcart-order-table th,
.wopcart-order-table td,
.wopcart-table th,
.wopcart-table td {
	padding: 0.6rem 0.5rem;
	border-bottom: 1px solid var(--wopcart-border);
	text-align: left;
	vertical-align: top;
}

.wopcart-table th {
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wopcart-text-muted);
}

.wopcart-order-table__total th,
.wopcart-order-table__total td {
	border-top: 1px solid var(--wopcart-border-strong);
	font-weight: 600;
}

.wopcart-downloads {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-downloads li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-account__nav {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin: 0 0 var(--wopcart-gap-lg);
	padding: 0 0 0.5rem;
	border-bottom: 1px solid var(--wopcart-border);
	list-style: none;
}

.wopcart-account__section {
	margin-bottom: var(--wopcart-gap-lg);
}

.wopcart-account__hint {
	color: var(--wopcart-text-muted);
}

.wopcart-account--login {
	max-width: 26rem;
}

/* Licenses */

.wopcart-licenses {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-licenses li {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-licenses__product {
	display: block;
	font-weight: 600;
}

/*
 * License keys are long, opaque and frequently copied by hand. They get a
 * monospace face, are allowed to break anywhere, and select in one click.
 */
.wopcart-licenses__key,
[data-wopcart-copy] {
	display: inline-block;
	padding: 0.15em 0.4em;
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	background: var(--wopcart-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.875em;
	overflow-wrap: anywhere;
	cursor: pointer;
}

[data-wopcart-copy]:hover {
	border-color: var(--wopcart-accent);
}

.wopcart-license--expired td,
.wopcart-license--disabled td {
	opacity: 0.6;
}

/* -------------------------------------------------------------------------
 * Reviews
 * ---------------------------------------------------------------------- */

.wopcart-reviews {
	margin: var(--wopcart-gap-lg) 0;
}

.wopcart-reviews__title {
	margin: 0 0 var(--wopcart-gap);
}

.wopcart-reviews__summary {
	display: flex;
	align-items: center;
	gap: var(--wopcart-gap-lg);
	flex-wrap: wrap;
	margin-bottom: var(--wopcart-gap-lg);
	padding-bottom: var(--wopcart-gap);
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-reviews__average {
	font-size: 2.5em;
	font-weight: 700;
	line-height: 1;
}

.wopcart-reviews__count {
	color: var(--wopcart-text-muted);
	font-size: 0.875em;
}

.wopcart-reviews__breakdown {
	flex: 1 1 14rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-reviews__breakdown li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125em;
}

.wopcart-reviews__bar {
	flex: 1 1 auto;
	height: 0.5em;
	border-radius: 999px;
	background: var(--wopcart-muted);
	overflow: hidden;
}

.wopcart-reviews__bar > span {
	display: block;
	height: 100%;
	background: var(--wopcart-accent);
}

.wopcart-reviews__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wopcart-reviews__empty,
.wopcart-reviews__gate {
	color: var(--wopcart-text-muted);
}

.wopcart-review {
	padding: var(--wopcart-gap) 0;
	border-bottom: 1px solid var(--wopcart-border);
}

.wopcart-review__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.wopcart-review__title {
	margin: 0;
	font-size: 1em;
}

.wopcart-review__meta {
	color: var(--wopcart-text-muted);
	font-size: 0.8125em;
}

.wopcart-review__author {
	font-weight: 600;
}

.wopcart-review__verified {
	color: var(--wopcart-success);
	font-size: 0.8125em;
}

.wopcart-review__body {
	margin: 0.5rem 0;
}

.wopcart-review__reply {
	margin: 0.75rem 0 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--wopcart-border-strong);
	background: var(--wopcart-muted);
	border-radius: var(--wopcart-radius);
}

.wopcart-review__foot {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.wopcart-review__vote {
	padding: 0.25em 0.7em;
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.8125em;
	cursor: pointer;
}

.wopcart-review__vote[disabled] {
	opacity: 0.55;
	cursor: default;
}

/*
 * Stars are one text node clipped to a percentage rather than five images, so
 * a 3.7 average renders exactly and the whole control costs no requests.
 */
.wopcart-stars {
	position: relative;
	display: inline-block;
	color: var(--wopcart-border-strong);
	font-size: 1em;
	line-height: 1;
	white-space: nowrap;
}

.wopcart-stars__fill {
	position: absolute;
	inset: 0 auto 0 0;
	overflow: hidden;
	color: var(--wopcart-warning);
	white-space: nowrap;
}

.wopcart-card__rating {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.875em;
}

/*
 * The rating input is a reversed row of radios so that hovering one star also
 * highlights the ones before it, using sibling selectors alone.
 */
.wopcart-rating-input {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 0.15rem;
}

.wopcart-rating-input input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.wopcart-rating-input label {
	color: var(--wopcart-border-strong);
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
}

.wopcart-rating-input input:checked ~ label,
.wopcart-rating-input label:hover,
.wopcart-rating-input label:hover ~ label {
	color: var(--wopcart-warning);
}

.wopcart-rating-input input:focus-visible + label {
	outline: 2px solid var(--wopcart-accent);
	outline-offset: 2px;
}

.wopcart-review-form {
	margin: var(--wopcart-gap-lg) 0;
	padding: var(--wopcart-gap);
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
}

/* -------------------------------------------------------------------------
 * Recommendations, restriction, currency switcher
 * ---------------------------------------------------------------------- */

.wopcart-recommendations {
	margin: var(--wopcart-gap-lg) 0;
}

.wopcart-recommendations__title {
	margin: 0 0 var(--wopcart-gap);
	font-size: 1.125em;
}

.wopcart-restrict {
	padding: var(--wopcart-gap-lg);
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	text-align: center;
}

.wopcart-restrict__message {
	margin: 0 0 var(--wopcart-gap);
}

.wopcart-restrict__price {
	font-weight: 600;
}

.wopcart-restrict__products {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	flex-wrap: wrap;
	margin: var(--wopcart-gap) 0 0;
	padding: 0;
	list-style: none;
}

.wopcart-restrict__login {
	margin: var(--wopcart-gap) 0 0;
	color: var(--wopcart-text-muted);
	font-size: 0.875em;
}

.wopcart-currency-switcher {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.wopcart-currency-switcher--links {
	flex-wrap: wrap;
}

.wopcart-currency-switcher--links a {
	padding: 0.15em 0.5em;
	border: 1px solid var(--wopcart-border);
	border-radius: var(--wopcart-radius);
	text-decoration: none;
	font-size: 0.875em;
}

.wopcart-currency-switcher--links a[aria-current="true"] {
	border-color: var(--wopcart-accent);
	background: var(--wopcart-muted);
}

/* -------------------------------------------------------------------------
 * JS-driven states
 * ---------------------------------------------------------------------- */

/*
 * Set on any element frontend.js is waiting on. Pointer events are dropped so a
 * double click cannot fire a second add-to-cart while the first is in flight.
 */
.wopcart-is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.wopcart-is-hidden {
	display: none !important;
}

/* Injected by frontend.js for transient feedback such as "Added to your cart". */
.wopcart-toast {
	position: fixed;
	z-index: 99999;
	right: 1rem;
	bottom: 1rem;
	max-width: min(22rem, calc(100vw - 2rem));
	padding: 0.75em 1em;
	border: 1px solid var(--wopcart-border-strong);
	border-radius: var(--wopcart-radius);
	background: Canvas;
	color: CanvasText;
}

.wopcart-toast--error {
	border-color: var(--wopcart-error);
}

.wopcart-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.wopcart-toast {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Final confirmation block
 *
 * The essential terms restated immediately above the order button, which EU
 * consumer law requires to sit next to it rather than merely on the page. It is
 * bordered and set apart deliberately: this is the last thing read before money
 * changes hands, and it should not be mistaken for decoration.
 * ---------------------------------------------------------------------- */

.wopcart-confirm {
	margin: var(--wopcart-gap-lg) 0 var(--wopcart-gap);
	padding: var(--wopcart-gap);
	border: 1px solid var(--wopcart-border-strong);
	border-radius: var(--wopcart-radius);
}

.wopcart-confirm__items {
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.wopcart-confirm__items li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.3rem 0;
}

.wopcart-confirm__total {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 0;
	padding-top: 0.6rem;
	border-top: 1px solid var(--wopcart-border);
	font-size: 1.0625em;
}

.wopcart-confirm__recurring {
	margin: 0.6rem 0 0;
	color: var(--wopcart-text-muted);
	font-size: 0.875em;
}

/* Plan switcher in the account's subscription table. */
.wopcart-plan-change {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.wopcart-plan-change .wopcart-hint {
	flex: 1 0 100%;
	margin-top: 0;
}
