/**
 * Casas Choice — [cc_imoveis_grid] shortcode (Comprar filter system + card
 * grid). Penpot board "Comprar" → Desktop / Mobile / "Menu filtros".
 *
 * Scoped entirely under .cc-listing so it never leaks into the rest of the
 * page (the Comprar page's other sections are Greenshift blocks). Tokens
 * mirror the ones already established in assets/css/imovel.css so the two
 * pages read as the same design system, without the two files depending on
 * each other (each is enqueued independently, scoped to its own page).
 */

.cc-listing {
	--cc-ink: var( --theme-palette-color-5, #333538 );
	--cc-ink-soft: rgba( 51, 53, 56, 0.6 );
	--cc-border: var( --theme-palette-color-7, #C4C7CA );
	--cc-bg-alt: var( --theme-palette-color-8, #F2F3F4 );
	--cc-accent: var( --theme-palette-color-1, #00A6CE );
	--cc-placeholder: #757575;
	--cc-container: 1800px;
	--cc-gutter: min( 4vw, 60px );
	--cc-font: 'Montserrat', sans-serif;

	background: var( --cc-bg );
	color: var( --cc-ink );
	font-family: var( --cc-font );
	box-sizing: border-box;
}

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

.cc-listing__container {
	margin-inline: auto;
}

/* Bare grids embedded inside a page that already provides its own
 * heading/section padding (homepage "Imóveis em destaque" / "Vendidos" —
 * both Greenshift rows with their own top/bottom spacing) — just the grid,
 * no extra block padding stacked on top of it. */
.cc-listing--bare .cc-listing__container {
	padding-block: 0;
}

/* ----------------------------------------------------------------------
 * Filter bar (desktop) — pill dropdown triggers + price inputs.
 * -------------------------------------------------------------------- */

.cc-filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 40px;
}

.cc-filter {
	position: relative;
}

.cc-filter__trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 12px 24px;
	background: transparent;
	border: 1px solid var( --cc-border );
	border-radius: 999px;
	font-family: var( --cc-font );
	font-size: 14px;
	line-height: 1.2;
	color: var( --cc-ink );
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

@media (hover: hover) {
	.cc-filter__trigger:hover {
		border-color: var( --cc-ink );
	}
}

.cc-filter.has-value .cc-filter__trigger {
	border-color: var( --cc-ink );
	background: var( --cc-bg-alt );
}

.cc-filter__trigger svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	stroke: var( --cc-ink );
	transition: transform 0.15s ease;
}

.cc-filter.is-open .cc-filter__trigger svg {
	transform: rotate( 180deg );
}

.cc-filter__panel {
	position: absolute;
	top: calc( 100% + 8px );
	left: 0;
	z-index: 40;
	min-width: 220px;
	background: var( --cc-bg );
	border: 1px solid rgba( 51, 53, 56, 0.15 );
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba( 24, 21, 16, 0.14 );
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY( -6px );
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.cc-filter.is-open .cc-filter__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
	background: #fff;
}

.cc-filter__row {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	width: 100%;
	padding: 10px 12px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	font-family: var( --cc-font );
	font-size: 14px;
	color: var( --cc-ink );
	text-align: left;
	cursor: pointer;
}

@media (hover: hover) {
	.cc-filter__row:hover {
		background: var( --cc-bg-alt );
	}
}

/* Always-visible checkbox (multi-select: Localização, Tipo de imóvel) /
 * radio (single-select: Tipo de negócio) indicator — filled + checkmark or
 * dot once selected, plain outline otherwise, so the row's toggle state
 * reads clearly even before anything is picked. */

.cc-filter__checkbox,
.cc-filter__radio {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background: var( --cc-bg );
	border: 1px solid var( --cc-border );
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cc-filter__checkbox {
	border-radius: 4px;
}

.cc-filter__radio {
	border-radius: 999px;
}

.cc-filter__checkbox svg {
	width: 12px;
	height: 12px;
	stroke: var( --cc-bg-alt );
	stroke-width: 3;
	opacity: 0;
	transition: opacity 0.1s ease;
}

.cc-filter__radio::after {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var( --cc-bg-alt );
	opacity: 0;
	transition: opacity 0.1s ease;
}

.cc-filter__row.is-selected .cc-filter__checkbox,
.cc-filter__row.is-selected .cc-filter__radio {
	background: var( --cc-accent );
	border-color: var( --cc-accent );
}

.cc-filter__row.is-selected .cc-filter__checkbox svg,
.cc-filter__row.is-selected .cc-filter__radio::after {
	opacity: 1;
}

.cc-filter__chip {
	display: inline-flex;
	align-items: center;
	height: 31px;
	padding-inline: 14px;
	background: transparent;
	border: 1px solid var( --cc-border );
	border-radius: 999px;
	font-family: var( --cc-font );
	font-size: 13px;
	font-weight: 400;
	color: var( --cc-ink );
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
	.cc-filter__chip:hover {
		border-color: var( --cc-ink );
	}
}

.cc-filter__chip.is-selected {
	background: var( --cc-accent );
	border-color: rgba( 196, 199, 202, 0.6 );
	color: var( --cc-bg-alt );
}

.cc-price-input {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 42px;
	padding-inline: 18px;
	background: transparent;
	border: 1px solid var( --cc-border );
	border-radius: 999px;
	margin-bottom: 0 !important;
	max-width: 182px;
}

.cc-price-input input {
	border: 0 !important;
	padding: 0 !important; 
}

.cc-price-input__field {
	width: 110px;
	border: 0;
	background: transparent;
	font-family: var( --cc-font );
	font-size: 14px;
	color: var( --cc-ink );
	padding: 0;
}

.cc-price-input__field::placeholder {
	color: var( --cc-placeholder );
}

.cc-price-input__field::-webkit-outer-spin-button,
.cc-price-input__field::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Chrome's datalist arrow (half a "number picker" next to the value). The
 * suggestions still open on click / typing / arrow keys. */
.cc-price-input__field::-webkit-calendar-picker-indicator {
	display: none !important;
}

.cc-price-input__field {
	-moz-appearance: textfield;
	appearance: textfield;
}

.cc-price-input__field:focus {
	outline: none;
}

/* "Limpar filtros" — end of the desktop pill row, only while a filter is
 * active (comprar.js). A text link, so it never competes with the pills. */
.cc-filters-reset {
	height: 42px;
	padding: 0 4px;
	background: none;
	border: 0;
	font-family: var( --cc-font );
	font-size: 14px;
	font-weight: 500;
	color: var( --cc-ink );
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

@media (hover: hover) {
	.cc-filters-reset:hover {
		color: var( --theme-palette-color-1, #00A6CE );
	}
}

.cc-filters-reset[hidden] {
	display: none;
}

/* Fades in as the first filter is picked (the grid below eases down to make
 * room — comprar.js, updateSummary()). */
.cc-filters-reset:not([hidden]) {
	animation: cc-filters-reset-in 0.35s ease;
}

@keyframes cc-filters-reset-in {
	from {
		opacity: 0;
	}
}

/* How to type a price (mobile drawer). */
.cc-filter-group__hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: var( --cc-placeholder );
}

/* ----------------------------------------------------------------------
 * Mobile "Filtros" trigger + right-side drawer ("Menu filtros").
 * -------------------------------------------------------------------- */

.cc-filters-trigger {
	display: none;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding-inline: 14px;
	background: transparent;
	border: 1px solid var( --cc-border );
	border-radius: 999px;
	font-family: var( --cc-font );
	font-size: 13px;
	color: var( --cc-ink );
	cursor: pointer;
	margin-bottom: 24px;
}

.cc-filters-trigger svg {
	width: 16px;
	height: 16px;
	stroke: var( --cc-ink );
}

/* Floating copy of the trigger (<1000px only): fixed bottom-right once the
 * in-flow trigger has scrolled out of view — see comprar.js. Slides up from
 * below the viewport edge with a fade; visibility is delayed on the way out
 * so it stays hidden from focus/AT once it's gone. */
.cc-filters-fab {
	display: none;
	position: fixed;
	right: 24px;
	bottom: calc( 24px + env( safe-area-inset-bottom, 0px ) );
	z-index: 999;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding-inline: 18px;
	background: var( --cc-ink );
	border: 0;
	border-radius: 999px;
	font-family: var( --cc-font );
	font-size: 14px;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.18 );
	opacity: 0;
	visibility: hidden;
	transform: translateY( calc( 100% + 48px ) );
	transition: transform 0.45s cubic-bezier( 0.22, 1, 0.36, 1 ), opacity 0.3s ease, visibility 0s linear 0.45s;
}

.cc-filters-fab svg {
	width: 16px;
	height: 16px;
	stroke: #fff;
}

.cc-filters-fab.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
	transition-delay: 0s;
}

.cc-filters-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	pointer-events: none;
}

.cc-filters-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba( 51, 53, 56, 0.5 );
	opacity: 0;
	transition: opacity 0.25s ease;
}

