/* Cabeçalho das listagens e colunas da grelha (desktop). Ver inc/shop-header.php */

@media (min-width: 850px) {
	/* Filhos das duas colunas do Flatsome passam a itens de uma só linha */
	.shop-page-title.category-page-title .page-title-inner {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0 12px;
		padding: 28px 0 20px;
		border-bottom: 1px solid #e5e5e5;
	}
	.shop-page-title.category-page-title .page-title-inner > div {
		display: contents;
	}

	/* Título */
	.shop-page-title.category-page-title .is-xsmall {
		order: 1;
		flex: 0 0 100%;
		margin: 0 0 18px;
	}
	.shop-page-title.category-page-title nav.breadcrumbs,
	.shop-page-title.category-page-title nav.breadcrumbs p {
		margin: 0;
		font-size: 12px;
		line-height: 1.2;
	}
	.shop-page-title.category-page-title nav.breadcrumbs .last {
		font-size: 32px;
		font-weight: 800;
		letter-spacing: 0;
	}

	/* Filtrar: só ícone e texto, discreto (o contorno fica para os seletores à direita) */
	.shop-page-title.category-page-title .category-filtering {
		order: 2;
		float: none;
		margin: 0;
	}
	.shop-page-title.category-page-title .filter-button {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		box-sizing: border-box;
		height: 44px;
		margin: 0;
		padding: 0 6px 0 0;
		border: 0;
		background: none;
		color: #111;
	}
	.shop-page-title.category-page-title .filter-button strong {
		font-size: 13px;
		font-weight: 600;
		letter-spacing: .04em;
		text-transform: uppercase;
	}
	.shop-page-title.category-page-title .filter-button:hover strong {
		text-decoration: underline;
		text-underline-offset: 4px;
	}

	/* Total de produtos */
	.shop-page-title.category-page-title .woocommerce-result-count {
		order: 3;
		margin: 0 auto 0 4px;
		color: #555;
		font-size: 13px;
	}

	/* Colunas */
	.giaw-grid {
		display: flex;
		order: 4;
		gap: 2px;
	}
	.giaw-grid__btn {
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 30px;
		height: 30px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: var(--giaw-r-btn, 5px);
		background: none;
		color: #b5b5b5;
		cursor: pointer;
	}
	.giaw-grid__btn[aria-pressed="true"] {
		background: #f0f0f0;
		color: #111;
	}
	.giaw-grid__btn:not([aria-pressed="true"]):hover {
		color: #111;
	}

	/* Ordenação */
	.shop-page-title.category-page-title form.woocommerce-ordering {
		order: 5;
		margin: 0;
	}
	.shop-page-title.category-page-title form.woocommerce-ordering select {
		width: auto;
		height: 44px;
		margin: 0;
		padding: 0 28px 0 10px;
		border: 0;
		border-radius: var(--giaw-r-btn, 5px);
		background-color: transparent;
		box-shadow: none;
		font-size: 13px;
		font-weight: 600;
	}

	/* Colunas escolhidas (sem atributo = 4, o padrão do tema) */
	html[data-giaw-cols="3"] .shop-container .products.row > .col {
		flex-basis: 33.3333%;
		max-width: 33.3333%;
	}
	html[data-giaw-cols="4"] .shop-container .products.row > .col {
		flex-basis: 25%;
		max-width: 25%;
	}
	html[data-giaw-cols="5"] .shop-container .products.row > .col {
		flex-basis: 20%;
		max-width: 20%;
	}
}

/* O seletor só existe em desktop */
@media (max-width: 849px) {
	.giaw-grid {
		display: none;
	}
}

/* Botão "Ver mais produtos" (carregamento por AJAX do Flatsome): discreto, preto, baixo */
.view-more-button.products-archive {
	box-sizing: border-box;
	min-width: 0;
	height: 40px;
	margin: 24px 0 0;
	padding: 0 22px;
	border: 0;
	border-radius: var(--giaw-r-btn, 5px) !important;
	background: #111 !important;
	color: #fff !important;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	line-height: 40px;
	text-transform: uppercase;
}
.view-more-button.products-archive:hover {
	background: #333 !important;
}

