/* Rapi Order storefront. Colours follow the Rapi brand; fonts inherit from the theme. */

.rapi-order,
.rapi-status {
	--rapi-ink: #122023;
	--rapi-green: #345a4c;
	--rapi-sage: #9dac98;
	--rapi-leaf: #a9d2b5;
	--rapi-mint: #e8f7d7;
	--rapi-paper: #fffdf9;
	--rapi-line: #d9e2d6;
	--rapi-muted: #526159;
	--rapi-error: #b3261e;
	--rapi-error-bg: #fdecea;
	--rapi-radius: 14px;

	color: var(--rapi-ink);
	max-width: 760px;
	margin-inline: auto;
	font-size: 1rem;
	line-height: 1.5;
	box-sizing: border-box;
}

.rapi-order *,
.rapi-status * {
	box-sizing: border-box;
}

.rapi-order [hidden],
.rapi-status [hidden] {
	display: none !important;
}

/* Without JavaScript both steps show and step buttons are hidden. */
.rapi-order:not(.rapi-js) .rapi-js-only,
.rapi-order:not(.rapi-js) .rapi-progress,
html:not(.rapi-has-js) .rapi-status .rapi-js-only {
	display: none;
}

.rapi-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Progress */
.rapi-progress {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	counter-reset: rapi-step;
}

.rapi-progress li {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0 0 8px;
	border-bottom: 3px solid var(--rapi-line);
	color: var(--rapi-muted);
	font-size: 0.875rem;
	font-weight: 600;
	counter-increment: rapi-step;
}

.rapi-progress li::before {
	content: counter(rapi-step);
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--rapi-line);
	color: var(--rapi-ink);
	font-size: 0.75rem;
}

.rapi-progress li.is-active {
	border-color: var(--rapi-green);
	color: var(--rapi-ink);
}

.rapi-progress li.is-active::before,
.rapi-progress li.is-done::before {
	background: var(--rapi-green);
	color: #fff;
}

.rapi-progress li.is-done {
	border-color: var(--rapi-leaf);
}

/* Steps and fields */
.rapi-step {
	margin: 0 0 32px;
}

.rapi-step__title {
	margin: 0 0 16px;
	font-size: 1.375rem;
	line-height: 1.3;
}

.rapi-field {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.rapi-label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-weight: 600;
	font-size: 0.9375rem;
}

.rapi-optional {
	color: var(--rapi-muted);
	font-weight: 400;
}

.rapi-hint {
	margin: 6px 0 0;
	color: var(--rapi-muted);
	font-size: 0.875rem;
}

.rapi-order input[type="text"],
.rapi-order input[type="email"],
.rapi-order input[type="tel"],
.rapi-order input[type="number"],
.rapi-order select,
.rapi-order textarea,
.rapi-upload input[type="file"] {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid var(--rapi-sage);
	border-radius: 10px;
	background: #fff;
	color: var(--rapi-ink);
	font: inherit;
}

.rapi-order textarea {
	min-height: 88px;
	resize: vertical;
}

.rapi-order input:focus-visible,
.rapi-order select:focus-visible,
.rapi-order textarea:focus-visible,
.rapi-upload input:focus-visible {
	outline: 3px solid var(--rapi-leaf);
	outline-offset: 1px;
	border-color: var(--rapi-green);
}

.rapi-order [aria-invalid="true"] {
	border-color: var(--rapi-error);
}

.rapi-field-error {
	margin: 6px 0 0;
	color: var(--rapi-error);
	font-size: 0.875rem;
	font-weight: 600;
}

.rapi-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.rapi-field--wide {
	grid-column: 1 / -1;
}

@media (max-width: 560px) {
	.rapi-grid {
		grid-template-columns: 1fr;
	}
}

