/* Atolyeman segment switcher — vertical icon rail fixed to the right edge.
   Icon-only by default; the label reveals as a tooltip on hover. Colors come
   from the theme's design tokens (with fallbacks), so the active state morphs
   with the selected audience. */

.at-segrail {
	position: fixed;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	z-index: 990;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-family: var(--at-font-sans, system-ui, sans-serif);
}

.at-segrail__item {
	position: relative;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--at-surface, #fff);
	color: var(--at-text, #1c1a17);
	border: 1px solid var(--at-border, #e5e0d8);
	box-shadow: 0 6px 18px rgba(28, 26, 23, .10);
	text-decoration: none;
	transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.at-segrail__item:hover {
	transform: translateX(-3px);
	border-color: var(--at-accent, #8a6d4b);
}
.at-segrail__item.is-active {
	background: var(--at-accent, #8a6d4b);
	color: var(--at-on-accent, #fff);
	border-color: var(--at-accent, #8a6d4b);
}

.at-segrail__icon { display: grid; place-items: center; }
.at-segrail__icon svg { width: 22px; height: 22px; display: block; }

/* Label = tooltip to the LEFT of the icon, revealed on hover/focus */
.at-segrail__label {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	padding: 7px 12px;
	border-radius: 8px;
	background: var(--at-text, #1c1a17);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 6px 18px rgba(28, 26, 23, .16);
	transition: opacity .16s ease, transform .16s ease;
}
.at-segrail__label::after {
	content: "";
	position: absolute;
	left: 100%;
	top: 50%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-left-color: var(--at-text, #1c1a17);
}
.at-segrail__item:hover .at-segrail__label,
.at-segrail__item:focus-visible .at-segrail__label {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* ---- Mobile (D6.2): rail -> bottom-docked bar ----------------------------
   A fixed right-edge rail permanently covered the content column on a phone
   (it sat on top of the shop's sort control and the product cards' right
   edge). Below 782px it docks to the bottom centre as a horizontal pill. */
@media (max-width: 782px) {
	.at-segrail {
		top: auto;
		bottom: 12px;
		right: 50%;
		transform: translateX(50%);
		flex-direction: row;
		gap: 4px;
		padding: 5px;
		border-radius: 999px;
		background: var(--at-surface, #fff);
		border: 1px solid var(--at-border, #e5e0d8);
		box-shadow: 0 8px 24px rgba(28, 26, 23, .16);
	}
	.at-segrail__item {
		width: 44px;
		height: 44px;
		border-color: transparent;
		box-shadow: none;
	}
	.at-segrail__item:hover { transform: none; }
	.at-segrail__icon svg { width: 20px; height: 20px; }
	/* Tooltips would be clipped by the viewport edge; the bar is icon-only. */
	.at-segrail__label { display: none; }
	/* Keep the bar from sitting on top of the page's last row of content.
	   `html body` (0,0,2) is needed to outrank Blocksy's reset, which zeroes
	   padding on a long `body, p, h1, …` list loaded after this file. */
	html body { padding-bottom: 70px; }
}

/* Whatever owns the screen owns it alone: the filter drawer sets this class on
   <body>, and :has() catches the first-visit chooser without extra markup. */
body.at-filters-open .at-segrail,
body:has(.at-chooser) .at-segrail {
	display: none;
}

/* On mobile the bottom-docked rail would overlap the bottom-fixed cookie-consent
   banner and block its buttons. While the banner is visible, lift the rail above
   it. This is a baseline offset; assets/segments.js refines it to the banner's
   exact height. */
@media (max-width: 782px) {
	body:has(.at-consent:not([hidden])) .at-segrail {
		bottom: 150px;
	}
}

/* ---- First-visit experience chooser ---- */
.at-chooser {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(28, 26, 23, .55);
}
.at-chooser__card {
	width: min(760px, 100%);
	background: var(--at-surface, #fff);
	border-radius: var(--at-radius-lg, 20px);
	padding: 40px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, .28);
	text-align: center;
}
.at-chooser__title {
	font-family: var(--at-font-display, Georgia, serif);
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	margin: 0 0 8px;
	color: var(--at-text, #1c1a17);
}
.at-chooser__sub {
	color: var(--at-text-muted, #6b6560);
	margin: 0 auto 28px;
	max-width: 46ch;
	font-size: 15px;
	line-height: 1.5;
}
.at-chooser__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}
.at-chooser__opt {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 22px 14px;
	border: 1px solid var(--at-border, #e5e0d8);
	border-radius: var(--at-radius, 12px);
	text-decoration: none;
	color: var(--at-text, #1c1a17);
	transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.at-chooser__opt:hover {
	border-color: var(--at-accent, #8a6d4b);
	transform: translateY(-2px);
	box-shadow: var(--at-shadow, 0 8px 24px rgba(0, 0, 0, .08));
}
.at-chooser__icon { color: var(--at-accent, #8a6d4b); }
.at-chooser__icon svg { width: 30px; height: 30px; }
.at-chooser__label { font-weight: 700; font-size: 15px; }
.at-chooser__desc { font-size: 12px; color: var(--at-text-muted, #6b6560); line-height: 1.3; }
.at-chooser__skip {
	display: inline-block;
	margin-top: 22px;
	color: var(--at-text-muted, #6b6560);
	font-size: 13px;
	text-decoration: underline;
}
@media (max-width: 640px) {
	.at-chooser__grid { grid-template-columns: repeat(2, 1fr); }
	.at-chooser__card { padding: 28px 20px; max-height: 88vh; overflow-y: auto; }
	.at-chooser__skip { padding: 10px 16px; } /* 13px link -> 44px tap target */
}

@media (prefers-reduced-motion: reduce) {
	.at-segrail__item,
	.at-segrail__label,
	.at-chooser__opt {
		transition: none;
	}
	.at-segrail__item:hover,
	.at-chooser__opt:hover {
		transform: none;
	}
}
