/* TechRelix Hanging Rail v1.0.0 */
.thr {
	--thr-bg: #fff;
	--thr-text: #111;
	--thr-muted: #6b6b6b;
	--thr-rod: #b9bcc0;
	--thr-hanger: #2b2b2b;
	--thr-accent: #111;
	--thr-accent-text: #fff;
	--thr-h: 420px;
	--thr-slot: 92px;
	--thr-tilt: 68deg;
	--thr-ease: cubic-bezier(.22, .8, .24, 1);
	position: relative;
	background: var(--thr-bg);
	color: var(--thr-text);
	padding: 48px 0 28px;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}
.thr *, .thr *::before, .thr *::after { box-sizing: border-box; }

.thr-head {
	display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
	max-width: 1280px; margin: 0 auto 24px; padding: 0 24px;
}
.thr-title { margin: 0; color: inherit; font-size: clamp(24px, 3vw, 38px); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.thr-sub { margin: 8px 0 0; color: var(--thr-muted); font-size: 15px; line-height: 1.5; }
.thr-all { color: inherit; font-size: 14px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; white-space: nowrap; }

.thr-stage { position: relative; }
.thr-viewport {
	overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
	cursor: grab; overscroll-behavior-x: contain;
}
.thr-viewport::-webkit-scrollbar { display: none; }
.thr-viewport.is-drag { cursor: grabbing; }
.thr-viewport.is-drag .thr-garment { pointer-events: none; }

/* Derived sizes live on the track so mobile can override them cleanly */
.thr-track {
	--thr-w: calc(var(--thr-h) * .72);
	--thr-rod-top: calc(var(--thr-w) * .016 + 1px);
	--thr-face-top: calc(var(--thr-w) * .19);
	list-style: none; margin: 0; padding: 0 64px;
	position: relative; display: flex; align-items: flex-start;
	width: max-content; min-width: 100%;
	justify-content: safe center;
	perspective: 1600px;
}
.thr--no-hanger .thr-track { --thr-rod-top: 6px; --thr-face-top: 0px; }

/* The rod */
.thr-track::before {
	content: ""; position: absolute; left: 0; right: 0; z-index: 0;
	top: var(--thr-rod-top); height: 6px; margin-top: -3px; border-radius: 3px;
	background: linear-gradient(180deg, #f3f4f5 0%, var(--thr-rod) 55%, #7d8186 100%);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .14);
}

.thr-item {
	position: relative; z-index: 1;
	flex: 0 0 var(--thr-slot);
	height: calc(var(--thr-h) + 64px);
	transition: flex-basis .6s var(--thr-ease);
}
.thr-item.is-active { flex-basis: calc(var(--thr-w) + 28px); z-index: 3; }

.thr-garment {
	all: unset;
	position: absolute; top: 0; left: 50%;
	width: var(--thr-w); height: var(--thr-h);
	margin-left: calc(var(--thr-w) / -2);
	transform-origin: 50% var(--thr-rod-top);
	cursor: pointer; display: block;
}
.thr-garment:focus-visible { outline: 2px solid var(--thr-accent); outline-offset: 6px; border-radius: 8px; }

.thr-turn {
	position: absolute; inset: 0; display: block;
	transform: rotateY(var(--thr-tilt));
	transform-style: preserve-3d;
	transition: transform .75s var(--thr-ease);
}
.thr-item.is-active .thr-turn { transform: rotateY(0deg); }
.thr-item.is-active .thr-garment { animation: thr-sway 1.4s var(--thr-ease); }

.thr-hanger {
	position: absolute; top: 0; left: 15%; width: 70%; height: auto;
	color: var(--thr-hanger); z-index: 0; overflow: visible;
	transition: transform .75s var(--thr-ease);
}
.thr-faces { position: absolute; left: 0; right: 0; bottom: 0; top: var(--thr-face-top); z-index: 1; display: block; }
.thr-face {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: contain; object-position: 50% 0;
	max-width: none; border: 0; border-radius: 0; box-shadow: none;
	filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .10));
	transition: opacity .45s ease, transform .75s var(--thr-ease);
	user-select: none; -webkit-user-drag: none;
}
.thr--flat .thr-face { filter: none; }

/* Real side photo: show it at rest, swap to front on turn */
.has-side .thr-turn { transform: none; }
.has-side .thr-hanger { transform: rotateY(var(--thr-tilt)); }
.has-side .thr-front { opacity: 0; transform: scaleX(.35); }
.has-side.is-active .thr-hanger { transform: none; }
.has-side.is-active .thr-front { opacity: 1; transform: none; }
.has-side.is-active .thr-side { opacity: 0; }

.is-oos .thr-face { opacity: .45; }

.thr-cap {
	position: absolute; left: 50%; top: calc(var(--thr-h) + 12px);
	width: calc(var(--thr-w) + 20px); transform: translateX(-50%);
	text-align: center; font-size: 14px; line-height: 1.35;
	opacity: 0; transition: opacity .35s ease; pointer-events: none;
}
.thr-item.is-active .thr-cap { opacity: 1; }
.thr-cap-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr-cap-price { display: block; color: var(--thr-muted); margin-top: 2px; }
.thr-cap-price del { opacity: .6; margin-right: 4px; }
.thr-cap-price ins { text-decoration: none; color: var(--thr-text); }

/* Entrance */
.thr.thr-js:not(.is-in) .thr-item { opacity: 0; }
.thr.is-in .thr-item { animation: thr-enter .9s var(--thr-ease) both; animation-delay: calc(var(--i) * 45ms); }

