/*
 * Elementor renders every widget inside its own auto-generated wrapper
 * (.elementor-widget-asg-category-showcase > .elementor-widget-container).
 * If that wrapper - or the Container the widget sits in - was ever given
 * a fixed/min height or "overflow: hidden" (e.g. copy-pasted from a
 * divider section), the grid below gets silently clipped to that height
 * instead of failing loudly. Force both back to natural sizing here so
 * the plugin can't be clipped by an accidental external setting.
 */
.elementor-widget-asg-category-showcase,
.elementor-widget-asg-category-showcase > .elementor-widget-container {
	width: 100%;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	overflow: visible !important;
}

.asg-category-showcase {
	--asg-cat-cols-desktop: 4;
	--asg-cat-cols-tablet: 2;
	--asg-cat-cols-mobile: 2;
	width: 100%;
}

.asg-category-grid {
	display: grid;
	grid-template-columns: repeat(var(--asg-cat-cols-desktop), 1fr);
	gap: 24px;
	width: 100%;
}

.asg-cat-tile {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	/* Fallback for the rare case a parent gives this 0 width (aspect-ratio
	   can't compute a height from 0), so a tile is never fully invisible. */
	min-height: 220px;
	border-radius: 10px;
	overflow: hidden;
	border: 3px solid #cf9a2e;
	background: #f2ede4;
	text-decoration: none;
}

.asg-cat-tile-media {
	position: absolute;
	inset: 0;
	display: block;
	z-index: 1;
}

.asg-cat-tile-media img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block;
	margin: 0;
	transition: transform .45s ease;
}

.asg-cat-tile:hover .asg-cat-tile-media img {
	transform: scale(1.06);
}

.asg-cat-tile-label {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 20px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--asg-green, #1c4b3c);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 13px 30px 13px 20px;
	clip-path: polygon(0 0, 88% 0, 100% 50%, 88% 100%, 0 100%);
	box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
	text-align: center;
}

/* ---- Tablet ---- */
@media (max-width: 1024px) {
	.asg-category-grid {
		grid-template-columns: repeat(var(--asg-cat-cols-tablet), 1fr);
		gap: 18px;
	}
	.asg-cat-tile-label {
		font-size: 13px;
		padding: 11px 24px 11px 16px;
	}
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
	.asg-category-grid {
		grid-template-columns: repeat(var(--asg-cat-cols-mobile), 1fr);
		gap: 12px;
	}
	.asg-cat-tile {
		border-width: 2px;
		border-radius: 8px;
	}
	.asg-cat-tile-label {
		left: 8px;
		right: 8px;
		bottom: 10px;
		font-size: 11px;
		letter-spacing: 1px;
		padding: 9px 18px 9px 12px;
	}
}

/* ---- Small phones (320-400px) ---- */

@media (max-width: 400px) {
	.asg-category-grid {
		gap: 10px;
	}

	.asg-cat-tile-label {
		left: 6px;
		right: 6px;
		bottom: 8px;
		font-size: 10px;
		letter-spacing: .5px;
		padding: 8px 14px 8px 10px;
	}
}
