/**
 * Barkod Kit — Blocksy type-2 ürün kartları (Shoptimizer üzerinde).
 */

[data-products="type-2"] {
	--bk-card-pad: 20px;
	--bk-card-gap: 8px;
	--bk-card-radius: 8px;
	--bk-card-border: 1px solid rgba(0, 0, 0, 0.08);
	--bk-card-bg: #fff;
	--bk-divider: rgba(0, 0, 0, 0.05);
	--bk-card-text: #2c2d33;
}

/* —— Kart iskeleti —— */
ul.products[data-products="type-2"] > li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	overflow: hidden;
	isolation: isolate;
	/* Shoptimizer gutter (15px) + ATC boşluğu (40px) yerine kart padding */
	padding: 0 var(--bk-card-pad) var(--bk-card-pad) !important;
	margin-bottom: var(--bk-card-gap);
	border: var(--bk-card-border);
	border-radius: var(--bk-card-radius);
	background: var(--bk-card-bg);
	box-shadow: none;
	height: auto;
	align-self: stretch;
}

@media (min-width: 993px) {
	/* Shoptimizer negative-margin + % width yerine gap’li flex */
	ul.products[data-products="type-2"] {
		display: flex !important;
		flex-wrap: wrap;
		width: 100% !important;
		margin-left: 0 !important;
		gap: var(--bk-card-gap);
	}

	ul.products[data-products="type-2"] > li.product {
		float: none !important;
		width: calc((100% - (var(--bk-card-gap) * 2)) / 3) !important; /* columns-3 */
		padding-bottom: var(--bk-card-pad) !important;
		margin-bottom: 0;
	}

	ul.products[data-products="type-2"].columns-2 > li.product {
		width: calc((100% - var(--bk-card-gap)) / 2) !important;
	}

	ul.products[data-products="type-2"].columns-4 > li.product {
		width: calc((100% - (var(--bk-card-gap) * 3)) / 4) !important;
	}

	ul.products[data-products="type-2"].columns-5 > li.product {
		width: calc((100% - (var(--bk-card-gap) * 4)) / 5) !important;
	}

	/* Shoptimizer hover gölge / pseudo */
	ul.products[data-products="type-2"] li.product:not(.product-category):before {
		display: none !important;
		content: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		box-shadow: none !important;
	}
}

ul.products[data-products="type-2"] li.product:hover,
ul.products[data-products="type-2"] li.product:focus-within {
	z-index: 1;
}

@media (max-width: 992px) {
	ul.products[data-products="type-2"] {
		row-gap: var(--bk-card-gap) !important;
		column-gap: var(--bk-card-gap) !important;
	}
}

/* —— Görsel —— */
[data-products="type-2"] .woocommerce-image__wrapper {
	width: calc(100% + (var(--bk-card-pad) * 2));
	margin-inline: calc(var(--bk-card-pad) * -1);
	margin-bottom: 0.75rem;
	transform: none !important;
}

[data-products="type-2"] li.product:hover .woocommerce-image__wrapper,
[data-products="type-2"] li.product:hover .woocommerce-image__wrapper img,
[data-products="type-2"] li.product:not(.product-category):hover img {
	transform: none !important;
}

[data-products="type-2"] .woocommerce-image__wrapper img {
	border-radius: 0;
	width: 100%;
	display: block;
}

/* —— Başlık alanı —— */
[data-products="type-2"] .woocommerce-card__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 1 1 auto;
	width: 100%;
	padding-top: 0.25rem;
	clear: both;
}

[data-products="type-2"] .product__categories {
	text-align: center;
	margin-bottom: 0.35rem;
}

[data-products="type-2"] .woocommerce-loop-product__title,
[data-products="type-2"] h2.woocommerce-loop-product__title {
	width: 100%;
	padding: 0.15rem 0 0.5rem;
	margin: 0;
	font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.875rem);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.02em;
	text-align: center;
}

[data-products="type-2"] .woocommerce-LoopProduct-link {
	display: block;
	text-align: center;
	color: inherit;
}

[data-products="type-2"] .star-rating,
[data-products="type-2"] .shoptimizer_ratingContainer {
	justify-content: center;
	margin-inline: auto;
	margin-bottom: 0.5rem;
}

/* —— Alt şerit: fiyat | buton —— */
[data-products="type-2"] .ct-woo-card-actions {
	display: flex;
	align-items: center;
	width: calc(100% + (var(--bk-card-pad) * 2));
	margin-inline: calc(var(--bk-card-pad) * -1);
	margin-top: auto;
	margin-bottom: calc(var(--bk-card-pad) * -1);
	border-top: 1px solid var(--bk-divider);
	border-bottom: none;
	background: transparent;
}

[data-products="type-2"] .ct-woo-card-actions > * {
	flex: 1 0 0;
	padding: 5px;
	min-height: 55px;
	margin: 0 !important;
}

[data-products="type-2"] .ct-woo-card-actions > .screen-reader-text {
	position: absolute !important;
	flex: 0 0 0 !important;
	width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden;
}

/* CommerceKit fiyat sarmalayıcısı + düz .price */
[data-products="type-2"] .ct-woo-card-actions > .cgkit-as-variation-price,
[data-products="type-2"] .ct-woo-card-actions > .price {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	column-gap: 5px;
}

[data-products="type-2"] .ct-woo-card-actions .price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	column-gap: 5px;
	margin: 0 !important;
	font-size: 15px;
	color: var(--bk-card-text);
	text-align: center;
}

[data-products="type-2"] .ct-woo-card-actions:has(.button) > .cgkit-as-variation-price:after,
[data-products="type-2"] .ct-woo-card-actions:has(.button) > .price:after {
	position: absolute;
	content: "";
	inset-inline-end: 0;
	top: calc(50% - 15px);
	width: 1px;
	height: 30px;
	background: var(--bk-divider);
}

/* Shoptimizer absolute / hover-opacity + Kirki yeşil butonu iptal */
ul.products[data-products="type-2"] li.product .ct-woo-card-actions .button,
ul.products[data-products="type-2"] li.product .ct-woo-card-actions .add_to_cart_button,
ul.products[data-products="type-2"] li.product .ct-woo-card-actions .added_to_cart {
	position: static !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	height: auto !important;
	min-height: 45px;
	padding: 8px 10px !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	opacity: 1 !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	line-height: 1.3 !important;
	font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
	font-weight: 600;
	text-align: center;
	color: var(--bk-card-text) !important;
}

ul.products[data-products="type-2"] li.product .ct-woo-card-actions .button:hover,
ul.products[data-products="type-2"] li.product .ct-woo-card-actions .added_to_cart:hover {
	background-color: transparent !important;
	color: var(--bk-card-text) !important;
	opacity: 0.7 !important;
}

[data-products="type-2"] [data-add-to-cart="auto-hide"] .added {
	display: none;
}

/* Kategori kartları */
ul.products[data-products="type-2"] > li.product-category {
	padding-bottom: var(--bk-card-pad) !important;
}

[data-products="type-2"] > .product-category .woocommerce-loop-category__title,
[data-products="type-2"] > .product-category h2 {
	text-align: center;
	width: 100%;
}
