/* PDF Bundle Options – front end (same look as the switcher's former bundle selector).
   Colors: --pdfbo-accent / --pdfbo-accent-deep, set by the settings or the switcher;
   the old defaults are the fallbacks. */

/* fail-safe (also printed inline with every block): the block shows when front.js
   marked it ready, and only a ready block hides the native form right after it;
   html.pdfbo-wait hides the native forms during start-up (no flash) */
.pdfbo {
	display: none
}

.pdfbo.is-ready {
	display: block
}

.pdfbo-wait .pdfbo-native,
.pdfbo.is-ready + .pdfbo-native {
	display: none
}

.pdfbo {
	--pdfbo-ink: #3a3a3a;
	--pdfbo-muted: #8a8a8a;
	--pdfbo-bg: #f6faf8;
	--pdfbo-radius: 14px;
	margin: 0 0 20px;
	color: var(--pdfbo-ink)
}

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

.pdfbo__head {
	margin: 0 0 4px
}

.pdfbo__sub {
	margin: 0 0 16px;
	color: var(--pdfbo-muted)
}

.pdfbo__opts {
	display: grid;
	gap: 18px
}

/* ---- option card ---- */
.pdfbo-opt {
	position: relative;
	border: 2px solid #e4e4e4;
	border-radius: var(--pdfbo-radius);
	background: #fff;
	transition: border-color .15s, box-shadow .15s
}

