/* ==========================================================================
   TASSEL Wine Categories v1.8.1 — dynamiczny kafel pętli Woo/Kadence
   Lekki CSS bez JavaScriptu. Jasna karta, efekty spójne z modułami głównymi.
   ========================================================================== */

.twc-loop-card {
	--twc-loop-accent: var(--global-palette1, #6d1b32);
	--twc-loop-accent-2: var(--global-palette2, #99304b);
	--twc-loop-ink: var(--global-palette4, #241a1c);
	--twc-loop-muted: var(--global-palette5, #6f5f63);
	--twc-loop-paper: var(--global-palette9, #fff);
	--twc-loop-soft: var(--global-palette8, #f7f1eb);
	--twc-loop-line: var(--global-gray-400, rgba(36, 26, 28, .14));
	--twc-loop-display: var(--global-heading-font-family, Georgia, "Times New Roman", serif);
	--twc-loop-body: var(--global-body-font-family, inherit);
	--twc-loop-ease: cubic-bezier(.22, .61, .36, 1);

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--twc-loop-line);
	border-radius: 14px;
	background: var(--twc-loop-paper);
	box-shadow: 0 2px 8px rgba(36, 26, 28, .045);
	color: var(--twc-loop-ink);
	font-family: var(--twc-loop-body);
	transition: transform .42s var(--twc-loop-ease), box-shadow .42s var(--twc-loop-ease), border-color .32s var(--twc-loop-ease);
	isolation: isolate;
}

.twc-loop-card,
.twc-loop-card *,
.twc-loop-card *::before,
.twc-loop-card *::after {
	box-sizing: border-box;
}

.twc-loop-card:hover,
.twc-loop-card:focus-within {
	transform: translateY(-6px);
	border-color: rgba(109, 27, 50, .36);
	border-color: color-mix(in srgb, var(--twc-loop-accent) 42%, transparent);
	box-shadow: 0 22px 48px rgba(36, 26, 28, .15);
}

.twc-loop-card a {
	color: inherit;
	text-decoration: none;
}

.twc-loop-card a:hover,
.twc-loop-card a:focus-visible {
	color: inherit;
	text-decoration: none;
}

.twc-loop-card a:focus-visible {
	outline: 2px solid var(--twc-loop-accent);
	outline-offset: 3px;
}

.twc-loop-card__media {
	position: relative;
	display: block;
	aspect-ratio: var(--twc-loop-ratio, 4 / 5);
	min-height: 0;
	overflow: hidden;
	background:
		radial-gradient(circle at 50% 78%, rgba(109, 27, 50, .15), transparent 34%),
		linear-gradient(155deg, var(--twc-loop-paper) 0%, var(--twc-loop-soft) 100%);
}

.twc-loop-card__media::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: auto 9% 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(109, 27, 50, .5), transparent);
	background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--twc-loop-accent) 50%, transparent), transparent);
	transform: scaleX(.54);
	transition: transform .48s var(--twc-loop-ease), opacity .35s var(--twc-loop-ease);
	opacity: .7;
}

.twc-loop-card:hover .twc-loop-card__media::after,
.twc-loop-card:focus-within .twc-loop-card__media::after {
	transform: scaleX(1);
	opacity: 1;
}

.twc-loop-card__glow {
	position: absolute;
	inset: auto 12% 5% 12%;
	height: 24%;
	border-radius: 50%;
	background: rgba(109, 27, 50, .13);
	filter: blur(24px);
	transform: scale(.82);
	transition: transform .55s var(--twc-loop-ease), opacity .4s var(--twc-loop-ease);
	opacity: .7;
}

.twc-loop-card:hover .twc-loop-card__glow,
.twc-loop-card:focus-within .twc-loop-card__glow {
	transform: scale(1.05);
	opacity: 1;
}

.twc-loop-card__img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	padding: clamp(.75rem, 2vw, 1.2rem);
	object-fit: contain;
	object-position: center bottom;
	transition: transform .7s var(--twc-loop-ease), filter .45s var(--twc-loop-ease);
}

.twc-loop-card:hover .twc-loop-card__img,
.twc-loop-card:focus-within .twc-loop-card__img {
	transform: translateY(-5px) scale(1.035);
	filter: saturate(1.04) contrast(1.02);
}

