/**
 * FS Woo Request a Quote — core (structure) stylesheet.
 *
 * ALWAYS loaded, and deliberately not editable: it holds only the mechanics the
 * panel cannot work without — fixed positioning, the slide transform, scroll
 * containment, the off-screen honeypot, the badge anchor.
 *
 * Every visual decision (colour, spacing, typography, borders, radii) lives in
 * the editable CSS under WooCommerce → Request a Quote → CSS, seeded from
 * assets/css/fs-quote-theme.css. Nothing here should fight a theme rule.
 */

:root {
	--fs-quote-width: 420px;
	--fs-quote-icon-size: 24px;
	--fs-quote-badge-size: 18px;
	--fs-quote-z: 99990;
	--fs-quote-speed: 0.28s;
}

/* --- Header badge ------------------------------------------------------- */

.fs-quote-counter {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.fs-quote-counter__icon {
	display: inline-flex;
}

.fs-quote-counter__icon svg {
	width: var(--fs-quote-icon-size);
	height: var(--fs-quote-icon-size);
}

.fs-quote-counter__badge {
	position: absolute;
	top: -7px;
	right: -10px;
	min-width: var(--fs-quote-badge-size);
	height: var(--fs-quote-badge-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.fs-quote-counter--hide-empty:not(.has-items) {
	display: none;
}

/* --- Button ------------------------------------------------------------- */

.fs-add-to-quote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

/* The span around the SVG is a flex item; without this the icon sits on the
   text baseline instead of the optical centre of the button. */
.fs-add-to-quote-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.fs-add-to-quote-btn__icon svg,
.fs-quote-counter__icon svg {
	display: block;
}

.fs-add-to-quote-btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* --- Off-canvas panel --------------------------------------------------- */

.fs-quote-panel-wrap[hidden] {
	display: none !important;
}

.fs-quote-panel-wrap {
	position: fixed;
	inset: 0;
	z-index: var(--fs-quote-z);
}

.fs-quote-panel__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity var(--fs-quote-speed) ease;
}

.fs-quote-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(var(--fs-quote-width), 100vw);
	display: flex;
	flex-direction: column;
	background: #fff;
	transform: translateX(100%);
	transition: transform var(--fs-quote-speed) cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fs-quote-panel-wrap.is-open .fs-quote-panel__overlay {
	opacity: 1;
}

.fs-quote-panel-wrap.is-open .fs-quote-panel {
	transform: translateX(0);
}

.fs-quote-panel-wrap--left .fs-quote-panel {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.fs-quote-panel__head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* The list takes the free height and scrolls on overflow... */
.fs-quote-panel__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ...so the form stays anchored to the bottom of the panel. */
.fs-quote-panel__foot {
	flex: 0 0 auto;
	max-height: 65vh;
	overflow-y: auto;
}

.fs-quote-panel.is-busy {
	opacity: 0.65;
	pointer-events: none;
}

/* --- Items -------------------------------------------------------------- */

.fs-quote-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fs-quote-item {
	position: relative;
	display: flex;
	align-items: flex-start;
}

.fs-quote-item.is-removing {
	opacity: 0.4;
	pointer-events: none;
}

.fs-quote-item__thumb {
	flex: 0 0 auto;
	line-height: 0;
}

.fs-quote-item__thumb img,
.fs-quote-item__img {
	max-width: 100%;
	height: auto;
	display: block;
}

.fs-quote-item__info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.fs-quote-item__qty {
	display: inline-flex;
	align-items: center;
	width: fit-content;
}

/* Glyph buttons: centred as a flex box rather than left to the text baseline. */
.fs-quote-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.fs-quote-qty-input {
	text-align: center;
	-moz-appearance: textfield;
}

.fs-quote-qty-input::-webkit-outer-spin-button,
.fs-quote-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fs-quote-item__controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

/* The note starts collapsed; [hidden] must win over any display rule. */
.fs-quote-item__note[hidden] {
	display: none !important;
}

.fs-quote-note-toggle {
	cursor: pointer;
}

.fs-quote-item__note-input {
	width: 100%;
	box-sizing: border-box;
	resize: vertical;
}

.fs-quote-item__remove {
	cursor: pointer;
}

.fs-quote-clear {
	cursor: pointer;
}

/* --- Form --------------------------------------------------------------- */

.fs-quote-form {
	display: flex;
	flex-direction: column;
}

.fs-quote-field {
	display: flex;
	flex-direction: column;
}

.fs-quote-field__input {
	width: 100%;
	box-sizing: border-box;
}

.fs-quote-consent {
	display: flex;
	align-items: flex-start;
}

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

/* --- Fly-to-counter ----------------------------------------------------- */

/* Ghost of the product image, created and removed by the script. */
.fs-quote-fly {
	position: fixed;
	z-index: 99995;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	pointer-events: none;
	opacity: 1;
	/* The image stays solid for most of the trip and only fades on arrival —
	   fading from the first frame is what made the movement hard to notice. */
	transition: transform 0.7s cubic-bezier(0.32, 0.03, 0.2, 1), opacity 0.22s ease-in 0.48s;
	will-change: transform, opacity;
}

@media ( prefers-reduced-motion: reduce ) {
	.fs-quote-fly {
		display: none;
	}
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.fs-quote-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fs-quote-submit {
	cursor: pointer;
}

.fs-quote-spinner {
	display: none;
}

.fs-quote-form.is-sending .fs-quote-spinner {
	display: inline-block;
}

.fs-quote-form__response:empty {
	display: none;
}

/* --- Toast -------------------------------------------------------------- */

.fs-quote-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: calc(var(--fs-quote-z) + 10);
	max-width: 320px;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.fs-quote-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* --- Misc --------------------------------------------------------------- */

html.fs-quote-locked,
body.fs-quote-locked {
	overflow: hidden;
}

@media (max-width: 480px) {
	.fs-quote-panel {
		width: 100vw;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fs-quote-panel,
	.fs-quote-panel__overlay,
	.fs-quote-toast {
		transition: none;
	}
}
