/* Layout only: colours and fonts come from the theme. */
:where(.solemar-bundle) > :where(.solemar-bundle-items, .solemar-bundle-saving) {
	flex: 0 0 100%;
	inline-size: 100%;
}

:where(.solemar-bundle-items) {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

:where(.solemar-bundle-item) {
	display: flex;
	gap: 1em;
	margin: 0;
	padding: 1em 0;
	border-block-end: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

:where(.solemar-bundle-image) {
	flex: 0 0 4.5em;
}

:where(.solemar-bundle-image) img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

:where(.solemar-bundle-details) {
	flex: 1;
	min-inline-size: 0;
}

:where(.solemar-bundle-name) {
	font-weight: 600;
}

:where(.solemar-bundle-price) {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0.25em 0 0.5em;
}

:where(.solemar-bundle-price) del {
	opacity: 0.6;
}

:where(.solemar-bundle-price) [hidden],
:where(.solemar-bundle-saving)[hidden] {
	display: none;
}

:where(.solemar-bundle-price) ins {
	text-decoration: none;
}

:where(.solemar-bundle-choices) {
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

:where(.solemar-bundle-choices) legend {
	margin: 0 0 0.35em;
	padding: 0;
	font-size: 0.875em;
}

:where(.solemar-bundle-values) {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 0.75em;
}

:where(.solemar-bundle-choice) {
	position: relative;
	cursor: pointer;
}

:where(.solemar-bundle-choice) input {
	position: absolute;
	opacity: 0;
	inline-size: 1px;
	block-size: 1px;
}

:where(.solemar-bundle-choice) span {
	display: block;
	min-inline-size: 3em;
	padding: 0.5em 0.75em;
	text-align: center;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 0.375em;
}

:where(.solemar-bundle-choice) input:checked + span {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
	font-weight: 600;
}

:where(.solemar-bundle-choice) input:focus-visible + span {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Not sold with the current picks: still selectable, which clears the conflicting pick. */
:where(.solemar-bundle-choice.is-unavailable) span {
	opacity: 0.55;
	text-decoration: line-through;
}

:where(.solemar-bundle-choice) input:disabled + span {
	opacity: 0.4;
	text-decoration: line-through;
	cursor: not-allowed;
}

:where(.solemar-bundle-saving) {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 0.5em;
}

/* "Also available in a bundle", on the page of an included product. */
:where(.solemar-bundle-offers) {
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: 28rem;
	margin-block: 1em;
	text-align: start;
}

:where(.solemar-bundle-offers-title) {
	margin-block-end: 0.5em;
	font-weight: 600;
}

:where(.solemar-bundle-offers-list) {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	list-style: none;
	margin: 0;
	padding: 0;
}

:where(.solemar-bundle-offers-list) li {
	margin: 0;
}

:where(.solemar-bundle-offer) {
	display: flex;
	gap: 1em;
	padding: 0.75em;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 0.375em;
	color: inherit;
	text-decoration: none;
}

:where(.solemar-bundle-offer):hover {
	border-color: currentColor;
}

:where(.solemar-bundle-offer):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

:where(.solemar-bundle-offer-image) {
	flex: 0 0 4.5em;
}

:where(.solemar-bundle-offer-image) img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

:where(.solemar-bundle-offer-details) {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25em;
	min-inline-size: 0;
}

:where(.solemar-bundle-offer-name) {
	font-weight: 600;
}

:where(.solemar-bundle-offer-items, .solemar-bundle-offer-saving) {
	font-size: 0.875em;
}

:where(.solemar-bundle-offer-link) {
	font-size: 0.875em;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Bundle policy: bundle page, cart and checkout. "div" and similar outweigh theme resets. */
div:where(.solemar-policy),
details:where(.solemar-policy) {
	box-sizing: border-box;
	inline-size: 100%;
	margin-block: 1em;
	padding: 0.75em 1em;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 0.375em;
	font-size: 0.875em;
	line-height: 1.6;
	text-align: start;
}

:where(.solemar-policy-title) {
	font-weight: 600;
}

:where(.solemar-policy.is-full) > :where(.solemar-policy-title) {
	margin-block-end: 0.25em;
}

/* Expandable and popup: the title is the control, with a mark at its end. */
details:where(.solemar-policy) > summary,
div:where(.solemar-policy) > button {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
	inline-size: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	letter-spacing: inherit;
	text-align: start;
	text-transform: none;
	cursor: pointer;
	list-style: none;
}

details:where(.solemar-policy) > summary::-webkit-details-marker {
	display: none;
}

details:where(.solemar-policy) > summary::after {
	content: "+";
}

details:where(.solemar-policy)[open] > summary {
	margin-block-end: 0.5em;
}

details:where(.solemar-policy)[open] > summary::after {
	content: "\2212";
}

/* Mirrored automatically in right-to-left text. */
div:where(.solemar-policy) > button::after {
	content: "\203A";
	font-size: 1.25em;
	line-height: 1;
}

:where(.solemar-policy-text) > :not(:first-child) {
	margin-block-start: 0.5em;
}

.solemar-policy-text ul {
	list-style: disc;
	padding-inline-start: 1.25em;
}

.solemar-policy-text ol {
	list-style: decimal;
	padding-inline-start: 1.25em;
}

/* Above "Place order", which some themes keep fixed to the bottom of small screens. */
:where(.solemar-policy.is-review) > :where(.solemar-policy-text) {
	max-block-size: 7em;
	overflow: auto;
}

dialog.solemar-policy-dialog {
	box-sizing: border-box;
	inline-size: min(32rem, calc(100vw - 2rem));
	max-block-size: min(40rem, calc(100vh - 2rem));
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 0.5em;
	overflow: auto;
	line-height: 1.6;
	text-align: start;
}

dialog.solemar-policy-dialog::backdrop {
	background: rgb(0 0 0 / 0.5);
}

/* The padding sits here, so a click on the dialog itself means the backdrop. */
:where(.solemar-policy-body) {
	padding: 1.25em;
}

:where(.solemar-policy-head) {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1em;
	margin-block-end: 0.75em;
}

dialog.solemar-policy-dialog button.solemar-policy-close {
	padding: 0 0.25em;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
}
