/**
 * 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; }
}
