/**
 * Abonneo storefront styles.
 *
 * Deliberately neutral: the panel inherits the theme typography and colours, and
 * only brings the layout, spacing and motion the theme cannot provide.
 */

.abonneo-subscribe-trigger {
	margin-left: .5em;
}

.abonneo-badge {
	display: inline-block;
	margin-left: .4em;
	padding: .1em .5em;
	border-radius: 999px;
	background: rgba(0, 0, 0, .07);
	font-size: .75em;
	text-transform: uppercase;
	letter-spacing: .04em;
	vertical-align: middle;
}

/* Panel ------------------------------------------------------------------- */

.abonneo-panel[hidden] {
	display: none;
}

.abonneo-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.abonneo-panel__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 24, .55);
	animation: abonneo-fade .18s ease-out;
}

.abonneo-panel__dialog {
	position: relative;
	z-index: 1;
	width: min(32rem, calc(100vw - 2rem));
	max-height: min(90vh, 48rem);
	overflow-y: auto;
	padding: 1.75rem;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(15, 18, 24, .28);
	animation: abonneo-pop .2s ease-out;
}

.abonneo-panel__close {
	position: absolute;
	top: .5rem;
	right: .75rem;
	border: 0;
	background: none;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: .55;
}

.abonneo-panel__close:hover,
.abonneo-panel__close:focus-visible {
	opacity: 1;
}

.abonneo-panel__title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

/* Mobile: the panel slides up from the bottom of the screen. */
@media (max-width: 640px) {
	.abonneo-panel {
		align-items: flex-end;
	}

	.abonneo-panel__dialog {
		width: 100%;
		max-height: 88vh;
		border-radius: 16px 16px 0 0;
		animation: abonneo-slide-up .22s ease-out;
	}
}

@media (prefers-reduced-motion: reduce) {
	.abonneo-panel__backdrop,
	.abonneo-panel__dialog {
		animation: none;
	}
}

/* Form -------------------------------------------------------------------- */

.abonneo-form {
	display: grid;
	gap: 1rem;
}

.abonneo-form--inline {
	margin-top: 1.25rem;
	padding: 1.25rem;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 12px;
}

.abonneo-field {
	display: grid;
	gap: .35rem;
}

.abonneo-label {
	font-weight: 600;
	font-size: .9rem;
}

.abonneo-input,
.abonneo-select {
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid rgba(0, 0, 0, .22);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	color: inherit;
}

.abonneo-input:focus-visible,
.abonneo-select:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.abonneo-field--purpose {
	display: flex;
	gap: .5rem;
}

.abonneo-choice {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	padding: .5rem .75rem;
	border: 1px solid rgba(0, 0, 0, .18);
	border-radius: 999px;
	cursor: pointer;
	font-size: .9rem;
}

.abonneo-choice:has(input:checked) {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
	font-weight: 600;
}

.abonneo-gift[hidden] {
	display: none;
}

.abonneo-gift {
	display: grid;
	gap: .75rem;
	padding: 1rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, .04);
}

/* Summary ----------------------------------------------------------------- */

.abonneo-summary {
	padding: 1rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, .04);
	font-size: .95rem;
}

.abonneo-summary.is-loading {
	opacity: .55;
}

.abonneo-summary__list {
	margin: 0;
	display: grid;
	gap: .5rem;
}

.abonneo-summary__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
}

.abonneo-summary__row dt {
	font-weight: 600;
	flex: 0 0 auto;
}

.abonneo-summary__row dd {
	margin: 0;
	text-align: right;
}

.abonneo-summary__note,
.abonneo-note {
	margin: .5rem 0 0;
	font-size: .82rem;
	opacity: .78;
}

.abonneo-note--checkout {
	text-align: center;
}

.abonneo-error {
	margin: 0;
	padding: .6rem .75rem;
	border-radius: 8px;
	background: rgba(200, 30, 30, .1);
	color: #8a1414;
	font-size: .88rem;
}

/* Consent ----------------------------------------------------------------- */

.abonneo-consent {
	display: flex;
	gap: .6rem;
	align-items: flex-start;
	margin: 1rem 0;
	padding: .9rem 1rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, .04);
	font-size: .9rem;
}

.abonneo-consent input {
	margin-top: .2rem;
}

/* My account -------------------------------------------------------------- */

.abonneo-subscriptions {
	width: 100%;
	border-collapse: collapse;
}