/* Product cards */
.rapi-products {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.rapi-product {
	position: relative;
	display: block;
	cursor: pointer;
}

.rapi-product input,
.rapi-chip input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.rapi-product__card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	padding: 16px;
	border: 2px solid var(--rapi-line);
	border-radius: var(--rapi-radius);
	background: var(--rapi-paper);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.rapi-product:hover .rapi-product__card {
	border-color: var(--rapi-sage);
}

.rapi-product input:checked + .rapi-product__card {
	border-color: var(--rapi-green);
	background: var(--rapi-mint);
	box-shadow: 0 0 0 1px var(--rapi-green);
}

.rapi-product input:focus-visible + .rapi-product__card {
	outline: 3px solid var(--rapi-leaf);
	outline-offset: 2px;
}

.rapi-product.is-soldout {
	cursor: not-allowed;
	opacity: 0.6;
}

.rapi-product__img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 10px;
	margin-bottom: 4px;
}

.rapi-product__name {
	font-weight: 700;
	font-size: 1.125rem;
}

.rapi-product__desc,
.rapi-product__meta {
	color: var(--rapi-muted);
	font-size: 0.875rem;
}

.rapi-product__meta {
	color: var(--rapi-green);
	font-weight: 600;
}

.rapi-product__price {
	margin-top: auto;
	padding-top: 6px;
	font-size: 1.375rem;
	font-weight: 800;
}

.rapi-product__soldout {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--rapi-ink);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

/* Chips (colour, sticker design) */
.rapi-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rapi-chip {
	position: relative;
	cursor: pointer;
}

.rapi-chip span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 8px 16px;
	border: 2px solid var(--rapi-line);
	border-radius: 999px;
	background: #fff;
	font-weight: 600;
	font-size: 0.9375rem;
}

.rapi-chip input:checked + span {
	border-color: var(--rapi-green);
	background: var(--rapi-mint);
}

.rapi-chip input:focus-visible + span {
	outline: 3px solid var(--rapi-leaf);
	outline-offset: 2px;
}

.rapi-swatch {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--rapi-swatch, transparent);
	border: 1px solid var(--rapi-sage);
}

/* Quantity stepper */
.rapi-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--rapi-sage);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.rapi-order .rapi-qty input[type="number"] {
	width: 64px;
	border: 0;
	border-radius: 0;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.rapi-qty input::-webkit-inner-spin-button,
.rapi-qty input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.rapi-qty__btn {
	width: 46px;
	border: 0;
	background: var(--rapi-mint);
	color: var(--rapi-ink);
	font-size: 1.25rem;
	font-weight: 700;
	cursor: pointer;
}

.rapi-qty__btn:hover {
	background: var(--rapi-leaf);
}

.rapi-order:not(.rapi-js) .rapi-qty__btn {
	display: none;
}

/* Gift and totals */
.rapi-gift {
	padding: 16px;
	border: 1px dashed var(--rapi-sage);
	border-radius: var(--rapi-radius);
	background: var(--rapi-paper);
}

.rapi-gift .rapi-label {
	float: left;
	width: 100%;
}

.rapi-gift__count {
	clear: both;
	margin: 0 0 4px;
}

.rapi-gift .rapi-chips {
	margin-top: 10px;
}

.rapi-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 14px 0;
	border-top: 1px solid var(--rapi-line);
	font-size: 1.125rem;
}

.rapi-subtotal strong {
	font-size: 1.375rem;
}

/* Buttons */
.rapi-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
	margin-top: 8px;
}

.rapi-btn,
.rapi-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 24px;
	border: 2px solid var(--rapi-green);
	border-radius: 999px;
	background: transparent;
	color: var(--rapi-green);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
}

.rapi-btn--primary {
	background: var(--rapi-green);
	color: #fff;
}

.rapi-btn--primary:hover {
	background: var(--rapi-ink);
	border-color: var(--rapi-ink);
}

.rapi-btn:focus-visible,
.rapi-copy:focus-visible {
	outline: 3px solid var(--rapi-leaf);
	outline-offset: 2px;
}

.rapi-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

.rapi-copy {
	min-height: 32px;
	padding: 4px 12px;
	font-size: 0.8125rem;
	margin-left: 8px;
}

