/**
 * Area81 Payment Methods — Frontend styles.
 *
 * Scoped under .area81-pm. Uses CSS custom properties for theming and sizing so
 * the same markup adapts to light/dark themes, three icon sizes, three label
 * modes, configurable grid columns, list orientation, and slider effects.
 */

.area81-pm {
	/* Sizing tokens (overridden by size modifiers below) */
	--area81-pm-icon-w: 56px;
	--area81-pm-icon-h: 36px;
	--area81-pm-gap: 12px;
	--area81-pm-radius: 8px;
	--area81-pm-columns: 6;

	/* Light theme palette (default) */
	--area81-pm-card-bg: #ffffff;
	--area81-pm-border: #e6e6e6;
	--area81-pm-shadow: 0 1px 3px rgba(0, 0, 0, .08);
	--area81-pm-text: inherit;
	--area81-pm-muted: rgba(0, 0, 0, .6);
	--area81-pm-title: inherit;

	margin: 1.5em 0;
	color: var(--area81-pm-text);
}

.area81-pm *,
.area81-pm *::before,
.area81-pm *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * THEME: Dark
 * ------------------------------------------------------------------------- */
.area81-pm--theme-dark {
	--area81-pm-card-bg: #1e1e22;
	--area81-pm-border: #34343a;
	--area81-pm-shadow: 0 1px 3px rgba(0, 0, 0, .5);
	--area81-pm-text: #e7e7ea;
	--area81-pm-muted: rgba(255, 255, 255, .65);
	--area81-pm-title: #ffffff;
}

/* ---------------------------------------------------------------------------
 * THEME: Transparent — no card background, border, or shadow. Inherits the
 * surrounding text color so it blends into any section. Icons keep a subtle
 * rounded padding box only via the icon itself.
 * ------------------------------------------------------------------------- */
.area81-pm--theme-transparent {
	--area81-pm-card-bg: transparent;
	--area81-pm-border: transparent;
	--area81-pm-shadow: none;
	--area81-pm-text: inherit;
	--area81-pm-muted: inherit;
	--area81-pm-title: inherit;
}

.area81-pm--theme-transparent .area81-pm__item {
	padding: 4px;
}

/* THEME: Auto — apply dark tokens when the visitor's OS prefers dark */
@media (prefers-color-scheme: dark) {
	.area81-pm--theme-auto {
		--area81-pm-card-bg: #1e1e22;
		--area81-pm-border: #34343a;
		--area81-pm-shadow: 0 1px 3px rgba(0, 0, 0, .5);
		--area81-pm-text: #e7e7ea;
		--area81-pm-muted: rgba(255, 255, 255, .65);
		--area81-pm-title: #ffffff;
	}
}

/* ---------------------------------------------------------------------------
 * SIZE modifiers
 * ------------------------------------------------------------------------- */
.area81-pm--size-small {
	--area81-pm-icon-w: 42px;
	--area81-pm-icon-h: 27px;
	--area81-pm-gap: 8px;
}

.area81-pm--size-medium {
	--area81-pm-icon-w: 56px;
	--area81-pm-icon-h: 36px;
	--area81-pm-gap: 12px;
}

.area81-pm--size-large {
	--area81-pm-icon-w: 76px;
	--area81-pm-icon-h: 48px;
	--area81-pm-gap: 16px;
}

/* ---------------------------------------------------------------------------
 * Headings
 * ------------------------------------------------------------------------- */
.area81-pm__title {
	margin: 0 0 .35em;
	font-size: 1.05rem;
	line-height: 1.3;
	color: var(--area81-pm-title);
}

.area81-pm__description {
	margin: 0 0 1em;
	color: var(--area81-pm-muted);
	font-size: .9rem;
	line-height: 1.5;
}

/* Category group blocks (when grouping is enabled) */
.area81-pm__group + .area81-pm__group {
	margin-top: 1.25em;
}

.area81-pm__group-title {
	margin: 0 0 .6em;
	font-size: .8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--area81-pm-muted);
}

/* ---------------------------------------------------------------------------
 * Shared icon card
 * ------------------------------------------------------------------------- */
.area81-pm__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0; /* allow flex children (the name) to shrink and wrap */
	background: var(--area81-pm-card-bg);
	border: 1px solid var(--area81-pm-border);
	border-radius: var(--area81-pm-radius);
	box-shadow: var(--area81-pm-shadow);
	padding: 8px 10px;
}

.area81-pm__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--area81-pm-icon-w);
	height: var(--area81-pm-icon-h);
	flex: 0 0 auto;
}

