/* TFTC Merch UX: shop redesign layer. Minimal, fluid, motion-first. */

:root {
	--tftc-ease: cubic-bezier(.2, .8, .2, 1);
	--tftc-ease-in-out: cubic-bezier(.65, 0, .35, 1);
	--tftc-ink: #0b0b0b;
	--tftc-muted: #8a8a8a;
	--tftc-orange: #f7931a;
}

/* ---------- Hard stop at the top and bottom of every page ----------
   No elastic overscroll (Mac trackpads, iPhone), and the page canvas is black so even a browser
   that still bounces shows black next to the black header/footer instead of white. */
html {
	background: #000 !important;
	overscroll-behavior: none;
}
/* iPhone Safari (iOS 26) paints the strip under its floating toolbar, and the status bar, from the page
   colours: the body colour, or a fixed element touching that edge. Body = footer colour, the page itself
   stays white, so nothing white shows under the black footer. */
body {
	overscroll-behavior: none;
	background: #111;
}
.wp-site-blocks { background: #fff; }
/* Woo's mini-cart drawer inherits its colour from the body, so keep it white explicitly */
.wp-block-woocommerce-mini-cart-contents { background-color: #fff !important; }
/* Closed, Woo only fades the drawer's full-screen overlay to opacity 0 and parks the white drawer off to
   the side; Safari still sees them and keeps its bottom bar white after the cart closes. Hide them for
   real once the slide-out has finished. */
.wc-block-components-drawer__screen-overlay--is-hidden {
	visibility: hidden;
	transition: opacity .3s, visibility 0s linear .3s !important;
}
/* the shop never scrolls, so pin edge strips that tell Safari: black at the top, footer colour at the bottom */
body.tftc-shop::before,
body.tftc-shop::after {
	content: "";
	position: fixed;
	left: 0;
	right: 0;
	height: 2px;
	pointer-events: none;
	z-index: 1;
}
body.tftc-shop::before { top: 0; background: #000; }
body.tftc-shop::after { bottom: 0; background: #111; }

/* ---------- Shop grid: fills the space between header and footer, scales with the window ---------- */

body.tftc-shop .wp-site-blocks > .wp-block-woocommerce-product-collection {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: clamp(24px, 4vh, 64px) clamp(16px, 4vw, 72px);
	max-width: none !important;
}

body.tftc-shop {
	/* hat size follows the window: limited by width (3 across) and by height (fits between header and footer) */
	--tftc-hat: clamp(180px, min(24vw, calc(100dvh - 380px)), 560px);
	--tftc-gap: clamp(20px, 4vw, 96px);
}

body.tftc-shop ul.wc-block-product-template {
	display: flex !important;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: flex-start;
	gap: 0 !important; /* spacing lives inside each item so the hover never drops between hats */
	margin: 0 auto !important;
	padding: 0;
	width: auto !important;
	max-width: none !important;
}

body.tftc-shop ul.wc-block-product-template > li.wc-block-product {
	width: calc(var(--tftc-hat) + var(--tftc-gap)) !important;
	padding: 0 calc(var(--tftc-gap) / 2) !important;
	box-sizing: border-box;
	max-width: none !important;
	flex: 0 0 auto;
	margin: 0 !important;
	text-align: center;
	transition:
		opacity .45s var(--tftc-ease),
		filter .45s var(--tftc-ease),
		transform .6s var(--tftc-ease);
	will-change: opacity, transform;
}

/* page entrance: header, hats and footer fade in together in one smooth motion.
   "backwards" fill only holds the start state before it begins, so hover fades still work afterwards. */
@keyframes tftc-rise {
	from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); }
	to   { opacity: 1; transform: none; }
}
@keyframes tftc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tftc-show { to { opacity: 1; } }
/* The entrance runs on the hat row as a whole, never on the individual hats, so each hat's own
   opacity stays free for the hover fade (an animation on the hat itself would lock it and then snap). */
body.tftc-shop:not(.tftc-ready) ul.wc-block-product-template,
body.tftc-shop:not(.tftc-ready) .wp-site-blocks > header,
body.tftc-shop:not(.tftc-ready) .wp-site-blocks > footer {
	opacity: 0;
	animation: tftc-show 0s linear 3.2s forwards; /* failsafe if the script never runs */
}
body.tftc-shop.tftc-ready ul.wc-block-product-template {
	animation: tftc-rise 1s cubic-bezier(.22, 1, .36, 1) backwards;
	will-change: opacity, transform;
}
body.tftc-shop.tftc-ready .wp-site-blocks > header,
body.tftc-shop.tftc-ready .wp-site-blocks > footer {
	animation: tftc-fade .8s cubic-bezier(.22, 1, .36, 1) backwards;
}

/* image: brightened so the photos' off-white backdrops match the page exactly, and edges feathered,
   so no box ever shows around a hat (blend modes break during fades, so they aren't used) */
body.tftc-shop li.wc-block-product .wc-block-components-product-image {
	margin: 0 0 clamp(10px, 1.6vh, 20px) !important;
	overflow: visible;
	background: transparent !important;
}
body.tftc-shop li.wc-block-product .wc-block-components-product-image a { outline: none; }
body.tftc-shop li.wc-block-product .wc-block-components-product-image img {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: contain !important;
	transition: transform .7s var(--tftc-ease);
	transform-origin: 50% 60%;
}
/* fallback for a hat photo that has no transparent cut-out yet: blend its white backdrop away */
body.tftc-shop li.wc-block-product .wc-block-components-product-image img:not(.tftc-cutout),
.tftc-sv__img:not(.tftc-cutout) {
	filter: brightness(1.025);
	-webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 94%, transparent);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 94%, transparent);
	mask-composite: intersect;
}

