.apc-tabs {
	--apc-tabs-accent: #155DFC;
	--apc-tabs-nav-gap: 8px;
	width: 100%;
	border: none;
	box-sizing: border-box;
}

.apc-tabs__nav {
	position: relative;
	display: flex;
	gap: var(--apc-tabs-nav-gap);
	border-bottom: 1px solid #e3e3e3;
	margin-bottom: 24px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.apc-tabs__nav::-webkit-scrollbar {
	display: none;
}

.apc-tabs[data-tab-align="center"] .apc-tabs__nav { justify-content: center; }
.apc-tabs[data-tab-align="flex-end"] .apc-tabs__nav { justify-content: flex-end; }
.apc-tabs[data-tab-align="space-between"] .apc-tabs__nav { justify-content: space-between; }

/* NOTE on naming: the CSS variable names below still say "active"/plain as
   originally written, but their meaning has been swapped per request — the
   --apc-tabs-btn-active-* variables (fed by the "Tab Button Colors" panel,
   navActive* attributes) now style the DEFAULT/non-selected button, and the
   plain --apc-tabs-btn-* variables (fed by "Active Tab Colors" panel, nav*
   attributes) now style the SELECTED button. */
.apc-tabs__nav-button {
	position: relative;
	z-index: 1;
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background-color: var(--apc-tabs-btn-active-bg, transparent);
	color: var(--apc-tabs-btn-active-text, inherit);
	border: var(--apc-tabs-btn-border-width, 1px) solid var(--apc-tabs-btn-active-border-color, transparent);
	border-radius: var(--apc-tabs-btn-radius, 6px);
	cursor: pointer;
	font: inherit;
	white-space: nowrap;
	flex: 0 0 auto;
	padding: 10px 16px;
	opacity: 0.6;
	transition: opacity 0.2s ease, filter 0.2s ease, color 0.2s ease;
}
.apc-tabs__nav-button:hover,
.apc-tabs__nav-button[aria-selected="true"] {
	opacity: 1;
}
/* Hover: brightness-based since there's no separate "hover color" control. */
.apc-tabs__nav-button:hover {
	filter: brightness(0.96);
}
.apc-tabs__nav-button[aria-selected="true"] {
	background-color: var(--apc-tabs-btn-bg, var(--apc-tabs-btn-active-bg, transparent));
	border-color: var(--apc-tabs-btn-border-color, var(--apc-tabs-btn-active-border-color, transparent));
	color: var(--apc-tabs-btn-text, var(--apc-tabs-btn-active-text, inherit));
}
.apc-tabs__nav-button[aria-selected="true"]:not([style*="--apc-tabs-btn-bg"]) {
	filter: brightness(0.92);
}
.apc-tabs__nav-button:focus-visible {
	outline: 2px solid var(--apc-tabs-accent);
	outline-offset: 2px;
}
.apc-tabs__nav-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	object-fit: contain;
}

/* Sliding indicator — for "underline" style it's a thin bar; for "pill" style
   (below) it's repurposed as the filled highlight sliding behind the active
   button. The "wobbly" overshoot curve (slightly past 1, then settles back)
   approximates a spring's bounce — the signature feel of Maxime Heckel's
   animated tabs — rather than a plain, no-overshoot ease. */
.apc-tabs__indicator {
	position: absolute;
	bottom: -1px;
	left: 0;
	height: 2px;
	width: 0;
	z-index: 0;
	border-radius: 2px;
	background: var(--apc-tabs-accent);
	transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pill variant */
.apc-tabs--pill .apc-tabs__nav {
	position: relative;
	border-bottom: none;
	
	padding: 4px;
	border-radius: 999px;
	display: inline-flex;
}
.apc-tabs--pill .apc-tabs__nav-button {
	background: transparent;
	border-radius: 999px;
	opacity: 1;
	color: var(--apc-tabs-btn-active-text, #444);
}
.apc-tabs--pill .apc-tabs__nav-button[aria-selected="true"] {
	background: transparent;
	color: var(--apc-tabs-btn-text, #1e1e1e);
	filter: none;
}
/* The indicator IS the moving pill here (not an underline) — sized/positioned
   in frontend.js to exactly match the active button, sliding with the wobble. */
.apc-tabs--pill .apc-tabs__indicator {
	top: 4px;
	bottom: auto;
	left: 0;
	height: calc(100% - 8px);
	border-radius: 999px;
	background: var(--apc-tabs-btn-bg, #fff);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.apc-tabs__panels {
	position: relative;
	display: grid;
}

/* Both panels are stacked in the same grid cell so the outgoing one can fade
   out while the incoming one fades in — a true crossfade instead of an
   instant hide-then-fade-in. Pure opacity only, no vertical movement or
   scale — matching the reference's yValue={false} (content doesn't slide,
   it just dissolves between states). */
.apc-tabs__panel {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.apc-tabs__panel[data-active="true"] {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.3s ease, visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
	.apc-tabs__panel,
	.apc-tabs__panel[data-active="true"] {
		transition: opacity 0.15s linear, visibility 0s linear;
	}
}

.apc-tabs__panel img {
	max-width: 100%;
	height: auto;
}

/* Responsive: narrow the nav, let it scroll horizontally, shrink type */
@media (max-width: 600px) {
	.apc-tabs[data-tab-align] .apc-tabs__nav {
		justify-content: flex-start;
	}
	.apc-tabs__nav-button {
		padding: 8px 12px;
		font-size: 14px;
	}
	.apc-tabs--pill .apc-tabs__nav {
		display: flex;
	}
}