/* Categorias no topo da loja: filas compactas */
.giaw-shop-cats {
	margin: 0 0 28px;
}
.giaw-shop-cats__group + .giaw-shop-cats__group {
	margin-top: 18px;
}
.giaw-shop-cats__label {
	display: block;
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.giaw-shop-cats .row {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-start !important; /* o tema centra a fila (align-center) e corta o início quando há scroll */
	gap: 8px;
	margin: 0;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}
.giaw-shop-cats .row::-webkit-scrollbar {
	display: none;
}
.giaw-shop-cats .row > .col {
	flex: 1 0 128px;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	scroll-snap-align: start;
}
.giaw-shop-cats .col-inner {
	padding: 0;
}
.giaw-shop-cats .banner {
	height: 120px;
	padding-top: 0 !important;
	border-radius: var(--giaw-r-btn, 5px);
	overflow: hidden;
}
.giaw-shop-cats .banner .text-box h3 {
	font-size: 11px;
	letter-spacing: .06em;
	line-height: 1.2;
}
@media (max-width: 549px) {
	.giaw-shop-cats .row > .col {
		flex: 0 0 112px;
	}
	.giaw-shop-cats .banner {
		height: 130px;
	}
}

/* Faixa das páginas 2, 3... */
.giaw-paged-note {
	margin: 0 0 16px;
	color: #555;
	font-size: 13px;
}
.giaw-paged-note a {
	color: #111;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Texto de apresentação da categoria: arrumado e discreto */
.giaw-seo-text {
	max-width: 720px;
	margin: 40px auto 28px;
	color: #6b6b6b;
	font-size: 12px;
	line-height: 1.7;
	text-align: center;
}

/* ---------- Telemóvel e tablet: cabeçalho da listagem (larguras fixas nos botões, sem depender do tamanho do conteúdo) ---------- */
@media (max-width: 849px) {
	body .shop-page-title.category-page-title .page-title-inner.giaw-bar {
		display: flex !important;
		flex-flow: row wrap !important;
		align-items: center;
		column-gap: 8px;
		padding: 18px 15px 8px;
		border-bottom: 1px solid #e5e5e5;
		text-align: left !important;
	}
	body .shop-page-title.category-page-title .giaw-bar > div {
		display: contents !important;
	}
	body .shop-page-title.category-page-title .is-xsmall {
		order: 1;
		flex: 0 0 100% !important;
		margin: 0 0 6px;
		text-align: left !important;
	}
	body .shop-page-title.category-page-title nav.breadcrumbs,
	body .shop-page-title.category-page-title nav.breadcrumbs p {
		margin: 0;
		font-size: 11px;
		line-height: 1.2;
		text-align: left !important;
	}
	body .shop-page-title.category-page-title nav.breadcrumbs .last {
		font-size: 26px !important;
		font-weight: 800;
		letter-spacing: 0;
		text-align: left !important;
	}
	body .shop-page-title.category-page-title .category-filtering {
		order: 2;
		display: flex !important;
		align-items: center;
		flex: 0 0 96px !important;
		float: none !important;
		width: 96px !important;
		height: 44px;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: none !important;
		box-shadow: none !important;
	}
	body .shop-page-title.category-page-title .filter-button {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		width: auto !important;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		color: #111;
		line-height: 1;
	}
	body .shop-page-title.category-page-title .filter-button i {
		top: 0 !important;
		margin: 0;
	}
	body .shop-page-title.category-page-title .filter-button strong {
		font-size: 13px;
		font-weight: 600;
		letter-spacing: .04em;
		text-transform: uppercase;
	}
	body .shop-page-title.category-page-title .woocommerce-result-count {
		display: block !important;
		order: 3;
		flex: 1 1 0 !important;
		min-width: 0;
		width: auto !important;
		margin: 0 !important;
		overflow: hidden;
		height: 44px;
		color: #555;
		font-size: 12px;
		line-height: 44px;
		text-align: left !important;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	body .shop-page-title.category-page-title form.woocommerce-ordering {
		order: 4;
		display: flex;
		align-items: center;
		flex: 0 0 160px !important;
		width: 160px !important;
		height: 44px;
		margin: 0 !important;
	}
	body .shop-page-title.category-page-title form.woocommerce-ordering select {
		display: block;
		width: 100% !important;
		max-width: none;
		height: 44px;
		margin: 0 !important;
		padding: 0 24px 0 6px;
		border: 0;
		background-color: transparent;
		box-shadow: none;
		font-size: 13px;
		font-weight: 600;
		text-align: right !important;
		text-align-last: right;
		text-overflow: ellipsis;
	}
}

/* Subcategorias no topo das categorias: sem rótulo, perto do cabeçalho */
.giaw-shop-cats--sub {
	margin-top: 4px;
}

/* Mosaicos de categorias: nome legível sobre qualquer foto (degradé escuro por baixo + sombra no texto) */
.giaw-shop-cats .banner {
	position: relative;
}
.giaw-shop-cats .banner::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	height: 65%;
	background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.giaw-shop-cats .banner .banner-layers {
	z-index: 2;
}
.giaw-shop-cats .banner .text-box h3 {
	font-size: 12px;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}

/* Categorias em texto: ligações em "pílulas" discretas */
.giaw-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.giaw-chip {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	height: 34px;
	padding: 0 14px;
	border: 1px solid #dcdcdc;
	border-radius: var(--giaw-r-btn, 5px);
	color: #111;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}
.giaw-chip:hover {
	border-color: #111;
	background: #111;
	color: #fff;
}
.giaw-shop-cats .giaw-chips {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
}
.giaw-shop-cats .giaw-chips::-webkit-scrollbar {
	display: none;
}

/* Mosaicos em desktop, lista em telemóvel */
.giaw-cats-chips {
	display: none;
}
@media (max-width: 849px) {
	.giaw-cats-tiles {
		display: none;
	}
	.giaw-cats-chips {
		display: block;
	}
}

/* Blur leve da foto ao passar o rato (só em ecrãs com rato) */
.giaw-shop-cats--head .banner .banner-bg img {
	transition: filter .25s ease, transform .25s ease;
}
@media (hover: hover) {
	.giaw-shop-cats--head .banner:hover .banner-bg img {
		filter: blur(2px);
		transform: scale(1.05);
	}
}

/* Mosaicos: no cabeçalho em desktop, lista em texto no corpo em telemóvel */
.giaw-shop-cats--head {
	display: none;
}
.giaw-shop-cats--body {
	display: block;
}
@media (min-width: 850px) {
	.giaw-shop-cats--head {
		display: block;
		order: 1;
		flex: 0 0 100%;
		margin: 0 0 22px;
	}
	.giaw-shop-cats--body {
		display: none;
	}
}

/* Título com caminho (breadcrumbs): o caminho em pequeno numa linha e o título da página por baixo */
.shop-page-title.category-page-title nav.breadcrumbs p {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 6px;
	margin: 0;
}
.shop-page-title.category-page-title nav.breadcrumbs p > a,
.shop-page-title.category-page-title nav.breadcrumbs p > .separator {
	font-size: 12px !important;
	font-weight: 500;
	line-height: 1.4;
	color: #6b6b6b;
}
.shop-page-title.category-page-title nav.breadcrumbs p > .last {
	flex: 0 0 100%;
	margin-top: 6px;
}
