/**
 * Sarun Fragrance Accords — frontend (product page) styles.
 * Reference-matched: full-width track = 100%; each bar fills its exact
 * percentage; the accord name sits inside the bar with auto-contrast text.
 * Subtle grow-width animation on scroll-in.
 */

.sarun-accords {
	--sarun-ink: #1d1d1f;
	--sarun-gold: #b8934d;
	--sarun-bar-h: 26px;
	--sarun-radius: 4px;
	margin: 14px 0;
	max-width: 620px;
	color: var(--sarun-ink);
	-webkit-font-smoothing: antialiased;
}

.sarun-accords__title {
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--sarun-gold);
	font-weight: 600;
	margin: 0 0 8px;
}

.sarun-accords__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Each item is the full-width "100%" track. The bar fills --sarun-w of it. */
.sarun-accords__item {
	position: relative;
	height: var(--sarun-bar-h);
	width: 100%;
}

.sarun-accords__bar {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	opacity: 0;
	border-radius: var(--sarun-radius);
	background: var(--sarun-gold);
	/* Matches the live-site feel: quick grow + gentle fade, staggered per bar. */
	transition: width 0.7s cubic-bezier(0.2, 0.75, 0.25, 1),
		opacity 0.45s ease;
	transition-delay: calc(var(--sarun-i, 0) * 0.08s);
	will-change: width, opacity;
}

/* Name sits over the bar, pinned to the left, never clipped by bar width. */
.sarun-accords__name {
	position: absolute;
	left: 12px;
	right: 8px;
	top: 0;
	height: var(--sarun-bar-h);
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	z-index: 2;
}

/* When scrolled into view (or on load if already visible), bars grow to their
   exact percentage width and fade in — staggered one after another. */
.sarun-accords.is-visible .sarun-accords__bar {
	width: var(--sarun-w, 0%);
	opacity: 1;
}

/* No-JS / reduced-motion fallback: final width immediately, no motion. */
.sarun-accords.no-js .sarun-accords__bar {
	width: var(--sarun-w, 0%);
	opacity: 1;
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.sarun-accords__bar {
		transition: none;
		width: var(--sarun-w, 0%);
		opacity: 1;
	}
}

/* Mobile */
@media screen and (max-width: 600px) {
	.sarun-accords {
		margin: 12px 0;
		--sarun-bar-h: 24px;
	}
	.sarun-accords__name { font-size: 12.5px; left: 10px; }
}
