/* =========================================================================
   Floating cards: the survey and the cookie banner (CookieYes).

   Small light twin of the search island (#pf-filter-box): white box,
   hairline, pill buttons, no shadow, medium weight only. Both sit
   bottom-right in one column: the cookie banner at the bottom, the survey
   above it (survey.js sets --sf-float-below to the banner's height while
   it is shown). Both slide up from below the window.

   One file for the shop and the pages that write their own <head> (/ui/,
   /documentation/), printed by supplyfamily_consent_mode_head()
   (inc/performance/consent-mode.php). Those pages have no theme.css, so
   every colour falls back to the light palette.
   ========================================================================= */

:root {
	--sf-float-edge: 20px;
	--sf-float-gap: 8px;
	--sf-float-width: 300px;
	--sf-float-radius: 18px;
	--sf-float-pad: 14px 16px 16px;
	--sf-float-time: .6s;
}

.sf-survey,
.cky-consent-container {
	--fc-bg: var(--white, #ffffff);
	--fc-ink: var(--dark, #101010);
	--fc-line: var(--grey, #dadada);
	--fc-muted: var(--darker-grey, #686868);
	--fc-soft: var(--light-grey, #f6f6f6);
	--fc-accent: var(--yellow, #fbc815);
	--fc-danger: var(--sf-color-danger, #d64545);
	--fc-ease: var(--easingOut, cubic-bezier(.16, 1, .3, 1));
}

@keyframes sf-float-in {
	from {
		transform: translate3d(0, calc(100% + var(--sf-float-edge)), 0);
		opacity: 0;
	}
	to {
		transform: translate3d(0, 0, 0);
		opacity: 1;
	}
}


.sf-survey__card,
.cky-consent-container .cky-consent-bar {
	background: var(--fc-bg) !important;
	color: var(--fc-ink) !important;
	border: 1px solid var(--fc-line) !important;
	border-radius: var(--sf-float-radius) !important;
	box-shadow: none !important;
	padding: var(--sf-float-pad) !important;
}

/* Shared pill: survey answers, cookie buttons, survey buttons. */
.sf-survey__option,
.sf-survey__btn,
.cky-consent-container .cky-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 5px 11px 6px !important;
	border: 1px solid var(--fc-line) !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--fc-ink) !important;
	font: inherit;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.01em;
	min-height: 0;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .2s var(--fc-ease), background-color .2s var(--fc-ease), color .2s var(--fc-ease);
}

.sf-survey__option:hover,
.sf-survey__btn:hover,
.cky-consent-container .cky-btn:hover {
	opacity: 1;
	border-color: var(--fc-ink) !important;
}

/* Chosen / main action: filled ink. */
.sf-survey__option:has(input:checked),
.sf-survey__btn--primary,
.cky-consent-container .cky-btn-accept {
	border-color: var(--fc-ink) !important;
	background: var(--fc-ink) !important;
	color: var(--fc-bg) !important;
}

.sf-survey__btn--primary:hover:not(:disabled),
.cky-consent-container .cky-btn-accept:hover {
	border-color: var(--fc-muted) !important;
	background: var(--fc-muted) !important;
}

/* Cookie banner: only for visitors in the opt-in regions
   (consent-mode.php adds .sf-consent-region to <html>). */
html:not(.sf-consent-region) .cky-consent-container {
	display: none !important;
}

.cky-consent-container[class*="cky-box-"] {
	top: auto;
	left: auto;
	right: var(--sf-float-edge);
	bottom: var(--sf-float-edge);
	animation: sf-float-in var(--sf-float-time) var(--fc-ease) both;
	width: var(--sf-float-width);
	max-width: calc(100vw - var(--sf-float-edge) * 2);
	border-radius: var(--sf-float-radius);
}

.cky-consent-container .cky-title {
	margin: 0 0 4px !important;
	padding: 0 !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	letter-spacing: -0.01em;
	color: var(--fc-ink) !important;
}

.cky-consent-container .cky-notice-des,
.cky-consent-container .cky-notice-des p {
	padding: 0 !important;
	max-height: none !important;
	overflow: visible !important;
	font-size: 12px !important;
	line-height: 1.4 !important;
	color: var(--fc-muted) !important;
}

.cky-consent-container .cky-notice-btn-wrapper {
	flex-direction: row !important;
	gap: 6px;
	margin-top: 12px !important;
	padding: 0 !important;
}

.cky-consent-container .cky-notice-btn-wrapper .cky-btn {
	flex: 0 0 auto;
	width: auto;
	order: 0;
}

/* -------------------------------------------------------------------------
   Site survey widget (floating card, above the cookie banner)
   ------------------------------------------------------------------------- */

.sf-survey {
	position: fixed;
	inset: 0;
	z-index: 10050;
	pointer-events: none;
}

.sf-survey__card {
	position: fixed;
	right: var(--sf-float-edge);
	bottom: calc(var(--sf-float-edge) + var(--sf-float-below, 0px));
	width: min(var(--sf-float-width), calc(100vw - var(--sf-float-edge) * 2));
	max-height: min(480px, calc(100dvh - var(--sf-float-edge) * 2 - var(--sf-float-below, 0px)));
	display: flex;
	flex-direction: column;
	transform: translate3d(0, calc(100% + var(--sf-float-edge) + var(--sf-float-below, 0px)), 0);
	opacity: 0;
	pointer-events: auto;
	transition:
		transform var(--sf-float-time) var(--fc-ease),
		opacity var(--sf-float-time) var(--fc-ease),
		bottom var(--sf-float-time) var(--fc-ease);
}

.sf-survey.is-open .sf-survey__card {
	transform: translate3d(0, 0, 0);
	opacity: 1;
}

.sf-survey__card:focus,
.sf-survey__card:focus-visible {
	outline: none;
}

.sf-survey__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--fc-muted);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	z-index: 3;
	transition: background-color .2s var(--fc-ease), color .2s var(--fc-ease);
}

.sf-survey__close:hover,
.sf-survey__close:focus-visible {
	outline: none;
	background: var(--fc-soft);
	color: var(--fc-ink);
}

.sf-survey__header {
	margin-bottom: 12px;
	padding-right: 20px;
}

.sf-survey__intro {
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 400;
	letter-spacing: -0.01em;
	color: var(--fc-muted);
}

.sf-survey__accent,
.sf-survey__intro-line2 {
	font-weight: 500;
	color: var(--fc-ink);
}

.sf-survey__accent {
	display: inline;
	padding: 0;
	background: none;
}

.sf-survey__progress {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.sf-survey__progress[hidden] {
	display: none !important;
}

.sf-survey__progress-mid {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.sf-survey__progress-track {
	flex: 1 1 auto;
	height: 2px;
	border-radius: 2px;
	background: var(--fc-soft);
	overflow: hidden;
}

.sf-survey__progress-fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--fc-ink);
	transition: width 0.28s var(--fc-ease);
}

.sf-survey__progress-count {
	flex-shrink: 0;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: var(--fc-muted);
	line-height: 1;
}

.sf-survey__nav {
	appearance: none;
	-webkit-appearance: none;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fc-ink);
	cursor: pointer;
	box-shadow: none;
	transition: opacity .2s var(--fc-ease);
}

.sf-survey__nav[hidden] {
	display: none !important;
}

.sf-survey__nav .icon {
	display: block;
	width: 11px;
	height: 11px;
	fill: currentColor;
}

.sf-survey__nav--prev .icon {
	transform: scaleX(-1);
}

.sf-survey__nav:hover {
	opacity: 0.6;
}

.sf-survey__nav:focus,
.sf-survey__nav:focus-visible {
	outline: none;
}

.sf-survey__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
}

.sf-survey__step {
	animation: sf-survey-step-in 0.28s var(--fc-ease);
}

@keyframes sf-survey-step-in {
	from {
		opacity: 0;
		transform: translate3d(8px, 0, 0);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

.sf-survey__prompt {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--fc-ink);
}

.sf-survey__helper {
	margin: -4px 0 10px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--fc-muted);
}

.sf-survey__options {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sf-survey__options > li {
	margin: 0;
	padding: 0;
}

.sf-survey__option {
	position: relative;
}

.sf-survey__option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.sf-survey__option-label {
	color: inherit;
	white-space: nowrap;
}

.sf-survey__comment {
	display: flex;
	flex-direction: column;
	width: 100%;
	border: 1px solid var(--fc-line);
	border-radius: 12px;
	background: transparent;
	transition: border-color .2s var(--fc-ease);
}

.sf-survey__comment:focus-within {
	border-color: var(--fc-ink);
}

.sf-survey__textarea {
	display: block;
	width: 100%;
	min-height: 64px;
	margin: 0;
	padding: 10px 12px 6px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--fc-ink);
	font: inherit;
	font-size: 13px;
	line-height: 1.4;
	resize: none;
	outline: none;
	box-shadow: none;
}

.sf-survey__textarea:focus,
.sf-survey__textarea:focus-visible {
	outline: none;
	border: 0;
	box-shadow: none;
}

.sf-survey__send {
	align-self: flex-end;
	margin: 0 6px 6px !important;
}

.sf-survey__skip {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block;
	margin: 8px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fc-muted);
	font: inherit;
	font-size: 12px;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	box-shadow: none;
	transition: color .2s var(--fc-ease);
}

.sf-survey__skip:hover {
	color: var(--fc-ink);
}

.sf-survey__btn {
	appearance: none;
	-webkit-appearance: none;
	text-transform: none;
	height: auto;
}

.sf-survey__done {
	width: 100%;
	margin-top: 10px !important;
}

.sf-survey__coupon {
	display: flex;
	align-items: stretch;
	margin-top: 4px;
	border: 1px solid var(--fc-line);
	border-radius: 999px;
	overflow: hidden;
}

.sf-survey__coupon-code {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	background: transparent;
	color: var(--fc-ink);
}

.sf-survey__copy {
	appearance: none;
	border: 0;
	border-left: 1px solid var(--fc-line);
	padding: 7px 12px;
	background: var(--fc-accent);
	color: var(--fc-ink);
	font: inherit;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: filter .2s var(--fc-ease);
}

.sf-survey__copy:hover {
	filter: brightness(0.97);
}

.sf-survey__error {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.35;
	color: var(--fc-danger);
}

.sf-survey__hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (max-width: 560px) {
	:root {
		--sf-float-edge: 10px;
		--sf-float-width: calc(100vw - 20px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cky-consent-container[class*="cky-box-"] {
		animation-name: none;
	}

	.sf-survey__card {
		transform: none;
	}
}
