/* ==========================================================
   PGRO Category Grid – v1.0.0
   ========================================================== */

.pgcg {
	--pgcg-accent: #f47b20;
	--pgcg-text: #1d1d1f;
	--pgcg-muted: #8a8a8e;
	--pgcg-stock: #2e9a5b;
	--pgcg-border: #e6e6e6;
	width: 100%;
}

.pgcg *,
.pgcg *::before,
.pgcg *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------- */
/* HERO                                                        */
/* ---------------------------------------------------------- */

.pgcg-hero {
	--pgcg-hero-overlay: rgba(30, 44, 99, 0.96);
	--pgcg-hero-overlay-end: rgba(30, 44, 99, 0.35);
	position: relative;
	display: flex;
	align-items: center;
	min-height: 400px;
	margin-bottom: 60px;
	border-radius: 28px;
	overflow: hidden;
	color: #fff;
	background: #1e2c63;
	isolation: isolate;
}

.pgcg-hero__bg {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: right center;
	z-index: -2;
}

.pgcg-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		90deg,
		var(--pgcg-hero-overlay) 0%,
		var(--pgcg-hero-overlay) 55%,
		var(--pgcg-hero-overlay-end) 100%
	);
}

.pgcg-hero__content {
	width: 100%;
	padding: 60px 60px 60px 20%;
}

.pgcg-hero__inner {
	max-width: 1000px;
}

.pgcg-hero__eyebrow {
	margin: 0 0 14px;
	font-size: clamp(15px, 1.6vw, 22px);
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.pgcg-hero__title {
	margin: 0 0 22px;
	font-size: clamp(32px, 5.6vw, 86px);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: -0.01em;
	color: inherit;
}

.pgcg-hero__text {
	margin: 0;
	max-width: 760px;
	font-size: clamp(14px, 1.3vw, 18px);
	line-height: 1.6;
	color: inherit;
	opacity: 0.95;
}

.pgcg-hero__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 28px;
	padding: 14px 28px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	background: var(--pgcg-accent);
	color: #fff;
	transition: transform .2s ease, filter .2s ease;
}

.pgcg-hero__btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.06);
	color: #fff;
}

@media (max-width: 1024px) {
	.pgcg-hero__content {
		padding: 48px 40px;
	}
}

@media (max-width: 767px) {
	.pgcg-hero {
		align-items: flex-end;
	}
	.pgcg-hero__overlay {
		background: linear-gradient(
			0deg,
			var(--pgcg-hero-overlay) 0%,
			var(--pgcg-hero-overlay) 60%,
			var(--pgcg-hero-overlay-end) 100%
		);
	}
	.pgcg-hero__content {
		padding: 32px 22px;
	}
	.pgcg-hero__title {
		margin-bottom: 14px;
	}
	.pgcg-hero__btn {
		margin-top: 20px;
		padding: 12px 22px;
	}
}

/* ---------------------------------------------------------- */
/* HEADER                                                      */
/* ---------------------------------------------------------- */

.pgcg-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 40px;
	border-bottom: 1px solid var(--pgcg-border);
}

.pgcg-header__title {
	position: relative;
	margin: 0;
	padding: 18px 0 22px;
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--pgcg-accent);
}

.pgcg-header__title::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 3px;
	background: var(--pgcg-accent);
}

.pgcg-header__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	font-size: 20px;
	font-weight: 500;
	color: var(--pgcg-text);
	text-decoration: none;
	transition: color .2s ease;
}

.pgcg-header__link:hover {
	color: var(--pgcg-accent);
}

.pgcg-header__link svg {
	transition: transform .2s ease;
}

.pgcg-header__link:hover svg {
	transform: translateX(3px);
}

@media (max-width: 767px) {
	.pgcg-header {
		margin-bottom: 20px;
	}
	.pgcg-header__title {
		font-size: 18px;
		padding: 12px 0 14px;
	}
	.pgcg-header__link {
		font-size: 14px;
		gap: 4px;
	}
	.pgcg-header__link svg {
		width: 14px;
		height: 14px;
	}
}

/* ---------------------------------------------------------- */
/* GRID – tutti i prodotti, niente scorrimento orizzontale     */
/* ---------------------------------------------------------- */

.pgcg-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	column-gap: 30px;
	row-gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgcg-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
	container-type: inline-size;
	container-name: pgcg-card;
}

/* Media */
.pgcg-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--pgcg-border);
	border-radius: 16px;
	background: #fff;
	overflow: hidden;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.pgcg-card:hover .pgcg-card__media {
	border-color: #d4d4d4;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

.pgcg-card__thumb {
	display: block;
	width: 100%;
	height: 100%;
}

.pgcg-card__thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: contain;
	padding: 8px;
	transition: transform .35s ease;
}

