/**
 * ETA Shop — hover quick-add na kafelku produktu
 * v1.0.4
 */

body.woocommerce.eta-shop-skin ul.products li.product .post_item.eta-product-card {
	position: relative;
	overflow: hidden;
}

/* Lekkie powiększenie zdjęcia — link na cały obszar miniatury */
body.woocommerce.eta-shop-skin ul.products li.product .post_featured {
	position: relative;
	overflow: hidden;
	border-radius: var(--eta-radius-sm, 10px);
}

body.woocommerce.eta-shop-skin ul.products li.product .post_featured > a {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

body.woocommerce.eta-shop-skin ul.products li.product .post_featured > a:focus-visible {
	outline: 2px solid var(--eta-link, #1a56db);
	outline-offset: 2px;
}

body.woocommerce.eta-shop-skin ul.products li.product .post_featured img {
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: transform;
}

body.woocommerce.eta-shop-skin ul.products li.product.is-image-zoom .post_featured img {
	transform: scale(1.06);
}

/* Matowa warstwa rozjaśnienia — CSS (bez konfliktu z GSAP inline) */
.eta-product-hover__veil {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: rgba(255, 255, 255, 0.15);
	opacity: 0;
	border-radius: inherit;
	transition: opacity 0.3s ease;
}

body.woocommerce.eta-shop-skin ul.products li.product.is-hover-active .eta-product-hover__veil {
	opacity: 1;
}

body.woocommerce.eta-shop-skin ul.products li.product.is-veil-leaving .eta-product-hover__veil {
	opacity: 0;
	transition-duration: 0.15s;
}

/* Tytuł + Kup teraz zawsze nad warstwą */
body.woocommerce.eta-shop-skin ul.products li.product .post_header,
body.woocommerce.eta-shop-skin ul.products li.product .woocommerce-loop-product__title,
body.woocommerce.eta-shop-skin ul.products li.product .woocommerce-loop-product__title a,
body.woocommerce.eta-shop-skin ul.products li.product .add_to_cart_wrap,
body.woocommerce.eta-shop-skin ul.products li.product .add_to_cart_button {
	position: relative;
	z-index: 6;
}

/* Strefa plus / licznik — przepuszcza klik w obraz (link pod spodem) */
.eta-product-hover__stage {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

body.woocommerce.eta-shop-skin ul.products li.product.is-hover-active .post_featured > a {
	cursor: pointer;
}

.eta-product-hover__plus,
.eta-product-hover__qty {
	pointer-events: auto;
}

.eta-product-hover__plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #ffffff;
	color: var(--eta-navy, #001f3f);
	font-size: 28px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 31, 63, 0.12);
	opacity: 0;
	transform: scale(0.88);
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.eta-product-hover__plus:hover,
.eta-product-hover__plus:focus-visible {
	background: #f2f8fb;
}

.eta-product-hover__plus:active {
	transform: scale(0.96);
}

.eta-product-card.is-hover-active.is-plus-visible .eta-product-hover__plus,
body.woocommerce.eta-shop-skin ul.products li.product.is-hover-active.is-plus-visible .eta-product-hover__plus {
	opacity: 1;
	transform: scale(1);
}

.eta-product-card.is-qty-mode .eta-product-hover__plus,
body.woocommerce.eta-shop-skin ul.products li.product.is-qty-mode .eta-product-hover__plus {
	display: none;
}

/* Licznik − n + */
.eta-product-hover__qty {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0;
	min-height: 44px;
	padding: 4px 6px;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 8px 24px rgba(0, 31, 63, 0.12);
	opacity: 0;
	transform: scale(0.92);
}

.eta-product-card.is-qty-mode .eta-product-hover__qty,
body.woocommerce.eta-shop-skin ul.products li.product.is-qty-mode .eta-product-hover__qty {
	display: inline-flex;
}

.eta-product-card.is-qty-mode.is-plus-visible .eta-product-hover__qty,
body.woocommerce.eta-shop-skin ul.products li.product.is-qty-mode.is-plus-visible .eta-product-hover__qty {
	opacity: 1;
	transform: scale(1);
}

.eta-product-hover__minus,
.eta-product-hover__plus-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--eta-navy, #001f3f);
	font-size: 22px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.eta-product-hover__minus:hover,
.eta-product-hover__plus-step:hover,
.eta-product-hover__minus:focus-visible,
.eta-product-hover__plus-step:focus-visible {
	background: rgba(0, 31, 63, 0.06);
}

.eta-product-hover__count {
	min-width: 28px;
	padding: 0 4px;
	color: var(--eta-navy, #001f3f);
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	user-select: none;
}

/* Zamknij — prawy górny róg kafelka */
.eta-product-hover__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 7;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.95);
	color: var(--eta-navy, #001f3f);
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 31, 63, 0.1);
	transition: background-color 0.15s ease;
}

.eta-product-hover__close:hover,
.eta-product-hover__close:focus-visible {
	background: #ffffff;
}

.eta-product-card.is-hover-active.is-plus-visible .eta-product-hover__close,
.eta-product-card.is-qty-mode .eta-product-hover__close,
body.woocommerce.eta-shop-skin ul.products li.product.is-hover-active.is-plus-visible .eta-product-hover__close,
body.woocommerce.eta-shop-skin ul.products li.product.is-qty-mode .eta-product-hover__close {
	opacity: 1;
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce.eta-shop-skin ul.products li.product .post_featured img {
		transition: none;
	}

	body.woocommerce.eta-shop-skin ul.products li.product.is-image-zoom .post_featured img {
		transform: none;
	}
}

@media (hover: none) {
	.eta-product-hover__veil,
	.eta-product-hover__stage,
	.eta-product-hover__close {
		display: none !important;
	}
}
