/*
 * OutdoorCabins addon choices: structural defaults so they work in any theme.
 * The OutdoorCabins theme adds the brand look in assets/css/theme.css.
 */

.oc-addons {
	flex: 1 1 100%;
	display: grid;
	gap: 1.25rem;
	margin: 0 0 1rem;
}

.oc-addons__group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.oc-addons__legend {
	margin-bottom: 0.4rem;
	padding: 0;
	font-weight: 600;
}

.oc-addons__required {
	font-size: 0.875em;
	font-weight: 400;
}

.oc-addons__description {
	margin: 0 0 0.5rem;
	font-size: 0.875em;
}

.oc-addons__options {
	display: grid;
	gap: 0.4rem;
}

.oc-addons__option {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 0.15rem 0.6rem;
	align-items: baseline;
	padding: 0.55rem 0.75rem;
	border: 1px solid rgb(0 0 0 / 25%);
	border-radius: 6px;
	cursor: pointer;
}

.oc-addons__option input {
	margin: 0;
}

.oc-addons__option-description {
	grid-column: 2 / -1;
	font-size: 0.875em;
}

.oc-addons__price {
	white-space: nowrap;
	font-weight: 600;
}

.oc-addons__heading {
	margin: 0;
	font-weight: 700;
}

.oc-addons__group--select {
	display: grid;
	gap: 0.4rem;
}

.oc-addons__group--select .oc-addons__legend,
.oc-addons__group--select .oc-addons__description {
	margin: 0;
}

.oc-addons__select {
	width: 100%;
	max-width: 100%;
}

/* The info box under a select: picture of the chosen option, the group's text, the option's conditions. */
.oc-addons__info {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 0.6rem 0.75rem;
	border: 1px solid rgb(0 0 0 / 15%);
	border-radius: 6px;
	font-size: 0.875em;
}

.oc-addons__info[hidden],
.oc-addons__figure[hidden],
.oc-addons__option-description[hidden] {
	display: none;
}

.oc-addons__figure {
	flex: none;
	margin: 0;
}

.oc-addons__image {
	display: block;
	width: 6rem;
	height: 4.5rem;
	object-fit: cover;
	border-radius: 4px;
}

.oc-addons__info-body {
	flex: 1 1 auto;
	min-width: 0;
}

/* A chosen option with a picture and no condition: the picture alone, without an empty text column. */
.oc-addons__info-body:not(:has(.oc-addons__option-description:not([hidden]))) {
	display: none;
}

.oc-addons__info-body > * + * {
	margin-top: 0.35rem;
}

.oc-addons__thumb {
	width: 3rem;
	height: 2.25rem;
	margin-right: 0.5rem;
	vertical-align: middle;
	object-fit: cover;
	border-radius: 4px;
}

.oc-addons__notes {
	margin: 0;
	padding: 0;
	list-style: none;
}

.oc-addons__notes .oc-addons__option-description {
	font-size: inherit;
}

.oc-addons__summary {
	margin: 0;
	font-weight: 600;
}

/*
 * A short single choice as buttons (radio inputs in labels). Rows (the default): one full-width option per line,
 * the price or «Standard» at its end, so long names and conditions read as a list. Tiles (every name short, no
 * lines under them): side by side, the price under the name. The radio sits on the name's first line.
 */
.oc-addons__choices {
	display: grid;
	gap: 0.5rem;
}

.oc-addons__choices--tiles {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.75rem), 1fr));
}

.oc-addons__choice {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 0.15rem 0.7rem;
	align-items: start;
	min-height: 2.75rem;
	padding: 0.65rem 0.85rem;
	border: 1px solid rgb(0 0 0 / 25%);
	border-radius: 6px;
	cursor: pointer;
}

/* Rows of a group with pictures (always rows): the picture between the radio and the name, centred with them;
   an option without a picture keeps the column empty. */
.oc-addons__choice--image {
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
}

.oc-addons__choice .oc-addons__choice-image--empty {
	height: 0;
	border-color: transparent;
}

.oc-addons__choices--tiles .oc-addons__choice {
	grid-template-columns: auto minmax(0, 1fr);
}

.oc-addons__choice input {
	margin: 0.2em 0 0;
}

.oc-addons__choice > .oc-addons__price,
.oc-addons__choice > .oc-addons__badge {
	justify-self: end;
	text-align: end;
}

/* The condition under a row takes the whole width under the name and the price. */
.oc-addons__choice > .oc-addons__option-description {
	grid-column: 2 / -1;
}

.oc-addons__choice--image > .oc-addons__option-description {
	grid-column: 3 / -1;
}

.oc-addons__choices--tiles .oc-addons__choice > .oc-addons__price,
.oc-addons__choices--tiles .oc-addons__choice > .oc-addons__badge {
	grid-column: -2;
	justify-self: start;
}

.oc-addons__choice-image {
	flex: none;
	width: 3.5rem;
	height: 2.625rem;
	object-fit: cover;
	border-radius: 4px;
}

.oc-addons__choice-body {
	display: grid;
	gap: 0.1rem;
	min-width: 0;
}

/* Words wrap whole (hyphenated where the browser knows Norwegian), never cut at any letter. */
.oc-addons__choice .oc-addons__name {
	font-weight: 500;
	overflow-wrap: break-word;
	hyphens: auto;
}

.oc-addons__choice .oc-addons__option-description {
	font-size: 0.8125em;
	line-height: 1.4;
}

.oc-addons__badge {
	padding: 0 0.45rem;
	border-radius: 999px;
	background: rgb(0 0 0 / 6%);
	font-size: 0.75em;
}

/* The explanation: short text always visible, the longer text and picture behind «Les mer». */
.oc-addons__explain {
	display: grid;
	gap: 0.35rem;
}

.oc-addons__explain > * {
	margin: 0;
}

.oc-addons__group--buttons .oc-addons__explain,
.oc-addons__group--checkbox .oc-addons__explain {
	margin-bottom: 0.6rem;
}

.oc-addons__more summary {
	width: fit-content;
	font-size: 0.875em;
	font-weight: 600;
	cursor: pointer;
}

.oc-addons__more-body {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
	font-size: 0.875em;
}

.oc-addons__more-image {
	flex: 0 0 auto;
	width: min(100%, 12rem);
	height: auto;
	border-radius: 4px;
}

.oc-addons__more-text {
	flex: 1 1 14rem;
	min-width: 0;
}

.oc-addons__more-text p {
	margin: 0 0 0.5em;
}

.oc-addons__draft {
	justify-self: start;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: rgb(255 196 0 / 25%);
	font-size: 0.75em;
	font-weight: 600;
}
