/* Ampros Trophy Figure Browser v0.4.0 */

body.ampros-has-figure-browser .ampros-tfb-dropdown {
	position: relative;
	width: 100%;
	max-width: 326px;
	margin: 0;
	box-sizing: border-box;
}

body.ampros-has-figure-browser .ampros-tfb-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	height: 37px;
	min-height: 37px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #fff;
	color: #777;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 37px;
	text-align: left;
	text-transform: none;
	box-shadow: none;
	box-sizing: border-box;
}

body.ampros-has-figure-browser .ampros-tfb-toggle:hover,
body.ampros-has-figure-browser .ampros-tfb-toggle:focus {
	border-color: #bbb;
	background: #fff;
	color: #777;
	outline: none;
	box-shadow: none;
}

body.ampros-has-figure-browser .ampros-tfb-toggle-text {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.ampros-has-figure-browser .ampros-tfb-toggle-icon {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-right: 1px solid #777;
	border-bottom: 1px solid #777;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

body.ampros-has-figure-browser .ampros-tfb-dropdown.is-open .ampros-tfb-toggle-icon {
	margin-top: 4px;
	transform: rotate(225deg);
}

body.ampros-has-figure-browser .ampros-tfb-menu {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 3px);
	left: 0;
	width: 100%;
	max-width: 326px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #fff;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
	box-sizing: border-box;
	display: none;
}

body.ampros-has-figure-browser .ampros-tfb-dropdown.is-open .ampros-tfb-menu {
	display: block;
}

body.ampros-has-figure-browser .ampros-tfb-picker {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	max-height: 350px;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0 4px 0 0;
	margin: 0;
	scrollbar-width: thin;
}

body.ampros-has-figure-browser .ampros-tfb-picker select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper {
	float: none !important;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 5px;
	min-width: 0;
	min-height: 106px;
	margin: 0 !important;
	padding: 7px 5px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: #fff;
	box-sizing: border-box;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.12s ease, opacity 0.12s ease;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper:hover,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper:focus {
	border-color: #B61A20;
	outline: none;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper.selected {
	border: 2px solid #B61A20 !important;
	padding: 6px 4px;
	box-shadow: none;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper.disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Reset inherited plugin/theme swatch framing. */
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor:hover,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor:focus,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor:active {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	height: 70px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
	text-indent: 0 !important;
	box-sizing: border-box;
	box-shadow: none !important;
	outline: none !important;
	text-decoration: none !important;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor::before,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor::after,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper::before,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper::after {
	display: none !important;
	content: none !important;
	border: 0 !important;
	box-shadow: none !important;
}

body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper img.swatch-img,
body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper img.wp-post-image {
	display: block;
	width: auto !important;
	max-width: 72px !important;
	height: auto !important;
	max-height: 70px !important;
	margin: 0 auto !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	object-fit: contain;
}

body.ampros-has-figure-browser .ampros-tfb-label {
	display: block;
	width: 100%;
	margin-top: 2px;
	padding-top: 0;
	border-top: 0;
	font-size: 12px;
	line-height: 1.15;
	color: #000;
	text-align: center;
	overflow-wrap: anywhere;
}

@media (max-width: 767px) {
	body.ampros-has-figure-browser .ampros-tfb-dropdown,
	body.ampros-has-figure-browser .ampros-tfb-menu {
		max-width: 100%;
	}

	body.ampros-has-figure-browser .ampros-tfb-menu {
		position: static;
		margin-top: 4px;
		box-shadow: none;
	}

	body.ampros-has-figure-browser .ampros-tfb-picker {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: 342px;
		gap: 8px;
	}

	body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper {
		min-height: 102px;
	}

	body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper .swatch-anchor {
		height: 64px !important;
	}

	body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper img.swatch-img,
	body.ampros-has-figure-browser .ampros-tfb-picker .select-option.swatch-wrapper img.wp-post-image {
		max-width: 66px !important;
		max-height: 64px !important;
	}

	body.ampros-has-figure-browser .ampros-tfb-label {
		font-size: 11px;
	}
}
