/**
 * LopAddons storefront styles.
 *
 * Everything is scoped under .lopaddons and driven by CSS custom properties, so
 * themes are never affected and every value can be changed from the design editor.
 * Breakpoints: tablet <= 1024px, mobile <= 640px.
 */
.lopaddons {
	--lop-accent: #2563eb;
	--lop-text: inherit;
	--lop-label: inherit;
	--lop-label-size: 0.95em;
	--lop-label-weight: 600;
	--lop-desc: #6b7280;
	--lop-font: inherit;
	--lop-font-size: 1em;
	--lop-input-bg: #fff;
	--lop-input-text: #111827;
	--lop-border: #d1d5db;
	--lop-border-width: 1px;
	--lop-radius: 6px;
	--lop-pad-y: 10px;
	--lop-pad-x: 12px;
	--lop-gap: 16px;
	--lop-hover-border: var(--lop-accent);
	--lop-hover-bg: rgba(0, 0, 0, 0.03);
	--lop-selected-bg: var(--lop-accent);
	--lop-selected-text: #fff;
	--lop-selected-border: var(--lop-accent);
	--lop-error: #dc2626;
	--lop-group-bg: transparent;
	--lop-group-border: transparent;
	--lop-group-border-width: 0px;
	--lop-group-radius: 0px;
	--lop-group-pad: 0px;
	--lop-title: inherit;
	--lop-title-size: 1.15em;
	clear: both;
	width: 100%;
	margin: 0 0 20px;
	text-align: left;
}

.lopaddons,
.lopaddons *,
.lopaddons *::before,
.lopaddons *::after {
	box-sizing: border-box;
}

.lopaddons [hidden],
.lopaddons [data-tab-hidden] {
	display: none !important;
}

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

/* ---------- Groups & grid ---------- */

.lopaddons .lop-group {
	margin: 0 0 var(--lop-gap);
	padding: var(--lop-group-pad);
	color: var(--lop-text);
	font-family: var(--lop-font);
	font-size: var(--lop-font-size);
	background: var(--lop-group-bg);
	border: var(--lop-group-border-width) solid var(--lop-group-border);
	border-radius: var(--lop-group-radius);
}

.lopaddons .lop-group__title {
	margin: 0 0 12px;
	color: var(--lop-title);
	font-size: var(--lop-title-size);
	font-weight: 700;
	line-height: 1.3;
}

.lopaddons .lop-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--lop-gap);
	align-items: start;
}

.lopaddons .lop-field {
	grid-column: span var(--lop-w-d, 12);
	min-width: 0;
	margin: 0;
}

.lopaddons .lop-field.is-disabled {
	opacity: 0.55;
}

.lopaddons .lop-align-center {
	text-align: center;
}

.lopaddons .lop-align-right {
	text-align: right;
}

/* ---------- Labels & texts ---------- */

.lopaddons .lop-label {
	display: block;
	margin: 0 0 6px;
	color: var(--lop-label);
	font-size: var(--lop-label-size);
	font-weight: var(--lop-label-weight);
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.lopaddons .lop-label-hidden > .lop-label,
.lopaddons .lop-group.lop-label-hidden .lop-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.lopaddons .lop-req {
	margin-left: 3px;
	color: var(--lop-error);
	text-decoration: none;
}

.lopaddons .lop-price,
.lopaddons .lop-price-note {
	margin-left: 6px;
	color: var(--lop-accent);
	font-size: 0.9em;
	font-weight: 600;
	white-space: nowrap;
}

.lopaddons .lop-price-note {
	margin-left: 2px;
	font-weight: 400;
	opacity: 0.85;
}

.lopaddons .lop-price del {
	margin-right: 2px;
	color: var(--lop-desc);
	font-weight: 400;
}

.lopaddons .lop-price ins {
	text-decoration: none;
	background: none;
}

.lopaddons .lop-desc {
	margin: 6px 0 0;
	color: var(--lop-desc);
	font-size: 0.875em;
	line-height: 1.45;
}

.lopaddons .lop-error {
	margin: 6px 0 0;
	padding: 0;
	color: var(--lop-error);
	font-size: 0.875em;
	font-weight: 500;
}

.lopaddons .lop-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-left: 6px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	vertical-align: middle;
	background: var(--lop-desc);
	border-radius: 50%;
	cursor: help;
}