@keyframes thr-enter { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes thr-sway {
	0% { transform: rotate(0); }
	25% { transform: rotate(2.4deg); }
	55% { transform: rotate(-1.4deg); }
	80% { transform: rotate(.6deg); }
	100% { transform: rotate(0); }
}

/* Arrows */
.thr-nav {
	position: absolute; top: calc(var(--thr-h) * .45); z-index: 5;
	width: 44px; height: 44px; border-radius: 50%; padding: 10px;
	border: 1px solid rgba(0, 0, 0, .12); background: rgba(255, 255, 255, .92); color: var(--thr-text);
	cursor: pointer; display: grid; place-items: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08); transition: opacity .2s;
}
.thr-nav[hidden] { display: none; }
.thr-nav:disabled { opacity: 0; pointer-events: none; }
.thr-nav svg { width: 20px; height: 20px; }
.thr-prev { left: 16px; }
.thr-next { right: 16px; }

.thr-empty { padding: 24px; border: 1px dashed #ccc; color: #666; text-align: center; font-size: 14px; }

/* ---------- Mobile: swipe slider, garments face front ---------- */
@media (max-width: 599px) {
	.thr { padding: 32px 0 20px; }
	.thr-head { padding: 0 16px; margin-bottom: 16px; }
	.thr-viewport { scroll-snap-type: x mandatory; cursor: auto; }
	.thr-track { --thr-w: 64vw; --thr-h: calc(64vw / .72); padding: 0 18vw; gap: 14px; }
	.thr-item, .thr-item.is-active { flex-basis: var(--thr-w); scroll-snap-align: center; }
	.thr-turn, .has-side .thr-hanger { transform: none; }
	.has-side .thr-side { opacity: 0; }
	.has-side .thr-front { opacity: 1; transform: none; }
	.thr-cap { opacity: 1; }
	.thr-item.is-active .thr-garment { animation: none; }
	.thr-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.thr *, .thr-modal * { transition: none !important; animation: none !important; }
}

/* ---------- Quick view ---------- */
.thr-lock { overflow: hidden !important; }
.thr-modal {
	--thr-accent: #111; --thr-accent-text: #fff; --thr-text: #111; --thr-muted: #6b6b6b;
	--thr-ease: cubic-bezier(.22, .8, .24, 1);
	position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center;
	color: var(--thr-text); font-size: 15px; line-height: 1.5;
}
.thr-modal[hidden] { display: none; }
.thr-modal *, .thr-modal *::before, .thr-modal *::after { box-sizing: border-box; }
.thr-m-backdrop { position: absolute; inset: 0; background: rgba(255, 255, 255, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s ease; }
.thr-modal.is-open .thr-m-backdrop { opacity: 1; }
.thr-m-panel {
	position: relative; width: min(940px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
	display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden;
	background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .14);
	opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .5s var(--thr-ease);
}
.thr-modal.is-open .thr-m-panel { opacity: 1; transform: none; }
.thr-m-close {
	position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
	border: 0; background: rgba(0, 0, 0, .05); color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.thr-m-media { position: relative; background: #f7f7f7; min-height: 420px; aspect-ratio: 3 / 4; }
.thr-m-img {
	position: absolute; inset: 6% 6% 14%; width: 88%; height: 80%; object-fit: contain; max-width: none;
	transform-origin: 0 0; transition: transform .6s var(--thr-ease), opacity .3s ease;
	filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .12));
}
.thr-m-views { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.thr-m-views[hidden] { display: none; }
.thr-m-views button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.thr-m-views button.is-on { background: var(--thr-accent); color: var(--thr-accent-text); }
.thr-m-info { padding: 44px 36px 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.thr-m-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: inherit; }
.thr-m-price { font-size: 18px; }
.thr-m-price del { color: var(--thr-muted); margin-right: 6px; font-size: .85em; }
.thr-m-price ins { text-decoration: none; }
.thr-m-opt-label { font-size: 13px; color: var(--thr-muted); margin-bottom: 6px; }
.thr-m-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.thr-m-pills button {
	min-width: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .15);
	background: #fff; color: inherit; font: inherit; font-size: 14px; cursor: pointer;
}
.thr-m-pills button.is-on { border-color: var(--thr-accent); box-shadow: inset 0 0 0 1px var(--thr-accent); }
.thr-m-pills button:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.thr-m-actions { display: grid; gap: 10px; margin-top: auto; padding-top: 8px; }
.thr-m-add, .thr-m-wa {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.thr-m-add { border: 0; background: var(--thr-accent); color: var(--thr-accent-text); }
.thr-m-add:disabled { opacity: .45; cursor: not-allowed; }
.thr-m-wa { border: 1px solid rgba(0, 0, 0, .14); background: #fff; color: inherit; }
.thr-m-wa[hidden] { display: none; }
.thr-m-wa svg { width: 20px; height: 20px; color: #25d366; }
.thr-m-link { color: var(--thr-muted); font-size: 14px; text-align: center; }
.thr-m-msg { margin: 0; font-size: 14px; min-height: 1.5em; text-align: center; }
.thr-m-msg a { color: inherit; font-weight: 600; }
.thr-m-msg.is-err { color: #b42318; }

@media (max-width: 760px) {
	.thr-modal { align-items: flex-end; }
	.thr-m-panel {
		width: 100%; max-height: 92vh; grid-template-columns: 1fr; border-radius: 20px 20px 0 0;
		overflow-y: auto; transform: translateY(40px);
	}
	.thr-m-media { min-height: 0; aspect-ratio: 1 / 1; }
	.thr-m-info { padding: 20px 20px 28px; overflow: visible; }
	.thr-m-title { font-size: 20px; }
}