.abonneo-subscriptions th,
.abonneo-subscriptions td {
	padding: .6rem .5rem;
	border-bottom: 1px solid rgba(0, 0, 0, .1);
	text-align: left;
	vertical-align: middle;
}

.abonneo-status {
	display: inline-block;
	padding: .15em .6em;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 600;
	background: rgba(0, 0, 0, .08);
}

.abonneo-status--active,
.abonneo-status--trialing {
	background: rgba(23, 138, 78, .14);
	color: #13673b;
}

.abonneo-status--past_due,
.abonneo-status--suspended {
	background: rgba(196, 120, 10, .16);
	color: #8a5406;
}

.abonneo-status--cancelled,
.abonneo-status--expired,
.abonneo-status--completed,
.abonneo-status--pending_cancellation {
	background: rgba(0, 0, 0, .09);
	color: #4a4a4a;
}

.abonneo-detail__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.abonneo-card {
	padding: 1rem;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 10px;
}

.abonneo-card__label {
	display: block;
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .6;
}

.abonneo-card__value {
	font-size: 1.1rem;
	font-weight: 600;
}

.abonneo-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 1rem 0 2rem;
}

@keyframes abonneo-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes abonneo-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

@keyframes abonneo-slide-up {
	from { transform: translateY(100%); }
	to   { transform: none; }
}

/* Order confirmation: the subscription block */
.abonneo-thankyou { margin: 1.5em 0 2em; padding: 1.2em 1.4em; border: 1px solid #e2e2e2; border-radius: 8px; background: #fafafa; }
.abonneo-thankyou h2 { margin-top: 0; font-size: 1.25em; }
.abonneo-thankyou__item { margin-bottom: 1em; }
.abonneo-thankyou__item p { margin: .3em 0; }
.abonneo-thankyou .abonneo-muted { color: #6b7280; font-size: .9em; margin-bottom: 0; }

/* Gift activation page */
.abonneo-redeem { max-width: 640px; }
.abonneo-gift-preview {
	display: flex;
	gap: 1.25em;
	align-items: flex-start;
	padding: 1.25em;
	margin: 0 0 1.5em;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 14px;
	background: rgba(0, 0, 0, .02);
}
.abonneo-gift-preview__image { flex: 0 0 150px; }
.abonneo-gift-preview__image img { display: block; width: 150px; height: auto; border-radius: 10px; }
.abonneo-gift-preview__body { flex: 1 1 auto; min-width: 0; }
.abonneo-gift-preview__eyebrow {
	margin: 0 0 .25em;
	font-size: .75em;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 700;
	opacity: .7;
}
.abonneo-gift-preview__title { margin: 0 0 .25em; font-size: 1.35em; }
.abonneo-gift-preview__terms { margin: 0 0 .15em; font-weight: 600; }
.abonneo-gift-preview__rhythm { margin: 0 0 .75em; opacity: .8; }
.abonneo-gift-preview__message {
	margin: .75em 0;
	padding: .6em 1em;
	border-left: 3px solid currentColor;
	font-style: italic;
	opacity: .85;
}
.abonneo-gift-preview .abonneo-note { margin: .5em 0 0; }
.abonneo-address { margin: 1.25em 0; padding: 0; border: 0; }
.abonneo-address legend { padding: 0; margin-bottom: .5em; font-weight: 600; }
.abonneo-address__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75em 1em; }
.abonneo-address__grid .abonneo-field { margin: 0; }
.abonneo-field--wide { grid-column: 1 / -1; }
@media (max-width: 600px) {
	.abonneo-gift-preview { flex-direction: column; }
	.abonneo-gift-preview__image, .abonneo-gift-preview__image img { width: 100%; flex-basis: auto; height: auto; }
	.abonneo-address__grid { grid-template-columns: 1fr; }
}

/* Gift: email delivery is a choice */
.abonneo-check { display: flex; align-items: flex-start; gap: .5em; cursor: pointer; font-weight: 600; }
.abonneo-check input { margin: .3em 0 0; flex: 0 0 auto; }
.abonneo-note--tight { margin: .35em 0 0 1.6em; font-size: .85em; opacity: .75; }
.abonneo-gift__email { margin-top: .75em; }

/* Wallet buttons buy one box, not a subscription */
.abonneo-one-click-note { margin: .5em 0 0; font-size: .85em; opacity: .75; line-height: 1.4; }
.abonneo-one-click-note[hidden] { display: none; }
