/**
 * Free Shipping Bar: storefront looks (Line, Pill, Minimal, Text only) and the sticky bar.
 *
 * Loaded only when a look is picked on the Design page; without a look the plugin prints its 2.5.7 HTML and CSS.
 * Colours come from the Design settings through the custom properties below (printed inline after this file).
 * Defaults pass WCAG AA: text #1D2327 on #F3F6F9 is 14.6 to 1, white on #171509 is 18.3 to 1.
 *
 * @version 3.0.0
 * @since   3.0.0
 */

:root {
	--alfs-bar-fill: #0B4F86;
	--alfs-bar-bg: #F3F6F9;
	--alfs-bar-text: #1D2327;
	--alfs-bar-sticky-bg: #171509;
	--alfs-bar-sticky-text: #FFFFFF;
	--alfs-bar-sticky-fill: #6BBFFF;
}

/* Bar */
.alfs-bar {
	display: block;
	box-sizing: border-box;
	margin: .75em 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--alfs-bar-bg);
	color: var(--alfs-bar-text);
	font-family: inherit;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: normal;
	text-align: left;
}
.alfs-bar .alfs-bar__text {
	display: block;
}
.alfs-bar .alfs-bar__text .amount,
.alfs-bar .alfs-bar__text bdi {
	color: inherit;
	font-weight: inherit;
}
.alfs-bar .alfs-bar__track {
	display: block;
	position: relative;
	height: 8px;
	margin-top: 8px;
	border-radius: 999px;
	overflow: hidden;
	background: #DCE3EA;
	background: color-mix(in srgb, var(--alfs-bar-text) 14%, var(--alfs-bar-bg));
}
.alfs-bar .alfs-bar__fill {
	display: block;
	height: 100%;
	max-width: 100%;
	border-radius: inherit;
	background: var(--alfs-bar-fill);
	transition: width .4s ease;
}

/* Pill */
.alfs-bar--pill .alfs-bar__track {
	height: 14px;
}
.alfs-bar--pill .alfs-bar__fill {
	background: var(--alfs-bar-fill);
	background: linear-gradient(90deg, color-mix(in srgb, var(--alfs-bar-fill) 78%, #FFFFFF), var(--alfs-bar-fill));
}

/* Minimal and Text only: no box, the page shows through */
.alfs-bar.alfs-bar--minimal,
.alfs-bar.alfs-bar--text {
	padding: 0;
	border-radius: 0;
	background: transparent;
}
.alfs-bar--minimal .alfs-bar__track {
	height: 4px;
	margin-top: 6px;
}

/* States */
.alfs-bar.alfs-bar--reached {
	background: #E7F5EC;
	color: #1F5E36;
}
.alfs-bar.alfs-bar--none {
	background: #EFEBDF;
	color: #3D3A30;
}
.alfs-bar.alfs-bar--minimal.alfs-bar--reached,
.alfs-bar.alfs-bar--text.alfs-bar--reached,
.alfs-bar.alfs-bar--minimal.alfs-bar--none,
.alfs-bar.alfs-bar--text.alfs-bar--none {
	background: transparent;
}

/* Inside a WooCommerce notice: take the notice's colours */
.alfs-bar.alfs-bar--inline {
	margin: .5em 0 0;
	padding: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
}
.alfs-bar--inline .alfs-bar__track {
	height: 6px;
	margin-top: 6px;
	background: rgba(255, 255, 255, .3);
	background: color-mix(in srgb, currentColor 25%, transparent);
}
.alfs-bar--inline .alfs-bar__fill {
	background: currentColor;
}

/* Product page */
.alfs-bar-product {
	margin: 0 0 1em;
}
.alfs-bar-product .alfs-bar {
	margin: 0;
}

/* Sticky bar (the plugin's fixed bar at the top or bottom of every page) */
#alg-wc-alfs-store-notice {
	box-sizing: border-box;
	padding: 10px 52px;
	background-color: var(--alfs-bar-sticky-bg);
	color: var(--alfs-bar-sticky-text);
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.alfs-bar.alfs-bar--sticky {
	margin: 0;
	padding: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	text-align: center;
}
.alfs-bar--sticky .alfs-bar__track {
	max-width: 420px;
	height: 6px;
	margin: 6px auto 0;
	background: rgba(255, 255, 255, .25);
	background: color-mix(in srgb, currentColor 25%, transparent);
}
.alfs-bar--sticky.alfs-bar--pill .alfs-bar__track {
	height: 10px;
}
.alfs-bar--sticky.alfs-bar--minimal .alfs-bar__track {
	height: 4px;
}
.alfs-bar--sticky .alfs-bar__fill,
.alfs-bar--sticky.alfs-bar--pill .alfs-bar__fill {
	background: var(--alfs-bar-sticky-fill);
}
#alg-wc-alfs-store-notice .alfs-bar-close {
	position: absolute;
	top: 50%;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: -18px 0 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}
#alg-wc-alfs-store-notice .alfs-bar-close:hover {
	background: rgba(255, 255, 255, .16);
	background: color-mix(in srgb, currentColor 16%, transparent);
}
#alg-wc-alfs-store-notice .alfs-bar-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
#alg-wc-alfs-store-notice .alfs-bar-close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}
#alg-wc-alfs-store-notice.alfs-bar-lifted {
	bottom: var(--alfs-bar-lift, 0px);
}
#alg-wc-alfs-store-notice.alfs-bar-yield {
	visibility: hidden;
}
#alg-wc-alfs-store-notice.alfs-bar-closed,
body.alfs-bar-sticky-off #alg-wc-alfs-store-notice {
	display: none !important;
}
.alfs-bar-spacer {
	display: block;
	height: 0;
}