.lopaddons .lop-tip::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 20;
	display: none;
	width: max-content;
	max-width: min(260px, 70vw);
	padding: 8px 10px;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	background: #111827;
	border-radius: 6px;
	transform: translateX(-50%);
}

.lopaddons .lop-tip:hover::after,
.lopaddons .lop-tip:focus::after {
	display: block;
}

@media (min-width: 641px) {
	.lopaddons .lop-label-left.lop-field,
	.lopaddons .lop-group.lop-label-left .lop-field:not(.lop-field--section):not(.lop-field--tabs):not(.lop-field--repeater) {
		display: grid;
		grid-template-columns: minmax(90px, 30%) minmax(0, 1fr);
		column-gap: 12px;
		align-items: start;
	}

	.lopaddons .lop-label-left .lop-label {
		margin: 0;
		padding-top: var(--lop-pad-y);
	}

	.lopaddons .lop-label-left .lop-desc,
	.lopaddons .lop-label-left .lop-error {
		grid-column: 2;
	}
}

/* ---------- Inputs ---------- */

.lopaddons:not(.lop-inherit) .lop-group:not(.lop-inherit) .lop-input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	margin: 0;
	padding: var(--lop-pad-y) var(--lop-pad-x);
	color: var(--lop-input-text);
	font-family: inherit;
	font-size: max(16px, 1em);
	line-height: 1.4;
	background-color: var(--lop-input-bg);
	border: var(--lop-border-width) solid var(--lop-border);
	border-radius: var(--lop-radius);
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.lopaddons .lop-input {
	width: 100%;
	max-width: 100%;
}

.lopaddons textarea.lop-input {
	min-height: 96px;
	resize: vertical;
}

.lopaddons:not(.lop-inherit) .lop-group:not(.lop-inherit) .lop-input:hover:not(:disabled) {
	border-color: var(--lop-hover-border);
}

.lopaddons .lop-input:focus-visible,
.lopaddons .lop-choice input:focus-visible ~ *,
.lopaddons .lop-switch input:focus-visible + .lop-switch__track,
.lopaddons .lop-btn:focus-visible,
.lopaddons .lop-upload__drop:focus-visible,
.lopaddons .lop-tabs__tab:focus-visible,
.lopaddons summary:focus-visible {
	outline: 2px solid var(--lop-accent);
	outline-offset: 2px;
}

.lopaddons .has-error > .lop-control .lop-input,
.lopaddons .has-error > .lop-control .lop-upload__drop {
	border-color: var(--lop-error) !important;
}

.lopaddons .lop-counter {
	display: block;
	margin-top: 4px;
	color: var(--lop-desc);
	font-size: 0.8em;
	text-align: right;
}

.lopaddons .lop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	color: var(--lop-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	background: transparent;
	border: 1px solid var(--lop-accent);
	border-radius: var(--lop-radius);
	cursor: pointer;
}

.lopaddons .lop-btn:hover {
	background: var(--lop-hover-bg);
}

.lopaddons .lop-btn--primary {
	color: var(--lop-selected-text);
	background: var(--lop-accent);
}

.lopaddons .lop-btn--primary:hover {
	background: var(--lop-accent);
	filter: brightness(0.92);
}

/* ---------- Choices ---------- */

.lopaddons .lop-options {
	display: grid;
	grid-template-columns: repeat(var(--lop-oc-d, 1), minmax(0, 1fr));
	gap: 8px;
}

.lopaddons .lop-options--fluid {
	display: flex;
	flex-wrap: wrap;
}

.lopaddons .lop-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 8px 12px;
	color: inherit;
	font-weight: 400;
	line-height: 1.35;
	background: var(--lop-input-bg);
	border: var(--lop-border-width) solid var(--lop-border);
	border-radius: var(--lop-radius);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

/* Hover only on devices that really hover: on touch screens a "sticky" hover would make a
 * tile that was just tapped to clear it still look selected. */
@media (hover: hover) {
	.lopaddons .lop-choice:hover {
		background-color: var(--lop-hover-bg);
		border-color: var(--lop-hover-border);
	}
}

