/* Floating Side Cart for WooCommerce */
:root {
	--wbnsc-width: 420px;
	--wbnsc-accent: #111827;
	--wbnsc-accent-text: #fff;
	--wbnsc-bg: #fff;
	--wbnsc-text: #111827;
	--wbnsc-muted: #6b7280;
	--wbnsc-border: #e5e7eb;
	--wbnsc-success: #15803d;
	--wbnsc-error: #b91c1c;
	--wbnsc-trigger-bg: #111827;
	--wbnsc-trigger-color: #fff;
	--wbnsc-trigger-size: 60px;
	--wbnsc-badge-bg: #dc2626;
	--wbnsc-badge-color: #fff;
	--wbnsc-overlay: #000;
	--wbnsc-overlay-opacity: 45%;
	--wbnsc-radius: 8px;
	--wbnsc-font-size: 15px;
	--wbnsc-offset-x: 24px;
	--wbnsc-offset-y: 24px;
	--wbnsc-z: 99999;
}

.wbnsc,
.wbnsc *,
.wbnsc-trigger,
.wbnsc-trigger * {
	box-sizing: border-box;
}

/* Theme resets: many themes style bare button/input/h2 aggressively. */
.wbnsc button,
.wbnsc button:hover,
.wbnsc button:focus,
.wbnsc-trigger,
.wbnsc-trigger:hover,
.wbnsc-trigger:focus {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	line-height: inherit;
	min-height: 0;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
}

.wbnsc button:focus-visible,
.wbnsc a:focus-visible,
.wbnsc input:focus-visible,
.wbnsc-trigger:focus-visible {
	outline: 2px solid var(--wbnsc-accent);
	outline-offset: 2px;
}

.wbnsc .wbnsc-icon {
	display: block;
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

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

/* ------------------------------------------------------------------ overlay + drawer */

.wbnsc-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--wbnsc-z);
	background: color-mix(in srgb, var(--wbnsc-overlay) var(--wbnsc-overlay-opacity), transparent);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}

.wbnsc-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--wbnsc-z) + 1);
	display: flex;
	flex-direction: column;
	width: min(var(--wbnsc-width), 100vw);
	max-width: 100vw;
	background: var(--wbnsc-bg);
	color: var(--wbnsc-text);
	font-size: var(--wbnsc-font-size);
	line-height: 1.45;
	text-align: left;
	box-shadow: -12px 0 40px rgba(0, 0, 0, .12);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform .38s cubic-bezier(.22, .8, .24, 1), opacity .3s ease, visibility .38s ease;
	outline: 0;
}

.wbnsc--side-left .wbnsc-drawer {
	right: auto;
	left: 0;
	box-shadow: 12px 0 40px rgba(0, 0, 0, .12);
	transform: translateX(-100%);
}

.wbnsc--anim-fade .wbnsc-drawer,
.wbnsc--anim-fade.wbnsc--side-left .wbnsc-drawer {
	transform: none;
	opacity: 0;
}

.wbnsc.is-open .wbnsc-overlay {
	opacity: 1;
	visibility: visible;
}

.wbnsc.is-open .wbnsc-drawer {
	transform: none;
	opacity: 1;
	visibility: visible;
}

html.wbnsc-lock,
html.wbnsc-lock body {
	overflow: hidden;
}

.wbnsc-drawer__inner {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.wbnsc-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	overflow: hidden;
	opacity: 0;
	transition: opacity .2s;
	pointer-events: none;
}

.wbnsc-loader span {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 40%;
	background: var(--wbnsc-accent);
	animation: wbnsc-load 1s ease-in-out infinite;
}

.wbnsc-drawer.is-loading .wbnsc-loader {
	opacity: 1;
}

@keyframes wbnsc-load {
	from { left: -40%; }
	to { left: 100%; }
}

/* ------------------------------------------------------------------ head */

.wbnsc .wbnsc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--wbnsc-border);
}

.wbnsc h2.wbnsc-title {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	color: var(--wbnsc-text);
	font-family: inherit;
	font-size: 1.2em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
}

.wbnsc .wbnsc-head__count {
	color: var(--wbnsc-muted);
	font-size: .72em;
	font-weight: 500;
}

.wbnsc button.wbnsc-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-right: -8px;
	border-radius: 50%;
	color: var(--wbnsc-text);
	transition: background-color .2s;
}

.wbnsc button.wbnsc-close:hover {
	background: color-mix(in srgb, var(--wbnsc-text) 8%, transparent);
}

/* ------------------------------------------------------------------ notices */

.wbnsc-notices:empty {
	display: none;
}

.wbnsc-notices {
	display: grid;
	gap: 8px;
	padding: 12px 20px 0;
}

