/* Structural layout only — colors/typography/spacing come from Elementor
   controls. Targets WooCommerce's own loop/card markup. */

.diza-producten-tegel {
	--diza-tegel-columns: 3;
	--diza-tegel-gap: 20px;
	--diza-tegel-button-size: 40px;
	display: grid;
	grid-template-columns: repeat( var( --diza-tegel-columns ), 1fr );
	gap: var( --diza-tegel-gap );
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Theme's classic float-grid clearfix pseudo-element was claiming grid cell 1. */
.diza-producten-tegel::before,
.diza-producten-tegel::after {
	content: none !important;
	display: none !important;
}

.diza-producten-tegel > li.product {
	/* Resets the theme's classic float-grid styling; !important beats its higher specificity. */
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	list-style: none;
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.diza-producten-tegel > li.product a {
	text-decoration: none;
}

.diza-producten-tegel > li.product img {
	display: block;
	width: 100%;
	height: auto;
}

.diza-producten-tegel__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: inline-block;
	padding: 4px 12px;
	line-height: 1.4;
	white-space: nowrap;
}

/* Decorative full-card link, below the add-to-cart button so that stays clickable. */
.diza-producten-tegel__card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.diza-producten-tegel > li.product .woocommerce-loop-product__title {
	margin: 12px 0 4px;
}

.diza-producten-tegel > li.product .star-rating {
	margin-bottom: 4px;
}

.diza-producten-tegel__rating-count {
	margin-left: 4px;
}

/* Product link fills the card so the price/stock block can sit at its bottom (!important: theme forces display:block). */
.diza-producten-tegel > li.product .woocommerce-LoopProduct-link {
	display: flex !important;
	flex-direction: column;
	flex: 1 1 auto;
}

/* Price + stock, bottom-left; button positioned absolutely bottom-right, padding-right avoids overlap. */
.diza-producten-tegel__meta {
	margin-top: auto;
	padding-top: 8px;
	padding-right: calc( var( --diza-tegel-button-size ) + 12px );
	min-height: var( --diza-tegel-button-size );
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-sizing: content-box;
}

.diza-producten-tegel > li.product .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 8px;
	margin: 0;
	padding: 0;
}

/* Sale: no browser underline on the new price; original price smaller and muted (!important beats WC's own .price del/ins rules). */
.diza-producten-tegel > li.product .price ins {
	text-decoration: none !important;
	background: none !important;
}

.diza-producten-tegel > li.product .price del {
	text-decoration: line-through;
	opacity: 1 !important;
}

/* `.button` (not `.add_to_cart_button`): a non-purchasable product's "Lees meer" link only has this class. */
.diza-producten-tegel > li.product .button {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	line-height: 1;
	text-align: center;
	box-sizing: border-box;
	/* Resets theme's default text-label padding, which threw off icon centering. */
	padding: 0 !important;
}

/* Own sale badge (replaces WC's .onsale); colors/typography/padding via Elementor controls. */
.diza-producten-tegel__sale {
	--diza-sale-offset: 12px;
	position: absolute;
	top: var( --diza-sale-offset );
	z-index: 2;
	display: inline-block;
	line-height: 1.4;
	white-space: nowrap;
}

.diza-producten-tegel__sale--right {
	right: var( --diza-sale-offset );
}

.diza-producten-tegel__sale--left {
	left: var( --diza-sale-offset );
}

.diza-producten-tegel__stock {
	display: block;
	margin-top: 4px;
}

.diza-producten-tegel__meta > .diza-producten-tegel__stock:first-child {
	margin-top: 0;
}

/* Targets both possible icon outputs: <svg> or <i> (font icon). */
.diza-producten-tegel__cart-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	box-sizing: content-box;
}

.diza-producten-tegel__cart-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.diza-producten-tegel__cart-icon i {
	display: block;
	line-height: 1;
}

/* --- Editor-only placeholder --- */

.diza-producten-tegel__placeholder {
	padding: 16px;
	border: 1px dashed #c3c4c7;
	background: #f6f7f7;
	color: #50575e;
	font-size: 13px;
}