/* title + price: quiet, tracked type */
body.tftc-shop li.wc-block-product .wp-block-post-title {
	margin: 0 0 4px !important;
	font-size: clamp(13px, 1.05vw, 17px) !important;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.3 !important;
}
body.tftc-shop li.wc-block-product .wp-block-post-title a {
	color: var(--tftc-ink);
	text-decoration: none;
}
body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-price {
	margin: 0 0 clamp(10px, 1.6vh, 18px) !important;
}
body.tftc-shop li.wc-block-product .wc-block-components-product-price {
	font-size: clamp(12px, .95vw, 15px) !important;
	color: var(--tftc-muted);
	letter-spacing: .04em;
}

/* add to cart: appears on hover (always visible on touch screens) */
body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-button {
	margin: 0 !important;
	transition: opacity .35s var(--tftc-ease), transform .45s var(--tftc-ease);
}
body.tftc-shop li.wc-block-product .wc-block-components-product-button__button {
	min-width: 148px;
	padding: 12px 26px !important;
	border-radius: 999px !important;
	font-size: 13px !important;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	background: var(--tftc-ink) !important;
	color: #fff !important;
	transition: transform .25s var(--tftc-ease), background-color .25s ease;
}
body.tftc-shop li.wc-block-product .wc-block-components-product-button__button:hover {
	transform: translateY(-1px);
}
body.tftc-shop li.wc-block-product .wc-block-components-product-button__button:active {
	transform: scale(.96);
}
body.tftc-shop li.wc-block-product .wc-block-components-product-button__button:focus:not(:focus-visible) {
	outline: none !important;
	box-shadow: none !important;
}

@media (hover: hover) and (pointer: fine) {
	body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-button {
		opacity: 0;
		transform: translateY(8px);
	}
	body.tftc-shop li.wc-block-product:hover .wp-block-woocommerce-product-button,
	body.tftc-shop li.wc-block-product:has(:focus-visible) .wp-block-woocommerce-product-button,
	body.tftc-shop li.wc-block-product.tftc-just-added .wp-block-woocommerce-product-button {
		opacity: 1;
		transform: none;
	}
	/* only the hovered hat ever shows its button (a click leaves focus on the last hat; that must not
	   keep its button up while you look at another one) */
	body.tftc-shop ul.wc-block-product-template:has(> li.wc-block-product:hover) > li.wc-block-product:not(:hover) .wp-block-woocommerce-product-button {
		opacity: 0;
		transform: translateY(8px);
		pointer-events: none;
	}

	/* focus mode: the hovered hat leans in, the others fade back */
	body.tftc-shop ul.wc-block-product-template:has(> li.wc-block-product:hover) > li.wc-block-product:not(:hover) {
		opacity: .16;
		filter: grayscale(1) blur(1.5px);
		transform: scale(.965);
	}
	body.tftc-shop li.wc-block-product:hover .wc-block-components-product-image img {
		transform: scale(1.06) translateY(-6px);
	}
}

