/*
 * Porto Garden Loja — catálogo (PG-2)
 * Visual das páginas atuais (Elementor, post-1463.css): título Belleza 61px/23px #B10020,
 * galeria de 3 colunas com raio de 8px, legenda centralizada em Belleza #B10020,
 * texto final em League Spartan 24px #427800.
 *
 * Escopo: body.pg-catalog (archive da loja / product_cat) e body.pg-product (produto).
 * Os seletores de grade usam !important só onde o Astra injeta CSS dinâmico de colunas
 * com especificidade maior (.ast-container .woocommerce ul.products:not(.elementor-grid)).
 */

body.pg-catalog,
body.pg-product {
	--pg-red: #b10020;
	--pg-green: #427800;
	--pg-radius: 8px;
	--pg-font-title: "Belleza", sans-serif;
	--pg-font-text: "League Spartan", sans-serif;
	--pg-gap: 30px;
}

/* ---------------------------------------------------------------------
 * Archive: título
 * ------------------------------------------------------------------- */

body.pg-catalog .woocommerce-products-header {
	margin: 0 0 30px;
	padding: 0;
	text-align: center;
}

body.pg-catalog .pg-archive-title {
	margin: 0 0 20px;
	padding: 0;
	font-family: var(--pg-font-title);
	font-size: 61px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--pg-red);
	text-align: center;
	overflow-wrap: break-word;
}

body.pg-catalog .woocommerce-products-header .term-description,
body.pg-catalog .woocommerce-products-header .page-description {
	text-align: center;
}

/* Garantia extra: nada de contagem/ordenação/breadcrumb mesmo se outro plugin recolocar. */
body.pg-catalog .woocommerce-result-count,
body.pg-catalog .woocommerce-ordering,
body.pg-catalog .woocommerce-breadcrumb {
	display: none !important;
}

/* ---------------------------------------------------------------------
 * Archive: grade
 * ------------------------------------------------------------------- */

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: var(--pg-gap);
	align-items: start;
	margin: 0 0 40px;
	padding: 0;
	list-style: none;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid::before,
:is(body.pg-catalog, body.pg-product) ul.products.pg-grid::after {
	content: none !important;
	display: none !important;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product {
	float: none !important;
	clear: none !important;
	width: auto !important;
	max-width: 100%;
	min-width: 0;
	margin: 0 !important;
	padding: 0;
	text-align: center;
}

/* Card: o link do WooCommerce envolve imagem, nome e preço. */
:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product > a.woocommerce-LoopProduct-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product img {
	display: block;
	width: 100%;
	height: auto !important;
	max-width: 100%;
	margin: 0 0 12px;
	border-radius: var(--pg-radius);
	object-fit: initial;
	aspect-ratio: auto;
	box-shadow: none;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__title {
	margin: 0 0 4px;
	padding: 0;
	font-family: var(--pg-font-title);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--pg-red);
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	overflow-wrap: break-word;
}

/* Banner do topo (seção reaproveitada da página Elementor antiga). */
/* Igual à página antiga: seção de ponta a ponta da tela, colada no cabeçalho. */
body.pg-catalog {
	overflow-x: clip; /* 100vw inclui a barra de rolagem; evita rolagem lateral */
}

body.pg-catalog.pg-has-banner #primary {
	margin-top: 0;
}

body.pg-catalog .pg-archive-banner {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin: 0 calc(50% - 50vw) 40px;
}

body.pg-catalog .pg-archive-banner > .elementor-section {
	width: 100%;
	max-width: none;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__price {
	display: block;
	margin: 0;
	font-family: var(--pg-font-title);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--pg-red);
	text-align: center;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__price .amount,
:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__price ins {
	color: var(--pg-red);
	font-weight: 400;
	text-decoration: none;
	background: none;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__price del {
	opacity: 0.6;
	margin-right: 4px;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product > a.woocommerce-LoopProduct-link:hover .pg-card__title,
:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product > a.woocommerce-LoopProduct-link:focus-visible .pg-card__title {
	text-decoration: underline;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product > a.woocommerce-LoopProduct-link:focus-visible {
	outline: 2px solid var(--pg-red);
	outline-offset: 4px;
	border-radius: var(--pg-radius);
}

/* Cabeçalho de grupo (subcategoria) dentro da grade: ocupa a linha inteira. */
:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.pg-group-title {
	grid-column: 1 / -1;
	float: none;
	width: auto;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	text-align: center;
}

:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.pg-group-title:first-child {
	margin-top: 0;
}

body.pg-catalog .pg-group-title__text {
	margin: 0;
	padding: 0;
	font-family: var(--pg-font-title);
	font-size: 48px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--pg-red);
	text-align: center;
	overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------
 * Archive: texto final
 * ------------------------------------------------------------------- */

body.pg-catalog .pg-archive-footer {
	margin: 20px 0 40px;
	padding: 0;
	font-family: var(--pg-font-text);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--pg-green);
	text-align: center;
}

/* ---------------------------------------------------------------------
 * Produto
 * ------------------------------------------------------------------- */

body.pg-product div.product .woocommerce-product-gallery img,
body.pg-product div.product .woocommerce-product-gallery .flex-viewport,
body.pg-product div.product .woocommerce-product-gallery__image,
body.pg-product div.product .flex-control-thumbs img {
	border-radius: var(--pg-radius);
}

body.pg-product div.product .woocommerce-product-gallery__image,
body.pg-product div.product .woocommerce-product-gallery .flex-viewport {
	overflow: hidden;
}

body.pg-product div.product .product_title {
	font-family: var(--pg-font-title);
	font-weight: 400;
	line-height: 1.25;
	color: var(--pg-red);
	overflow-wrap: break-word;
}

body.pg-product div.product .summary p.price,
body.pg-product div.product .summary span.price {
	font-family: var(--pg-font-title);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--pg-red);
}

body.pg-product div.product .summary .price .amount,
body.pg-product div.product .summary .price ins {
	color: var(--pg-red);
	text-decoration: none;
	background: none;
}

/* ---------------------------------------------------------------------
 * Responsivo (breakpoints do Elementor: tablet <= 1024px, mobile <= 767px)
 * ------------------------------------------------------------------- */

@media (max-width: 1024px) {
	:is(body.pg-catalog, body.pg-product) ul.products.pg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		--pg-gap: 24px;
	}

	body.pg-catalog .pg-group-title__text {
		font-size: 36px;
	}
}

@media (max-width: 767px) {
	body.pg-catalog .pg-archive-title {
		font-size: 23px;
	}

	:is(body.pg-catalog, body.pg-product) ul.products.pg-grid {
		--pg-gap: 16px;
	}

	:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__title,
	:is(body.pg-catalog, body.pg-product) ul.products.pg-grid > li.product .pg-card__price {
		font-size: 15px;
	}

	body.pg-catalog .pg-group-title__text {
		font-size: 23px;
	}

	body.pg-product div.product .summary p.price,
	body.pg-product div.product .summary span.price {
		font-size: 24px;
	}
}

@media (max-width: 399px) {
	:is(body.pg-catalog, body.pg-product) ul.products.pg-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* Produto: "Produtos relacionados" com os cards do catálogo. */
body.pg-product .related.products {
	clear: both;
	margin-top: 60px;
}

body.pg-product .related.products > h2 {
	margin: 0 0 30px;
	font-family: var(--pg-font-title);
	font-size: 36px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--pg-red);
	text-align: center;
	text-transform: none;
}

@media (max-width: 767px) {
	body.pg-product .related.products > h2 {
		font-size: 23px;
	}
}
