/**
 * Term Tooltips Pro for UniShop2
 * Version: 2.1.0
 * Путь: catalog/view/theme/unishop2/stylesheet/term-tooltips.css
 *
 * Исправление: убран блок .term-tooltip-trigger::before (content: attr(data-term)),
 * который при наведении показывал СВОЙ маленький чёрный тултип поверх настоящего
 * Bootstrap-тултипа — на десктопе вылезали два всплывающих блока одновременно.
 */

/* ОСНОВНОЙ СТИЛЬ ПОДСВЕЧЕННОГО ТЕРМИНА */
.term-tooltip-trigger {
	display: inline-block;
	border-bottom: 1px dashed #1e5a94;
	cursor: help;
	color: inherit;
	background-color: transparent;
	transition: all 0.2s ease;
	padding: 0;
	margin: 0;
	text-decoration: none;
	font-weight: 500;
	position: relative;
	outline: none;
	white-space: normal;
	word-wrap: break-word;
	letter-spacing: 0.01em;
}

.term-tooltip-trigger:hover,
.term-tooltip-trigger:focus {
	background-color: rgba(30, 90, 148, 0.05);
	border-bottom-color: #1c4f80;
	color: #1e5a94;
	text-decoration: none;
}

.term-tooltip-trigger:active {
	background-color: rgba(30, 90, 148, 0.1);
}

/* КАСТОМНЫЙ ТУЛТИП */
.term-tooltip.tooltip {
	font-family: inherit;
	font-size: 13px;
	line-height: 1.4;
	max-width: 320px;
	z-index: 1080;
	pointer-events: none;
	word-wrap: break-word;
	animation: tooltipFadeIn 0.2s ease-in-out;
}

.term-tooltip.tooltip .tooltip-inner {
	background-color: #ffffff;
	color: #333333;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	padding: 12px 16px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
	text-align: left;
	max-height: 80vh;
	overflow: hidden;
	font-weight: 400;
	position: relative;
}

.term-tooltip .tooltip-inner .term-name {
	display: block;
	font-weight: 600;
	color: #1e5a94;
	margin-bottom: 6px;
	font-size: 14px;
}

.term-tooltip .tooltip-inner .term-el {
	display: block;
	color: #444444;
	font-size: 13px;
	line-height: 1.5;
}

.term-tooltip .tooltip-inner::after {
	content: '';
	display: block;
	width: 100%;
	height: 1px;
	background: linear-gradient(to right, transparent, rgba(30, 90, 148, 0.2), transparent);
	margin-top: 8px;
}

/* СТРЕЛКИ ТУЛТИПА */
.term-tooltip.tooltip .tooltip-arrow { border-color: transparent; }
.term-tooltip.tooltip.bs-tooltip-top .tooltip-arrow { border-top-color: #ffffff; bottom: -1px; }
.term-tooltip.tooltip.bs-tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; top: -1px; }
.term-tooltip.tooltip.bs-tooltip-left .tooltip-arrow { border-left-color: #ffffff; right: -1px; }
.term-tooltip.tooltip.bs-tooltip-right .tooltip-arrow { border-right-color: #ffffff; left: -1px; }

/* МОБИЛЬНЫЕ УСТРОЙСТВА */
@media (max-width: 768px) {
	.term-tooltip-trigger {
		border-bottom-width: 2px;
		display: inline;
		white-space: normal;
		line-height: 1.4;
		padding: 2px 0;
		margin: -2px 0;
	}

	.term-tooltip.tooltip {
		font-size: 14px;
		width: max-content;
		max-width: 300px;
	}

	.term-tooltip.tooltip .tooltip-inner {
		padding: 14px;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.term-tooltip.tooltip { max-width: 350px; }
}

@media (max-width: 480px) {
	.term-tooltip-trigger { font-size: 12px; }
	.term-tooltip.tooltip .tooltip-inner { font-size: 13px; padding: 10px; }
}

/* АНИМАЦИИ */
@keyframes termPulse {
	0% { opacity: 0.7; transform: scale(0.98); }
	50% { opacity: 1; transform: scale(1); }
	100% { opacity: 1; transform: scale(1); }
}
.term-tooltip-trigger { animation: termPulse 0.3s ease-in-out; }

@keyframes tooltipFadeIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ТЁМНАЯ ТЕМА */
.theme-dark .term-tooltip-trigger { border-bottom-color: #5aa0d6; color: #e1e1e1; }
.theme-dark .term-tooltip-trigger:hover,
.theme-dark .term-tooltip-trigger:focus { background-color: rgba(90, 160, 214, 0.1); color: #5aa0d6; }
.theme-dark .term-tooltip.tooltip .tooltip-inner { background-color: #2d2d2d; border-color: #444444; color: #e1e1e1; }
.theme-dark .term-tooltip.tooltip .tooltip-inner .term-name { color: #5aa0d6; }
.theme-dark .term-tooltip.tooltip .tooltip-inner .term-el { color: #d0d0d0; }
.theme-dark .term-tooltip.tooltip.bs-tooltip-top .tooltip-arrow { border-top-color: #2d2d2d; }
.theme-dark .term-tooltip.tooltip.bs-tooltip-bottom .tooltip-arrow { border-bottom-color: #2d2d2d; }
.theme-dark .term-tooltip.tooltip.bs-tooltip-left .tooltip-arrow { border-left-color: #2d2d2d; }
.theme-dark .term-tooltip.tooltip.bs-tooltip-right .tooltip-arrow { border-right-color: #2d2d2d; }

/* Цветовые варианты по типу термина (опционально, если захотите проставлять data-type) */
.term-tooltip-trigger[data-type="fish"] { border-bottom-color: #c0392b; }
.term-tooltip-trigger[data-type="seafood"] { border-bottom-color: #2980b9; }
.term-tooltip-trigger[data-type="processing"] { border-bottom-color: #27ae60; }
.term-tooltip-trigger[data-type="international"] { border-bottom-color: #e67e22; }

/* АДАПТАЦИЯ ПОД UNISHOP2 */
.product-thumb .term-tooltip-trigger { font-size: 13px; }
.product-description .term-tooltip-trigger { font-size: 14px; }
.product-specifications .term-tooltip-trigger { font-size: 13px; }
#quickview .term-tooltip-trigger { font-size: 13px; }

/* ПЕЧАТЬ */
@media print {
	.term-tooltip-trigger { border-bottom: none; text-decoration: underline; color: #000000; background: none; }
	.term-tooltip.tooltip { display: none !important; }
}