/* after adding: the other hats breathe once to invite a second look */
@keyframes tftc-breathe {
	0%, 100% { transform: none; }
	45% { transform: translateY(-8px) scale(1.02); }
}
body.tftc-shop li.wc-block-product.tftc-invite .wc-block-components-product-image {
	animation: tftc-breathe .9s var(--tftc-ease); /* on the photo, not the hat, so it never fights the hover fade */
}

/* ---------- Phones: one big hat at a time, the other two peeking in from the sides ----------
   The script moves the row (finger 1:1, then a glide that always stops on a centered hat) and sets,
   per hat, --o (signed distance from center, -1..1) and --d (0..1); everything below is transform/opacity.
   --tftc-chrome = header + footer height, measured by the script. */
@media (max-width: 760px) {
	body.tftc-shop {
		--tftc-gap: 0px;
		--tftc-hat: max(170px, min(72vw, calc(100dvh - var(--tftc-chrome, 156px) - 200px), 380px));
	}
	body.tftc-shop .wp-site-blocks { min-height: 100dvh; display: flex; flex-direction: column; }
	body.tftc-shop .wp-site-blocks > .wp-block-woocommerce-product-collection {
		flex-direction: column;
		padding: 0 !important;
		min-width: 0;
		overflow: hidden;
	}
	body.tftc-shop ul.wc-block-product-template {
		width: 100% !important;
		margin: 0 !important;
		padding: 10px calc((100% - var(--tftc-hat)) / 2) 4px !important;
		box-sizing: border-box;
		/* the script moves the row (finger 1:1, then glides to center); native scrolling is off */
		overflow-x: hidden;
		overflow-y: hidden;
		touch-action: pan-y;
		-webkit-user-select: none;
		user-select: none;
		scrollbar-width: none;
		justify-content: flex-start;
	}
	body.tftc-shop ul.wc-block-product-template::-webkit-scrollbar { display: none; }
	body.tftc-shop ul.wc-block-product-template img { -webkit-user-drag: none; -webkit-touch-callout: none; }
	body.tftc-shop ul.wc-block-product-template > li.wc-block-product {
		width: var(--tftc-hat) !important;
		padding: 0 !important;
		transition: none !important;
		transform: translate3d(calc(var(--o, 0) * var(--tftc-hat) * -0.16), 0, 0) scale(calc(1 - .3 * var(--d, 0)));
		opacity: calc(1 - .55 * var(--d, 0));
		transform-origin: 50% 40%;
		z-index: 1;
	}
	body.tftc-shop ul.wc-block-product-template > li.wc-block-product.is-center { z-index: 2; }
	body.tftc-shop li.wc-block-product .wc-block-components-product-image { margin-bottom: 14px !important; }
	/* name, price and button belong to the centered hat only */
	body.tftc-shop li.wc-block-product .wp-block-post-title,
	body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-price,
	body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-button {
		opacity: max(0, calc(1 - 2.6 * var(--d, 0)));
		transition: none !important;
	}
	body.tftc-shop li.wc-block-product:not(.is-center) .wp-block-woocommerce-product-button { pointer-events: none; }
	body.tftc-shop li.wc-block-product .wp-block-post-title { font-size: 15px !important; margin-bottom: 2px !important; }
	body.tftc-shop li.wc-block-product .wp-block-woocommerce-product-price { margin-bottom: 16px !important; }
	body.tftc-shop li.wc-block-product .wc-block-components-product-price { font-size: 14px !important; }
	body.tftc-shop li.wc-block-product .wc-block-components-product-button__button {
		min-width: 0;
		width: min(100%, 260px);
		height: 50px;
		padding: 0 24px !important;
	}
	/* dots: which of the three you're on */
	.tftc-dots {
		display: flex;
		justify-content: center;
		gap: 2px;
		margin: 14px 0 0;
	}
	.tftc-dots button {
		width: 28px; height: 28px;
		padding: 0; border: 0; background: none;
		display: grid; place-items: center;
		cursor: pointer;
	}
	.tftc-dots button::before {
		content: "";
		width: 7px; height: 7px; border-radius: 50%;
		background: var(--tftc-ink);
		opacity: .18;
		transform: scale(.85);
		transition: opacity .35s var(--tftc-ease), transform .35s var(--tftc-ease);
	}
	.tftc-dots button.is-on::before { opacity: 1; transform: none; }
}
.tftc-dots { display: none; }
@media (max-width: 760px) { body.tftc-shop .tftc-dots { display: flex; } }