.wbnsc .wbnsc-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	border-radius: var(--wbnsc-radius);
	font-size: .88em;
	background: color-mix(in srgb, var(--wbnsc-error) 10%, var(--wbnsc-bg));
	color: var(--wbnsc-error);
	animation: wbnsc-in .25s ease;
}

.wbnsc .wbnsc-notice--success {
	background: color-mix(in srgb, var(--wbnsc-success) 10%, var(--wbnsc-bg));
	color: var(--wbnsc-success);
}

.wbnsc button.wbnsc-notice__undo {
	flex: none;
	font-weight: 600;
	text-decoration: underline;
}

@keyframes wbnsc-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ items */

.wbnsc-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 20px;
}

.wbnsc ul.wbnsc-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbnsc li.wbnsc-item {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 14px;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--wbnsc-border);
	transition: opacity .2s;
}

.wbnsc li.wbnsc-item:last-child {
	border-bottom: 0;
}

.wbnsc li.wbnsc-item--no-thumb {
	grid-template-columns: minmax(0, 1fr);
}

.wbnsc li.wbnsc-item.is-busy {
	opacity: .55;
}

.wbnsc li.wbnsc-item.is-removing {
	opacity: 0;
	transform: translateX(12px);
	transition: opacity .2s, transform .2s;
}

.wbnsc .wbnsc-item__thumb {
	display: block;
	width: 76px;
	height: 76px;
	overflow: hidden;
	border-radius: var(--wbnsc-radius);
	background: color-mix(in srgb, var(--wbnsc-text) 5%, var(--wbnsc-bg));
}

.wbnsc .wbnsc-item__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.wbnsc .wbnsc-item__main {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.wbnsc .wbnsc-item__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.wbnsc .wbnsc-item__name {
	color: var(--wbnsc-text);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.wbnsc a.wbnsc-item__name:hover {
	color: var(--wbnsc-text);
	text-decoration: underline;
}

.wbnsc button.wbnsc-item__remove {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: -4px -6px 0 0;
	border-radius: 50%;
	color: var(--wbnsc-muted);
	font-size: .9em;
	transition: color .2s, background-color .2s;
}

.wbnsc button.wbnsc-item__remove:hover {
	color: var(--wbnsc-error);
	background: color-mix(in srgb, var(--wbnsc-error) 8%, transparent);
}

.wbnsc .wbnsc-item__meta,
.wbnsc .wbnsc-item__unit {
	color: var(--wbnsc-muted);
	font-size: .85em;
}

.wbnsc .wbnsc-item__meta dl {
	display: flex;
	flex-wrap: wrap;
	gap: 0 .35em;
	margin: 0;
}

.wbnsc .wbnsc-item__meta dt,
.wbnsc .wbnsc-item__meta dd {
	float: none;
	margin: 0;
	padding: 0;
	font-weight: 400;
}

.wbnsc .wbnsc-item__meta dd {
	margin-right: .6em;
}

.wbnsc .wbnsc-item__meta p {
	display: inline;
	margin: 0;
}

.wbnsc .wbnsc-item__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 6px;
}

.wbnsc .wbnsc-item__total {
	font-weight: 600;
	white-space: nowrap;
}

.wbnsc .wbnsc-item__qtytext {
	color: var(--wbnsc-muted);
	font-size: .9em;
}

/* quantity stepper */
.wbnsc .wbnsc-qty {
	display: inline-flex;
	align-items: stretch;
	height: 34px;
	border: 1px solid var(--wbnsc-border);
	border-radius: var(--wbnsc-radius);
	overflow: hidden;
}

.wbnsc button.wbnsc-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	font-size: .8em;
	color: var(--wbnsc-text);
	transition: background-color .15s;
}

.wbnsc button.wbnsc-qty__btn:hover {
	background: color-mix(in srgb, var(--wbnsc-text) 7%, transparent);
}

.wbnsc button.wbnsc-qty__btn:disabled {
	opacity: .35;
	cursor: not-allowed;
	background: none;
}

.wbnsc input.wbnsc-qty__input {
	width: 38px;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--wbnsc-text);
	font: inherit;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.wbnsc input.wbnsc-qty__input::-webkit-outer-spin-button,
.wbnsc input.wbnsc-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wbnsc .wbnsc-row.is-stale {
	opacity: .45;
}

/* skeleton while the cart loads */
.wbnsc .wbnsc-skel .wbnsc-item__thumb,
.wbnsc .wbnsc-skel i {
	background: linear-gradient(90deg, color-mix(in srgb, var(--wbnsc-text) 6%, var(--wbnsc-bg)) 25%, color-mix(in srgb, var(--wbnsc-text) 12%, var(--wbnsc-bg)) 50%, color-mix(in srgb, var(--wbnsc-text) 6%, var(--wbnsc-bg)) 75%) 0 0 / 200% 100%;
	animation: wbnsc-shimmer 1.2s linear infinite;
}

