/**
 * Add-on Products - product page.
 * Logical properties keep the layout correct in both LTR and RTL.
 */

.wcd-addons {
	width: 100%;
	margin: 0.75em 0 1.25em;
}

.wcd-addons-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wcd-addon {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0.5em 0;
	padding: 0;
}

.wcd-addon-checkbox {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0.2em 0 0;
}

/* Block wrapper so the label text and the tooltip icon share one text flow. */
.wcd-addon-text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1.1em;
	line-height: 1.5;
    margin: -5px 0 0;
}

.wcd-addon-label {
	display: inline;
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: 400;
	line-height: inherit;
	cursor: pointer;
}

/* ---------- tooltip ---------- */

.wcd-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-inline-start: 10px;
	color: #000;
	cursor: help;
	line-height: 0;
}

.wcd-tip:focus {
	outline: 1px dotted currentColor;
	outline-offset: 2px;
}

.wcd-tip-icon {
	display: inline-flex;
	color: inherit;
}

.wcd-tip-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.wcd-tip-content {
	position: absolute;
	bottom: calc(100% + 10px);
	inset-inline-start: 50%;
	transform: translateX(-50%);
	z-index: 99;
	display: none;
	width: max-content;
	max-width: min(280px, 80vw);
	padding: 0.85em 1em;
	background: #fff;
	color: #333;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
	font-size: 0.9rem;
	line-height: 1.5;
	text-align: start;
	white-space: normal;
	cursor: auto;
}

/* translateX is direction agnostic, so RTL needs the mirrored offset. */
[dir="rtl"] .wcd-tip-content,
.rtl .wcd-tip-content {
	transform: translateX(50%);
}

.wcd-tip:hover .wcd-tip-content,
.wcd-tip:focus .wcd-tip-content,
.wcd-tip.is-open .wcd-tip-content {
	display: block;
}

.wcd-tip-content::after {
	content: "";
	position: absolute;
	top: 100%;
	inset-inline-start: 50%;
	margin-inline-start: -6px;
	border: 6px solid transparent;
	border-top-color: #fff;
}

.wcd-tip-content .wcd-tip-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 0.6em;
	border-radius: 6px;
}

.wcd-tip-content .wcd-tip-text p:last-child {
	margin-bottom: 0;
}

/* Viewport edge corrections applied by frontend.js. */
.wcd-tip-content.wcd-tip-flip-start {
	inset-inline-start: 0;
	transform: none;
}

.wcd-tip-content.wcd-tip-flip-end {
	inset-inline-start: auto;
	inset-inline-end: 0;
	transform: none;
}

.wcd-tip-content.wcd-tip-flip-start::after,
.wcd-tip-content.wcd-tip-flip-end::after {
	inset-inline-start: auto;
	inset-inline-end: 12px;
	margin-inline-start: 0;
}

/* ---------- cart ---------- */

.woocommerce-cart tr.wcd-addon-line td.product-remove {
	pointer-events: none;
}
