/* ==========================================================================
   Guest Wishlist, Quick View & Compare
   ========================================================================== */

.gwqc-actions {
	display: inline-flex;
	gap: 6px;
	margin: 8px 0;
	align-items: center;
}

/* Оверлей поверх изображения карточки товара */
li.product,
.product-item,
.elementor-product,
.shopengine-product-card,
.wc-block-grid__product {
	position: relative;
}

.gwqc-actions--overlay {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	flex-direction: column;
	margin: 0;
	opacity: 0;
	transform: translateX( 6px );
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}

/* Показываем при наведении на карточку; на тач-устройствах — всегда */
li.product:hover .gwqc-actions--overlay,
.product-item:hover .gwqc-actions--overlay,
.elementor-product:hover .gwqc-actions--overlay,
.shopengine-product-card:hover .gwqc-actions--overlay,
.wc-block-grid__product:hover .gwqc-actions--overlay,
.gwqc-actions--overlay:hover {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

@media ( hover: none ) {
	.gwqc-actions--overlay {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

.gwqc-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 50%;
	background: #fff;
	color: #333;
	cursor: pointer;
	line-height: 1;
	transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.gwqc-btn:hover {
	transform: translateY( -1px );
	border-color: rgba( 0, 0, 0, 0.28 );
}

.gwqc-btn .gwqc-icon {
	font-size: 18px;
	pointer-events: none;
}

/* Активное состояние избранного */
.gwqc-wishlist.active {
	background: #e8384f;
	border-color: #e8384f;
	color: #fff;
}
.gwqc-wishlist.active .gwqc-icon-heart::before {
	content: '\2665'; /* закрашенное сердце */
}
.gwqc-wishlist.active .gwqc-icon-heart {
	font-size: 0; /* прячем исходный символ, используем ::before */
}
.gwqc-wishlist.active .gwqc-icon-heart::before {
	font-size: 18px;
}

/* Активное состояние сравнения */
.gwqc-compare.active {
	background: #2c7be5;
	border-color: #2c7be5;
	color: #fff;
}

/* Всплывающее уведомление (лимит сравнения) */
.gwqc-flash {
	position: absolute;
	bottom: calc( 100% + 6px );
	left: 50%;
	transform: translateX( -50% );
	white-space: nowrap;
	background: #222;
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
	z-index: 5;
	animation: gwqc-fade 1.6s ease forwards;
}
@keyframes gwqc-fade {
	0% { opacity: 0; }
	15% { opacity: 1; }
	85% { opacity: 1; }
	100% { opacity: 0; }
}

/* Счётчик избранного */
.gwqc-counter-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
}
.gwqc-counter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #e8384f;
	color: #fff;
	font-size: 11px;
	line-height: 1;
}

/* ==========================================================================
   Модальное окно быстрого просмотра
   ========================================================================== */

body.gwqc-modal-open {
	overflow: hidden;
}

.gwqc-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 20px;
	animation: gwqc-in 0.15s ease;
}
@keyframes gwqc-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.gwqc-modal {
	position: relative;
	background: #fff;
	border-radius: 8px;
	max-width: 860px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
}

.gwqc-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: none;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	z-index: 2;
}
.gwqc-modal-close:hover { color: #000; }

.gwqc-modal-body {
	padding: 28px;
}

.gwqc-qv {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
}
.gwqc-qv-gallery img {
	width: 100%;
	height: auto;
	border-radius: 6px;
}
.gwqc-qv-title {
	margin: 0 0 10px;
	font-size: 1.5rem;
}
.gwqc-qv-price {
	font-size: 1.25rem;
	margin-bottom: 10px;
}
.gwqc-qv-desc {
	margin: 12px 0 18px;
	color: #555;
}
.gwqc-qv-link {
	display: inline-block;
	margin-top: 12px;
}

/* ==========================================================================
   Страницы избранного и сравнения
   ========================================================================== */

.gwqc-page-inner {
	min-height: 80px;
}
.gwqc-empty,
.gwqc-loading {
	padding: 24px 0;
	color: #777;
}

.gwqc-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 20px;
}
.gwqc-grid-item {
	position: relative;
	text-align: center;
}
.gwqc-grid-link {
	display: block;
	text-decoration: none;
	color: inherit;
}
.gwqc-grid-link img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 8px;
}
.gwqc-grid-title {
	font-size: 0.95rem;
	margin: 6px 0;
}
.gwqc-grid-price {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.gwqc-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	border: none;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}
.gwqc-remove:hover { background: #e8384f; }

/* Таблица сравнения */
.gwqc-compare-scroll {
	overflow-x: auto;
}
.gwqc-compare-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 600px;
}
.gwqc-compare-table th,
.gwqc-compare-table td {
	border: 1px solid rgba( 0, 0, 0, 0.1 );
	padding: 12px;
	vertical-align: top;
	text-align: left;
}
.gwqc-compare-table th {
	background: #f7f7f7;
	width: 160px;
	font-weight: 600;
}
.gwqc-compare-table td {
	position: relative;
	text-align: center;
	min-width: 180px;
}
.gwqc-compare-table .gwqc-row-image img {
	max-width: 140px;
	height: auto;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media ( max-width: 782px ) {
	.gwqc-qv {
		grid-template-columns: 1fr;
	}
	.gwqc-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}
@media ( max-width: 480px ) {
	.gwqc-grid {
		grid-template-columns: 1fr;
	}
}