.wbnsc .wbnsc-skel i {
	display: block;
	width: 80%;
	height: 11px;
	margin: 4px 0;
	border-radius: 6px;
}

.wbnsc .wbnsc-skel i:nth-child(2) { width: 45%; }
.wbnsc .wbnsc-skel i:nth-child(3) { width: 30%; margin-top: 18px; }

@keyframes wbnsc-shimmer {
	from { background-position: 100% 0; }
	to { background-position: -100% 0; }
}

/* ------------------------------------------------------------------ empty */

.wbnsc .wbnsc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 100%;
	padding: 40px 10px;
	text-align: center;
}

.wbnsc .wbnsc-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wbnsc-text) 6%, var(--wbnsc-bg));
	color: var(--wbnsc-muted);
	font-size: 32px;
}

.wbnsc .wbnsc-empty p {
	margin: 0;
	color: var(--wbnsc-muted);
}

/* ------------------------------------------------------------------ footer */

.wbnsc .wbnsc-foot {
	display: grid;
	gap: 14px;
	padding: 16px 20px 20px;
	border-top: 1px solid var(--wbnsc-border);
	background: var(--wbnsc-bg);
	box-shadow: 0 -10px 24px -18px rgba(0, 0, 0, .25);
}

.wbnsc button.wbnsc-coupon__toggle {
	color: var(--wbnsc-muted);
	font-size: .9em;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wbnsc button.wbnsc-coupon__toggle:hover {
	color: var(--wbnsc-text);
}

.wbnsc .wbnsc-coupon__form {
	display: none;
	gap: 8px;
	margin: 0;
}

.wbnsc .wbnsc-coupon.is-open .wbnsc-coupon__form {
	display: flex;
}

.wbnsc .wbnsc-coupon.is-open .wbnsc-coupon__toggle {
	margin-bottom: 8px;
}

.wbnsc .wbnsc-coupon__form input[type="text"] {
	flex: 1;
	min-width: 0;
	height: 42px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--wbnsc-border);
	border-radius: var(--wbnsc-radius);
	background: var(--wbnsc-bg);
	box-shadow: none;
	color: var(--wbnsc-text);
	font: inherit;
	font-size: .92em;
}

.wbnsc .wbnsc-coupon__form input[type="text"]:focus {
	border-color: var(--wbnsc-accent);
	outline: 0;
}

.wbnsc .wbnsc-coupon__form .wbnsc-btn {
	height: 42px;
	padding: 0 16px;
}

.wbnsc ul.wbnsc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbnsc li.wbnsc-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 3px 4px 3px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wbnsc-success) 12%, var(--wbnsc-bg));
	color: var(--wbnsc-success);
	font-size: .8em;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.wbnsc li.wbnsc-chip button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: .85em;
}

.wbnsc li.wbnsc-chip button:hover {
	background: color-mix(in srgb, var(--wbnsc-success) 20%, transparent);
}

.wbnsc .wbnsc-totals {
	display: grid;
	gap: 6px;
}

.wbnsc .wbnsc-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.wbnsc .wbnsc-row__value {
	font-weight: 600;
	text-align: right;
}

.wbnsc .wbnsc-row--discount {
	color: var(--wbnsc-success);
	font-size: .92em;
}

.wbnsc .wbnsc-row--total {
	margin-top: 4px;
	padding-top: 8px;
	border-top: 1px dashed var(--wbnsc-border);
	font-size: 1.1em;
	font-weight: 700;
}

.wbnsc p.wbnsc-note {
	margin: 2px 0 0;
	color: var(--wbnsc-muted);
	font-size: .8em;
}

.wbnsc .wbnsc-actions {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 10px;
}

.wbnsc .wbnsc-btn,
.wbnsc button.wbnsc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	border: 1px solid var(--wbnsc-accent);
	border-radius: var(--wbnsc-radius);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: filter .2s, background-color .2s, color .2s;
}

.wbnsc .wbnsc-btn--primary,
.wbnsc .wbnsc-btn--primary:hover,
.wbnsc .wbnsc-btn--primary:focus,
.wbnsc button.wbnsc-btn--primary,
.wbnsc button.wbnsc-btn--primary:hover {
	background: var(--wbnsc-accent);
	color: var(--wbnsc-accent-text);
	border-color: var(--wbnsc-accent);
}

.wbnsc .wbnsc-btn--primary:hover {
	filter: brightness(1.15);
}

.wbnsc .wbnsc-btn--secondary,
.wbnsc .wbnsc-btn--secondary:focus {
	background: transparent;
	color: var(--wbnsc-accent);
}