.cc-filters-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: 85vw;
	height: 100%;
	background: var( --cc-bg-alt );
	display: flex;
	flex-direction: column;
	transform: translateX( 100% );
	transition: transform 0.3s ease;
}

.cc-filters-drawer.is-open {
	pointer-events: auto;
}

.cc-filters-drawer.is-open .cc-filters-drawer__scrim {
	opacity: 1;
}

.cc-filters-drawer.is-open .cc-filters-drawer__panel {
	transform: translateX( 0 );
}

.cc-filters-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid rgba( 51, 53, 56, 0.1 );
	flex-shrink: 0;
}

.cc-filters-drawer__title {
	font-family: var( --cc-font );
	font-size: 18px;
	font-weight: 600;
	color: var( --cc-ink );
	margin: 0;
}

.cc-filters-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: var( --cc-ink );
}

.cc-filters-drawer__close svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
}

.cc-filters-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.cc-filter-group {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cc-filter-group__label {
	font-family: var( --cc-font );
	font-size: 14px;
	font-weight: 500;
	color: var( --cc-ink );
	margin: 0;
}

.cc-filter-group__rows {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cc-filter-group--chips .cc-filter-group__rows {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
}

.cc-filter-group--list .cc-filter__row {
	padding: 0;
	border-radius: 0;
}

@media (hover: hover) {
	.cc-filter-group--list .cc-filter__row:hover {
		background: transparent;
		opacity: 0.7;
	}
}

.cc-filter-group__price-row {
	display: flex;
	gap: 12px;
}

.cc-filter-group__price-row .cc-price-input {
	flex: 1;
}

.cc-filter-group__price-row .cc-price-input__field {
	width: 100%;
}

.cc-filters-drawer__footer {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	padding: 24px;
	border-top: 1px solid rgba( 51, 53, 56, 0.1 );
}

.cc-filters-clear,
.cc-filters-apply {
	flex: 1;
	height: 51px;
	border-radius: 6px;
	font-family: var( --cc-font );
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

/* Secondary action — clears everything immediately. */
.cc-filters-clear {
	background: transparent;
	border: 1px solid var( --cc-border );
	color: var( --cc-ink );
}

/* Primary action — commits whatever was picked in the drawer. */
.cc-filters-apply {
	background: var( --cc-ink );
	border: 1px solid rgba( 196, 199, 202, 0.6 );
	color: var( --cc-bg-alt );
}

/* ----------------------------------------------------------------------
 * Card grid.
 * -------------------------------------------------------------------- */

.cc-listing-grid {
	display: grid;
	/* Fixed 3 columns (not auto-fit) — Penpot's Comprar grid is exactly 3
	 * columns at any desktop width, not "however many happen to fit". */
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 52px 24px;
	/* For the filter transition (comprar.js, swapCards()): cards leaving
	 * the results are taken out of the flow and positioned against the grid;
	 * rows stay at their natural height while the grid's own height eases
	 * (no stretching); and the browser doesn't scroll to follow a card that
	 * moved (scroll anchoring). */
	position: relative;
	align-content: start;
	overflow-anchor: none;
	transition: opacity 0.25s ease;
}

/* Waiting on new results: the current ones dim — after a beat, so a quick
 * response doesn't flash. */
.cc-listing-grid[aria-busy="true"] {
	opacity: 0.55;
	transition-delay: 0.2s;
}

.cc-listing {
	/* "Aplicar Filtros" deep into the results scrolls back up to here
	 * (comprar.js) — clear of the sticky header. */
	scroll-margin-top: calc( 16px + var( --admin-bar, 0px ) + var( --theme-frame-size, 0px ) + var( --header-sticky-height, 0px ) * var( --sticky-shrink, 100 ) / 100 );
}

.cc-listing-empty {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	font-family: var( --cc-font );
	font-size: 16px;
	color: var( --cc-ink-soft );
	padding-block: 64px;
}

.cc-listing-empty p {
	margin: 0;
	max-width: 46ch;
}

.cc-listing-empty__title {
	font-size: 20px;
	color: var( --cc-ink );
}

.cc-listing-empty__btn {
	display: inline-flex;
	align-items: center;
	height: 51px;
	margin-top: 16px;
	padding: 0 28px;
	border-radius: 6px;
	background: var( --cc-ink );
	color: var( --cc-bg-alt );
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

@media (hover: hover) {
	.cc-listing-empty__btn:hover {
		color: var( --cc-bg-alt );
		opacity: .88;
	}
}

/* "N imóveis" between the filters and the grid (QA NOVO 06). */
.cc-listing-count {
	margin: -16px 0 24px;
	font-family: var( --cc-font );
	font-size: 14px;
	color: var( --cc-ink-soft );
}

.cc-listing-card {
	display: flex;
	flex-direction: column;
	/* Grid items default to min-width/min-height:auto, which refuses to
	 * shrink below content's intrinsic size — harmless for a single <img>
	 * (cc-listing-card__img's own aspect-ratio wins regardless), but a
	 * Swiper track's un-initialized slides (.cc-gcard) can very briefly
	 * report an enormous intrinsic size while the grid is still 1 column
	 * wide, which aspect-ratio then locks in. Overriding both to 0 is the
	 * standard fix for "aspect-ratio box explodes inside grid/flex". */
	min-width: 0;
	min-height: 0;
	background: var( --cc-bg-alt );
	text-decoration: none;
	color: inherit;
	background-color: #fff;
	transition: 500ms all ease;
}

@media ( min-width: 1000px ) {
	/* Hover lift + soft layered shadow — every card (Comprar grid, homepage
	 * teasers/sliders, related listings). ≥1000px only: below that (touch
	 * layouts) cards have no hover effects at all. */
	@media (hover: hover) {
		.cc-listing-card:hover {
			box-shadow: 0px 225px 63px rgba(0, 0, 0, 0),
						0px 144px 58px rgba(0, 0, 0, 0.01),
						0px 81px 49px rgba(0, 0, 0, 0.05),
						0px 36px 36px rgba(0, 0, 0, 0.09),
						0px 9px 20px rgba(0, 0, 0, 0.1);
			transform: translateY(-2px);
		}
	}

	@media (hover: hover) {
		.cc-listing-card:hover .cc-listing-card__cta {
			color: var(--theme-palette-color-1);
		}
	}

	@media (hover: hover) {
		.cc-listing-card:hover .cc-listing-card__cta svg path {
			fill: var(--theme-palette-color-1);
		}
	}

	/* Same nudge the article cards' arrow does (.cc-persp-card__cta svg). */
	@media (hover: hover) {
		.cc-listing-card:hover .cc-listing-card__cta svg {
			transform: translateX(4px);
		}
	}
}

.cc-listing-card__img {
	position: relative;
	width: 100%;
	aspect-ratio: 583 / 420;
	background: #ffffff;
	overflow: hidden;
}

/* Bottom vignette so the hover pagination dots (.cc-gcard__pagination,
 * bottom: 12px) stay legible over any photo, regardless of how bright it is.
 * z-index: 0 (not 1) is deliberate: Swiper's bundled CSS hardcodes
 * `.swiper { position: relative; z-index: 1; }`, and a z-index TIE between
 * two positioned siblings resolves in document order — since this ::after is
 * always ordered after .cc-gcard__swiper (generated content paints last among
 * an element's own children), z-index: 1 here would reliably WIN that tie and
 * paint over the entire swiper subtree, dots included, on multi-photo cards.
 * Dropping to 0 keeps this rule scoped to what it's actually for — the
 * single-photo cards below that render a plain <img> with no .cc-gcard__swiper
 * to compete with (a non-positioned <img> still loses to z-index: 0). The
 * multi-photo case gets its own copy declared *inside* the swiper below. */
.cc-listing-card__img::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
	height: 96px;
	background: linear-gradient( to top, rgba( 0, 0, 0, 1 ) 0%, rgba( 0, 0, 0, 0 ) 100% );
	pointer-events: none;
	opacity: .8;
}

/* Multi-photo cards: the vignette re-declared as the swiper's own ::after
 * instead of relying on .cc-listing-card__img::after above (which now always
 * loses to `.swiper`'s z-index: 1 by design — see comment above). Declaring
 * it here paints it *inside* that same local stacking context, safely
 * between the sliding photos (unpositioned, stack level 0) and
 * .cc-gcard__pagination (z-index: 3) — i.e. only on the image, under the dots. */
.cc-gcard__swiper::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	height: 96px;
	background: linear-gradient( to top, rgba( 0, 0, 0, 1 ) 0%, rgba( 0, 0, 0, 0 ) 100% );
	pointer-events: none;
	opacity: .8;
}

/* Vendidos card: taller photo (no price row to balance against) + a
 * "Vendido" badge over the top-left corner in place of the price. */

.cc-listing-card--sold .cc-listing-card__img {
	aspect-ratio: 583 / 460;
}

.cc-listing-card__badge {
	position: absolute;
	top: 15px;
	left: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	background: var( --cc-bg-alt );
	border-radius: 4px;
	font-family: var( --cc-font );
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	color: var( --theme-palette-color-4, #181510 );
}

/* "Em Destaque" badge only — "Vendido" has no icon. */
.cc-listing-card__badge svg {
	width: 12px;
	height: 12px;
	display: block;
}

.cc-listing-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

@media ( min-width: 1000px ) {
	@media (hover: hover) {
		.cc-listing-card:hover .cc-listing-card__img img {
			transform: scale( 1.04 );
		}
	}
}

.cc-listing-card__body {
	/* Grows to fill the card (cards in a row share the tallest one's height),
	 * with the divider + price/CTA row pinned to the bottom (see the hr
	 * rule) so those line up across the whole row. */
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 24px;
	/* Only meaningful on .cc-gcard, where this is an <a> (see
	 * cc_render_gallery_card()) rather than a plain <div> — harmless no-op
	 * on the plain single-photo cards. */
	text-decoration: none;
	color: inherit;
	background: var(--theme-palette-color-9);
}

.cc-listing-card__title {
	font-family: var( --cc-font );
	font-size: 20px;
	font-weight: 400;
	line-height: 1.5;
	color: var( --cc-ink );
	margin: 0;
	width: 90%;
}

.cc-listing-card__stats {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: -4px 0 0;
	font-family: var( --cc-font );
	font-size: 14px;
	color: var( --cc-ink-soft );
}

.cc-listing-card__stat {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cc-listing-card__stat svg {
	width: 15px;
	height: 15px;
	display: block;
	flex: 0 0 auto;
}

.cc-listing-card__dot {
	color: var( --cc-ink-soft );
}

.cc-listing-card__hr {
	border: 0;
	border-top: 1px solid var( --cc-border );
	/* `margin-top: auto` pushes this divider — and the foot row right under
	 * it — to the bottom of the stretched body. */
	margin: auto 0 0;
}

.cc-listing-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* No price (sold listings): the CTA alone stays on the right, like on every
 * other card. Must come after the base rule above (same specificity). */
.cc-listing-card__foot--end {
	justify-content: flex-end;
}

.cc-listing-card__price {
	font-family: var( --cc-font );
	font-size: 24px;
	font-weight: 400;
	color: var( --cc-ink );
}

/* "Preço sob consulta" (cc_preco()) is a sentence, not a number — the
 * regular price size/weight reads oddly on it. */
.cc-listing-card__price--indisponivel {
	font-size: 14px;
}

.cc-listing-card__cta {
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var( --cc-font );
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var( --cc-ink );
	white-space: nowrap;
}

.cc-listing-card__cta svg {
	width: 16px;
	height: 16px;
	display: block;
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.cc-listing-card__cta svg path {
	transition: fill 0.2s ease;
}

/* ----------------------------------------------------------------------
 * Gallery-slider cards (.cc-gcard — cc_render_gallery_card()): the
 * homepage's "Imóveis em destaque" / "Vendidos" teaser. A Swiper instance
 * fills the photo area; its nav arrows and pagination dots stay hidden
 * until the card is hovered, so the default look matches the plain
 * single-photo cards exactly.
 *
 * At ≥1000px the arrows/dots are revealed on hover. Below that
 * assets/js/cc-gallery-cards.js doesn't start the per-card Swiper at all
 * (on touch layouts swiping moves between listings, not photos); a card
 * without one (that, a single photo, or JS not run yet) is never
 * `.swiper-initialized`, and the rules below key off that to fall back to a
 * plain first-photo-only, controls-free look.
 * -------------------------------------------------------------------- */

.cc-gcard__swiper,
.cc-gcard__swiper .swiper-wrapper,
.cc-gcard__swiper .swiper-slide {
	width: 100%;
	height: 100%;
}

/* The photo opens the listing too (cc-gallery-cards.js). */
.cc-gcard__img {
	cursor: pointer;
}

.cc-gcard__swiper .swiper-slide {
	overflow: hidden;
}

.cc-gcard__swiper .swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cc-gcard__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	background: rgba( 255, 255, 255, 0.9 );
	border: 1px solid rgba( 51, 53, 56, 0.35 );
	border-radius: 999px;
	color: var( --cc-ink );
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s ease, background-color 0.15s ease;
}

@media (hover: hover) {
	.cc-gcard__nav:hover {
		opacity: 1;
	}
}

.cc-gcard__nav svg {
	width: 20px;
	height: 20px;
	display: block;
}

.cc-gcard__nav--prev {
	left: 12px;
}

.cc-gcard__nav--next {
	right: 12px;
}

.cc-gcard__nav.swiper-button-disabled {
	opacity: 0 !important;
	pointer-events: none;
}

.cc-gcard__pagination {
	position: absolute;
	bottom: 16px !important;
	left: 0;
	right: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.cc-gcard__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	background: #fff;
	opacity: 1;
	border-radius: 999px;
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.15s ease;
}

.cc-gcard__pagination .swiper-pagination-bullet-active {
	width: 24px;
	background: var( --cc-accent );
}

/* ≥1000px: revealed on card hover. */
@media ( min-width: 1000px ) {
	@media (hover: hover) {
		.cc-gcard:hover .cc-gcard__nav:not( .swiper-button-disabled ),
		.cc-gcard:hover .cc-gcard__pagination {
			opacity: 1;
		}
	}
}

/* Per-card Swiper never got initialized: show only the first photo, no
 * nav/pagination — see block docblock above. */
.cc-gcard__swiper:not( .swiper-initialized ) .swiper-wrapper {
	display: block;
}

.cc-gcard__swiper:not( .swiper-initialized ) .swiper-slide {
	display: none;
}

.cc-gcard__swiper:not( .swiper-initialized ) .swiper-slide:first-child {
	display: block;
}

.cc-gcard__swiper:not( .swiper-initialized ) .cc-gcard__pagination {
	display: none;
}

.cc-gcard__swiper:not( .swiper-initialized ) ~ .cc-gcard__nav {
	display: none;
}

/* ----------------------------------------------------------------------
 * Outer card grid/slider (.cc-gcard-grid — cc_render_gcard_grid()): wraps
 * .cc-gcard cards for the homepage's "Imóveis em destaque" and "Vendidos"
 * teaser. ≥1200px it's a plain 3-column grid (assets/js/cc-gcard-grid.js
 * never constructs the Swiper instance up there, so — same trick as the
 * per-card slider above — it's never `.swiper-initialized` and these rules
 * fall back to a static grid). Below 1200px it's a real Swiper slider (two
 * cards at once down to 686px, one below that — assets/js/cc-gcard-grid.js's
 * `breakpoints`) with a "1 / N" counter + nav row underneath, matching the
 * Penpot mobile board (same recipe as [cc_testemunhos]/[cc_equipa]'s mobile
 * sliders — assets/css/testemunhos.css / equipa.css — duplicated rather
 * than shared, per this file's own "no cross-file dependency" convention).
 * -------------------------------------------------------------------- */

.cc-gcard-grid__swiper {
	width: 100%;
	overflow: visible;
}

.cc-gcard-grid__swiper > .swiper-wrapper {
	align-items: stretch;
}

.cc-gcard-grid__swiper > .swiper-wrapper > .cc-gcard-grid__slide {
	height: auto;
}

.cc-gcard-grid__slide > .cc-listing-card,
.cc-gcard-grid__slide > .cc-persp-card {
	height: 100%;
}

/* min-width:1200px guard: a single card (no .cc-gcard-grid__foot at all —
 * see cc_render_gcard_grid()) never gets a Swiper instance on ANY
 * breakpoint, so without this guard it would also be "not initialized" —
 * and thus forced into a 3-column grid — below 1200px too. Scoping the
 * fallback to the same breakpoint the JS uses means an un-initialized
 * wrapper below 1200px just gets normal block layout instead (a single
 * full-width card, which is exactly what it should look like there). */
@media ( min-width: 1200px ) {
	/* `>` (direct child), not a bare descendant selector: .swiper-wrapper and
	 * .swiper-slide are generic Swiper class names, and each .cc-gcard card
	 * rendered inside a slide here (cc_render_gallery_card()) has its OWN,
	 * separately-scoped nested photo slider (.cc-gcard__swiper, ≥1000px only
	 * — see its block above), with its own .swiper-wrapper/.swiper-slide
	 * several levels deeper. An unscoped descendant selector matches those
	 * too, and — by specificity (0,3,0) vs. that slider's own (0,2,0) —
	 * actually WINS, grid-ifying every card's photo slides into a useless
	 * static 3-up thumbnail grid instead of a slider. `>` keeps this fallback
	 * to exactly the outer, whole-card wrapper/slides it's meant for. */
	.cc-gcard-grid__swiper:not( .swiper-initialized ) > .swiper-wrapper {
		display: grid;
		grid-template-columns: repeat( 3, 1fr );
		gap: 24px 24px;
	}

	/* One or two cards: same width as in a full row, centred (QA NOVO 40). */
	.cc-gcard-grid--n1 > .cc-gcard-grid__swiper:not( .swiper-initialized ) > .swiper-wrapper {
		grid-template-columns: calc( ( 100% - 48px ) / 3 );
		justify-content: center;
	}

	.cc-gcard-grid--n2 > .cc-gcard-grid__swiper:not( .swiper-initialized ) > .swiper-wrapper {
		grid-template-columns: repeat( 2, calc( ( 100% - 48px ) / 3 ) );
		justify-content: center;
	}

	.cc-gcard-grid__swiper:not( .swiper-initialized ) > .swiper-wrapper > .swiper-slide {
		width: auto;
		height: auto;
		/* Same "grid item defaults to min-width:auto" fix as .cc-listing-card
		 * — see its own comment above for the full explanation. */
		min-width: 0;
	}
}

.cc-gcard-grid__foot {
	display: none;
	align-items: center;
	justify-content: space-between;
	margin-top: 24px;
}

.cc-gcard-grid__foot-nav {
	display: flex;
	gap: 8px;
}

.cc-gcard-grid__counter {
	font-family: var( --cc-font );
	font-size: 18px;
	font-weight: 500;
	color: var( --cc-ink );
}

.cc-gcard-grid__prev,
.cc-gcard-grid__next {
	width: 46px;
	height: 46px;
	flex: 0 0 auto;
	border-radius: 999px;
	border: 1px solid rgba( 51, 53, 56, 0.35 );
	background: transparent;
	color: var( --cc-ink );
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: opacity 0.15s ease;
}

.cc-gcard-grid__prev svg,
.cc-gcard-grid__next svg {
	width: 18px;
	height: 18px;
	display: block;
}

.cc-gcard-grid__prev.swiper-button-disabled,
.cc-gcard-grid__next.swiper-button-disabled {
	opacity: .35;
	pointer-events: none;
}

@media ( max-width: 1199px ) {
	.cc-gcard-grid__foot {
		display: flex;
	}
}

/* `.cc-gcard-grid--slider` — more cards than one desktop row (opt-in, see
 * cc_render_gcard_grid()'s `desktop_slider`): a slider at every width, 3 at
 * a time from 1200px (assets/js/cc-gcard-grid.js), so the counter + nav row
 * shows on desktop too. */
.cc-gcard-grid--slider .cc-gcard-grid__foot {
	display: flex;
}

@media ( min-width: 1200px ) {
	/* Until Swiper takes over, the grid fallback above would lay every card
	 * out in rows — show just the first 3, which is what the slider opens
	 * on anyway, so nothing jumps when it initializes. */
	.cc-gcard-grid--slider .cc-gcard-grid__swiper:not( .swiper-initialized ) > .swiper-wrapper > .swiper-slide:nth-child( n+4 ) {
		display: none;
	}

	/* The swiper is `overflow: visible` (see above), which on desktop would
	 * show the next cards spilling past the container's right edge. Clip it
	 * at the container's sides — 23px out, just inside the 24px gap, so the
	 * next card never peeks in — but leave room above/below for the cards'
	 * hover lift and shadow (.cc-listing-card:hover — its layers fade out
	 * ~130px below the card), which `overflow: hidden` would cut off. */
	.cc-gcard-grid--slider .cc-gcard-grid__swiper {
		clip-path: inset( -8px -23px -160px -23px );
	}
}

/* ----------------------------------------------------------------------
 * <1000px: filter bar → drawer trigger.
 * -------------------------------------------------------------------- */

@media ( max-width: 999px ) {
	.cc-listing__container {
		padding-block: 24px 64px;
	}

	.cc-filters-bar {
		display: none;
	}

	.cc-filters-trigger {
		display: inline-flex;
	}

	.cc-filters-fab {
		display: inline-flex;
	}
}

/* <1200px: grid → 2 columns; ≤568px: single column. */

@media ( max-width: 1199px ) {
	.cc-listing-grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 692px ) {
	.cc-listing-grid {
		grid-template-columns: minmax( 0, 1fr );
		gap: 32px;
	}
}

/* The cards carry `.cc-bleed-mobile` (style.css, ≤767px) so they run edge to
 * edge — but only once the grid is a single column (≤692px). In the
 * 2-column range (693–767px) they have to stay inside their grid cells. */
@media ( min-width: 693px ) and ( max-width: 767px ) {
	.cc-listing-grid > .cc-bleed-mobile {
		width: auto !important;
		max-width: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cc-filters-fab {
		transition: none;
	}

	.cc-filter__panel,
	.cc-filter__trigger svg,
	.cc-filters-drawer__scrim,
	.cc-filters-drawer__panel,
	.cc-listing-card__img img {
		transition: none;
	}

	.cc-filters-reset:not([hidden]) {
		animation: none;
	}
}