/* Summary */
.rapi-summary {
	margin: 24px 0;
	padding: 20px;
	border-radius: var(--rapi-radius);
	background: var(--rapi-mint);
}

.rapi-summary__title {
	margin: 0 0 12px;
	font-size: 1.125rem;
}

.rapi-summary__subtitle {
	margin: 16px 0 6px;
	font-size: 1rem;
}

.rapi-summary dl,
.rapi-bank {
	margin: 0;
}

.rapi-summary dl > div,
.rapi-bank > div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 6px 0;
	border-bottom: 1px solid rgba(18, 32, 35, 0.1);
}

.rapi-summary dt,
.rapi-summary dd,
.rapi-bank dt,
.rapi-bank dd {
	margin: 0;
}

.rapi-summary dd,
.rapi-bank dd {
	text-align: right;
	font-weight: 600;
}

.rapi-summary__total {
	border-bottom: 0 !important;
	font-size: 1.125rem;
	font-weight: 800;
}

.rapi-address {
	font-style: normal;
}

/* Alerts and badges */
.rapi-alert {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: 10px;
	border-left: 4px solid var(--rapi-sage);
	background: var(--rapi-paper);
}

.rapi-alert--error {
	border-color: var(--rapi-error);
	background: var(--rapi-error-bg);
}

.rapi-alert--info {
	border-color: var(--rapi-green);
	background: var(--rapi-mint);
}

.rapi-alert--success {
	border-color: var(--rapi-green);
	background: var(--rapi-mint);
}

.rapi-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--rapi-line);
	font-size: 0.75rem;
	font-weight: 700;
	vertical-align: middle;
}

.rapi-badge--payment-verified,
.rapi-badge--order-completed {
	background: var(--rapi-green);
	color: #fff;
}

.rapi-badge--payment-submitted,
.rapi-badge--order-shipped {
	background: var(--rapi-leaf);
}

.rapi-badge--payment-rejected,
.rapi-badge--order-cancelled {
	background: var(--rapi-error-bg);
	color: var(--rapi-error);
}

/* Order page */
.rapi-status__head {
	margin-bottom: 20px;
}

.rapi-eyebrow {
	margin: 0;
	color: var(--rapi-green);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.8125rem;
}

.rapi-status__title {
	margin: 4px 0 8px;
	font-size: 1.75rem;
	line-height: 1.2;
}

.rapi-status__meta {
	margin: 0;
	color: var(--rapi-muted);
	font-size: 0.9375rem;
}

.rapi-status__meta .rapi-badge {
	color: var(--rapi-ink);
}

.rapi-pay {
	padding: 24px;
	border: 2px solid var(--rapi-green);
	border-radius: var(--rapi-radius);
	background: #fff;
}

.rapi-pay__amount {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 12px;
	font-weight: 600;
}

.rapi-pay__amount strong {
	font-size: 2rem;
	color: var(--rapi-green);
}

.rapi-pay__deadline {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: 10px;
	background: #fff4e0;
	color: #6b4300;
	font-weight: 600;
	font-size: 0.9375rem;
}

.rapi-pay__steps {
	margin: 0 0 16px;
	padding-left: 1.25em;
}

.rapi-pay__steps li {
	margin-bottom: 4px;
}

.rapi-pay__qr {
	display: grid;
	place-items: center;
	margin: 0 0 16px;
	padding: 16px;
	border-radius: 10px;
	background: var(--rapi-paper);
}

.rapi-pay__qr img {
	width: 100%;
	max-width: 280px;
	height: auto;
}

.rapi-bank {
	margin-bottom: 20px;
}

.rapi-bank dt {
	white-space: nowrap;
}

.rapi-bank dd {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.rapi-bank .rapi-copy {
	margin-left: 0;
}

.rapi-upload {
	padding-top: 16px;
	border-top: 1px solid var(--rapi-line);
}

.rapi-upload .rapi-btn {
	margin-top: 12px;
	width: 100%;
}

.rapi-help {
	text-align: center;
}

.rapi-notice {
	padding: 16px;
	border-radius: 10px;
	background: #f4f6f3;
}
