/* -------------------------------------------------------------------------
 * Eltechnika – machine add-ons: product page panel
 *
 * Loaded by the add-ons plugin only on product pages that offer add-ons,
 * after Bricks' generated CSS (it used to live in Customizer → Additional
 * CSS, which printed last). The cart and mini-cart rows are addons-cart.css.
 * ---------------------------------------------------------------------- */

/* Required: the panel uses [hidden] to toggle, and display:flex/grid on a
   child would override it. Keep this rule first. */
.eltechnika-addons[hidden] {
	display: none !important;
}

/* --- Panel ------------------------------------------------------------ */

.eltechnika-addons {
	margin: 28px 0 0;
}

.eltechnika-addons__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
}

.eltechnika-addons__title {
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-family: "Barlow Condensed", sans-serif;
}

.eltechnika-addons__optional {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9a9a9a;
}

.eltechnika-addons__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* --- Row -------------------------------------------------------------- */

.eltechnika-addon {
	padding: 14px 18px;
	border: 1px solid #e0e0e0;
	background: #fff;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* The label is what ticks the add-on. The quantity bar sits outside it,
   so the stepper never toggles the checkbox. */
.eltechnika-addon__main {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 18px;
	cursor: pointer;
}

.eltechnika-addon:hover {
	border-color: #b5b5b5;
}

/* Selected state — class is set in JS, so no :has() dependency. */
.eltechnika-addon.is-added {
	border-color: var(--c-accent);
	background: #fff;
	background: color-mix(in srgb, var(--c-accent) 4%, #fff);
}

/* Keyboard focus, since the checkbox itself is visually hidden. */
.eltechnika-addon:focus-within {
	outline: 2px solid var(--c-accent);
	outline-offset: 2px;
}

/* Visually hidden but focusable and still posted with the form. */
.eltechnika-addon__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	white-space: nowrap;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
}

/* --- Thumbnail -------------------------------------------------------- */

.eltechnika-addon__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	flex: 0 0 auto;
	overflow: hidden;
	background: #f5f5f5;
}

.eltechnika-addon__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Keeps rows aligned when an add-on has no image of its own. */
.eltechnika-addon__media.is-empty {
	background: #f0f0f0;
}

/* --- Body ------------------------------------------------------------- */

.eltechnika-addon__body {
	min-width: 0;
}

.eltechnika-addon__name {
	display: block;
	line-height: 1.3;
	color: #1a1a1a;
}

.eltechnika-addon__sku {
	display: block;
	margin-top: 2px;
	font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	letter-spacing: 0.02em;
	color: #9a9a9a;
}

/* --- Price + toggle --------------------------------------------------- */

.eltechnika-addon__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.eltechnika-addon__price {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	color: #1a1a1a;
}

.eltechnika-addon__toggle {
	display: inline-block;
	min-width: 96px;
	padding: 7px 14px;
	font-size: 14px;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #d0d0d0;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.eltechnika-addon:hover .eltechnika-addon__toggle {
	border-color: #1a1a1a;
}

.eltechnika-addon.is-added .eltechnika-addon__toggle {
	color: #fff;
	background: var(--c-accent);
	border-color: var(--c-accent);
}

/* --- Unavailable ------------------------------------------------------ */

.eltechnika-addon.is-unavailable {
	background: #fafafa;
	border-color: #ededed;
}

.eltechnika-addon.is-unavailable .eltechnika-addon__main {
	cursor: not-allowed;
}

.eltechnika-addon.is-unavailable .eltechnika-addon__name,
.eltechnika-addon.is-unavailable .eltechnika-addon__sku,
.eltechnika-addon.is-unavailable .eltechnika-addon__price {
	color: #c4c4c4;
}

.eltechnika-addon.is-unavailable .eltechnika-addon__media {
	opacity: 0.45;
}

/* --- Groups ----------------------------------------------------------- */

.eltechnika-addons__group-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.eltechnika-addons__group + .eltechnika-addons__group {
	margin-top: 14px;
}

.eltechnika-addons__group-title {
	margin: 0 0 8px;
	font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #5a5a5a;
}

/* --- Stock ------------------------------------------------------------ */

.eltechnika-addon__stock {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: #5a5a5a;
}

/* --- Quantity --------------------------------------------------------- */

/* The bar uses [hidden] while the add-on is unticked; display:flex would
   otherwise override it. */
.eltechnika-addon__qty[hidden] {
	display: none !important;
}

/* Lined up under the name: past the thumbnail and the gap. */
.eltechnika-addon__qty {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 12px 0 0 calc(72px + 18px);
	padding-top: 12px;
	border-top: 1px solid #ececec;
}

.eltechnika-addon__qty-label {
	font-size: 14px;
	color: #5a5a5a;
}

.eltechnika-addon__stepper {
	display: inline-flex;
	align-items: stretch;
	height: 38px;
	border: 1px solid #d0d0d0;
	background: #fff;
}

.eltechnika-addons .eltechnika-addon__step {
	/* The theme's button reset aligns text to the start; centre the glyph. */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 36px;
	min-width: 0;
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 18px;
	line-height: 1;
	color: #1a1a1a;
	cursor: pointer;
}

.eltechnika-addons .eltechnika-addon__step:hover:not(:disabled) {
	color: var(--c-accent);
}

.eltechnika-addons .eltechnika-addon__step:disabled {
	color: #c4c4c4;
	cursor: not-allowed;
}

.eltechnika-addons .eltechnika-addon__qty-input {
	width: 46px;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	color: #1a1a1a;
	-moz-appearance: textfield;
	appearance: textfield;
}

.eltechnika-addons .eltechnika-addon__qty-input::-webkit-outer-spin-button,
.eltechnika-addons .eltechnika-addon__qty-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.eltechnika-addon__unit {
	margin-left: auto;
	font-size: 13px;
	white-space: nowrap;
	color: #9a9a9a;
}

/* --- Summary ---------------------------------------------------------- */

.eltechnika-addons__summary[hidden] {
	display: none !important;
}

.eltechnika-addons__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 10px;
	padding: 16px 18px;
	background: #f5f5f5;
}

.eltechnika-addons__summary-count {
	font-size: 15px;
	color: #5a5a5a;
}

.eltechnika-addons__summary-total {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	color: #1a1a1a;
}

/* --- Simple products --------------------------------------------------- */

/* The panel sits inside form.cart, which the product template lays out as one
   flex row for the quantity and the button, so the panel was squeezed in
   beside them and stretched them to its height. Give it a full-width row of
   its own above them, where a variable product's panel sits. :has() limits
   this to forms that contain a panel. */
form.cart:not(.variations_form):has(> .eltechnika-addons) {
	flex-wrap: wrap;
}

form.cart:not(.variations_form) > .eltechnika-addons {
	flex: 0 0 100%;
	margin: 0 0 14px;
}

/* --- Mobile ----------------------------------------------------------- */

@media (max-width: 600px) {
	.eltechnika-addon {
		padding: 12px 14px;
	}

	.eltechnika-addon__main {
		gap: 12px;
	}

	/* Full width under the thumbnail: no room beside it. */
	.eltechnika-addon__qty {
		margin-left: 0;
	}

	.eltechnika-addon__media {
		width: 56px;
		height: 56px;
	}

	.eltechnika-addon__price {
		font-size: 16px;
	}

	.eltechnika-addon__toggle {
		min-width: 0;
		padding: 6px 10px;
		font-size: 13px;
	}
}