.pgcg-card:hover .pgcg-card__thumb img {
	transform: scale(1.03);
}

/* Wishlist (TI Wishlist) */
.pgcg-card__wish {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
}

.pgcg-card__wish .tinv-wraper,
.pgcg-card__wish .tinv-wishlist {
	margin: 0 !important;
	padding: 0 !important;
}

.pgcg-card__wish .tinvwl_add_to_wishlist_button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0 !important;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	color: var(--pgcg-accent) !important;
}

.pgcg-card__wish .tinvwl_add_to_wishlist_button::before {
	margin: 0 !important;
	color: var(--pgcg-accent) !important;
	font-size: 20px !important;
}

.pgcg-card__wish .tinvwl_add_to_wishlist-text,
.pgcg-card__wish .tinvwl-tooltip,
.pgcg-card__wish .tinv-wishlist-clear {
	display: none !important;
}

/* Body */
.pgcg-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding-top: 16px;
}

.pgcg-card__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--pgcg-text);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.pgcg-card__title a {
	color: inherit;
	text-decoration: none;
}

.pgcg-card__title a:hover {
	color: var(--pgcg-accent);
}

/* Prezzo + etichetta IVA discreta */
.pgcg-card__price-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	margin-top: auto;
}

.pgcg-card__price,
.pgcg-card__price .amount,
.pgcg-card__price bdi {
	font-size: 22px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--pgcg-text);
}

.pgcg-card__price del {
	opacity: .5;
	font-size: .75em;
	margin-right: 4px;
}

.pgcg-card__price del .amount,
.pgcg-card__price del bdi {
	font-size: inherit;
}

.pgcg-card__price ins {
	text-decoration: none;
}

.pgcg-card__price .woocommerce-price-suffix {
	display: none !important;
}

.pgcg-card__tax {
	font-size: 11px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .02em;
	color: var(--pgcg-muted);
	opacity: .85;
	white-space: nowrap;
}

/* Disponibilità */
.pgcg-card__stock {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pgcg-stock);
}

.pgcg-card__stock svg {
	flex-shrink: 0;
}

.pgcg-card__stock.is-out {
	color: #c0392b;
}

/* Empty */
.pgcg-empty {
	padding: 30px 20px;
	text-align: center;
	color: var(--pgcg-muted);
	border: 1px dashed var(--pgcg-border);
	border-radius: 12px;
}

/* ---------------------------------------------------------- */
/* CARD COMPATTE (4 colonne su mobile ecc.)                    */
/* Si basano sulla larghezza della card, non dello schermo.    */
/* ---------------------------------------------------------- */

@container pgcg-card (max-width: 200px) {
	.pgcg-card__body { padding-top: 10px; }
	.pgcg-card__title { font-size: 14px; }
	.pgcg-card__price,
	.pgcg-card__price .amount,
	.pgcg-card__price bdi { font-size: 18px; }
	.pgcg-card__stock { font-size: 12px; }
	.pgcg-card__wish { top: 8px; right: 8px; }
	.pgcg-card__wish .tinvwl_add_to_wishlist_button { width: 32px; height: 32px; }
	.pgcg-card__wish .tinvwl_add_to_wishlist_button::before { font-size: 16px !important; }
}

@container pgcg-card (max-width: 120px) {
	.pgcg-card__media { aspect-ratio: 1 / 1; }
	.pgcg-card__thumb img { padding: 4px; }
	.pgcg-card__body { padding-top: 6px; }
	.pgcg-card__title {
		font-size: 10.5px;
		line-height: 1.3;
		margin-bottom: 4px;
	}
	.pgcg-card__price-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 1px;
	}
	.pgcg-card__price,
	.pgcg-card__price .amount,
	.pgcg-card__price bdi { font-size: 12.5px; font-weight: 600; }
	.pgcg-card__tax { font-size: 8.5px; }
	.pgcg-card__stock { font-size: 9.5px; gap: 3px; margin-top: 4px; }
	.pgcg-card__stock svg { width: 11px; height: 11px; }
	.pgcg-card__wish { top: 3px; right: 3px; }
	.pgcg-card__wish .tinvwl_add_to_wishlist_button { width: 24px; height: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
	.pgcg-card__wish .tinvwl_add_to_wishlist_button::before { font-size: 12px !important; }
}

/* Fallback browser senza container queries */
@supports not (container-type: inline-size) {
	@media (max-width: 767px) {
		.pgcg-card__title { font-size: 10.5px; }
		.pgcg-card__price,
		.pgcg-card__price .amount,
		.pgcg-card__price bdi { font-size: 12.5px; }
		.pgcg-card__tax { font-size: 8.5px; }
		.pgcg-card__stock { font-size: 9.5px; }
	}
}