/* Krótki opis odsłaniany na obrazie, spójny z kaflami strony głównej. */
.twc-loop-card__hover-desc {
	position: absolute;
	z-index: 2;
	inset: auto 0 0;
	display: flex;
	align-items: flex-end;
	min-height: 48%;
	padding: clamp(2.4rem, 5vw, 4.5rem) clamp(1rem, 2vw, 1.35rem) clamp(1rem, 2vw, 1.35rem);
	background: linear-gradient(to top, rgba(24, 12, 15, .94) 0%, rgba(24, 12, 15, .76) 45%, rgba(24, 12, 15, 0) 100%);
	color: #fff;
	font-size: clamp(.78rem, 1vw, .9rem);
	line-height: 1.55;
	text-shadow: 0 1px 16px rgba(0, 0, 0, .35);
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .36s var(--twc-loop-ease), transform .46s var(--twc-loop-ease);
	pointer-events: none;
}

.twc-loop-card__hover-desc > span {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

.twc-loop-card--desc-hover:hover .twc-loop-card__hover-desc,
.twc-loop-card--desc-hover:focus-within .twc-loop-card__hover-desc {
	opacity: 1;
	transform: translateY(0);
}

.twc-loop-card--desc-hover:hover .twc-loop-card__img,
.twc-loop-card--desc-hover:focus-within .twc-loop-card__img {
	filter: saturate(.88) brightness(.72);
}

.twc-loop-card__badge,
.twc-loop-card__sale {
	position: absolute;
	z-index: 3;
	top: .9rem;
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	border-radius: 999px;
	font-size: .64rem;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
}

.twc-loop-card__badge {
	right: .9rem;
	gap: .42rem;
	padding: .55rem .82rem .55rem .68rem;
	border: 1px solid rgba(109, 27, 50, .3);
	border-color: color-mix(in srgb, var(--twc-loop-accent) 44%, transparent);
	background: rgba(255, 255, 255, .92);
	background: color-mix(in srgb, var(--twc-loop-paper) 90%, transparent);
	box-shadow: 0 8px 22px rgba(36, 26, 28, .1);
	color: var(--twc-loop-accent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.twc-loop-card__badge .twc__star {
	width: 1rem;
	height: 1rem;
	fill: currentColor;
}

.twc-loop-card__sale {
	left: .9rem;
	padding: .58rem .8rem;
	background: var(--twc-loop-accent);
	color: #fff;
}

.twc-loop-card__body {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	padding: clamp(1.1rem, 2.1vw, 1.45rem);
	text-align: left;
}

.twc-loop-card__category {
	margin: 0 0 .58rem;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .16em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--twc-loop-accent);
}

.twc-loop-card__title {
	margin: 0;
	font-family: var(--twc-loop-display);
	font-size: clamp(1.18rem, 1.55vw, 1.45rem);
	font-weight: 600;
	line-height: 1.22;
	letter-spacing: -.012em;
	color: var(--twc-loop-ink);
}

.twc-loop-card__title a {
	color: inherit !important;
}

.single-content .twc-loop-card .twc-loop-card__title,
.entry-content .twc-loop-card .twc-loop-card__title,
.woocommerce ul.products li.product .twc-loop-card .twc-loop-card__title {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--twc-loop-ink) !important;
}

.twc-loop-card__price {
	margin-top: .65rem;
	font-family: var(--twc-loop-display);
	font-size: 1.05rem;
	line-height: 1.2;
	color: var(--twc-loop-accent);
}

.twc-loop-card__price del {
	margin-right: .35em;
	font-size: .84em;
	opacity: .52;
}

.twc-loop-card__price ins {
	text-decoration: none;
}

.twc-loop-card__rating {
	margin-top: .55rem;
	font-size: .8rem;
	color: var(--twc-loop-accent);
}

.twc-loop-card__rating .star-rating {
	float: none;
	margin: 0;
}

.twc-loop-card__desc {
	margin: .75rem 0 0;
	font-size: .87rem;
	line-height: 1.58;
	color: var(--twc-loop-muted);
}

.twc-loop-card__footer {
	display: flex;
	align-items: center;
	width: 100%;
	margin-top: auto;
	padding-top: 1rem;
}

.twc-loop-card__more,
.twc-loop-card__cart {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: .65rem;
	min-height: 2.6rem;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .13em;
	line-height: 1.25;
	text-transform: uppercase;
	transition: color .3s var(--twc-loop-ease), background-color .3s var(--twc-loop-ease), border-color .3s var(--twc-loop-ease);
}

.twc-loop-card__more {
	width: 100%;
	padding-top: .85rem;
	border-top: 1px solid var(--twc-loop-line);
	color: var(--twc-loop-accent) !important;
}

.twc-loop-card__more .twc__ico,
.twc-loop-card__cart .twc__ico {
	width: 1.15rem;
	height: 1.15rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .35s var(--twc-loop-ease);
}

.twc-loop-card:hover .twc-loop-card__more .twc__ico,
.twc-loop-card:focus-within .twc-loop-card__more .twc__ico,
.twc-loop-card__cart:hover .twc__ico,
.twc-loop-card__cart:focus-visible .twc__ico {
	transform: translateX(4px);
}

.twc-loop-card__cart {
	width: 100%;
	padding: .78rem 1rem;
	border: 1px solid var(--twc-loop-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--twc-loop-accent) !important;
}

.twc-loop-card__cart:hover,
.twc-loop-card__cart:focus-visible {
	border-color: var(--twc-loop-accent);
	background: var(--twc-loop-accent);
	color: #fff !important;
}

.twc-loop-card__cart.loading {
	opacity: .7;
}

.twc-loop-card__cart.added::after {
	content: "✓";
	margin-left: auto;
}

.twc-loop-card + .added_to_cart,
.twc-loop-card .added_to_cart {
	position: relative;
	z-index: 3;
	display: inline-block;
	margin-top: .5rem;
	font-size: .7rem;
	color: var(--twc-loop-muted);
}

/* Reset elementów Kadence/Woo Template otaczających pojedynczy shortcode. */
.woocommerce ul.products li.product .twc-loop-card img,
.woocommerce-page ul.products li.product .twc-loop-card img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

/* Gutenberg/Kadence dodają techniczne wrappery wokół bloku Shortcode.
   :has() jest wyłącznie progresywnym ulepszeniem równych wysokości. */
.woocommerce ul.products li.product .wp-block-shortcode:has(.twc-loop-card),
.woocommerce ul.products li.product .kt-inside-inner-col:has(.twc-loop-card) {
	height: 100%;
}

.woocommerce ul.products li.product .twc-loop-card h2,
.woocommerce ul.products li.product .twc-loop-card h3,
.woocommerce-page ul.products li.product .twc-loop-card h2,
.woocommerce-page ul.products li.product .twc-loop-card h3 {
	margin: 0;
	padding: 0;
	font-size: clamp(1.18rem, 1.55vw, 1.45rem);
}

@media (max-width: 767px) {
	.twc-loop-card {
		border-radius: 11px;
	}

	.twc-loop-card__badge,
	.twc-loop-card__sale {
		top: .7rem;
	}

	.twc-loop-card__badge {
		right: .7rem;
	}

	.twc-loop-card__sale {
		left: .7rem;
	}

	.twc-loop-card__body {
		padding: 1rem;
	}
}

@media (hover: none) {
	.twc-loop-card:hover {
		transform: none;
	}

	/* Na ekranach dotykowych nie zasłaniamy etykiety butelki opisem. */
	.twc-loop-card__hover-desc {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.twc-loop-card,
	.twc-loop-card *,
	.twc-loop-card *::before,
	.twc-loop-card *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}


/* ==========================================================================
   Natywne kafle kategorii WooCommerce / Kadence
   Ten sam język wizualny co shortcode style="kafelki", bez zmiany szablonu.
   ========================================================================== */

.woocommerce ul.products li.product-category.product,
.woocommerce-page ul.products li.product-category.product {
	--twc-native-accent: var(--global-palette1, #6d1b32);
	--twc-native-accent-2: var(--global-palette2, #99304b);
	--twc-native-display: var(--global-heading-font-family, Georgia, "Times New Roman", serif);
	--twc-native-body: var(--global-body-font-family, inherit);
	--twc-native-ease: cubic-bezier(.22, .61, .36, 1);

	position: relative;
	min-width: 0;
	margin-bottom: clamp(1rem, 2.4vw, 2rem) !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 3px;
	background: #211216 !important;
	box-shadow: 0 8px 24px rgba(31, 17, 20, .09);
	overflow: hidden;
	transition: transform .45s var(--twc-native-ease), box-shadow .45s var(--twc-native-ease);
	isolation: isolate;
}

.woocommerce ul.products li.product-category.product:hover,
.woocommerce ul.products li.product-category.product:focus-within,
.woocommerce-page ul.products li.product-category.product:hover,
.woocommerce-page ul.products li.product-category.product:focus-within {
	transform: translateY(-5px);
	box-shadow: 0 24px 48px rgba(31, 17, 20, .22);
}

.woocommerce ul.products li.product-category.product > a,
.woocommerce-page ul.products li.product-category.product > a {
	position: relative;
	display: grid !important;
	align-items: end;
	width: 100%;
	aspect-ratio: 3 / 4;
	min-height: 300px;
	margin: 0 !important;
	padding: 0 !important;
	color: #fff !important;
	text-decoration: none !important;
	overflow: hidden;
	isolation: isolate;
}

.woocommerce ul.products li.product-category.product > a::before,
.woocommerce-page ul.products li.product-category.product > a::before {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
	background: linear-gradient(to top, rgba(19, 10, 12, .96) 0%, rgba(19, 10, 12, .79) 31%, rgba(19, 10, 12, .38) 60%, rgba(19, 10, 12, .08) 100%);
	pointer-events: none;
}

.woocommerce ul.products li.product-category.product > a::after,
.woocommerce-page ul.products li.product-category.product > a::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
	background: radial-gradient(circle at 50% 18%, rgba(255,255,255,.12), transparent 42%);
	opacity: .4;
	transition: opacity .4s var(--twc-native-ease);
	pointer-events: none;
}

.woocommerce ul.products li.product-category.product:hover > a::after,
.woocommerce ul.products li.product-category.product:focus-within > a::after,
.woocommerce-page ul.products li.product-category.product:hover > a::after,
.woocommerce-page ul.products li.product-category.product:focus-within > a::after {
	opacity: .72;
}

.woocommerce ul.products li.product-category.product img,
.woocommerce-page ul.products li.product-category.product img {
	position: absolute !important;
	z-index: 0;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	object-fit: cover;
	object-position: center;
	transform: scale(1.001);
	transition: transform .85s var(--twc-native-ease), filter .45s var(--twc-native-ease);
}

.woocommerce ul.products li.product-category.product:hover img,
.woocommerce ul.products li.product-category.product:focus-within img,
.woocommerce-page ul.products li.product-category.product:hover img,
.woocommerce-page ul.products li.product-category.product:focus-within img {
	transform: scale(1.065);
	filter: saturate(.96) contrast(1.02);
}

.woocommerce ul.products li.product-category.product .product-details,
.woocommerce-page ul.products li.product-category.product .product-details {
	position: static;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin: 0 !important;
	padding: clamp(1.1rem, 2vw, 1.55rem) !important;
	border: 0 !important;
	background: transparent !important;
	color: #fff !important;
	text-align: center;
}

.woocommerce ul.products li.product-category.product .product-details::before,
.woocommerce-page ul.products li.product-category.product .product-details::before {
	content: "";
	display: block;
	width: 36px;
	height: 1px;
	margin: 0 auto .85rem;
	background: rgba(255,255,255,.88);
	transition: width .45s var(--twc-native-ease);
}

.woocommerce ul.products li.product-category.product:hover .product-details::before,
.woocommerce ul.products li.product-category.product:focus-within .product-details::before,
.woocommerce-page ul.products li.product-category.product:hover .product-details::before,
.woocommerce-page ul.products li.product-category.product:focus-within .product-details::before {
	width: 58px;
}

.woocommerce ul.products li.product-category.product h2.woocommerce-loop-category__title,
.woocommerce-page ul.products li.product-category.product h2.woocommerce-loop-category__title {
	position: static;
	z-index: 2;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--twc-native-display);
	font-size: clamp(1.02rem, 1.45vw, 1.28rem) !important;
	font-weight: 600;
	line-height: 1.25 !important;
	letter-spacing: .035em;
	text-align: center;
	text-transform: uppercase;
	color: #fff !important;
}

.woocommerce ul.products li.product-category.product mark.twc-native-cat__count,
.woocommerce-page ul.products li.product-category.product mark.twc-native-cat__count {
	position: absolute !important;
	z-index: 4;
	top: .85rem !important;
	right: .85rem !important;
	bottom: auto !important;
	left: auto !important;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 3.75rem;
	height: 3.75rem;
	margin: 0 !important;
	padding: .3rem !important;
	border: 1px solid rgba(255,255,255,.4);
	border-radius: 50%;
	background: rgba(92, 16, 27, .9) !important;
	box-shadow: 0 8px 22px rgba(0,0,0,.22);
	color: #fff !important;
	line-height: 1;
	transform: translate3d(0, 0, 0) rotate(-7deg) !important;
	translate: none !important;
	transition: transform .45s var(--twc-native-ease), background-color .35s var(--twc-native-ease);
	pointer-events: none;
	will-change: transform;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.woocommerce ul.products li.product-category.product:hover mark.twc-native-cat__count,
.woocommerce ul.products li.product-category.product:focus-within mark.twc-native-cat__count,
.woocommerce-page ul.products li.product-category.product:hover mark.twc-native-cat__count,
.woocommerce-page ul.products li.product-category.product:focus-within mark.twc-native-cat__count {
	transform: translate3d(0, 0, 0) rotate(0) scale(1.05) !important;
	translate: none !important;
	background: var(--twc-native-accent-2) !important;
}

.twc-native-cat__count-n {
	font-family: var(--twc-native-display);
	font-size: .98rem;
	font-weight: 700;
}

.twc-native-cat__count-w {
	margin-top: .16rem;
	font-family: var(--twc-native-body);
	font-size: .49rem;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.05;
	text-transform: uppercase;
}

.twc-native-cat__reveal {
	z-index: 2;
	display: grid;
	width: 100%;
	grid-template-rows: 0fr;
	margin-top: 0;
	opacity: 0;
	transition: grid-template-rows .48s var(--twc-native-ease), opacity .34s var(--twc-native-ease), margin-top .48s var(--twc-native-ease);
}

.twc-native-cat__desc {
	display: -webkit-box;
	min-height: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	font-size: .82rem;
	line-height: 1.5;
	color: rgba(255,255,255,.84);
}

.woocommerce ul.products li.product-category.product:hover .twc-native-cat__reveal,
.woocommerce ul.products li.product-category.product:focus-within .twc-native-cat__reveal,
.woocommerce-page ul.products li.product-category.product:hover .twc-native-cat__reveal,
.woocommerce-page ul.products li.product-category.product:focus-within .twc-native-cat__reveal {
	grid-template-rows: 1fr;
	margin-top: .65rem;
	opacity: 1;
}

.twc-native-cat__cta {
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: .38rem;
	margin-top: .72rem;
	font-family: var(--twc-native-body);
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.2;
	text-transform: uppercase;
	color: rgba(255,255,255,.9);
}

.twc-native-cat__cta .twc__ico {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .35s var(--twc-native-ease);
}

.woocommerce ul.products li.product-category.product:hover .twc-native-cat__cta .twc__ico,
.woocommerce ul.products li.product-category.product:focus-within .twc-native-cat__cta .twc__ico,
.woocommerce-page ul.products li.product-category.product:hover .twc-native-cat__cta .twc__ico,
.woocommerce-page ul.products li.product-category.product:focus-within .twc-native-cat__cta .twc__ico {
	transform: translateX(4px);
}

@media (max-width: 767px) {
	.woocommerce ul.products li.product-category.product > a,
	.woocommerce-page ul.products li.product-category.product > a {
		min-height: 250px;
	}

	.woocommerce ul.products li.product-category.product mark.twc-native-cat__count,
	.woocommerce-page ul.products li.product-category.product mark.twc-native-cat__count {
		top: .65rem !important;
		right: .65rem !important;
		width: 3.25rem;
		height: 3.25rem;
	}
}

@media (hover: none) {
	.woocommerce ul.products li.product-category.product:hover,
	.woocommerce-page ul.products li.product-category.product:hover {
		transform: none;
	}

	/* Na dotyku CTA jest widoczne, a opis nie rozpycha i nie zasłania zdjęcia. */
	.twc-native-cat__reveal {
		display: none;
	}
}
