/*
 * Gala Store — STRUCTURAL styles only.
 * No colours, no typography: the theme owns all of that. Everything here exists so the
 * modal, overlay and floating pills work even before the theme styles them.
 */

.gala-modal[hidden] {
	display: none;
}

.gala-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	overflow-y: auto;
}

.gala-modal__overlay {
	position: absolute;
	inset: 0;
	cursor: pointer;
}

.gala-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 32rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
}

/* Keeps a large source logo from swamping the dialog before the theme sizes it. */
.gala-modal__brand img {
	display: block;
	max-width: 160px;
	height: auto;
	margin: 0 auto;
}

.gala-modal__close {
	position: absolute;
	top: .5rem;
	right: .5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: none;
	cursor: pointer;
	padding: .5rem;
	line-height: 0;
}

.gala-modal-open,
.gala-modal-open body {
	overflow: hidden;
}

.gala-redeem-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.gala-redeem-form__input {
	flex: 1 1 12rem;
	min-width: 0;
}

.gala-redeem-form__error[hidden] {
	display: none;
}

.gala-redeem-form__input.is-error {
	animation: gala-shake 320ms ease;
}

@keyframes gala-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-5px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(3px); }
}

.gala-fab {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 9998;
	cursor: pointer;
}

.gala-fab[hidden] {
	display: none;
}

.gala-credits {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 9998;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .375rem;
}

.gala-cats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gala-cat {
	display: block;
	height: 100%;
	text-decoration: none;
}

.gala-cat__media {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
}

.gala-cat__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.gala-cat__body {
	display: block;
}

.gala-cat__name,
.gala-cat__count {
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.gala-redeem-form__input.is-error {
		animation: none;
	}
}
