/* Better Product Options – front end */
.bpo-options { width: 100%; margin: 0 0 1.25em; }
.bpo-section { margin-bottom: 1em; }
.bpo-section[hidden], .bpo-field[hidden], .bpo-summary[hidden], .bpo-summary-row[hidden] { display: none !important; }
.bpo-section-title { margin: 0 0 .25em; }
.bpo-section-subtitle { margin: 0 0 .75em; font-size: .9em; }

.bpo-fields { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.bpo-field { flex: 1 1 100%; min-width: 0; }
.bpo-w-half { flex: 1 1 calc(50% - 8px); }
.bpo-w-third { flex: 1 1 calc(33.333% - 11px); }

.bpo-label { display: block; font-weight: 600; margin-bottom: 4px; }
.bpo-label .required, .bpo-choice-text .required { color: #e2401c; text-decoration: none; border: 0; }
.bpo-price-hint { font-weight: 400; opacity: .75; font-size: .9em; white-space: nowrap; }
.bpo-description, .bpo-file-help { display: block; font-size: .85em; opacity: .8; margin-top: 4px; }
.bpo-heading { margin: .5em 0 .25em; }

.bpo-field input.bpo-input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
.bpo-field select.bpo-input,
.bpo-field textarea.bpo-input { width: 100%; box-sizing: border-box; }
.bpo-field input[type=color] { width: 56px; height: 36px; padding: 2px; cursor: pointer; }

.bpo-range { display: flex; align-items: center; gap: 10px; }
.bpo-range input { flex: 1; }
.bpo-range-value { min-width: 3ch; text-align: right; font-weight: 600; }

.bpo-choices { display: flex; flex-direction: column; gap: 6px; }
.bpo-choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; margin: 0; }
.bpo-choice input { margin: 0; }

/* Swatches */
.bpo-choices--image_swatch, .bpo-choices--color_swatch { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.bpo-choices--image_swatch .bpo-choice, .bpo-choices--color_swatch .bpo-choice {
	flex-direction: column; text-align: center; gap: 4px; position: relative;
}
.bpo-choices--image_swatch input, .bpo-choices--color_swatch input {
	position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.bpo-swatch {
	display: block; border: 2px solid rgba(0,0,0,.12); border-radius: 6px; overflow: hidden;
	transition: border-color .15s, box-shadow .15s;
}
.bpo-swatch--image { width: 72px; height: 72px; }
.bpo-swatch--image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bpo-swatch--color { width: 36px; height: 36px; border-radius: 50%; }
.bpo-choice input:checked + .bpo-swatch { border-color: currentColor; box-shadow: 0 0 0 2px rgba(0,0,0,.08); }
.bpo-choice input:focus-visible + .bpo-swatch { outline: 2px solid currentColor; outline-offset: 2px; }
.bpo-choices--image_swatch .bpo-choice-text, .bpo-choices--color_swatch .bpo-choice-text { font-size: .85em; max-width: 90px; }

/* Summary */
.bpo-summary { margin-top: 1em; padding: .75em 1em; border: 1px solid rgba(0,0,0,.1); border-radius: 6px; background: rgba(0,0,0,.02); }
.bpo-summary-row { display: flex; justify-content: space-between; gap: 1em; padding: 2px 0; }
.bpo-summary-total { border-top: 1px solid rgba(0,0,0,.1); margin-top: 4px; padding-top: 6px; font-size: 1.05em; }

/* Label left of the field */
.bpo-label-left {
	display: grid; grid-template-columns: minmax(100px, 30%) 1fr;
	column-gap: 12px; row-gap: 2px; align-items: center;
}
.bpo-label-left > .bpo-label { grid-column: 1; margin: 0; }
.bpo-label-left > :not(.bpo-label) { grid-column: 2; }
.bpo-label-left > .bpo-description, .bpo-label-left > .bpo-file-help { margin-top: 0; }

@media (max-width: 600px) {
	.bpo-w-half, .bpo-w-third { flex-basis: 100%; }
	.bpo-label-left { display: block; }
	.bpo-label-left > .bpo-label { margin-bottom: 4px; }
}
