/**
 * 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: 10px;
	height: 40px;
	padding-inline: 18px;
	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;
}

.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 );
}

.cc-filter__panel--chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px;
	min-width: 260px;
}

.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;
}

.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: 600;
	color: var( --cc-ink );
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.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: 45px;
	padding-inline: 18px;
	background: transparent;
	border: 1px solid var( --cc-border );
	border-radius: 999px;
}

.cc-price-input__prefix {
	font-size: 14px;
	color: var( --cc-placeholder );
}

.cc-price-input__field {
	width: 96px;
	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;
}

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

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

/* ----------------------------------------------------------------------
 * 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 );
}

.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: min( 86vw, 340px );
	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;
}

.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, 1fr );
	gap: 52px 24px;
}

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

.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;
}

.cc-listing-card__img {
	position: relative;
	width: 100%;
	aspect-ratio: 583 / 420;
	background: #E9E4D6;
	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__foot--end {
	justify-content: flex-end;
}

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

.cc-listing-card:hover .cc-listing-card__img img {
	transform: scale( 1.04 );
}

.cc-listing-card__body {
	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.235;
	color: var( --cc-ink );
	margin: 0;
}

.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: 0;
}

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

.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 {
	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;
}

.cc-listing-more {
	display: flex;
	justify-content: center;
	margin-top: 52px;
}

.cc-listing-more__btn {
	height: 48px;
	padding-inline: 32px;
	background: var( --cc-ink );
	border: 1px solid rgba( 196, 199, 202, 0.6 );
	border-radius: 6px;
	font-family: var( --cc-font );
	font-size: 14px;
	font-weight: 500;
	color: var( --cc-bg-alt );
	cursor: pointer;
}

.cc-listing-more__btn:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ----------------------------------------------------------------------
 * 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.
 *
 * This is a ≥1000px-only feature (Penpot: below that, each card in the
 * outer .cc-gcard-grid slider shows just its single cover photo — there's
 * no room for a second layer of per-card sliding, and no hover to reveal it
 * from on a touch device anyway). assets/js/cc-gallery-cards.js only
 * constructs the Swiper instance at ≥1000px in the first place, so below
 * that .cc-gcard__swiper is never `.swiper-initialized` — the rules below
 * key off that to fall back to a plain first-photo-only, controls-free look
 * without needing a second, separate breakpoint check in JS.
 * -------------------------------------------------------------------- */

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

.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;
}

.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 only — see block docblock above. */
@media ( min-width: 1000px ) {
	.cc-gcard:hover .cc-gcard__nav:not( .swiper-button-disabled ),
	.cc-gcard:hover .cc-gcard__pagination {
		opacity: 1;
	}
}

/* <1000px (or the per-card Swiper simply 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. ≥1000px 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 1000px it's a real one-card-at-a-time
 * Swiper slider 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__slide {
	background-color: var(--theme-palette-color-9);
	transition: 500ms all ease;
}

.cc-gcard-grid__slide: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);
}

.cc-gcard-grid__slide:hover .cc-listing-card__cta {
	color: var(--theme-palette-color-1);
}

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

/* min-width:1000px 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 1000px too. Scoping the
 * fallback to the same breakpoint the JS uses means an un-initialized
 * wrapper below 1000px just gets normal block layout instead (a single
 * full-width card, which is exactly what it should look like there). */
@media ( min-width: 1000px ) {
	/* `>` (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;
	}

	.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: 999px ) {
	.cc-gcard-grid__foot {
		display: flex;
	}
}

/* ----------------------------------------------------------------------
 * Mobile (<768px): filter bar → drawer trigger; grid → single column.
 * -------------------------------------------------------------------- */

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

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

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

	.cc-listing-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cc-filter__panel,
	.cc-filter__trigger svg,
	.cc-filters-drawer__scrim,
	.cc-filters-drawer__panel,
	.cc-listing-card__img img {
		transition: none;
	}
}