.wbnsc .wbnsc-btn--secondary:hover {
	background: var(--wbnsc-accent);
	color: var(--wbnsc-accent-text);
}

.wbnsc button.wbnsc-continue {
	justify-self: center;
	color: var(--wbnsc-muted);
	font-size: .88em;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wbnsc button.wbnsc-continue:hover {
	color: var(--wbnsc-text);
}

/* ------------------------------------------------------------------ triggers */

.wbnsc-trigger .wbnsc-icon {
	display: block;
	width: 1em;
	height: 1em;
}

.wbnsc-trigger__icon {
	position: relative;
	display: inline-flex;
}

a.wbnsc-trigger .wbnsc-count {
	position: absolute;
	top: -.55em;
	right: -.7em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35em;
	height: 1.35em;
	padding: 0 .3em;
	border-radius: 999px;
	background: var(--wbnsc-badge-bg);
	color: var(--wbnsc-badge-color);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	font-family: inherit;
}

a.wbnsc-trigger .wbnsc-count[data-count="0"] {
	display: none;
}

/* floating */
a.wbnsc-float,
a.wbnsc-float:hover,
a.wbnsc-float:focus {
	position: fixed;
	z-index: calc(var(--wbnsc-z) - 1);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wbnsc-trigger-size);
	height: var(--wbnsc-trigger-size);
	border-radius: 50%;
	background: var(--wbnsc-trigger-bg);
	color: var(--wbnsc-trigger-color);
	font-size: calc(var(--wbnsc-trigger-size) * .42);
	box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .35);
	transition: transform .25s ease, opacity .25s ease, visibility .25s;
}

a.wbnsc-float:hover {
	transform: scale(1.06);
}

a.wbnsc-float .wbnsc-count {
	top: -.9em;
	right: -1em;
	font-size: max(11px, calc(var(--wbnsc-trigger-size) * .2));
	box-shadow: 0 0 0 2px var(--wbnsc-trigger-bg);
}

.wbnsc-float--bottom-right { right: var(--wbnsc-offset-x); bottom: var(--wbnsc-offset-y); }
.wbnsc-float--bottom-left { left: var(--wbnsc-offset-x); bottom: var(--wbnsc-offset-y); }
.wbnsc-float--top-right { right: var(--wbnsc-offset-x); top: var(--wbnsc-offset-y); }
.wbnsc-float--top-left { left: var(--wbnsc-offset-x); top: var(--wbnsc-offset-y); }
.wbnsc-float--middle-right { right: var(--wbnsc-offset-x); top: calc(50% - var(--wbnsc-trigger-size) / 2); }
.wbnsc-float--middle-left { left: var(--wbnsc-offset-x); top: calc(50% - var(--wbnsc-trigger-size) / 2); }

.admin-bar .wbnsc-float--top-right,
.admin-bar .wbnsc-float--top-left {
	top: calc(var(--wbnsc-offset-y) + 32px);
}

a.wbnsc-float--hide-empty.is-empty,
.wbnsc.is-open a.wbnsc-float {
	opacity: 0;
	visibility: hidden;
	transform: scale(.6);
	pointer-events: none;
}

a.wbnsc-float.is-bump {
	animation: wbnsc-bump .5s ease;
}

@keyframes wbnsc-bump {
	0%, 100% { transform: scale(1); }
	40% { transform: scale(1.18); }
}

/* inline: shortcode + menu */
a.wbnsc-inline,
a.wbnsc-inline:hover,
a.wbnsc-inline:focus {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	color: inherit;
	font-size: inherit;
	text-decoration: none;
	vertical-align: middle;
}

a.wbnsc-inline .wbnsc-trigger__icon {
	font-size: 1.4em;
}

a.wbnsc-inline .wbnsc-trigger__label,
a.wbnsc-inline .wbnsc-trigger-subtotal {
	line-height: 1.2;
}

a.wbnsc-inline .wbnsc-trigger-subtotal {
	font-weight: 600;
}

.wbnsc-menu-item > a.wbnsc-inline {
	padding-right: .9em;
}

@media (max-width: 480px) {
	.wbnsc-drawer {
		width: 100vw;
	}

	.wbnsc .wbnsc-head,
	.wbnsc .wbnsc-foot {
		padding-left: 16px;
		padding-right: 16px;
	}

	.wbnsc-body {
		padding: 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wbnsc-overlay,
	.wbnsc-drawer,
	a.wbnsc-float,
	.wbnsc li.wbnsc-item {
		transition: none;
	}

	.wbnsc-loader span,
	a.wbnsc-float.is-bump,
	.wbnsc .wbnsc-notice {
		animation: none;
	}
}
