/*
 * Attribute dropdowns (tentrend_render_product_attribute_control): a custom
 * panel instead of the native select list, so it can be styled. Single choice
 * opens a listbox; extra's and opties open a checklist so several can be chosen.
 * Shared by the product page and the homepage featured product; both wrap the
 * fields in .tt-featured-content. assets/js/attribute-dropdown.js drives it.
 */
.tt-featured-content .tt-dropdown {
	position: relative;
	grid-column: 2;
	width: min(100%, 240px);
}

.tt-featured-content .tt-dropdown__toggle,
.tt-featured-content .tt-dropdown__toggle:hover,
.tt-featured-content .tt-dropdown__toggle:focus {
	display: block;
	width: 100%;
	min-height: 42px;
	margin: 0;
	border: 0;
	border-radius: 6px;
	font-family: "TT Chocolates", sans-serif;
	font-size: 0.875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 500;
	line-height: 1.2;
	text-align: left;
	padding: 6px 30px 6px 6px;
	background-color: #ebe4d7;
	color: #1e160f;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 7l6 6 6-6' stroke='%233f3328' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 20px 20px;
	background-position: right 2px center;
	cursor: pointer;
}

.tt-featured-content .tt-dropdown.is-open .tt-dropdown__toggle {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 13l6-6 6 6' stroke='%233f3328' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tt-featured-content .tt-dropdown__toggle:focus-visible {
	outline: 2px solid var(--tt-gold, #997a38);
	outline-offset: 2px;
}

.tt-featured-content .tt-dropdown__value {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tt-featured-content .tt-dropdown__panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 6px);
	left: 0;
	box-sizing: border-box;
	min-width: 100%;
	width: max-content;
	max-width: min(320px, calc(100vw - (var(--tt-content-gutter, 28px) * 2) - 56px));
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #f6f1ed;
	border: 1px solid rgba(166, 157, 147, 0.45);
	border-radius: 6px;
	box-shadow: 0 14px 32px rgba(44, 28, 14, 0.12);
}

.tt-featured-content .tt-dropdown__panel[hidden] {
	display: none;
}

.tt-featured-content .tt-dropdown__option {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 9px 10px;
	border-radius: 4px;
	font-family: "TT Chocolates", sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	color: #1e160f;
	cursor: pointer;
	transition: background-color 160ms ease;
}

.tt-featured-content .tt-dropdown__option:hover,
.tt-featured-content .tt-dropdown__option[role="option"]:focus {
	background-color: #ebe4d7;
	outline: none;
}

.tt-featured-content .tt-dropdown__option[role="option"]:focus-visible {
	outline: 2px solid var(--tt-gold, #997a38);
	outline-offset: -2px;
}

/* Single choice: the current option in gold with a check on the right. */
.tt-featured-content .tt-dropdown__option[aria-selected="true"] {
	padding-right: 34px;
	color: var(--tt-gold, #997a38);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' stroke='%23997a38' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 12px 12px;
	background-position: right 12px center;
}

.tt-featured-content .tt-dropdown__option input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--tt-stone, #a69d93);
	border-radius: 3px;
	background: #fff no-repeat center / 12px 12px;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease;
}

.tt-featured-content .tt-dropdown__option input[type="checkbox"]:checked {
	background-color: var(--tt-gold, #997a38);
	border-color: var(--tt-gold, #997a38);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tt-featured-content .tt-dropdown__option input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--tt-gold, #997a38);
	outline-offset: 2px;
}