/* no grey tap flash on iPhone over hats, names and buttons */
html { -webkit-tap-highlight-color: transparent; }
body.tftc-shop li.wc-block-product a:focus:not(:focus-visible) { outline: none !important; box-shadow: none !important; }
@media (pointer: coarse) {
	body.tftc-shop li.wc-block-product a:focus { outline: none !important; box-shadow: none !important; }
}

/* ---------- Cart icon reaction ---------- */

@keyframes tftc-cart-bump {
	0% { transform: scale(1); }
	30% { transform: scale(1.28) rotate(-8deg); }
	55% { transform: scale(.94) rotate(4deg); }
	100% { transform: scale(1); }
}
.wc-block-mini-cart__button.tftc-bump .wc-block-mini-cart__quantity-badge {
	animation: tftc-cart-bump .55s var(--tftc-ease);
}
@keyframes tftc-ring {
	from { opacity: .55; transform: translate(-50%, -50%) scale(.6); }
	to   { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}
.tftc-ring {
	position: fixed;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid var(--tftc-orange);
	pointer-events: none;
	z-index: 100001;
	animation: tftc-ring .7s var(--tftc-ease) forwards;
}

/* the flying hat */
.tftc-flyer {
	position: fixed;
	z-index: 100000;
	pointer-events: none;
	object-fit: contain;
	will-change: transform, opacity;
}
.tftc-flyer:not(.tftc-cutout) {
	filter: brightness(1.025);
	-webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent);
	mask-image: radial-gradient(closest-side, #000 82%, transparent);
}

/* ---------- Added-to-cart toast ---------- */

.tftc-toast {
	position: fixed;
	top: 92px;
	right: clamp(12px, 3vw, 40px);
	z-index: 100002;
	width: min(340px, calc(100vw - 24px));
	padding: 14px;
	border-radius: 18px;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(18px) saturate(1.4);
	-webkit-backdrop-filter: blur(18px) saturate(1.4);
	box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 50px -12px rgba(0,0,0,.28);
	color: var(--tftc-ink);
	font-size: 14px;
	opacity: 0;
	transform: translateY(-10px) scale(.98);
	transform-origin: top right;
	transition: opacity .35s var(--tftc-ease), transform .45s var(--tftc-ease);
}
.tftc-toast.is-open { opacity: 1; transform: none; }
/* phones: the card rises from the bottom so it never covers the hat that was just added */
@media (max-width: 760px) {
	.tftc-toast {
		top: auto;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		left: 12px;
		right: 12px;
		width: auto;
		transform: translateY(16px) scale(.98);
		transform-origin: bottom center;
		background: #fff;
	}
	.tftc-toast.is-open { transform: none; }
}
.tftc-toast__row { display: flex; align-items: center; gap: 12px; }
.tftc-toast__thumb {
	width: 56px; height: 56px; flex: none;
	border-radius: 12px; background: #f4f4f4;
	object-fit: contain; mix-blend-mode: multiply;
}
.tftc-toast__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--tftc-muted); margin: 0 0 2px; }
.tftc-toast__name { font-weight: 600; letter-spacing: .04em; margin: 0; }
.tftc-toast__check {
	display: inline-grid; place-items: center;
	width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px;
	border-radius: 50%; background: var(--tftc-ink); color: #fff; font-size: 10px;
}
.tftc-toast__actions { display: flex; gap: 8px; margin-top: 12px; }
.tftc-toast__btn {
	flex: 1;
	display: inline-flex; align-items: center; justify-content: center;
	height: 40px; border-radius: 999px;
	font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	text-decoration: none; cursor: pointer;
	transition: transform .2s var(--tftc-ease), background-color .2s ease, color .2s ease;
}
.tftc-toast__btn:active { transform: scale(.97); }
.tftc-toast__btn--primary { background: var(--tftc-ink); color: #fff; border: 0; }
.tftc-toast__btn--primary:hover { background: #000; color: #fff; }
.tftc-toast__btn--ghost { background: transparent; color: var(--tftc-ink); border: 1px solid rgba(0,0,0,.14); }
.tftc-toast__btn--ghost:hover { border-color: rgba(0,0,0,.4); }
.tftc-toast__timer {
	position: absolute; left: 18px; right: 18px; bottom: 6px; height: 2px;
	border-radius: 2px; background: rgba(0,0,0,.08); overflow: hidden;
}
.tftc-toast__timer::after {
	content: ""; position: absolute; inset: 0;
	background: var(--tftc-ink); transform-origin: left;
	animation: tftc-timer var(--tftc-toast-ms, 6000ms) linear forwards;
}
.tftc-toast:hover .tftc-toast__timer::after { animation-play-state: paused; }
@keyframes tftc-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
	body.tftc-shop ul.wc-block-product-template,
	body.tftc-shop ul.wc-block-product-template > li.wc-block-product,
	body.tftc-shop .wp-site-blocks > header,
	body.tftc-shop .wp-site-blocks > footer,
	body.tftc-shop li.wc-block-product .wc-block-components-product-image img,
	.tftc-toast { transition: none !important; animation: none !important; opacity: 1; }
}

/* ---------- No product pages: hats aren't links ---------- */

body.tftc-shop li.wc-block-product { position: relative; }
body.tftc-shop li.wc-block-product .wc-block-components-product-image a,
body.tftc-shop li.wc-block-product .wp-block-post-title a {
	cursor: pointer;
	-webkit-user-drag: none;
}
body.tftc-shop li.wc-block-product .wc-block-components-product-image img { -webkit-user-drag: none; user-select: none; }

/* cart, mini-cart and checkout: product names/images don't link anywhere */
.wc-block-cart-items .wc-block-components-product-name,
.wc-block-cart-item__image a,
.wc-block-mini-cart__drawer .wc-block-components-product-name,
.wc-block-mini-cart__drawer .wc-block-cart-item__image a {
	pointer-events: none;
	text-decoration: none !important;
	color: inherit;
}

/* ---------- Spotlight: click a hat, it moves center stage with its details ---------- */

html.tftc-sv-lock { overflow: hidden; }
body.tftc-shop li.wc-block-product.tftc-sv-source .wc-block-components-product-image img { visibility: hidden; }

.tftc-sv {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	top: var(--tftc-sv-top, 0px);
	z-index: 9990;
	display: grid;
	place-items: center;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-tap-highlight-color: transparent;
}
.tftc-sv__bg { position: absolute; inset: 0; background: #fff; }
.tftc-sv__stage {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(260px, 380px);
	align-items: center;
	gap: clamp(32px, 6vw, 110px);
	padding: clamp(24px, 5vh, 56px) clamp(72px, 7vw, 120px);
}
.tftc-sv__media {
	width: min(46vw, calc(100dvh - var(--tftc-sv-top, 0px) - 140px), 620px);
	aspect-ratio: 1 / 1;
}
.tftc-sv__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transform-origin: 50% 50%;
	will-change: transform;
	user-select: none;
	-webkit-user-drag: none;
	backface-visibility: hidden;
}
.tftc-sv__info { color: var(--tftc-ink); }
.tftc-sv__count {
	margin: 0 0 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--tftc-muted);
	font-variant-numeric: tabular-nums;
}
.tftc-sv__name {
	margin: 0 0 6px !important;
	font-size: clamp(28px, 2.6vw, 40px) !important;
	font-weight: 600 !important;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.1 !important;
}
.tftc-sv__price { margin: 0 0 22px; font-size: 18px; color: var(--tftc-muted); letter-spacing: .02em; }
.tftc-sv__desc { margin: 0 0 30px; }
.tftc-sv__desc p { margin: 0 0 4px; font-size: 16px; line-height: 1.6; color: #333; }
.tftc-sv__actions { display: grid; gap: 10px; }
.tftc-sv__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	box-sizing: border-box;
	width: 100%; height: 56px; padding: 0 28px;
	border-radius: 999px; border: 0;
	font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	text-decoration: none; cursor: pointer;
	transition: transform .2s var(--tftc-ease), background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.tftc-sv__btn:active { transform: scale(.98); }
.tftc-sv__btn:focus { outline: none; }
.tftc-sv__btn:focus-visible { outline: 2px solid var(--tftc-orange); outline-offset: 3px; }
.tftc-sv__btn--primary { background: var(--tftc-ink); color: #fff !important; }
.tftc-sv__btn--primary:hover { background: #000; }
.tftc-sv__btn--ghost { background: transparent; color: var(--tftc-ink) !important; border: 1px solid rgba(0,0,0,.16); }
.tftc-sv__btn--ghost:hover { border-color: rgba(0,0,0,.45); }
.tftc-sv__btn[disabled] { opacity: .6; cursor: default; }
.tftc-sv__check {
	display: inline-grid; place-items: center; width: 18px; height: 18px;
	border-radius: 50%; background: #fff; color: var(--tftc-ink); font-size: 11px;
}
.tftc-sv__meta {
	display: flex; align-items: center; gap: 8px;
	margin: 18px 0 0; font-size: 13px; color: var(--tftc-muted); letter-spacing: .02em;
}
.tftc-sv__meta::before {
	content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tftc-orange);
}

/* close + arrows */
.tftc-sv__icon {
	position: absolute;
	z-index: 2;
	display: grid; place-items: center;
	width: 46px; height: 46px;
	padding: 0; border: 0; border-radius: 50%;
	background: transparent; color: var(--tftc-ink);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s var(--tftc-ease), opacity .2s ease;
}
.tftc-sv__icon:hover { background: #f1f1f1; }
.tftc-sv__icon:active { transform: scale(.94); }
.tftc-sv__icon:focus { outline: none; }
.tftc-sv__icon:focus-visible { outline: 2px solid var(--tftc-orange); outline-offset: 2px; }
.tftc-sv__icon svg { width: 22px; height: 22px; }
.tftc-sv__close { top: clamp(12px, 2.5vh, 28px); right: clamp(12px, 2.5vw, 36px); }
.tftc-sv__prev, .tftc-sv__next { top: 50%; margin-top: -23px; }
.tftc-sv__prev { left: clamp(10px, 2vw, 32px); }
.tftc-sv__next { right: clamp(10px, 2vw, 32px); }

/* phones and narrow windows: everything fits on one screen (photo shrinks first), buttons pinned to the bottom, swipe between hats */
@media (max-width: 760px) {
	.tftc-sv { display: block; overflow-y: auto; }
	.tftc-sv__stage {
		display: flex;
		flex-direction: column;
		min-height: 100%;
		gap: 0;
		padding: 12px 24px 0;
		width: 100%;
		max-width: 480px;
		margin: 0 auto;
		box-sizing: border-box;
		align-items: stretch;
	}
	.tftc-sv__media {
		width: min(100%, max(170px, calc(100dvh - var(--tftc-sv-top, 0px) - 300px)));
		height: auto;
		flex: none;
		margin: 0 auto 10px;
	}
	.tftc-sv__info { display: flex; flex-direction: column; flex: 1; }
	.tftc-sv__count { margin-bottom: 8px; }
	.tftc-sv__name { font-size: 26px !important; margin-bottom: 2px !important; }
	.tftc-sv__price { margin-bottom: 12px; font-size: 16px; }
	.tftc-sv__desc { margin-bottom: 14px; }
	.tftc-sv__desc p { font-size: 15px; line-height: 1.5; margin-bottom: 2px; }
	.tftc-sv__meta { margin: 0 0 4px; font-size: 12px; }
	.tftc-sv__actions {
		position: sticky;
		bottom: 0;
		order: 9;
		margin: auto -24px 0;
		padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
		background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 14px);
		grid-template-columns: 1fr;
	}
	.tftc-sv__actions:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; }
	.tftc-sv__actions .tftc-sv__btn { height: 52px; padding: 0 14px; font-size: 13px; letter-spacing: .06em; white-space: nowrap; }
	.tftc-sv__prev, .tftc-sv__next { display: none; }
	.tftc-sv__close { top: 6px; right: 6px; background: rgba(255,255,255,.85); }
}

/* touch screens: header icons get a full-size tap area (invisible, so the header doesn't grow) */
@media (pointer: coarse) {
	header .wc-block-mini-cart__button,
	header .wc-block-customer-account a,
	header .wp-block-woocommerce-customer-account a { position: relative; }
	header .wc-block-mini-cart__button::after,
	header .wc-block-customer-account a::after,
	header .wp-block-woocommerce-customer-account a::after {
		content: "";
		position: absolute;
		left: 50%; top: 50%;
		width: 48px; height: 48px;
		transform: translate(-50%, -50%);
	}
}

/* ---------- Checkout on phones: order summary, then the form, without big empty gaps ---------- */

@media (max-width: 760px) {
	.wp-block-woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-cart,
	.wp-block-woocommerce-checkout .wc-block-components-sidebar.wc-block-cart__sidebar,
	.wp-block-woocommerce-checkout .wp-block-woocommerce-cart-order-summary-block { margin-bottom: 0 !important; margin-top: 0 !important; }
	.wp-block-woocommerce-checkout.alignwide { padding-top: 8px !important; }
}

/* ---------- Account page: same title style as the policy pages ---------- */

body.tftc-account h1.wp-block-post-title,
body.tftc-account main h1 {
	font-size: clamp(30px, 3vw, 42px) !important;
	font-weight: 600 !important;
	letter-spacing: -.015em;
	line-height: 1.15 !important;
	color: var(--tftc-ink);
}

/* ---------- Policy pages: one readable column, left aligned, quiet section labels ---------- */

body.tftc-legal main#wp--skip-link--target,
body.tftc-legal main {
	margin-top: 0 !important;
	text-align: left !important;
}
body.tftc-legal main > .wp-block-group {
	padding-top: clamp(48px, 9vh, 104px) !important;
	padding-bottom: clamp(56px, 10vh, 120px) !important;
}
body.tftc-legal main > .wp-block-group > *,
body.tftc-legal .wp-block-post-content > * {
	max-width: 660px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}
body.tftc-legal h1.wp-block-post-title {
	display: block !important;
	margin-top: 0 !important;
	margin-bottom: 10px !important;
	font-size: clamp(30px, 3vw, 42px) !important;
	font-weight: 600 !important;
	letter-spacing: -.015em;
	line-height: 1.15 !important;
	color: var(--tftc-ink);
}
body.tftc-legal .wp-block-post-content {
	padding-left: 0 !important;  /* the page already has side padding; a second layer pushed text off the title's edge */
	padding-right: 0 !important;
	font-size: 17px;
	line-height: 1.7;
	color: #2a2a2a;
}
body.tftc-legal .wp-block-post-content p {
	font-size: inherit !important;
	line-height: inherit !important;
	margin: 0 0 1.05em !important;
}
/* "Last updated" line under the title */
body.tftc-legal .wp-block-post-content > p:first-child em {
	font-style: normal;
	font-size: 14px;
	letter-spacing: .02em;
	color: var(--tftc-muted);
}
body.tftc-legal .wp-block-post-content > p:first-child { margin-bottom: 2.2em !important; }
body.tftc-legal .wp-block-post-content h2 {
	margin: 2.6em 0 .8em !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.4 !important;
	color: var(--tftc-ink);
}
body.tftc-legal .wp-block-post-content ul {
	margin: 0 0 1.2em !important;
	padding-left: 1.15em !important;
}
body.tftc-legal .wp-block-post-content li { margin: 0 0 .45em; padding-left: .2em; }
body.tftc-legal .wp-block-post-content li::marker { color: var(--tftc-muted); }
body.tftc-legal .wp-block-post-content strong { font-weight: 600; color: var(--tftc-ink); }
body.tftc-legal .wp-block-post-content a {
	color: var(--tftc-ink);
	text-decoration: underline;
	text-decoration-color: rgba(0,0,0,.25);
	text-underline-offset: 3px;
	transition: text-decoration-color .2s ease;
}
body.tftc-legal .wp-block-post-content a:hover { text-decoration-color: var(--tftc-orange); }
body.tftc-legal .wp-block-post-content code {
	font-size: .85em;
	padding: .12em .4em;
	border-radius: 5px;
	background: #f3f3f3;
	color: #333;
}
@media (max-width: 600px) {
	body.tftc-legal .wp-block-post-content { font-size: 16px; }
}

/* ---------- Small notice (e.g. "Your cart is empty") ---------- */

.tftc-note {
	position: fixed;
	left: 50%;
	bottom: clamp(70px, 12vh, 120px);
	z-index: 100002;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--tftc-ink);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow: 0 14px 40px -12px rgba(0,0,0,.45);
	opacity: 0;
	transform: translate(-50%, 10px);
	transition: opacity .45s var(--tftc-ease), transform .55s var(--tftc-ease);
	pointer-events: none;
}
.tftc-note.is-open { opacity: 1; transform: translate(-50%, 0); }