.lopaddons .lop-choice {
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* Clicks on the picture go to the tile (no native image drag / long-press menu). */
.lopaddons .lop-choice__image img {
	pointer-events: none;
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
}

.lopaddons .lop-choice > input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.lopaddons .lop-choice__text {
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 8px;
	min-width: 0;
	color: var(--lop-input-text);
	overflow-wrap: anywhere;
}

.lopaddons .lop-choice .lop-price {
	margin-left: 0;
}

.lopaddons .lop-choice__mark {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	background: #fff;
	border: 2px solid var(--lop-border);
	border-radius: 4px;
	transition: border-color 0.15s, background-color 0.15s;
}

.lopaddons .lop-choice input[type="radio"] ~ .lop-choice__mark {
	border-radius: 50%;
}

.lopaddons .lop-choice input:checked ~ .lop-choice__mark {
	background: var(--lop-accent);
	border-color: var(--lop-accent);
	box-shadow: inset 0 0 0 3px #fff;
}

.lopaddons .lop-choice:has(input:checked) {
	border-color: var(--lop-selected-border);
}

.lopaddons .lop-choice:has(input:disabled) {
	cursor: not-allowed;
}

/* Button style choices */
.lopaddons .lop-choice--buttons {
	justify-content: center;
	padding: 10px 16px;
	text-align: center;
}

.lopaddons .lop-choice--buttons .lop-choice__text {
	justify-content: center;
}

.lopaddons .lop-choice--buttons:has(input:checked) {
	background: var(--lop-selected-bg);
	border-color: var(--lop-selected-border);
}

.lopaddons .lop-choice--buttons:has(input:checked) .lop-choice__text,
.lopaddons .lop-choice--buttons:has(input:checked) .lop-price {
	color: var(--lop-selected-text);
}

/* Colour swatches */
.lopaddons .lop-choice--color_swatch {
	padding: 6px 12px 6px 6px;
}

.lopaddons .lop-choice__color {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 50%;
}

.lopaddons .lop-choice--color_swatch:has(input:checked) {
	box-shadow: 0 0 0 2px var(--lop-selected-border);
}

/* Image choices */
.lopaddons .lop-choice--image_swatch {
	flex-direction: column;
	align-items: stretch;
	padding: 6px;
	text-align: center;
}

.lopaddons .lop-choice__image {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f3f4f6;
	border-radius: calc(var(--lop-radius) - 2px);
}

.lopaddons .lop-choice__image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.lopaddons .lop-choice--image_swatch .lop-choice__text {
	justify-content: center;
	padding: 2px 2px 4px;
}

.lopaddons .lop-choice--image_swatch:has(input:checked) {
	box-shadow: 0 0 0 2px var(--lop-selected-border);
}

/* Options that scroll sideways on the devices chosen in the field settings.
 * --lop-sv-d / -t / -m: options visible at once (2.5 lets the next one peek out). */
.lopaddons .lop-scroller {
	position: relative;
	min-width: 0;
}

@media (min-width: 1025px) {
	.lopaddons .lop-options.lop-scroll-d {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: calc((100% - (var(--lop-sv-d) - 1) * 8px) / var(--lop-sv-d));
		column-gap: 8px;
		padding: 3px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 3px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.lopaddons .lop-options.lop-scroll-d > .lop-choice {
		scroll-snap-align: start;
	}
}

@media (min-width: 641px) and (max-width: 1024px) {
	.lopaddons .lop-options.lop-scroll-t {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: calc((100% - (var(--lop-sv-t) - 1) * 8px) / var(--lop-sv-t));
		column-gap: 8px;
		padding: 3px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 3px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.lopaddons .lop-options.lop-scroll-t > .lop-choice {
		scroll-snap-align: start;
	}
}

@media (max-width: 640px) {
	.lopaddons .lop-options.lop-scroll-m {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: calc((100% - (var(--lop-sv-m) - 1) * 8px) / var(--lop-sv-m));
		column-gap: 8px;
		padding: 3px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 3px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.lopaddons .lop-options.lop-scroll-m > .lop-choice {
		scroll-snap-align: start;
	}
}

/* With the script running, the arrows (mouse) and swiping (touch) replace the scrollbar. */
.lopaddons .lop-scroller.is-ready > .lop-options {
	scrollbar-width: none;
}

.lopaddons .lop-scroller.is-ready > .lop-options::-webkit-scrollbar {
	display: none;
}

/* Soft edge on the side(s) with more options. */
.lopaddons .lop-scroller.lop-fade-r > .lop-options {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

.lopaddons .lop-scroller.lop-fade-l > .lop-options {
	-webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
	mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
}

.lopaddons .lop-scroller.lop-fade-l.lop-fade-r > .lop-options {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
	mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.lopaddons .lop-scroller__btn {
	display: none;
}

/* Arrows only where a mouse or trackpad is the main pointer; touch screens swipe. */
@media (hover: hover) {
	.lopaddons .lop-scroller.is-ready.is-scrollable > .lop-scroller__btn {
		position: absolute;
		top: 50%;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 36px;
		min-width: 0;
		height: 36px;
		min-height: 0;
		margin: -18px 0 0;
		padding: 0;
		color: var(--lop-input-text);
		font-size: 0;
		line-height: 0;
		background: var(--lop-input-bg);
		border: 1px solid var(--lop-border);
		border-radius: 50%;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
		cursor: pointer;
		transition: opacity 0.15s, visibility 0.15s;
	}
}

.lopaddons .lop-scroller__btn--prev {
	left: 4px;
	inset-inline-start: 4px;
	inset-inline-end: auto;
}

.lopaddons .lop-scroller__btn--next {
	right: 4px;
	inset-inline-start: auto;
	inset-inline-end: 4px;
}

.lopaddons .lop-scroller__btn::before {
	content: "";
	width: 8px;
	height: 8px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
}

/* Chevrons point towards the options they reveal (mirrored for right-to-left text). */
.lopaddons .lop-scroller__btn--next::before,
.lopaddons .lop-scroller.is-rtl > .lop-scroller__btn--prev::before {
	margin-right: 3px;
	margin-left: 0;
	transform: rotate(-45deg);
}

.lopaddons .lop-scroller__btn--prev::before,
.lopaddons .lop-scroller.is-rtl > .lop-scroller__btn--next::before {
	margin-right: 0;
	margin-left: 3px;
	transform: rotate(135deg);
}

.lopaddons .lop-scroller:not(.can-prev) > .lop-scroller__btn--prev,
.lopaddons .lop-scroller:not(.can-next) > .lop-scroller__btn--next {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Switch */
.lopaddons .lop-switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	cursor: pointer;
}

.lopaddons .lop-switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.lopaddons .lop-switch__track {
	position: relative;
	flex: 0 0 46px;
	width: 46px;
	height: 26px;
	background: var(--lop-border);
	border-radius: 999px;
	transition: background-color 0.15s;
}

.lopaddons .lop-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s;
}

.lopaddons .lop-switch input:checked + .lop-switch__track {
	background: var(--lop-accent);
}

.lopaddons .lop-switch input:checked + .lop-switch__track::after {
	transform: translateX(20px);
}

/* ---------- Searchable select ---------- */

.lopaddons .lop-fs {
	position: relative;
}

.lopaddons .lop-fs__button {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	padding-right: 34px !important;
	text-align: left;
	cursor: pointer;
}

.lopaddons .lop-fs__button::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 14px;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	opacity: 0.6;
}

.lopaddons .lop-fs__placeholder {
	color: var(--lop-desc);
}

.lopaddons .lop-fs__chip {
	padding: 2px 8px;
	color: var(--lop-selected-text);
	font-size: 0.85em;
	background: var(--lop-accent);
	border-radius: 999px;
}

.lopaddons .lop-fs__panel {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	z-index: 30;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--lop-border);
	border-radius: var(--lop-radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.lopaddons .lop-fs__search {
	width: 100%;
	min-height: 40px;
	margin: 0 0 6px;
	padding: 8px 10px;
	color: #111827;
	font-size: 16px;
	background: #fff;
	border: 1px solid var(--lop-border);
	border-radius: 4px;
}

.lopaddons .lop-fs__list {
	max-height: 240px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.lopaddons .lop-fs__option {
	margin: 0;
	padding: 10px;
	color: #111827;
	border-radius: 4px;
	cursor: pointer;
}

.lopaddons .lop-fs__option:hover,
.lopaddons .lop-fs__option:focus {
	background: #f3f4f6;
	outline: none;
}

.lopaddons .lop-fs__option.is-selected {
	color: var(--lop-accent);
	font-weight: 600;
}

.lopaddons .lop-fs__option.is-selected::before {
	content: "✓ ";
}

.lopaddons .lop-fs__empty {
	padding: 10px;
	color: var(--lop-desc);
}

/* ---------- Range, stepper, colour, font ---------- */

.lopaddons .lop-range {
	display: flex;
	align-items: center;
	gap: 12px;
}

.lopaddons .lop-range input[type="range"] {
	flex: 1;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0;
	accent-color: var(--lop-accent);
}

.lopaddons .lop-range__value {
	flex: 0 0 auto;
	min-width: 48px;
	font-weight: 600;
	text-align: right;
}

.lopaddons .lop-stepper {
	display: inline-flex;
	align-items: stretch;
	max-width: 100%;
}

.lopaddons .lop-stepper .lop-input {
	width: 84px;
	text-align: center;
	border-radius: 0 !important;
	-moz-appearance: textfield;
}

.lopaddons .lop-stepper .lop-input::-webkit-outer-spin-button,
.lopaddons .lop-stepper .lop-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.lopaddons .lop-stepper__btn {
	flex: 0 0 44px;
	width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	color: var(--lop-input-text);
	font-size: 20px;
	line-height: 1;
	background: var(--lop-hover-bg);
	border: var(--lop-border-width) solid var(--lop-border);
	border-radius: var(--lop-radius) 0 0 var(--lop-radius);
	cursor: pointer;
}

.lopaddons .lop-stepper__btn:last-child {
	border-radius: 0 var(--lop-radius) var(--lop-radius) 0;
}

.lopaddons .lop-color {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.lopaddons .lop-color__picker {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 2px;
	background: var(--lop-input-bg);
	border: var(--lop-border-width) solid var(--lop-border);
	border-radius: var(--lop-radius);
	cursor: pointer;
}

.lopaddons .lop-color__text {
	flex: 1 1 110px;
	width: auto !important;
	min-width: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

.lopaddons .lop-color__palette {
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	gap: 8px;
}

.lopaddons .lop-color__chip {
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 50%;
	cursor: pointer;
}

.lopaddons .lop-font__preview {
	margin-top: 8px;
	padding: 12px;
	font-size: 1.25em;
	line-height: 1.3;
	background: var(--lop-hover-bg);
	border-radius: var(--lop-radius);
	overflow-wrap: anywhere;
}

.lopaddons .lop-formula {
	display: inline-block;
	min-height: 44px;
	padding: var(--lop-pad-y) var(--lop-pad-x);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	background: var(--lop-hover-bg);
	border-radius: var(--lop-radius);
}

/* ---------- Upload ---------- */

.lopaddons .lop-upload__drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 20px 14px;
	text-align: center;
	background: var(--lop-input-bg);
	border: 2px dashed var(--lop-border);
	border-radius: var(--lop-radius);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.lopaddons .lop-upload__drop:hover,
.lopaddons .lop-upload__drop.is-over {
	background: var(--lop-hover-bg);
	border-color: var(--lop-accent);
}

.lopaddons .lop-upload__icon {
	width: 28px;
	height: 28px;
	border: 2px solid var(--lop-accent);
	border-top: 0;
	border-radius: 0 0 6px 6px;
	position: relative;
	margin-top: 8px;
}

.lopaddons .lop-upload__icon::before {
	content: "";
	position: absolute;
	bottom: 6px;
	left: 50%;
	width: 2px;
	height: 22px;
	background: var(--lop-accent);
	transform: translateX(-50%);
}

.lopaddons .lop-upload__icon::after {
	content: "";
	position: absolute;
	bottom: 18px;
	left: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid var(--lop-accent);
	border-left: 2px solid var(--lop-accent);
	transform: translateX(-50%) rotate(45deg);
}

.lopaddons .lop-upload__text {
	color: var(--lop-input-text);
	font-weight: 600;
}

.lopaddons .lop-upload__hint,
.lopaddons .lop-upload__off {
	margin: 0;
	color: var(--lop-desc);
	font-size: 0.8em;
	overflow-wrap: anywhere;
}

/* The real file input covers the whole drop area (invisible): taps reach it directly. */
.lopaddons .lop-upload__drop {
	position: relative;
}

.lopaddons .lop-upload__input {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	cursor: pointer;
	opacity: 0;
}

.lopaddons .lop-upload__input::-webkit-file-upload-button,
.lopaddons .lop-upload__input::file-selector-button {
	cursor: pointer;
}

.lopaddons .lop-upload__input:disabled {
	cursor: not-allowed;
}

.lopaddons .lop-upload__drop:focus-within {
	outline: 2px solid var(--lop-accent);
	outline-offset: 2px;
	border-color: var(--lop-accent);
}

.lopaddons .lop-upload__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lopaddons .lop-upload__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 8px 0 0;
	padding: 8px;
	background: var(--lop-hover-bg);
	border-radius: var(--lop-radius);
}

.lopaddons .lop-upload__thumb {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	margin: 0;
	object-fit: cover;
	background: #e5e7eb;
	border-radius: 4px;
}

.lopaddons .lop-upload__thumb--file {
	position: relative;
}

.lopaddons .lop-upload__thumb--file::after {
	content: "";
	position: absolute;
	inset: 9px 12px;
	border: 2px solid #6b7280;
	border-radius: 2px;
}

.lopaddons .lop-upload__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: 0.9em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lopaddons .lop-upload__bar {
	flex: 1 1 100%;
	order: 5;
	height: 4px;
	overflow: hidden;
	background: var(--lop-border);
	border-radius: 2px;
}

.lopaddons .lop-upload__bar > span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--lop-accent);
	transition: width 0.15s;
}

.lopaddons .lop-upload__remove,
.lopaddons .lop-repeater__remove,
.lopaddons .lop-popup__close {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	color: #374151;
	font-size: 22px;
	line-height: 1;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.lopaddons .lop-upload__remove:hover,
.lopaddons .lop-repeater__remove:hover,
.lopaddons .lop-popup__close:hover {
	color: var(--lop-error);
	background: rgba(0, 0, 0, 0.06);
}

/* ---------- Sub-fields (address, social), products ---------- */

.lopaddons .lop-subgrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.lopaddons .lop-sub--wide {
	grid-column: 1 / -1;
}

.lopaddons .lop-sublabel {
	display: block;
	margin: 0 0 4px;
	color: var(--lop-desc);
	font-size: 0.85em;
	font-weight: 500;
}

.lopaddons .lop-subreq {
	color: var(--lop-error);
}

.lopaddons .lop-product {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 8px;
	font-weight: 400;
	text-align: center;
	background: var(--lop-input-bg);
	border: var(--lop-border-width) solid var(--lop-border);
	border-radius: var(--lop-radius);
	cursor: pointer;
}

.lopaddons .lop-product:has(input[type="checkbox"]:checked) {
	border-color: var(--lop-selected-border);
	box-shadow: 0 0 0 1px var(--lop-selected-border);
}

.lopaddons .lop-product__image img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	border-radius: calc(var(--lop-radius) - 2px);
}

.lopaddons .lop-product__name {
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.lopaddons .lop-product__price {
	font-size: 0.9em;
}

.lopaddons .lop-product__pick {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 36px;
}

.lopaddons .lop-product__pick input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--lop-accent);
}

.lopaddons .lop-product__qty {
	text-align: center;
}

/* ---------- Content ---------- */

.lopaddons .lop-heading {
	margin: 0;
	color: var(--lop-title);
	line-height: 1.3;
}

.lopaddons .lop-content > :first-child {
	margin-top: 0;
}

.lopaddons .lop-content > :last-child {
	margin-bottom: 0;
}

.lopaddons .lop-content img,
.lopaddons .lop-content iframe,
.lopaddons .lop-content video {
	max-width: 100%;
	height: auto;
}

.lopaddons .lop-divider {
	margin: 4px 0;
	border: 0;
	border-top: 1px solid var(--lop-border);
}

/* ---------- Containers ---------- */

.lopaddons .lop-section__title {
	margin: 0 0 10px;
	color: var(--lop-title);
	font-weight: 700;
}

.lopaddons .lop-accordion {
	border: 1px solid var(--lop-border);
	border-radius: var(--lop-radius);
}

.lopaddons .lop-accordion__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	padding: 10px 14px;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.lopaddons .lop-accordion__head::-webkit-details-marker {
	display: none;
}

.lopaddons .lop-accordion__head::after {
	content: "";
	flex: 0 0 9px;
	width: 9px;
	height: 9px;
	margin-left: 12px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.15s;
}

.lopaddons .lop-accordion[open] > .lop-accordion__head::after {
	transform: rotate(-135deg);
}

.lopaddons .lop-accordion__body {
	padding: 4px 14px 14px;
}

.lopaddons .lop-tabs__list {
	display: flex;
	gap: 4px;
	margin: 0 0 14px;
	overflow-x: auto;
	border-bottom: 1px solid var(--lop-border);
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.lopaddons .lop-tabs__tab {
	flex: 0 0 auto;
	min-height: 44px;
	margin: 0 0 -1px;
	padding: 10px 14px;
	color: inherit;
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	background: transparent;
	border: 0;
	border-bottom: 3px solid transparent;
	border-radius: 0;
	cursor: pointer;
	opacity: 0.7;
}

.lopaddons .lop-tabs__tab.is-active {
	color: var(--lop-accent);
	border-bottom-color: var(--lop-accent);
	opacity: 1;
}

.lopaddons .lop-tabs__panel {
	grid-column: auto;
}

.lopaddons .lop-repeater__row {
	margin: 0 0 12px;
	padding: 12px;
	border: 1px solid var(--lop-border);
	border-radius: var(--lop-radius);
}

.lopaddons .lop-repeater__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 36px;
	margin: 0 0 8px;
	font-weight: 600;
}

.lopaddons .lop-popup__summary {
	margin-left: 10px;
	color: var(--lop-accent);
	font-size: 0.9em;
	font-weight: 600;
}

.lopaddons .lop-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(17, 24, 39, 0.55);
}

.lopaddons .lop-popup__panel {
	display: flex;
	flex-direction: column;
	width: min(640px, 100%);
	max-height: min(90vh, 100%);
	max-height: min(90dvh, 100%);
	color: #111827;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.lopaddons .lop-popup__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 12px 12px 18px;
	font-weight: 700;
	border-bottom: 1px solid #e5e7eb;
}

.lopaddons .lop-popup__body {
	padding: 18px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.lopaddons .lop-popup__foot {
	padding: 12px 18px;
	text-align: right;
	border-top: 1px solid #e5e7eb;
}

html.lop-popup-open {
	overflow: hidden;
}

/* ---------- Totals & share ---------- */

.lopaddons .lop-totals {
	margin: 0 0 var(--lop-gap);
	padding: 12px 14px;
	background: rgba(0, 0, 0, 0.035);
	border-radius: var(--lop-radius);
}

.lopaddons .lop-totals__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 3px 0;
	font-variant-numeric: tabular-nums;
}

.lopaddons .lop-totals__grand {
	margin-top: 6px;
	padding-top: 8px;
	font-size: 1.1em;
	font-weight: 700;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.lopaddons .lop-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 var(--lop-gap);
}

.lopaddons .lop-share__done {
	color: var(--lop-accent);
	font-weight: 600;
}

/* ---------- Theme-matching mode ----------
 * Inputs keep whatever the theme gives them; only layout is applied. */
.lopaddons.lop-inherit .lop-choice,
.lopaddons .lop-group.lop-inherit .lop-choice,
.lopaddons.lop-inherit .lop-upload__drop,
.lopaddons .lop-group.lop-inherit .lop-upload__drop {
	background: transparent;
	border-color: currentColor;
	border-color: color-mix(in srgb, currentColor 25%, transparent);
}

.lopaddons.lop-inherit,
.lopaddons .lop-group.lop-inherit {
	--lop-accent: currentColor;
	--lop-input-text: inherit;
	--lop-selected-text: inherit;
	--lop-selected-bg: color-mix(in srgb, currentColor 12%, transparent);
	--lop-desc: inherit;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.lopaddons .lop-field {
		grid-column: span var(--lop-w-t, 12);
	}

	.lopaddons .lop-options {
		grid-template-columns: repeat(var(--lop-oc-t, 1), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.lopaddons .lop-field {
		grid-column: span var(--lop-w-m, 12);
	}

	.lopaddons .lop-options {
		grid-template-columns: repeat(var(--lop-oc-m, 1), minmax(0, 1fr));
	}

	.lopaddons .lop-subgrid {
		grid-template-columns: minmax(0, 1fr);
	}

	.lopaddons .lop-popup {
		align-items: flex-end;
		padding: 0;
	}

	.lopaddons .lop-popup__panel {
		width: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: 14px 14px 0 0;
	}

	.lopaddons .lop-popup__foot .lop-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lopaddons * {
		transition: none !important;
	}
}
