/*
 * PDP fit note + size-guide dialog (inc/fit-notes.php). GROWTH C11.
 * System F tokens: cream #F4EFE6, cream-soft #EDE6D8, polaroid paper #FAF6EC,
 * ink #1A1714, ink-muted #3A342E, ink-soft #6B625A, pink #E8356B / deep #E31754,
 * tile-mustard #D6AE6B. Own classes only (the Tailwind build is precompiled).
 */

/* ---------- Size guide trigger (beside the size label) ---------- */
.sf-sg-trigger {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	/* 44px tap target without pushing the label row taller. */
	min-height: 44px;
	margin: -12px -4px -12px 0;
	padding: 0 4px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #1A1714;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
	text-decoration-color: rgb(26 23 20 / 0.35);
	border-radius: 6px;
	transition: color .15s ease, text-decoration-color .15s ease;
}
.sf-sg-trigger:hover { text-decoration-color: #E8356B; }
.sf-sg-trigger:focus-visible { outline: 2px solid #E8356B; outline-offset: 2px; }
.sf-sg-trigger__icon { flex: none; color: #E31754; }

/* ---------- Fit note (under the size pills) ---------- */
.sf-fitnote {
	position: relative;
	display: flex;
	margin-top: 14px;
	/* Polaroid paper: lifts off the cream-soft buy box without a border. */
	background: #FAF6EC;
	border-radius: 10px;
	box-shadow: 0 1px 0 rgb(26 23 20 / 0.06), 0 6px 18px -10px rgb(26 23 20 / 0.25);
	overflow: hidden;
}
/* The distinctive move: a strip of tape measure down the left edge.
   Mustard tape, ink ticks every 6px with a longer tick every 30px. */
.sf-fitnote__tape {
	flex: none;
	width: 14px;
	background-color: #D6AE6B;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='30'%3E%3Cg stroke='%231A1714' stroke-width='1' stroke-opacity='.7'%3E%3Cpath d='M0 .5h9M0 6.5h4.5M0 12.5h4.5M0 18.5h6.5M0 24.5h4.5'/%3E%3C/g%3E%3C/svg%3E");
	background-repeat: repeat-y;
	background-position: 0 8px;
}
.sf-fitnote__body { padding: 12px 16px 13px 14px; min-width: 0; }
.sf-fitnote__eyebrow {
	margin: 0 0 4px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: #6B625A; /* 5.6:1 on paper */
}
.sf-fitnote__head {
	margin: 0;
	font-family: 'Epilogue', 'Manrope', system-ui, sans-serif;
	font-style: italic;
	font-weight: 900;
	font-size: 19px;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: #1A1714;
}
.sf-fitnote__stop { color: #E31754; }
.sf-fitnote__advice {
	margin: 3px 0 0;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #1A1714;
}
.sf-fitnote__why {
	margin: 6px 0 0;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 12.5px;
	line-height: 1.45;
	color: #3A342E; /* 11:1 on paper */
}

/* ---------- Fit bar (replaces the note behind systemf_fit_bar_on) ----------
   Sits on the note's paper and tape. The distinctive move: the headline's pink
   full stop drops onto a strip of tape and marks where the garment sits. True to
   size is always tinted, so every lean reads as a distance from home, and the
   dot only carries a tick when it lands there. */
.sf-fitbar__body { flex: 1; padding: 12px 16px 13px 15px; }
.sf-fitbar .sf-fitnote__eyebrow { margin-bottom: 4px; }
.sf-fitbar__head {
	margin: 0;
	font-family: 'Epilogue', 'Manrope', system-ui, sans-serif;
	font-style: italic;
	font-weight: 900;
	font-size: 25px;
	line-height: 1.05;
	letter-spacing: -0.03em;
	color: #1A1714;
}
.sf-fitbar__scale { margin-top: 12px; }
.sf-fitbar__track {
	--sf-fit-gap: 3px;
	--sf-fit-seg: calc((100% - 4 * var(--sf-fit-gap)) / 5);
	position: relative;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: var(--sf-fit-gap);
	height: 14px;
}
/* Each segment is a length of tape, with a tick every 6px along its top edge. */
.sf-fitbar__seg {
	background-color: #EDE6D8;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='14'%3E%3Cpath d='M.5 0v4' stroke='%231A1714' stroke-opacity='.4'/%3E%3C/svg%3E");
	background-repeat: repeat-x;
	background-position: 3px 0;
	box-shadow: inset 0 0 0 1px rgb(26 23 20 / 0.06);
}
.sf-fitbar__seg:first-child { border-radius: 4px 1px 1px 4px; }
.sf-fitbar__seg:nth-child(5) { border-radius: 1px 4px 4px 1px; }
.sf-fitbar__seg.is-home { background-color: #EBD9B7; } /* tile-mustard at half strength on paper */
.sf-fitbar__seg.is-on {
	background-color: #1A1714;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='14'%3E%3Cpath d='M.5 0v4' stroke='%23FAF6EC' stroke-opacity='.55'/%3E%3C/svg%3E");
	box-shadow: none;
}
.sf-fitbar__dot {
	position: absolute;
	top: 50%;
	left: calc((var(--sf-fit-seg) + var(--sf-fit-gap)) * var(--sf-fit-at) + var(--sf-fit-seg) / 2);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border-radius: 50%;
	background: #E31754;
	color: #FAF6EC; /* 4.3:1 on the pink: a graphic, 3:1 needed */
	animation: sf-fit-settle .5s cubic-bezier(.2, .8, .2, 1) .2s backwards;
}
/* True to size is the good news: full tape mustard and a tick. The thin paper
   rim lifts the pink off the mustard, where it only has 2:1. */
.sf-fitbar.is-true_to_size .sf-fitbar__seg.is-on {
	background-color: #D6AE6B;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='14'%3E%3Cpath d='M.5 0v4' stroke='%231A1714' stroke-opacity='.7'/%3E%3C/svg%3E");
}
.sf-fitbar.is-true_to_size .sf-fitbar__dot { box-shadow: 0 0 0 2px #FAF6EC; }
/* Every reading starts from true to size and travels out to its stop. */
@keyframes sf-fit-settle {
	from { left: 50%; }
}
.sf-fitbar__tick path {
	stroke-dasharray: 1;
	animation: sf-fit-tick .3s ease-out .35s backwards;
}
@keyframes sf-fit-tick {
	from { stroke-dashoffset: 1; }
	to { stroke-dashoffset: 0; }
}
.sf-fitbar__ends {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 8px;
	margin-top: 8px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	color: #6B625A; /* 5.5:1 on paper */
}
.sf-fitbar__end:nth-child(3) { text-align: right; }
.sf-fitbar__end.is-on { font-weight: 800; color: #1A1714; }
.sf-fitbar__advice {
	margin: 10px 0 0;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: #1A1714;
}
@media (prefers-reduced-motion: reduce) {
	.sf-fitbar__dot,
	.sf-fitbar__tick path { animation: none; }
}

/* ---------- Size guide dialog ---------- */
.sf-sg-dialog {
	width: min(560px, calc(100vw - 32px));
	max-height: min(86vh, 760px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: #F4EFE6;
	color: #1A1714;
	box-shadow: 0 24px 60px -12px rgb(26 23 20 / 0.35), 0 2px 6px rgb(26 23 20 / 0.12);
	overflow: auto;
	overscroll-behavior: contain;
}
.sf-sg-dialog::backdrop { background: rgb(26 23 20 / 0.55); }
.sf-sg-dialog[open] { animation: sf-sg-in .22s cubic-bezier(.2,.8,.2,1); }
@keyframes sf-sg-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html:has(.sf-sg-dialog[open]) { overflow: hidden; }

/* Phones: a bottom sheet. */
@media (max-width: 639px) {
	.sf-sg-dialog {
		width: 100vw;
		max-width: 100vw;
		max-height: 88vh;
		margin: auto 0 0;
		border-radius: 18px 18px 0 0;
	}
	.sf-sg-dialog[open] { animation-name: sf-sg-up; }
	@keyframes sf-sg-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
	.sf-sg-dialog[open] { animation: none; }
}

.sf-sg-dialog__inner { padding: 22px 22px 26px; }
@media (min-width: 640px) { .sf-sg-dialog__inner { padding: 28px 30px 30px; } }

.sf-sg-dialog__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sf-sg-dialog__eyebrow {
	margin: 0 0 6px;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
	color: #6B625A;
}
.sf-sg-dialog__title {
	margin: 0;
	font-family: 'Epilogue', 'Manrope', system-ui, sans-serif;
	font-style: italic; font-weight: 900;
	font-size: 34px; line-height: 0.95; letter-spacing: -0.035em;
	color: #1A1714;
}
.sf-sg-dialog__title span { color: #E8356B; }
.sf-sg-dialog__close {
	flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; margin: -6px -8px 0 0;
	border: 0; border-radius: 9999px; background: transparent; color: #1A1714; cursor: pointer;
	transition: background-color .15s ease;
}
.sf-sg-dialog__close:hover { background: #EDE6D8; }
.sf-sg-dialog__close:focus-visible { outline: 2px solid #E8356B; outline-offset: 2px; }

.sf-sg-dialog__fit {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-left: 4px solid #D6AE6B;
	background: #EDE6D8;
	border-radius: 0 8px 8px 0;
	font-family: 'Manrope', system-ui, sans-serif; font-size: 13.5px; line-height: 1.45; color: #1A1714;
}
.sf-sg-dialog__fit strong { font-weight: 800; }

.sf-sg-dialog__units { display: inline-flex; gap: 3px; margin-bottom: 14px; background: #EDE6D8; border-radius: 9999px; padding: 3px; }
.sf-sg-dialog__units[hidden] { display: none; }
.sf-sg-unit {
	border: 0; background: transparent; border-radius: 9999px; padding: .5rem 1rem; min-height: 36px;
	font-family: 'Manrope', system-ui, sans-serif; font-size: 11px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .1em; color: #3A342E; cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.sf-sg-unit:hover { color: #1A1714; }
.sf-sg-unit.is-active { background: #1A1714; color: #F4EFE6; }
.sf-sg-unit:focus-visible { outline: 2px solid #E8356B; outline-offset: 2px; }

.sf-sg-dialog__table {
	overflow-x: auto;
	border-radius: 10px;
	background: #FAF6EC;
	box-shadow: 0 0 0 1px rgb(26 23 20 / 0.08);
}
.sf-sg-dialog__table:focus-visible { outline: 2px solid #E8356B; outline-offset: 2px; }
.sf-sg-dialog__table table { width: 100%; border-collapse: collapse; margin: 0; font-family: 'Manrope', system-ui, sans-serif; font-size: 14px; }
.sf-sg-dialog__table td,
.sf-sg-dialog__table th {
	width: auto; height: auto;
	padding: 10px 14px;
	text-align: left;
	color: #3A342E;
	font-variant-numeric: tabular-nums;
	border-bottom: 1px solid rgb(26 23 20 / 0.07);
	white-space: nowrap;
}
.sf-sg-dialog__table tr:last-child td { border-bottom: 0; }
.sf-sg-dialog__table tr:first-child td,
.sf-sg-dialog__table th {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #1A1714;
	background: #EDE6D8;
}
.sf-sg-dialog__table tr:first-child td strong { font-weight: 700; }
.sf-sg-dialog__table td:first-child { font-weight: 700; color: #1A1714; }

.sf-sg-dialog__how { margin: 14px 0 0; font-family: 'Manrope', system-ui, sans-serif; font-size: 12.5px; line-height: 1.5; color: #3A342E; }
.sf-sg-dialog__more {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 6px;
	font-family: 'Manrope', system-ui, sans-serif; font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .12em; color: #1A1714; text-decoration: none;
}
.sf-sg-dialog__more:hover { text-decoration: underline; text-decoration-color: #E8356B; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.sf-sg-dialog__more:focus-visible { outline: 2px solid #E8356B; outline-offset: 2px; border-radius: 4px; }