.pdfbo-opt:hover {
	border-color: var(--pdfbo-accent, #a8d8c9)
}

.pdfbo-opt.is-selected {
	border-color: var(--pdfbo-accent-deep, #2e7d67);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .06)
}

.pdfbo-opt.is-soldout,
.pdfbo-opt.is-soldout:hover {
	border-color: #e4e4e4
}

.pdfbo-opt.is-soldout .pdfbo-opt__btn {
	cursor: not-allowed
}

/* faded, except the sold-out note (keeps its contrast) */
.pdfbo-opt.is-soldout .pdfbo-opt__radio,
.pdfbo-opt.is-soldout .pdfbo-opt__imgs,
.pdfbo-opt.is-soldout .pdfbo-opt__title,
.pdfbo-opt.is-soldout .pdfbo-opt__desc,
.pdfbo-opt.is-soldout .pdfbo-opt__price {
	opacity: .55
}

/* real button (type=button) – protected against theme button styles */
.pdfbo-opt__btn {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr);
	align-items: center;
	gap: 4px 14px;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 14px 16px !important;
	border: 0 !important;
	border-radius: inherit;
	background: none !important;
	box-shadow: none !important;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: var(--pdfbo-ink) !important;
	cursor: pointer
}

.pdfbo-opt__btn:focus-visible {
	outline: 2px solid var(--pdfbo-accent-deep, #2e7d67);
	outline-offset: 2px
}

.pdfbo-opt__radio {
	position: relative;
	width: 20px;
	height: 20px;
	border: 2px solid #c9c9c9;
	border-radius: 50%
}

.pdfbo-opt.is-selected .pdfbo-opt__radio {
	border-color: var(--pdfbo-accent-deep, #2e7d67)
}

.pdfbo-opt.is-selected .pdfbo-opt__radio::after {
	content: '';
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--pdfbo-accent-deep, #2e7d67)
}

/* the image column is always one image wide – the text starts in line on every card */
.pdfbo-opt__imgs {
	display: flex;
	flex-direction: column
}

.pdfbo-opt__img {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: 10px;
	background-color: var(--pdfbo-bg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	/* white frame + soft shadow: stacked images stay apart on the white card */
	box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, .14)
}

/* several products: images under each other, overlapping */
.pdfbo-opt__img+.pdfbo-opt__img {
	margin-top: -16px
}

.pdfbo-opt__title {
	display: block;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere
}

.pdfbo-opt__desc,
.pdfbo-opt__soldout {
	display: block;
	margin-top: 3px;
	font-size: .88em;
	line-height: 1.4
}

.pdfbo-opt__soldout {
	font-weight: 600;
	color: #b23b3b
}

/* price always under title / description; radio and images span two rows */
/* regular + sale price may wrap, a single amount never breaks */
.pdfbo-opt__price {
	grid-column: 3;
	font-weight: 700
}

.pdfbo-opt__price .amount {
	white-space: nowrap
}

/* the card's text color instead of the theme's .amount color */
.pdfbo-opt__price,
.pdfbo-opt__price .amount,
.pdfbo-opt__price bdi {
	color: var(--pdfbo-ink) !important
}

.pdfbo-opt__price ins {
	text-decoration: none;
	background: none
}

.pdfbo-opt__radio,
.pdfbo-opt__imgs {
	grid-row: span 2
}

.pdfbo-opt__price del,
.pdfbo-opt__price del .amount,
.pdfbo-opt__price del bdi {
	color: var(--pdfbo-muted) !important;
	font-weight: 400
}

.pdfbo-opt__price del {
	margin-right: 5px
}

/* the badge sits on the card's top border */
.pdfbo-opt__badge {
	position: absolute;
	top: 0;
	right: 16px;
	z-index: 1;
	transform: translateY(-50%);
	padding: 3px 10px;
	border-radius: 8px;
	background: var(--pdfbo-accent-deep, #2e7d67);
	color: #fff;
	font-size: .78em;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	pointer-events: none
}

/* ---- items of the selected option ---- */
.pdfbo-opt__items {
	display: grid;
	gap: 10px;
	padding: 0 16px 14px
}

.pdfbo-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-top: 10px;
	border-top: 1px solid #eee
}

.pdfbo-item__img {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background-color: var(--pdfbo-bg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat
}

.pdfbo-item__body {
	flex: 1 1 auto;
	min-width: 0
}

.pdfbo-item__name {
	display: block;
	font-size: .92em;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere
}

/* name of a bundled product = link to its own page (opens in a new tab) */
.pdfbo-item__link,
.pdfbo-item__link:visited {
	color: inherit !important;
	font-weight: inherit;
	text-decoration: none !important;
	cursor: pointer
}

.pdfbo-item__link:hover,
.pdfbo-item__link:focus-visible {
	color: var(--pdfbo-accent-deep, #2e7d67) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px
}

.pdfbo-item__link:focus-visible {
	outline: 2px solid var(--pdfbo-accent-deep, #2e7d67);
	outline-offset: 2px;
	border-radius: 3px
}

.pdfbo-item__linkicon {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-left: 6px;
	vertical-align: -3px;
	color: var(--pdfbo-accent-deep, #2e7d67)
}

/* text for screen readers only */
.pdfbo-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap
}

.pdfbo-item__attrs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 8px
}

.pdfbo-attr {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 140px;
	flex: 1 1 140px;
	margin: 0;
	font-size: .85em
}

.pdfbo-attr__label {
	font-weight: 600
}

.pdfbo-attr__select {
	width: 100%;
	max-width: 100%;
	margin: 0
}

.pdfbo-attr__select.is-missing {
	border-color: #b23b3b !important;
	outline: 1px solid #b23b3b
}

.pdfbo-opt__hint {
	margin: 0;
	font-size: .85em;
	color: var(--pdfbo-muted)
}

/* candidate picker of an extra "self" slot */
.pdfbo-opt__pick {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin-top: 8px
}

.pdfbo-opt__picklabel {
	font-size: .88em;
	font-weight: 600
}

.pdfbo-opt__picks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px
}

.pdfbo-pick {
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 !important;
	border: 2px solid #e4e4e4 !important;
	border-radius: 10px;
	background-color: var(--pdfbo-bg) !important;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	cursor: pointer
}

.pdfbo-pick.is-selected {
	border-color: var(--pdfbo-accent-deep, #2e7d67) !important
}

.pdfbo-pick:disabled {
	opacity: .4;
	cursor: not-allowed
}

.pdfbo-pick:focus-visible {
	outline: 2px solid var(--pdfbo-accent-deep, #2e7d67);
	outline-offset: 2px
}

/* ---- button + feedback (full width, below the options) ---- */
.pdfbo .pdfbo-add.button {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 18px 0 0;
	font-weight: 700 !important;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .10);
	transition: transform .15s ease, box-shadow .15s ease
}

.pdfbo .pdfbo-add.button:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .14)
}

.pdfbo .pdfbo-add.button:disabled {
	opacity: .55;
	cursor: not-allowed
}

.pdfbo-feedback {
	margin-top: 10px;
	font-size: .9em;
	line-height: 1.4;
	text-align: center
}

.pdfbo-feedback:empty {
	display: none
}

.pdfbo-feedback.is-ok {
	color: var(--pdfbo-accent-deep, #2e7d67);
	font-weight: 600
}

.pdfbo-feedback.is-err {
	color: #b23b3b
}

.pdfbo-feedback__link {
	margin-left: 10px;
	color: inherit;
	text-decoration: underline
}

/* WooCommerce would add its own "view cart" link next to the button –
   it is in the feedback instead */
.pdfbo .added_to_cart.wc-forward {
	display: none !important
}

/* mobile: compact, the description only on the selected card */
@media (max-width:600px) {
	.pdfbo-opt__btn {
		column-gap: 10px;
		padding: 12px !important
	}

	.pdfbo-opt__img {
		width: 52px;
		height: 52px
	}

	.pdfbo-opt__img+.pdfbo-opt__img {
		margin-top: -14px
	}

	.pdfbo-opt:not(.is-selected) .pdfbo-opt__desc {
		display: none
	}

	.pdfbo-opt__items {
		padding: 0 12px 12px
	}
}
