/* T5 quick buy. Everything sits in :where() (no specificity), so the theme's own rules win. Colors come from
   --eikst-qb-* variables with neutral fallbacks. Inside the card the options cover the bottom of the image; the
   dialog is centered on desktop and a bottom sheet under 768px.
   One exception: the buttons the plugin draws itself (close, undo, to cart, the status ×, back, add). A theme's
   generic button rule ("button", "[type=button]", with :hover or :focus, even under a body or kit class) would turn
   them into grey boxes, so their look is set at three classes and the element (0,3,1), the same in every state.
   Restyle them through the --eikst-qb-* variables, or with a selector at least as heavy. */

/* In a card laid out as a column the box sits at the bottom, so the buttons of a row of cards line up. The status node
   stays in the page (role=status, announced when it fills) and takes room only when it has something to say. */
:where(.eikst-qb) {
	display: flex;
	flex-direction: column;
	margin-top: auto;
}
:where(.eikst-qb-btn) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	cursor: pointer;
}
:where(.eikst-qb-btn.is-busy) {
	opacity: .6;
	cursor: progress;
}

/* Status line under the button: "נוסף לסל · ביטול · לסל" */
:where(.eikst-qb-st:not(:empty)) {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 6px;
	font-size: .88rem;
	line-height: 1.3;
}
:where(.eikst-qb-ok) {
	color: var(--eikst-qb-ok, inherit);
	font-weight: 700;
}
:where(.eikst-qb-dot) {
	opacity: .5;
}
.eikst-qb .eikst-qb-st button:is(.eikst-qb-undo, .eikst-qb-go, .eikst-qb-x) {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: auto;
	height: auto;
	min-width: 32px;
	min-height: 32px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.eikst-qb .eikst-qb-st button.eikst-qb-x {
	margin-inline-start: auto;
	font-size: 1.25rem;
	line-height: 1;
	text-decoration: none;
}
:where(.eikst-qb-err) {
	flex-basis: 100%;
	color: var(--eikst-qb-error, #b42318);
}

/* Inside the card */
:where(.eikst-qb-host) {
	position: relative;
}
:where(.eikst-qb-panel) {
	position: absolute;
	right: 0;
	left: 0;
	z-index: 5;
	overflow-y: auto;
	padding: 12px;
	border-radius: 12px;
	background: var(--eikst-qb-bg, rgba(255, 255, 255, .97));
	box-shadow: 0 -6px 20px rgba(0, 0, 0, .1);
	overscroll-behavior: contain;
}
.eikst-qb-host .eikst-qb-panel button.eikst-qb-close {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font-family: inherit;
	font-size: 1.4rem;
	font-weight: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
}
:where(.eikst-qb-panel .eikst-qb-form) {
	padding-inline-end: 36px;
}
:where(.eikst-qb-panel.is-busy, .eikst-qb-dlg.is-busy) {
	cursor: progress;
}

/* The form */
:where(.eikst-qb-fs) {
	min-width: 0;
	margin: 0 0 10px;
	padding: 0;
	border: 0;
}
:where(.eikst-qb-lg) {
	margin: 0 0 6px;
	padding: 0;
	font-weight: 700;
	font-size: .9rem;
}
:where(.eikst-qb-cur) {
	font-weight: 400;
}
:where(.eikst-qb-vals) {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
:where(.eikst-qb-v) {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	min-width: 44px;
	margin: 0;
	padding: 4px 12px;
	border: 1px solid var(--eikst-qb-line, rgba(0, 0, 0, .18));
	border-radius: 999px;
	background: var(--eikst-qb-chip, #fff);
	font-size: .9rem;
	line-height: 1.2;
	cursor: pointer;
}
:where(.eikst-qb-v input) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}
:where(.eikst-qb-v:focus-within) {
	outline: 2px solid var(--eikst-qb-accent, currentColor);
	outline-offset: 2px;
}
:where(.eikst-qb-v.is-on) {
	border-color: var(--eikst-qb-accent, currentColor);
	box-shadow: inset 0 0 0 1px var(--eikst-qb-accent, currentColor);
	font-weight: 700;
}
:where(.eikst-qb-v.is-na) {
	opacity: .55;
}
:where(.eikst-qb-v.is-oos) {
	opacity: .5;
	cursor: not-allowed;
}
:where(.eikst-qb-v.is-oos .eikst-qb-n) {
	text-decoration: line-through;
}
:where(.eikst-qb-oos) {
	font-size: .78rem;
}
:where(.eikst-qb-oos[hidden]) {
	display: none;
}
:where(.eikst-qb-sw) {
	flex: none;
	width: 22px;
	height: 22px;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 50%;
}
:where(.eikst-qb-pr) {
	margin: 0 0 10px;
	font-family: var(--eikst-price-font, inherit);
	font-weight: var(--eikst-price-weight-big, 700);
}
:where(.eikst-qb-pr:empty) {
	display: none;
}
:where(.eikst-qb-u .eikst-unit) {
	display: inline;
	margin-inline-start: 6px;
	font-weight: 400;
	font-size: .8rem;
	opacity: .75;
}
:where(.eikst-qb-msg) {
	margin: 0 0 10px;
	color: var(--eikst-qb-error, #b42318);
	font-size: .88rem;
}
:where(.eikst-qb-msg[hidden]) {
	display: none;
}
:is(.eikst-qb-panel, .eikst-qb-dlg) .eikst-qb-form button.eikst-qb-add {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: auto;
	min-height: 48px;
	margin: 0;
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--eikst-qb-accent, #111);
	box-shadow: none;
	color: var(--eikst-qb-accent-ink, #fff);
	font: inherit;
	font-weight: 700;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
}

/* The dialog */
:where(.eikst-qb-dlg) {
	width: min(480px, calc(100vw - 32px));
	max-height: min(640px, calc(100vh - 32px));
	overflow-y: auto;
	padding: 16px 20px 20px;
	border: 0;
	border-radius: 16px;
	background: var(--eikst-qb-bg, #fff);
	color: var(--eikst-qb-ink, inherit);
	box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
	overscroll-behavior: contain;
}
:where(.eikst-qb-dlg::backdrop) {
	background: rgba(0, 0, 0, .45);
}
:where(.eikst-qb-top) {
	margin: -4px 0 8px;
}
.eikst-qb-dlg .eikst-qb-top button.eikst-qb-back {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	width: auto;
	height: auto;
	min-height: 44px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
:where(.eikst-qb-head) {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}
:where(.eikst-qb-img) {
	flex: none;
	width: 88px;
	height: 88px;
	object-fit: contain;
	border-radius: 12px;
	background: var(--eikst-card-img-bg, #fff);
}
:where(.eikst-qb-img[hidden]) {
	display: none;
}
:where(.eikst-qb-hx) {
	min-width: 0;
}
:where(.eikst-qb-title) {
	margin: 0 0 4px;
	font-size: 1.1rem;
	line-height: 1.3;
}
:where(.eikst-qb-hx .eikst-qb-pr) {
	margin: 0;
}
:where(.eikst-qb-full) {
	display: block;
	margin-top: 12px;
	text-align: center;
	font-size: .9rem;
}
:where(html.eikst-qb-lock) {
	overflow: hidden;
}

@media (max-width: 767.98px) {
	:where(.eikst-qb-dlg) {
		width: 100%;
		max-width: 100%;
		max-height: 85vh;
		margin: auto 0 0;
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		border-radius: 16px 16px 0 0;
	}
	:where(.eikst-qb-dlg[open]) {
		animation: eikst-qb-up .22s ease-out;
	}
	/* 16px or more, so phones do not zoom into the form (the two buttons at their own weight, as above) */
	:where(.eikst-qb-v) {
		font-size: 1rem;
	}
	:is(.eikst-qb-panel, .eikst-qb-dlg) .eikst-qb-form button.eikst-qb-add,
	.eikst-qb-dlg .eikst-qb-top button.eikst-qb-back {
		font-size: 1rem;
	}
}
@keyframes eikst-qb-up {
	from {
		transform: translateY(40px);
		opacity: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	:where(.eikst-qb-dlg[open]) {
		animation: none;
	}
}
