/* Nutrient tags — bottom-left on image + tooltips */

.op-product-thumb {
	position: relative;
	display: block;
	width: 100%;
	overflow: visible;
	line-height: 0;
	z-index: 2;
	border-radius: 12px 12px 0 0;
}

.op-product-thumb__clip {
	display: block;
	width: 100%;
	overflow: hidden;
	line-height: 0;
	border-radius: 12px 12px 0 0;
}

.op-product-thumb img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0 !important;
	border-radius: 0;
}

.op-vit-badges {
	position: absolute;
	left: 10px;
	bottom: 10px;
	right: auto;
	top: auto;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 5px;
	margin: 0;
	padding: 0;
	max-width: calc(100% - 20px);
	pointer-events: none;
	line-height: 1.2;
	overflow: visible;
}

.op-vit-badge {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 20px;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid rgba(0, 0, 0, 0.1);
	color: #333333;
	font-family: var(--organela-font, 'Raleway', sans-serif);
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: none !important;
	pointer-events: auto;
	cursor: help;
	z-index: 1;
}

.op-vit-badge[class*="op-vit-badge--"] {
	background: rgba(255, 255, 255, 0.94);
	border-color: rgba(0, 0, 0, 0.1);
	color: #333333;
	box-shadow: none !important;
}

/* Floating body tooltip (JS) — never clipped by card overflow */
.op-vit-tip-portal {
	position: fixed;
	z-index: 2147483646;
	width: max-content;
	max-width: min(240px, calc(100vw - 24px));
	padding: 8px 10px;
	border-radius: 10px;
	background: #1a2418;
	color: #f3f6f2;
	font-family: var(--organela-font, 'Raleway', sans-serif);
	font-size: 0.7rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-align: left;
	white-space: normal;
	pointer-events: none;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.op-vit-tip-portal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.op-vit-tip-portal::after {
	content: '';
	position: absolute;
	left: var(--op-tip-arrow-x, 12px);
	top: 100%;
	border: 6px solid transparent;
	border-top-color: #1a2418;
}

.op-vit-tip-portal.is-below::after {
	top: auto;
	bottom: 100%;
	border-top-color: transparent;
	border-bottom-color: #1a2418;
}

/* Keep CSS tips for summary (no overflow clip) */
.op-vit-badge[data-tip]::after,
.op-vit-badge[data-tip]::before {
	display: none;
}

.op-vit-badges--summary .op-vit-badge[data-tip]::after {
	display: block;
	content: attr(data-tip);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 8px);
	z-index: 20;
	width: max-content;
	max-width: min(240px, 70vw);
	padding: 8px 10px;
	border-radius: 10px;
	background: #1a2418;
	color: #f3f6f2;
	font-size: 0.7rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
	pointer-events: none;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.op-vit-badges--summary .op-vit-badge[data-tip]::before {
	display: block;
	content: '';
	position: absolute;
	left: 50%;
	bottom: calc(100% + 2px);
	margin-left: -6px;
	border: 6px solid transparent;
	border-top-color: #1a2418;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s ease;
	pointer-events: none;
}

.op-vit-badges--summary .op-vit-badge[data-tip]:hover::after,
.op-vit-badges--summary .op-vit-badge[data-tip]:focus::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.op-vit-badges--summary .op-vit-badge[data-tip]:hover::before,
.op-vit-badges--summary .op-vit-badge[data-tip]:focus::before {
	opacity: 1;
	visibility: visible;
}

/* Summary block (single product) */
.op-vit-badges--summary {
	position: static;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: none;
	pointer-events: auto;
	overflow: visible;
}

.op-vit-badges--summary .op-vit-badge {
	background: #fff;
	min-height: 26px;
	padding: 4px 10px;
	font-size: 0.74rem;
}

ul.products li.product:has(.op-vit-badge:hover),
ul.products li.product:has(.op-vit-badge:focus),
ul.products .product:has(.op-vit-badge:hover),
ul.products .product:has(.op-vit-badge:focus),
.op-home-products__grid .product:has(.op-vit-badge:hover),
.op-home-products__grid .product:has(.op-vit-badge:focus) {
	overflow: visible !important;
	z-index: 40;
}

ul.products li.product span.onsale {
	z-index: 5;
}

/* ——— Fiber badge (black text + black outline, same corner as АКЦИЈА) ——— */
.op-fiber-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid #111111;
	color: #111111;
	font-family: var(--organela-font, 'Raleway', sans-serif);
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	white-space: nowrap;
	box-shadow: none;
	cursor: help;
	pointer-events: auto;
}

/* Sit next to / under АКЦИЈА when both present */
ul.products li.product:has(.onsale) .op-fiber-badge--card,
.op-home-products__grid .product:has(.onsale) .op-fiber-badge--card {
	top: 34px;
}

.op-fiber-badge--inline {
	position: static;
	top: auto;
	left: auto;
	min-height: 26px;
	padding: 4px 10px;
	font-size: 0.74rem;
	border: 1px solid #111111;
	color: #111111;
}

.op-fiber-badge--single {
	position: static;
	top: auto;
	left: auto;
	border: 1px solid #111111;
	color: #111111;
}

.op-fiber-badge--modal {
	position: relative;
	top: auto;
	left: auto;
}

.op-product__stage-tags {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 4;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 24px);
	pointer-events: none;
}

.op-product__stage-tags .op-product__badge,
.op-product__stage-tags .op-fiber-badge {
	pointer-events: auto;
}

.op-product__fiber {
	margin: 0 0 8px;
}

@media (max-width: 700px) {
	.op-fiber-badge--card {
		top: 8px;
		left: 8px;
		padding: 3px 7px;
		font-size: 0.58rem;
	}

	ul.products li.product:has(.onsale) .op-fiber-badge--card,
	.op-home-products__grid .product:has(.onsale) .op-fiber-badge--card {
		top: 32px;
	}
}

@media (max-width: 700px) {
	.op-vit-badges {
		left: 8px;
		bottom: 8px;
		gap: 4px;
		max-width: calc(100% - 16px);
	}

	.op-vit-badge {
		min-height: 20px;
		padding: 2px 6px;
		font-size: 0.62rem;
	}

	.op-vit-badge[data-tip]::after {
		max-width: min(180px, 72vw);
	}
}

/* Let card overflow clip image, but not floating tips */
ul.products li.product:has(.op-vit-badge:hover),
ul.products li.product:has(.op-vit-badge:focus),
ul.products .product:has(.op-vit-badge:hover),
ul.products .product:has(.op-vit-badge:focus),
.op-home-products__grid .product:has(.op-vit-badge:hover),
.op-home-products__grid .product:has(.op-vit-badge:focus) {
	overflow: visible !important;
	z-index: 40;
}
