/**
 * AI Content Transparency - frontend styles.
 *
 * Intentionally minimal: themes are expected to override/extend this
 * using the configurable CSS class (default: wc-ai-content-notice).
 */
.wc-ai-content-notice {
	margin: 0 0 1.5em;
	color: #3c434a;
	font-size: 0.9em;
	line-height: 1.5;
}

/**
 * Image badge: an AI icon overlaid on the product gallery that reveals
 * the AI transparency message on hover, click/tap, or keyboard focus.
 *
 * No background or outline by design: the icon is filled white and
 * rendered with mix-blend-mode: difference, so it blends directly with
 * the photo beneath it and automatically appears white over dark areas
 * and black over light areas, without any per-image analysis.
 */
.wcaict-image-badge-wrap {
	position: relative;
}

/**
 * Used only by the JS fallback, which wraps a bare <img> (not its
 * parent link/container). inline-block + line-height:0 makes the
 * wrapper shrink exactly to the image's own rendered box, instead of
 * stretching to fill a taller/wider parent.
 */
.wcaict-image-badge-wrap--fallback {
	display: inline-block;
	max-width: 100%;
	line-height: 0;
}

.wcaict-image-badge {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	mix-blend-mode: difference;
	cursor: pointer;
	appearance: none;
	outline: none;
}

/**
 * Themes often style every <button> with a background, border, min
 * size, padding, or line-height on :hover/:focus (sometimes via CSS
 * custom properties or !important), which wins over the plain rules
 * above because it targets those states/properties more specifically.
 * Force the overlay button to keep its own box and stay
 * background-free regardless of the theme's generic button styles.
 */
.wcaict-image-badge,
.wcaict-image-badge:hover,
.wcaict-image-badge:focus,
.wcaict-image-badge:focus-visible,
.wcaict-image-badge.is-active {
	width: 28px !important;
	height: 28px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 0 !important;
	background: none !important;
	background-color: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
}

.wcaict-image-badge-wrap--catalog .wcaict-image-badge,
.wcaict-image-badge-wrap--catalog .wcaict-image-badge:hover,
.wcaict-image-badge-wrap--catalog .wcaict-image-badge:focus,
.wcaict-image-badge-wrap--catalog .wcaict-image-badge:focus-visible,
.wcaict-image-badge-wrap--catalog .wcaict-image-badge.is-active {
	width: 20px !important;
	height: 20px !important;
}

.wcaict-image-badge svg {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	fill: currentColor;
}

.wcaict-image-badge-tooltip {
	position: absolute;
	top: calc(0.75em + 36px);
	right: 0.75em;
	z-index: 3;
	display: none;
	max-width: 240px;
	margin: 0;
	padding: 0.6em 0.85em;
	border-radius: 4px;
	background: #1d2327;
	color: #fff;
	font-size: 0.8em;
	line-height: 1.4;
	text-align: left;
}

.wcaict-image-badge:hover + .wcaict-image-badge-tooltip,
.wcaict-image-badge:focus + .wcaict-image-badge-tooltip,
.wcaict-image-badge.is-active + .wcaict-image-badge-tooltip {
	display: block;
}

.rtl .wcaict-image-badge,
.rtl .wcaict-image-badge-tooltip {
	right: auto;
	left: 0.75em;
}

/**
 * Catalog/related-product thumbnails: always bottom-left, regardless
 * of text direction or pointer type.
 */
.wcaict-image-badge-wrap--catalog .wcaict-image-badge {
	top: auto;
	right: auto;
	bottom: 10px;
	left: 10px;
}

.wcaict-image-badge-wrap--catalog .wcaict-image-badge-tooltip {
	top: auto;
	right: auto;
	bottom: 38px;
	left: 10px;
}

/**
 * On desktop (a real mouse/trackpad, not a touchscreen), nudge the
 * single product page badge further from the image edge so it
 * doesn't crowd the corner. Catalog thumbnails keep their fixed
 * bottom-left position at any pointer type.
 */
@media (hover: hover) and (pointer: fine) {
	.wcaict-image-badge {
		top: 1.75em;
		right: 2.75em;
	}

	.wcaict-image-badge-tooltip {
		top: calc(1.75em + 36px);
		right: 2.75em;
	}

	.rtl .wcaict-image-badge-wrap:not(.wcaict-image-badge-wrap--catalog) .wcaict-image-badge,
	.rtl .wcaict-image-badge-wrap:not(.wcaict-image-badge-wrap--catalog) .wcaict-image-badge-tooltip {
		right: auto;
		left: 2.75em;
	}
}