/* Phones: one line, never over the checkout button (the script lifts the bar above fixed buttons) */
@media (max-width: 600px) {
	#alg-wc-alfs-store-notice {
		padding: 8px 48px 8px 14px;
		font-size: 14px;
		text-align: left;
	}
	.alfs-bar.alfs-bar--sticky {
		text-align: left;
	}
	.alfs-bar--sticky .alfs-bar__text {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.alfs-bar--sticky .alfs-bar__text br,
	.alfs-bar--sticky .alfs-bar__track {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alfs-bar .alfs-bar__fill,
	#alg-wc-alfs-store-notice {
		transition: none;
	}
}

@media (forced-colors: active) {
	.alfs-bar .alfs-bar__track {
		border: 1px solid CanvasText;
	}
	.alfs-bar .alfs-bar__fill {
		background: Highlight;
	}
}

/* Admin: Design page fields (inside the plugin screen) */
.alfs-design {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
	margin: 0;
}
.alfs-design [hidden] {
	display: none !important;
}
.alfs-design-fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.alfs-design .alfs-design-presets {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
.alfs-design .alfs-design-preset {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	padding: 16px;
	border: 1px solid #CFC8B4;
	border-radius: 16px;
	background: #FFFFFF;
	color: #171509;
	cursor: pointer;
}
.alfs-design .alfs-design-preset.on {
	padding: 15px;
	border: 2px solid #0B4F86;
}
.alfs-design .alfs-design-preset input[type="radio"] {
	position: absolute;
	top: 16px;
	left: 16px;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}
.alfs-design .alfs-design-preset:focus-within {
	outline: 3px solid #6BBFFF;
	outline-offset: 2px;
}
.alfs-design .alfs-design-preset b {
	display: block;
	font-size: 13px;
}
.alfs-design-preview {
	display: block;
	pointer-events: none;
}
.alfs-design-preview .alfs-bar {
	margin: 0;
}
.alfs-design-plain {
	display: block;
	padding: 4px 0;
	color: #3D3A30;
	font-weight: 400;
}
.alfs-design .alfs-design-hex {
	text-transform: uppercase;
}
.alfs-design .alfs-design-hex[aria-invalid="true"] {
	border-color: #B42318;
}
.alfs-design .hint.is-bad {
	color: #B42318;
}
.alfs-design-sample {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.alfs-design-sticky-sample {
	display: block;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--alfs-bar-sticky-bg);
	color: var(--alfs-bar-sticky-text);
	text-align: center;
}
.alfs-design-nojs {
	display: flex;
	justify-content: flex-end;
}
.alfs-design.is-js .alfs-design-nojs {
	display: none;
}
.alfs-design-toast {
	position: fixed;
	z-index: 100000;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	padding: 10px 18px;
	border-radius: 999px;
	background: #171509;
	color: #FFFFFF;
	font-weight: 600;
}
@media (max-width: 640px) {
	.alfs-design .alfs-design-presets {
		grid-template-columns: minmax(0, 1fr);
	}
}