.area81-pm__icon svg,
.area81-pm__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.area81-pm__name {
	font-size: .9rem;
	font-weight: 500;
	line-height: 1.25;
	color: var(--area81-pm-text);
	/* Wrap long names (e.g. "American Express") instead of overflowing. */
	overflow-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
	max-width: 100%;
	min-width: 0;
}

/* Accessible hidden text */
.area81-pm .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;
}

/* ---------------------------------------------------------------------------
 * GRID
 * ------------------------------------------------------------------------- */
.area81-pm__grid {
	display: grid;
	grid-template-columns: repeat(var(--area81-pm-columns), minmax(0, 1fr));
	gap: var(--area81-pm-gap);
	align-items: stretch;
}

.area81-pm__grid .area81-pm__item {
	width: 100%;
}

/* ---------------------------------------------------------------------------
 * LIST
 * ------------------------------------------------------------------------- */
.area81-pm__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--area81-pm-gap);
}

/* Vertical (default): stacked rows */
.area81-pm--vertical .area81-pm__list {
	flex-direction: column;
}

.area81-pm--vertical .area81-pm__list-row .area81-pm__item {
	width: 100%;
	justify-content: flex-start;
	gap: 14px;
}

/* Horizontal: inline, wrapping */
.area81-pm--horizontal .area81-pm__list {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
}

.area81-pm--horizontal .area81-pm__list-row {
	display: inline-flex;
}

/* ---------------------------------------------------------------------------
 * SLIDER (shared)
 * ------------------------------------------------------------------------- */
.area81-pm__slider {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.area81-pm__track {
	display: flex;
	gap: var(--area81-pm-gap);
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding: 4px;
	scrollbar-width: thin;
	flex: 1 1 auto;
}

.area81-pm__track::-webkit-scrollbar {
	height: 6px;
}

.area81-pm__track::-webkit-scrollbar-thumb {
	background: var(--area81-pm-border);
	border-radius: 3px;
}

.area81-pm__slider .area81-pm__item {
	scroll-snap-align: start;
	flex: 0 0 auto;
}

.area81-pm__track:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.area81-pm__nav {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--area81-pm-border);
	background: var(--area81-pm-card-bg);
	box-shadow: var(--area81-pm-shadow);
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--area81-pm-text);
	transition: background .15s ease, transform .15s ease;
}

.area81-pm__nav:hover {
	filter: brightness(.96);
}

.area81-pm__nav:active {
	transform: scale(.94);
}

.area81-pm__nav[disabled] {
	opacity: .35;
	cursor: default;
}

/* SLIDER effect: Fade — JS toggles .is-active on the "current" item */
.area81-pm--effect-fade .area81-pm__track {
	scroll-snap-type: none;
	overflow: hidden;
}

/* SLIDER effect: Marquee — continuous CSS animation, paused on hover */
.area81-pm--effect-marquee .area81-pm__track {
	overflow: hidden;
	scroll-snap-type: none;
}

.area81-pm--effect-marquee .area81-pm__nav {
	display: none; /* marquee has no manual nav */
}

.area81-pm--effect-marquee .area81-pm__track.is-marquee {
	animation: area81-pm-marquee linear infinite;
}

.area81-pm--effect-marquee .area81-pm__track.is-marquee:hover {
	animation-play-state: paused;
}

@keyframes area81-pm-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); } /* half, because items are duplicated */
}

/* ---------------------------------------------------------------------------
 * LABEL modes
 * ------------------------------------------------------------------------- */
/* icon + text: in grid, stack icon over label so narrow columns stay readable */
.area81-pm--label-icon-text.area81-pm--grid .area81-pm__item {
	flex-direction: column;
	gap: 6px;
	text-align: center;
}

.area81-pm--label-icon-text .area81-pm__name {
	color: var(--area81-pm-text);
}

/* icon-hover: cursor hint that there's a tooltip */
.area81-pm--label-icon-hover .area81-pm__item {
	cursor: help;
}

/* ---------------------------------------------------------------------------
 * RESPONSIVE
 * ------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.area81-pm--size-large {
		--area81-pm-icon-w: 60px;
		--area81-pm-icon-h: 38px;
	}

	/* Never exceed 4 columns on small screens regardless of the setting */
	.area81-pm__grid {
		grid-template-columns: repeat(min(var(--area81-pm-columns), 4), minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.area81-pm__track {
		scroll-behavior: auto;
	}
	.area81-pm--effect-marquee .area81-pm__track.is-marquee {
		animation: none;
	}
}
