/* Search Offers Block — alineado con identitat Organigrama i tokens del tema (tipografia, botons, inputs). */

.wp-block-extendable-search-offers,
.wp-block-extendable-home-offers {
	/* Marca: si el preset --primary del lloc és el verd corporatiu, tot hereda coherent. */
	--oferta-brand: var(--wp--preset--color--primary, #5d7b3e);
	--oferta-brand-foreground: var(--wp--preset--color--background, #ffffff);
	--oferta-cta-bg: #d4e157;
	--oferta-cta-bg-hover: #c6d931;
	--oferta-cta-text: #2a361c;
	--oferta-surface: var(--wp--preset--color--background, #ffffff);
	--oferta-surface-muted: var(--wp--preset--color--tertiary, #f4f6f1);
	--oferta-border: color-mix(in srgb, var(--wp--preset--color--foreground, #1a1a1a) 12%, transparent);
	--oferta-border-strong: color-mix(in srgb, var(--wp--preset--color--foreground, #1a1a1a) 18%, transparent);
	--oferta-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
	/* CTAs: radi = token de botó del tema (theme.json); ombra = mateixa família que les targetes del bloc */
	--oferta-cta-shadow: var(--oferta-shadow-card);
	--oferta-cta-shadow-hover: var(--oferta-shadow-card), 0 8px 28px color-mix(in srgb, var(--oferta-brand) 32%, transparent);
	--oferta-radius-lg: 12px;
	--oferta-radius-pill: 2rem;
	--oferta-font-body: var(--wp--preset--font-family--body, var(--wp--preset--font-family--inter, inherit));
	--oferta-font-heading: var(--wp--preset--font-family--heading, var(--wp--preset--font-family--inter, inherit));
	--oferta-input-radius: var(--wp--custom--elements--input--border--radius, 4px);
	--oferta-input-border: var(--wp--custom--elements--input--border--color, var(--wp--preset--color--foreground, #0b0620));
	--oferta-focus-ring: 0 0 0 2px var(--oferta-surface), 0 0 0 4px var(--oferta-brand);
	font-family: var(--oferta-font-body);
	color: var(--wp--preset--color--foreground);
}

/* Fallbacks si el navegador no suporta color-mix */
@supports not (color: color-mix(in srgb, black 50%, white)) {
	.wp-block-extendable-search-offers,
	.wp-block-extendable-home-offers {
		--oferta-border: rgba(0, 0, 0, 0.1);
		--oferta-border-strong: rgba(0, 0, 0, 0.14);
		--oferta-cta-shadow-hover: var(--oferta-shadow-card), 0 8px 28px rgba(0, 0, 0, 0.12);
	}

	.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input {
		border-color: #5d7b3e;
		box-shadow: 0 2px 12px rgba(93, 123, 62, 0.14);
	}

	.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input::placeholder {
		color: #5d7b3e;
		opacity: 0.55;
	}
}

/* ===== Shared card styles (Listing + Home) ===== */

.wp-block-extendable-home-offers .oferta-card,
.wp-block-extendable-search-offers .ofertas-results .oferta-card {
	position: relative;
	overflow: hidden;
	background-color: var(--oferta-surface);
	border: 1px solid var(--oferta-border);
	border-radius: var(--oferta-radius-lg);
	display: flex;
	flex-direction: column;
	min-height: 240px;
	box-shadow: var(--oferta-shadow-card);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.wp-block-extendable-home-offers .oferta-card:hover,
.wp-block-extendable-search-offers .ofertas-results .oferta-card:hover {
	border-color: var(--oferta-brand);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.wp-block-extendable-home-offers .oferta-card-logo,
.wp-block-extendable-search-offers .oferta-card-logo {
	position: absolute;
	top: 0.35rem;
	right: 0.55rem;
	height: clamp(72px, 7vw, 96px) !important;
	width: auto;
	z-index: 0;
	pointer-events: none;
	user-select: none;
}

.wp-block-extendable-home-offers .oferta-content-wrapper,
.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper {
	position: relative;
	z-index: 1;
	/* Espai reservat només per al tag d'àrea (el logo només ocupa la part superior). */
	--oferta-logo-space: 96px;
	padding-right: var(--wp--preset--spacing--30, 1.25rem);
}

.wp-block-extendable-home-offers .oferta-date-tag,
.wp-block-extendable-search-offers .ofertas-results .oferta-date-tag {
	z-index: 2;
}

.wp-block-extendable-home-offers .oferta-area-pill,
.wp-block-extendable-search-offers .ofertas-results .oferta-area-pill {
	position: relative;
	z-index: 1;
	max-width: calc(100% - var(--oferta-logo-space, 96px) - 0.75rem);
}

@media (max-width: 600px) {
	.wp-block-extendable-home-offers .oferta-card-logo,
	.wp-block-extendable-search-offers .oferta-card-logo {
		height: 56px !important;
		top: 0.35rem;
		right: 0.45rem;
	}

	.wp-block-extendable-home-offers .oferta-content-wrapper,
	.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper {
		--oferta-logo-space: 0;
		padding-right: var(--wp--preset--spacing--30, 1.25rem) !important;
		padding-top: calc(var(--wp--preset--spacing--50, 2rem) + 1.25rem) !important;
	}
}

.wp-block-extendable-home-offers .oferta-date-tag,
.wp-block-extendable-search-offers .ofertas-results .oferta-date-tag {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	background-color: var(--oferta-brand);
	color: var(--oferta-brand-foreground);
	border-radius: 10px;
	z-index: 3;
	padding: 0.45rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

@media (max-width: 600px) {
	.wp-block-extendable-home-offers .oferta-date-tag,
	.wp-block-extendable-search-offers .ofertas-results .oferta-date-tag {
		top: 0.5rem;
		left: 0.5rem;
		padding: 0.38rem 0.65rem;
	}
}

.wp-block-extendable-home-offers .oferta-content-wrapper,
.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper {
	padding-left: var(--wp--preset--spacing--30, 1.25rem);
	padding-right: var(--wp--preset--spacing--30, 1.25rem);
	padding-top: var(--wp--preset--spacing--50, 2rem);
	padding-bottom: var(--wp--preset--spacing--30, 1.25rem);
	display: flex;
	flex-direction: column;
	flex: 1;
}

.wp-block-extendable-home-offers .oferta-area-pill,
.wp-block-extendable-search-offers .ofertas-results .oferta-area-pill {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	margin: 0 0 0.75rem 0;
	padding: 0.2rem 0.65rem;
	border-radius: var(--oferta-radius-pill);
	background: var(--oferta-surface-muted);
	border: 1px solid var(--oferta-border-strong);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--oferta-brand);
}

@media (max-width: 600px) {
	.wp-block-extendable-home-offers .oferta-area-pill,
	.wp-block-extendable-search-offers .ofertas-results .oferta-area-pill {
		max-width: calc(100% - 4.5rem);
		margin-top: 0.45rem;
	}
}

/* Card excerpt (listing + home) */
.wp-block-extendable-search-offers .ofertas-results .oferta-card-excerpt,
.wp-block-extendable-home-offers .oferta-card-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 var(--wp--preset--spacing--20, 0.75rem);
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--wp--preset--color--foreground);
	opacity: 0.78;
	overflow-wrap: anywhere;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-card-excerpt {
	-webkit-line-clamp: 3;
}

.wp-block-extendable-home-offers .oferta-card-excerpt {
	-webkit-line-clamp: 2;
}

.wp-block-extendable-home-offers .oferta-content-wrapper h3,
.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper h3.wp-block-heading {
	font-family: var(--oferta-font-heading);
	font-size: clamp(1rem, 0.95rem + 0.35vw, 1.125rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--foreground);
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--20, 0.75rem);
	hyphens: auto;
	overflow-wrap: anywhere;
}

.wp-block-extendable-home-offers .oferta-zone-button-row,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-top: auto;
	gap: var(--wp--preset--spacing--20, 0.75rem);
	flex-wrap: nowrap;
}

.wp-block-extendable-home-offers .oferta-zone-button-row > p,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row > p {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wp--preset--color--foreground);
	opacity: 0.82;
	flex: 1 1 auto;
	min-width: 4.5rem;
	overflow-wrap: break-word;
}

.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-zona-label,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-zona-label {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	line-height: 1.3;
	min-width: 4.5rem;
}

.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-zona-label-text,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-zona-label-text {
	font-weight: 600;
}

.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-zona-name,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-zona-name {
	font-weight: 500;
	overflow-wrap: break-word;
	word-break: normal;
}

.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-web-cta,
.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-web-cta {
	flex: 0 0 auto;
	align-self: flex-end;
	white-space: nowrap;
	max-width: 100%;
}

/* Títol de pàgina just sobre el bloc de cerca (p. ex. «Explora les ofertes…») */
.wp-block-heading:has(+ .wp-block-extendable-search-offers),
.wp-block-heading#ofertes {
	color: var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
}

/* Títol del bloc — reforç visual coherent amb capçaleres de pàgina / banner */
.wp-block-extendable-search-offers .ofertas-block-title {
	font-family: var(--oferta-font-heading);
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	letter-spacing: 0.04em;
	line-height: var(--wp--custom--typography--line-height--tiny, 1.15);
	color: var(--oferta-brand);
	text-wrap: balance;
}

@media (min-width: 782px) {
	.wp-block-extendable-search-offers .ofertas-block-title {
		font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.25rem);
	}
}

/* Menys aire sota el títol per acostar filtres i resultats */
.wp-block-extendable-search-offers > .wp-block-group:first-of-type {
	margin-bottom: var(--wp--preset--spacing--30, 1rem) !important;
}

/* Línia curta sota el títol + text introductori (com banners del lloc) */
.wp-block-extendable-search-offers .ofertas-block-intro-sep {
	width: 3rem;
	max-width: 25%;
	height: 0;
	margin: 0.65rem auto 0.85rem;
	border: 0;
	border-top: 2px solid var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
	opacity: 0.85;
}

.wp-block-extendable-search-offers .ofertas-block-intro {
	max-width: 38rem;
	margin: 0 auto 1.25rem;
	padding: 0 var(--wp--preset--spacing--20, 0.75rem);
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	line-height: var(--wp--custom--typography--line-height--medium, 1.45);
	color: var(--wp--preset--color--foreground);
	opacity: 0.82;
}

/* Filtres sense caixa: sense fons ni vora; només ritme vertical */
.wp-block-extendable-search-offers .ofertas-filters-bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: var(--wp--preset--spacing--30, 1.15rem);
	margin-bottom: var(--wp--preset--spacing--40, 1.5rem);
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.wp-block-extendable-search-offers .ofertas-tags-panel {
	display: contents;
}

.wp-block-extendable-search-offers .ofertas-tags-row-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	outline: none;
}

.wp-block-extendable-search-offers .ofertas-tags-row-toggle:focus,
.wp-block-extendable-search-offers .ofertas-tags-row-toggle:focus-visible {
	outline: none;
	box-shadow: none;
}

.wp-block-extendable-search-offers .ofertas-tags-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	font-size: 1.05rem;
	border-radius: 999px;
	border: 1px solid var(--oferta-border-strong);
	color: var(--oferta-brand);
	background: var(--oferta-surface);
	transition: transform 0.18s ease;
	flex: 0 0 auto;
}

.wp-block-extendable-search-offers .ofertas-tags-row.is-collapsed .ofertas-tags-arrow {
	transform: rotate(-90deg);
}

.wp-block-extendable-search-offers .ofertas-tags-row-body {
	width: 100%;
}

.wp-block-extendable-search-offers .ofertas-tags-row.is-collapsed .ofertas-tags-row-body {
	display: none;
}

.wp-block-extendable-search-offers .ofertas-tags-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	width: 100%;
	min-width: 0;
}

/* Fila cerca: destacada i centrada */
.wp-block-extendable-search-offers .ofertas-filters-row-actions {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	width: 100%;
	min-width: 0;
	padding-bottom: var(--wp--preset--spacing--30, 1.15rem);
	margin-bottom: 0.35rem;
	border-bottom: 1px solid var(--oferta-border);
}

.wp-block-extendable-search-offers .ofertas-tags-label {
	margin: 0;
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	color: var(--oferta-brand);
	opacity: 1;
	letter-spacing: 0.02em;
}

.wp-block-extendable-search-offers .ofertas-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	align-items: center;
}

/* Més aire entre línies de tags */
.wp-block-extendable-search-offers .ofertas-tags-row {
	gap: 0.65rem;
}

/* Tags: estil “outline” com botons secundaris; actiu com marca */
.wp-block-extendable-search-offers .ofertas-tag {
	border: 1px solid var(--oferta-border-strong);
	background: var(--oferta-surface);
	color: var(--wp--preset--color--foreground);
	border-radius: var(--oferta-radius-pill);
	padding: 0.55rem 1.1rem;
	font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);
	line-height: 1.3;
	font-weight: var(--wp--custom--typography--font-weight--medium, 500);
	cursor: pointer;
	transition:
		background-color 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease,
		opacity 0.18s ease;
	white-space: normal;
	text-align: left;
	max-width: 100%;
	hyphens: auto;
	overflow-wrap: anywhere;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.wp-block-extendable-search-offers .ofertas-tag:hover:not(.is-disabled):not(.is-active) {
	border-color: var(--oferta-brand);
	color: var(--oferta-brand);
	background: rgba(255, 255, 255, 0.85);
}

.wp-block-extendable-search-offers .ofertas-tag:focus-visible {
	outline: none;
	box-shadow: var(--oferta-focus-ring);
}

.wp-block-extendable-search-offers .ofertas-tag.is-active {
	background: var(--oferta-brand);
	border-color: var(--oferta-brand);
	color: var(--oferta-brand-foreground);
	box-shadow: 0 4px 14px rgba(45, 74, 32, 0.2);
}

.wp-block-extendable-search-offers .ofertas-tag.is-disabled {
	opacity: 0.38;
	cursor: not-allowed;
	box-shadow: none;
}

.wp-block-extendable-search-offers .ofertas-clear-filters {
	border: 0;
	background: transparent;
	color: var(--oferta-brand);
	font-size: 0.9375rem;
	font-weight: var(--wp--custom--typography--font-weight--medium, 500);
	padding: 0.35rem 0;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	align-self: center;
	white-space: nowrap;
	transition: opacity 0.15s ease;
	flex: 0 0 auto;
	order: 2;
}

.wp-block-extendable-search-offers .ofertas-clear-filters:hover {
	opacity: 0.85;
}

.wp-block-extendable-search-offers .ofertas-clear-filters:focus-visible {
	outline: none;
	border-radius: 4px;
	box-shadow: var(--oferta-focus-ring);
}

.wp-block-extendable-search-offers .ofertas-filters-right {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	align-items: center;
	flex: 1 1 auto;
	width: 100%;
	max-width: 36rem;
	min-width: 0;
	margin-left: 0;
	order: 1;
}

.wp-block-extendable-search-offers .ofertas-search-label {
	margin: 0;
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	color: var(--oferta-brand);
	opacity: 1;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase;
}

.wp-block-extendable-search-offers .ofertas-search {
	width: 100%;
}

.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input {
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
	line-height: var(--wp--custom--typography--line-height--medium, 1.4);
	font-weight: var(--wp--custom--typography--font-weight--medium, 500);
	border-radius: var(--oferta-radius-pill);
	border-width: 2px;
	border-style: solid;
	border-color: var(--oferta-brand);
	background: var(--oferta-surface);
	color: var(--wp--preset--color--foreground);
	padding: 0.85em 1.35em;
	box-shadow: 0 2px 12px color-mix(in srgb, var(--oferta-brand) 14%, transparent);
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}

.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input::placeholder {
	color: color-mix(in srgb, var(--oferta-brand) 52%, var(--wp--preset--color--foreground));
	opacity: 0.72;
}

.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input:hover {
	border-color: var(--oferta-brand);
	box-shadow: 0 4px 16px color-mix(in srgb, var(--oferta-brand) 18%, transparent);
}

.wp-block-extendable-search-offers .ofertas-search .wp-block-search__input:focus {
	outline: none;
	border-color: var(--oferta-brand);
	box-shadow: var(--oferta-focus-ring), var(--oferta-shadow-card);
}

.wp-block-extendable-search-offers .ofertas-filters-fallback {
	display: none;
}

@media (max-width: 768px) {
	.wp-block-extendable-search-offers .ofertas-filters-row-actions {
		align-items: center;
	}
	.wp-block-extendable-search-offers .ofertas-clear-filters {
		align-self: center;
		order: 2;
	}
	.wp-block-extendable-search-offers .ofertas-filters-right {
		align-items: center;
		max-width: 100%;
		order: 1;
	}
}

/* Mobile: tags wrap naturally (no columns, no scroll) */
@media (max-width: 600px) {
	.wp-block-extendable-search-offers .ofertas-tags-row {
		gap: 0.5rem;
		padding-bottom: 0.25rem;
		border-bottom: 1px solid var(--oferta-border);
	}

	.wp-block-extendable-search-offers .ofertas-tags {
		display: flex;
		flex-wrap: wrap;
		gap: 0.6rem;
		align-items: center;
	}

	.wp-block-extendable-search-offers .ofertas-tag {
		/* Let tags fill rows, but allow multiple per row */
		flex: 1 1 9.5rem;
		max-width: 100%;
		justify-content: flex-start;
		text-align: left;
		padding-left: 1rem;
		padding-right: 1rem;
		/* single-line + ellipsis for cleaner “fit” */
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

/* Estat de càrrega / buit / error */
.wp-block-extendable-search-offers .ofertas-loading,
.wp-block-extendable-search-offers .ofertas-no-results {
	font-size: 1rem;
	line-height: var(--wp--custom--typography--line-height--normal, 1.6);
	color: var(--wp--preset--color--foreground);
	opacity: 0.72;
}

.wp-block-extendable-search-offers .ofertas-error {
	font-size: 1rem;
	line-height: var(--wp--custom--typography--line-height--normal, 1.6);
	color: #b42318;
}

/* Graella de resultats */
.wp-block-extendable-search-offers .ofertas-results {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--30, 1.25rem);
	margin-top: var(--wp--preset--spacing--30, 1.15rem) !important;
	align-items: stretch;
	scroll-margin-top: 0.5rem;
}

@media (min-width: 900px) {
	.wp-block-extendable-search-offers .ofertas-results {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--40, 1.75rem);
	}
}

@media (min-width: 1100px) {
	.wp-block-extendable-search-offers .ofertas-results {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Targeta */
.wp-block-extendable-search-offers .ofertas-results .oferta-card {
	position: relative;
	overflow: hidden;
	background-color: var(--oferta-surface);
	border: 1px solid var(--oferta-border);
	border-radius: var(--oferta-radius-lg);
	display: flex;
	flex-direction: column;
	min-height: 240px;
	box-shadow: var(--oferta-shadow-card);
	transition:
		box-shadow 0.2s ease,
		border-color 0.2s ease;
}

/* Logo petit a dalt-dreta de cada targeta */
.wp-block-extendable-search-offers .ofertas-results .oferta-card-logo {
	position: absolute;
	top: 0.6rem;
	right: 0.75rem;
	height: clamp(72px, 7vw, 96px) !important;
	width: auto;
	opacity: 0.9;
	pointer-events: none;
	user-select: none;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-card:hover {
	border-color: var(--oferta-brand);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.04),
		0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Data — mateixa lectura visual que badge corporatiu */
.wp-block-extendable-search-offers .ofertas-results .oferta-date-tag {
	position: absolute;
	top: 0;
	left: 0;
	background-color: var(--oferta-brand);
	color: var(--oferta-brand-foreground);
	/* Esquerra superior = radi de la targeta; cantó inferior dret del badge arrodonit */
	border-radius: var(--oferta-radius-lg) 0 10px 0;
	z-index: 1;
	padding: 0.45rem 0.75rem !important;
	font-size: 0.8125rem;
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-area-pill {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	margin: 0 0 0.75rem 0;
	padding: 0.2rem 0.65rem;
	border-radius: var(--oferta-radius-pill);
	background: var(--oferta-surface-muted);
	border: 1px solid var(--oferta-border-strong);
	font-size: 0.6875rem;
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--oferta-brand);
}

.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper h3.wp-block-heading {
	font-family: var(--oferta-font-heading);
	font-size: clamp(1rem, 0.95rem + 0.35vw, 1.125rem);
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	line-height: var(--wp--custom--typography--line-height--small, 1.25);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--foreground);
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--20, 0.75rem) !important;
	hyphens: auto;
	overflow-wrap: anywhere;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-content-wrapper .has-small-font-size {
	font-size: 0.9375rem !important;
	line-height: var(--wp--custom--typography--line-height--medium, 1.45);
	color: var(--wp--preset--color--foreground);
	opacity: 0.78;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row {
	margin-bottom: 0;
	flex-wrap: nowrap;
}

.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row > p {
	font-size: 0.875rem !important;
	font-weight: var(--wp--custom--typography--font-weight--medium, 500);
	color: var(--wp--preset--color--foreground);
	opacity: 0.82;
}

/* Mòbil: zona i botó en columna per evitar text tallat */
@media (max-width: 600px) {
	.wp-block-extendable-home-offers .oferta-zone-button-row,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row {
		flex-direction: column;
		align-items: stretch;
		flex-wrap: wrap;
		gap: 0.75rem;
	}

	.wp-block-extendable-home-offers .oferta-zone-button-row > p,
	.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-zona-label,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row > p,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-zona-label {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
	}

	/* Línia pròpia: «Zona: Gironès» en una sola línia */
	.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-zona-label,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-zona-label {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0.3em;
	}

	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .wp-block-buttons {
		width: 100%;
	}

	.wp-block-extendable-home-offers .oferta-zone-button-row .wp-block-button,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .wp-block-button {
		width: 100%;
	}

	.wp-block-extendable-home-offers .oferta-zone-button-row .oferta-web-cta,
	.wp-block-extendable-search-offers .ofertas-results .oferta-zone-button-row .oferta-web-cta {
		width: 100%;
		align-self: stretch;
		justify-content: center;
		text-align: center;
		white-space: normal;
	}
}

/* Fallback selects (progressive enhancement) */
.wp-block-extendable-search-offers select.wp-block-search__input {
	cursor: pointer;
	appearance: none;
	background-image: url('data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'10\' height=\'6\' viewBox=\'0 0 10 6\'%3E%3Cpath fill=\'%23333333\' fill-rule=\'evenodd\' d=\'M5 4.586L1.707 1.293a1 1 0 0 0-1.414 1.414l4 4a1 1 0 0 0 1.414 0l4-4a1 1 0 1 0-1.414-1.414L5 4.586z\'/%3E%3C/svg%3E');
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 10px 6px;
	padding-right: 2.5rem;
}

/*
 * Botons web Organigrama: majúscules, prefix “>” (com columnes / banners).
 * Radi i ritme: tokens del tema (--wp--custom--elements--button--*).
 * Variant --lime: fons verd llima, text fosc (Style B del lloc).
 */
.wp-block-extendable-search-offers .oferta-web-cta,
.oferta-modal-overlay .oferta-web-cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	text-decoration: none !important;
	text-transform: uppercase;
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	line-height: 1.2;
	border-radius: var(--wp--custom--elements--button--border--radius, 2rem) !important;
	padding: 0.65em 1.25em !important;
	border: none !important;
	transition:
		background-color 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease;
}

/* CTA styles also apply inside home-offers block */
.wp-block-extendable-home-offers .oferta-web-cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	text-decoration: none !important;
	text-transform: uppercase;
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	line-height: 1.2;
	border-radius: var(--wp--custom--elements--button--border--radius, 2rem) !important;
	padding: 0.65em 1.25em !important;
	border: none !important;
	transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.wp-block-extendable-home-offers .oferta-web-cta::before {
	content: '>';
	margin-right: 0.15em;
	font-weight: 700;
}

.wp-block-extendable-home-offers .oferta-web-cta--lime {
	background-color: var(--oferta-cta-bg) !important;
	color: var(--oferta-cta-text) !important;
	box-shadow: var(--oferta-cta-shadow);
}

.wp-block-extendable-home-offers .oferta-web-cta--lime:hover {
	background-color: var(--oferta-cta-bg-hover) !important;
	color: var(--oferta-cta-text) !important;
	box-shadow: var(--oferta-cta-shadow-hover);
}

.wp-block-extendable-home-offers .oferta-web-cta:focus-visible {
	outline: none;
	box-shadow: var(--oferta-focus-ring);
}

.wp-block-extendable-search-offers .oferta-web-cta::before,
.oferta-modal-overlay .oferta-web-cta::before {
	content: '>';
	margin-right: 0.15em;
	font-weight: 700;
}

.wp-block-extendable-search-offers .oferta-web-cta--lime,
.oferta-modal-overlay .oferta-web-cta--lime {
	background-color: var(--oferta-cta-bg) !important;
	color: var(--oferta-cta-text) !important;
	box-shadow: var(--oferta-cta-shadow);
}

.wp-block-extendable-search-offers .oferta-web-cta--lime:hover,
.oferta-modal-overlay .oferta-web-cta--lime:hover {
	background-color: var(--oferta-cta-bg-hover) !important;
	color: var(--oferta-cta-text) !important;
	box-shadow: var(--oferta-cta-shadow-hover);
}

.wp-block-extendable-search-offers .oferta-web-cta:focus-visible,
.oferta-modal-overlay .oferta-web-cta:focus-visible {
	outline: none;
	box-shadow: var(--oferta-focus-ring);
}

.wp-block-extendable-search-offers .ofertas-view-all-container {
	display: flex;
	justify-content: center;
	margin-top: var(--wp--preset--spacing--50, 2rem) !important;
	margin-bottom: var(--wp--preset--spacing--50, 2rem) !important;
}

/* Modal (fora del wrapper del bloc — variables locals per coherència) */
.oferta-modal-overlay {
	--oferta-brand: #5d7b3e;
	--oferta-brand-foreground: #ffffff;
	--oferta-cta-bg: #d4e157;
	--oferta-cta-bg-hover: #c6d931;
	--oferta-cta-text: #2a361c;
	--oferta-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
	--oferta-cta-shadow: var(--oferta-shadow-card);
	--oferta-cta-shadow-hover: var(--oferta-shadow-card), 0 8px 28px rgba(93, 123, 62, 0.22);
	--oferta-surface: #ffffff;
	--oferta-surface-muted: #f4f6f1;
	--oferta-border: rgba(0, 0, 0, 0.1);
	--oferta-radius-lg: 12px;
	--oferta-radius-pill: 2rem;
	--oferta-font-body: var(--wp--preset--font-family--body, var(--wp--preset--font-family--inter, system-ui, sans-serif));
	--oferta-font-heading: var(--wp--preset--font-family--heading, var(--wp--preset--font-family--inter, system-ui, sans-serif));
	--oferta-focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--oferta-brand);
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 18, 12, 0.45);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.oferta-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.oferta-modal-content {
	font-family: var(--oferta-font-body, inherit);
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--foreground, #0b0620);
	background-color: var(--oferta-surface, #fff);
	border-radius: var(--oferta-radius-lg, 12px);
	max-width: 640px;
	width: min(92vw, 640px);
	max-height: min(88vh, 900px);
	overflow-y: auto;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
	border: 1px solid var(--oferta-border, rgba(0, 0, 0, 0.08));
	transform: translateY(8px) scale(0.98);
	transition: transform 0.25s ease;
	padding: clamp(1rem, 3vw, 1.5rem);
	box-sizing: border-box;
}

.oferta-modal-overlay.active .oferta-modal-content {
	transform: translateY(0) scale(1);
}

@media (min-width: 782px) {
	.oferta-modal-content {
		max-width: 1024px;
		width: min(96vw, 1024px);
		font-size: 0.9375rem;
		line-height: 1.5;
	}

	/* Títol → comarca → àrea professional → logo + data */
	.oferta-modal-title {
		order: 1;
		font-size: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
		letter-spacing: 0.03em;
	}

	.oferta-modal-heading-block > .oferta-modal-zona-line {
		order: 2;
		margin: 0;
	}

	.oferta-modal-chips {
		order: 3;
	}

	.oferta-modal-logo-date-row {
		order: 4;
	}

	.oferta-modal-section-title {
		font-size: 0.9375rem;
		color: var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
		opacity: 1;
		border-bottom-color: color-mix(in srgb, var(--oferta-brand, #5d7b3e) 35%, transparent);
	}

	.oferta-modal-section p,
	.oferta-modal-descripcion,
	.oferta-modal-funcions {
		font-size: 0.9375rem;
		line-height: 1.55;
	}

	.oferta-modal-area-chip {
		font-size: 0.6875rem;
		letter-spacing: 0.06em;
		padding: 0.2rem 0.65rem;
	}

	.oferta-modal-date-chip {
		font-size: 0.8125rem;
		letter-spacing: 0.02em;
		padding: 0.45rem 0.75rem;
	}
}

.oferta-modal-header {
	position: relative;
	padding-bottom: 1rem;
	margin-bottom: 0.75rem;
	border-bottom: 1px solid var(--oferta-border, rgba(0, 0, 0, 0.1));
}

.oferta-modal-heading-block {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.65rem;
	min-width: 0;
	padding-right: 2.75rem;
}

.oferta-modal-title {
	width: 100%;
	min-width: 0;
	margin: 0;
}

/* Logo + data a la mateixa línia, sota el títol */
.oferta-modal-logo-date-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.oferta-modal-logo {
	flex: 0 0 auto;
	height: clamp(64px, 6vw, 88px);
	width: auto;
	opacity: 0.9;
	pointer-events: none;
	user-select: none;
}

.oferta-modal-logo-date-row .oferta-modal-date-chip {
	flex: 0 0 auto;
	white-space: nowrap;
}

.oferta-modal-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	width: 100%;
	margin-top: 0;
}

@media (max-width: 600px) {
	.oferta-modal-content {
		padding-top: 1.1rem;
	}

	.oferta-modal-heading-block {
		padding-right: 2.5rem;
		gap: 0.5rem;
	}

	.oferta-modal-logo-date-row {
		gap: 0.85rem;
	}

	.oferta-modal-logo {
		height: 76px;
	}
}

.oferta-modal-date-chip,
.oferta-modal-area-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.65rem;
	border-radius: var(--oferta-radius-pill, 2rem);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.oferta-modal-date-chip {
	background: var(--oferta-brand);
	color: var(--oferta-brand-foreground);
}

.oferta-modal-area-chip {
	background: var(--oferta-surface-muted);
	color: var(--oferta-brand);
	border: 1px solid rgba(45, 74, 32, 0.2);
}

.oferta-modal-title {
	font-family: var(--oferta-font-heading, inherit);
	font-weight: var(--wp--custom--typography--font-weight--semi-bold, 600);
	line-height: 1.25;
	color: var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
	font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	overflow-wrap: break-word;
	hyphens: auto;
}

.oferta-modal-basics {
	margin-bottom: 0.25rem;
}

.oferta-modal-heading-block > .oferta-modal-zona-line {
	margin: 0;
	width: 100%;
}

.oferta-modal-zona-line,
.oferta-modal-professio-line {
	margin: 0.15rem 0 0 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--oferta-brand);
	font-weight: 500;
}

.oferta-modal-professio-line {
	color: var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
	font-weight: 600;
	opacity: 1;
}

.oferta-modal-section {
	margin-top: 0.85rem;
	text-align: left;
}

.oferta-modal-section-title {
	margin: 0 0 0.4rem 0;
	padding-bottom: 0.35rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--oferta-brand, var(--wp--preset--color--primary, #5d7b3e));
	opacity: 1;
	border-bottom: 1px solid color-mix(in srgb, var(--oferta-brand, #5d7b3e) 30%, transparent);
}

.oferta-modal-descripcion-empty {
	margin: 0;
	font-size: 0.875rem;
	font-style: italic;
	opacity: 0.55;
}

.oferta-modal-sep {
	margin: 1.35rem 0;
	border: 0;
	border-top: 1px solid var(--oferta-border, rgba(0, 0, 0, 0.1));
}

.oferta-modal-close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	box-sizing: border-box;
	width: 2.25rem;
	height: 2.25rem;
	min-width: 2.25rem;
	min-height: 2.25rem;
	max-height: 2.25rem;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	font-size: 1.35rem;
	line-height: 1;
	border-radius: 999px !important;
	background: var(--oferta-surface-muted, #f4f4f4) !important;
	color: var(--wp--preset--color--foreground) !important;
	border: 1px solid var(--oferta-border, rgba(0, 0, 0, 0.1)) !important;
	text-decoration: none !important;
}

.oferta-modal-close:hover {
	filter: brightness(0.97);
}

.oferta-modal-close:focus-visible {
	outline: none;
	box-shadow: var(--oferta-focus-ring);
}

.oferta-modal-section p,
.oferta-modal-descripcion,
.oferta-modal-funcions {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.55;
	opacity: 0.92;
}

.oferta-modal-descripcion,
.oferta-modal-funcions {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.oferta-modal-infofeina-text {
	opacity: 0.75;
	font-size: 0.8125rem;
	line-height: 1.45;
	margin: 0 0 0.75rem 0;
	text-align: left;
}

.oferta-modal-actions {
	display: flex;
	justify-content: center;
	margin-top: 0.25rem;
}

/* ----- Home offers block: grid only (cards/CTA shared above) ----- */

.wp-block-extendable-home-offers .extendable-home-offers__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
}

@media (max-width: 900px) {
	.wp-block-extendable-home-offers .extendable-home-offers__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.wp-block-extendable-home-offers .extendable-home-offers__grid {
		grid-template-columns: 1fr;
	}
}

