/**
 * Care / washing instruction symbols (caresym webfont).
 * Font file: assets/fonts/caresym-webfont.woff2 (served from this plugin).
 */

@font-face {
	font-family: care_symbols;
	src: url(../fonts/caresym-webfont.woff2) format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/*
 * OceanWP / WooCommerce tabs and tables often clip absolute children.
 * Tooltips must escape those boxes.
 */
.woocommerce div.product .woocommerce-tabs .panel,
.woocommerce-Tabs-panel,
.woocommerce-product-attributes,
.woocommerce-product-attributes tbody,
.woocommerce-product-attributes tr,
.woocommerce-product-attributes-item__value {
	overflow: visible !important;
}

.woocommerce-product-attributes-item__value .bess-care-symbols {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	position: relative;
	z-index: 1;
	overflow: visible !important;
	/* Fixed px — rem/em shrink under OceanWP table / root sizing. */
	font-family: care_symbols, "Times New Roman", Times, Georgia, "DejaVu Serif", serif !important;
	font-size: 22px !important;
	font-weight: 400 !important;
	font-style: normal !important;
	line-height: 1.2 !important;
	letter-spacing: 1px;
}

.woocommerce-product-attributes-item__value .bess-care-symbol {
	position: relative;
	display: inline-block;
	font-family: care_symbols, "Times New Roman", Times, Georgia, "DejaVu Serif", serif !important;
	font-size: 22px !important;
	font-weight: 400 !important;
	font-style: normal !important;
	line-height: 1 !important;
	letter-spacing: 1px;
}

.bess-care-symbol--has-tooltip {
	cursor: help;
	outline: none;
}

/*
 * Tooltip below the icon (washing row is often last in the table;
 * "above" gets clipped by the tabs panel / previous rows).
 */
.bess-care-symbol--has-tooltip[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	left: 50%;
	top: calc(100% + 8px);
	bottom: auto;
	transform: translateX(-50%) translateY(-2px);
	z-index: 10000;
	box-sizing: border-box;
	width: max-content;
	max-width: min(280px, 80vw);
	padding: 8px 12px;
	border-radius: 4px;
	background: #1a1a1a;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	font-style: normal !important;
	line-height: 1.4 !important;
	letter-spacing: 0 !important;
	text-align: center;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.bess-care-symbol--has-tooltip[data-tooltip]::before {
	content: "";
	position: absolute;
	left: 50%;
	top: calc(100% + 2px);
	bottom: auto;
	transform: translateX(-50%);
	z-index: 10000;
	border: 6px solid transparent;
	border-bottom-color: #1a1a1a;
	border-top-color: transparent;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease, visibility 0.12s ease;
}

.bess-care-symbol--has-tooltip:hover::after,
.bess-care-symbol--has-tooltip:hover::before,
.bess-care-symbol--has-tooltip:focus::after,
.bess-care-symbol--has-tooltip:focus::before,
.bess-care-symbol--has-tooltip:focus-visible::after,
.bess-care-symbol--has-tooltip:focus-visible::before {
	opacity: 1;
	visibility: visible;
}

.bess-care-symbol--has-tooltip:hover::after,
.bess-care-symbol--has-tooltip:focus::after,
.bess-care-symbol--has-tooltip:focus-visible::after {
	transform: translateX(-50%) translateY(0);
}
