/* ────────────────────────────────────────────────────────────────────────────
   WC Category Products Block – style frontendowe i edytora
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Wrapper zewnętrzny (dodawany przez useBlockProps / get_block_wrapper_attributes) */

.wc-cat-products-wrapper {
	box-sizing: border-box;
}

/* ── Nagłówek kategorii ──────────────────────────────────────────────────── */

.wc-cat-products__heading {
	margin: 0 0 1.25rem;
	padding: 0;
	font-size: clamp( 1.25rem, 2.5vw, 1.75rem );
	font-weight: 700;
	line-height: 1.25;
	color: #1e293b;
	letter-spacing: -0.01em;
	position: relative;
}

/* ── Link w nagłówku ─────────────────────────────────────────────────────── */

.wc-cat-products__heading-link {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.wc-cat-products__heading-link:hover,
.wc-cat-products__heading-link:focus-visible {
	opacity: 0.75;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 2px;
}

/* Badge ↗ widoczny tylko w edytorze (ukryty na froncie przez editor.css) */
.wc-cat-products__heading-link-badge {
	display: none;
}

/* Dekoracyjna linia pod nagłówkiem */
.wc-cat-products__heading::after {
	content: '';
	display: block;
	margin-top: 0.5rem;
	width: 3rem;
	height: 3px;
	background: currentColor;
	border-radius: 2px;
	opacity: 0.25;
}

/* Wyrównanie linii dekoracyjnej razem z tekstem */
.wc-cat-products__heading[style*="center"]::after {
	margin-left: auto;
	margin-right: auto;
}

.wc-cat-products__heading[style*="right"]::after {
	margin-left: auto;
	margin-right: 0;
}

/* ── Wyrównanie bloku (left / center / right) ────────────────────────────── */

.wc-cat-products-wrapper.alignleft {
	float: left;
	margin-right: 2rem;
	max-width: 50%;
}

.wc-cat-products-wrapper.alignright {
	float: right;
	margin-left: 2rem;
	max-width: 50%;
}

.wc-cat-products-wrapper.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

/* Wide i Full – siatka może rozciągnąć się poza content */
.wc-cat-products-wrapper.alignwide,
.wc-cat-products-wrapper.alignfull {
	width: 100%;
}

/* ── Siatka produktów ────────────────────────────────────────────────────── */

.wc-cat-products {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 1.5rem;
	padding: 0;
	list-style: none;
	margin: 0;
}

/* ── Pojedynczy kafelek ──────────────────────────────────────────────────── */

.wc-cat-products__item {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	background: #ffffff;
	transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.wc-cat-products__item:hover {
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.12 );
	transform: translateY( -2px );
}

/* ── Link opakowujący ────────────────────────────────────────────────────── */

.wc-cat-products__link {
	display: block;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

/* ── Miniatura produktu ──────────────────────────────────────────────────── */

.wc-cat-products__thumbnail {
	position: relative;
	overflow: hidden;
	background: #f8fafc;
	aspect-ratio: 1 / 1;
}

.wc-cat-products__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.wc-cat-products__item:hover .wc-cat-products__thumbnail img {
	transform: scale( 1.05 );
}

.wc-cat-products__thumbnail--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	color: #94a3b8;
	font-size: 0.85rem;
}

/* ── Informacje o produkcie ──────────────────────────────────────────────── */

.wc-cat-products__info {
	padding: 0.85rem 1rem 1rem;
}

.wc-cat-products__title {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
	line-height: 1.4;
	color: #1e293b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wc-cat-products__price {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
	color: #0f766e;
}

.wc-cat-products__price del {
	color: #94a3b8;
	font-weight: 400;
	margin-right: 4px;
}

.wc-cat-products__price ins {
	text-decoration: none;
	color: #ef4444;
}

/* ── Komunikaty informacyjne ─────────────────────────────────────────────── */

.wc-cat-products__notice {
	padding: 1.25rem 1.5rem;
	background: #f1f5f9;
	border-left: 4px solid #94a3b8;
	border-radius: 0 6px 6px 0;
	color: #475569;
	font-size: 0.9rem;
	margin: 0;
}

.wc-cat-products__notice--error {
	background: #fef2f2;
	border-color: #f87171;
	color: #b91c1c;
}

/* ── Responsywność ───────────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
	.wc-cat-products {
		grid-template-columns: repeat( 2, 1fr );
		gap: 1rem;
	}

	.wc-cat-products-wrapper.alignleft,
	.wc-cat-products-wrapper.alignright {
		float: none;
		margin: 0;
		max-width: 100%;
	}
}

@media ( max-width: 480px ) {
	.wc-cat-products {
		grid-template-columns: 1fr;
		gap: 0.875rem;
	}

	.wc-cat-products__thumbnail {
		aspect-ratio: 4 / 3;
	}

	.wc-cat-products__heading {
		font-size: 1.25rem;
	}
}
