/* =========================================================
   CCG – VILLA LISTING (WPBakery element)
   Cards themselves: villas/card.css. Tokens first: restyle from here.
   ========================================================= */

.ccg-villas {
	--v-text: #fff;
	--v-muted: rgba(255, 255, 255, .45);
	--v-line: rgba(255, 255, 255, .12);
	--v-line-strong: rgba(255, 255, 255, .28);
	--v-surface: var(--nectar-extra-color-3, #0b0b0b);   /* dialog + menu background */
	--v-surface-2: #161616;                               /* image placeholder */
	--v-hover: rgba(255, 255, 255, .06);
	--v-eyebrow: #c2a477;                                 /* section labels, filter count */
	--v-accent: #fff;                                     /* primary button / ticked box */
	--v-accent-ink: #000;
	--v-btn-line: var(--light-fade, rgb(255 255 255 / 15%));
	--v-radius: var(--border-radius-value, 1rem);
	--v-ease: cubic-bezier(.2, .7, .2, 1);
	--cv-cols: 3;
	--cv-gap-x: 25px;
	--cv-gap-y: 35px;
	position: relative;
	width: 100%;
	color: var(--v-text);
	font-size: 1rem;
	line-height: 1.55;
}

.ccg-villas.is--light {
	--v-text: #000;
	--v-muted: rgba(0, 0, 0, .6);
	--v-line: rgba(0, 0, 0, .12);
	--v-line-strong: rgba(0, 0, 0, .3);
	--v-surface: #f2f0eb;
	--v-surface-2: #e6e2da;
	--v-hover: rgba(0, 0, 0, .05);
	--v-eyebrow: #8a6d3f;
	--v-accent: #000;
	--v-accent-ink: #fff;
	--v-btn-line: rgba(0, 0, 0, .15);
}

.ccg-villas *,
.ccg-villas *::before,
.ccg-villas *::after { box-sizing: border-box; }

/* Salient adds padding, margins and bullets to these */
.ccg-villas p,
.ccg-villas h3,
.ccg-villas ul,
.ccg-villas li {
	margin: 0;
	padding: 0;
	color: inherit;
}
.ccg-villas ul,
.ccg-villas li { list-style: none; }
.ccg-villas a { color: inherit; }
.ccg-villas img { display: block; max-width: 100%; }
.ccg-villas button { color: inherit; cursor: pointer; }
.ccg-villas [hidden] { display: none !important; }
.ccg-villas :focus-visible { outline: 2px solid var(--v-text); outline-offset: 3px; }

html.ccg-villas-lock { overflow: hidden; }

.ccg-villas-note {
	padding: 16px;
	border: 1px dashed currentColor;
	font-size: .875rem;
	opacity: .7;
}

/* ---------- Icons ---------- */

.ccg-villas__icon {
	display: inline-block;
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

button.ccg-villas__btn.ccg-villas__filters-btn svg.ccg-villas__icon {
    color: var(--nectar-extra-color-2) !important;
}

/* ---------- Buttons (same look as .villa-btn on the villa page) ---------- */

.ccg-villas__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .6em;
	margin: 0;
	padding: var(--button-padding);
	border: var(--button-border, 2px solid);
	border-color: var(--v-btn-line);
	border-radius: 0;
	background: transparent;
	color: var(--v-text) !important;
	font-size: .75rem;
	font-weight: 500;
	line-height: 0.75;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .25s, border-color .25s, color .25s, opacity .25s;
}
.ccg-villas__btn .ccg-villas__icon {width: 1.15em;height: 1.15em;}
.ccg-villas__btn:hover { background: var(--v-accent); border-color: var(--v-accent); color: var(--v-accent-ink) !important; }
.ccg-villas__btn--primary { background: var(--v-accent); border-color: var(--v-accent); color: var(--v-accent-ink) !important; }
.ccg-villas__btn--primary:hover { background: transparent; color: var(--v-text) !important; }

.ccg-villas__icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--v-hover);
	transition: background-color .2s;
}
.ccg-villas__icon-btn:hover { background: var(--v-line); }

.ccg-villas__link-btn {
	margin: 0;
	padding: 6px 4px;
	border: 0;
	background: none;
	font-size: .8125rem;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Toolbar: filters, count, sort ---------- */

.ccg-villas__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding-bottom: 20px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--v-line);
}
.ccg-villas__bar-start {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
}
.ccg-villas__count {color: var(--v-muted) !important;font-size: .875rem;}

.ccg-villas__badge {
	display: inline-grid;
	place-items: center;
	min-width: 1.7em;
	height: 1.7em;
	padding: 0 .45em;
	border-radius: 999px;
	background: var(--v-eyebrow);
	color: #000;
	font-size: .7rem;
	letter-spacing: 0;
}

.ccg-villas__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: -12px 0 32px;
}
.ccg-villas__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 10px 7px 14px;
	border: 1px solid var(--v-line-strong);
	border-radius: 999px;
	background: transparent;
	font-size: .8125rem;
	line-height: 1.2;
	transition: border-color .2s;
}
.ccg-villas__chip:hover { border-color: var(--v-text); }
.ccg-villas__chip .ccg-villas__icon { width: 14px; height: 14px; opacity: .7; }

/* Sort menu: a filled button at every width, the same size as the Filters
   button (its border is the fill colour, so the two line up) */
.ccg-villas__sort {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-left: auto;
	padding: var(--button-padding);
	border: var(--button-border, 2px solid);
	border-color: var(--v-surface);
	background: var(--v-surface);   /* --nectar-extra-color-3 (a light tone on light listings) */
	font-size: .875rem;
	line-height: 1;
	transition: border-color .25s;
}
.ccg-villas__sort:hover {/* border-color: var(--v-line-strong); */}
.ccg-villas__sort-label {color: var(--v-muted);font-size: .8rem;}
.ccg-villas__sort-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-size: .8rem;
	font-weight: 500;
	line-height: 1;
}
/* The whole filled button opens the menu, not just the words in it */
.ccg-villas__sort-btn::after { content: ''; position: absolute; inset: 0; }
.ccg-villas__sort-btn .ccg-villas__icon { width: 14px; height: 14px; transition: transform .2s; }
.ccg-villas__sort-btn[aria-expanded="true"] .ccg-villas__icon { transform: rotate(180deg); }

.ccg-villas ul.ccg-villas__sort-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 30;
	min-width: 220px;
	margin: 0;
	padding: 6px;
	list-style: none;
	border: 1px solid var(--v-line);
	border-radius: 12px;
	background: var(--v-surface);
	box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
	outline: none;
}
.ccg-villas .ccg-villas__sort-menu li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 10px 12px;
	list-style: none;
	border-radius: 8px;
	font-size: .875rem;
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
}
.ccg-villas__sort-menu li:hover,
.ccg-villas__sort-menu li.is--active { background: var(--v-hover); }
.ccg-villas__sort-menu li[aria-selected="true"] { font-weight: 500; }
.ccg-villas__sort-menu li .ccg-villas__icon { width: 16px; height: 16px; color: var(--v-eyebrow); visibility: hidden; }
.ccg-villas__sort-menu li[aria-selected="true"] .ccg-villas__icon { visibility: visible; }

/* ---------- Cards: grid ---------- */

.ccg-villas__items {
	display: grid;
	gap: var(--cv-gap-y) var(--cv-gap-x);
	transition: opacity .3s;
}
.ccg-villas.is--loading .ccg-villas__items { opacity: .35; pointer-events: none; }

.ccg-villas.is--grid .ccg-villas__items { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) {
	.ccg-villas.is--grid .ccg-villas__items {grid-template-columns: 1fr;}
}
@media (min-width: 1000px) {
	.ccg-villas.is--grid .ccg-villas__items {grid-template-columns: 1fr 1fr;}
}
@media (min-width: 1300px) {
	.ccg-villas.is--grid .ccg-villas__items {grid-template-columns: 1fr 1fr 1fr;}
}
@media 
@media (min-width: 1000px) and (max-width: 1279px) {
	.ccg-villas.is--grid.is--cols-4 .ccg-villas__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ccg-villas .villa-tile.is--new { animation: ccg-villas-in .5s var(--v-ease) both; }
@keyframes ccg-villas-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Cards: carousel ---------- */

.ccg-villas.is--carousel .ccg-villas__items {
	--cv-view: 1.15;   /* cards in view; the fraction peeks the next card */
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--cv-view) - 1) * var(--cv-gap-x)) / var(--cv-view));
	/* Run off both sides of the screen. The matching padding keeps the cards
	   sized to the container and the first / last card stopping at its edges;
	   scroll-padding snaps each card to the container's left edge.
	   villa-listing.js sets the gaps to the screen edges (--cv-bleed-l / -r). */
	margin-left: calc(-1 * var(--cv-bleed-l, 0px));
	margin-right: calc(-1 * var(--cv-bleed-r, 0px));
	padding-left: var(--cv-bleed-l, 0px);
	padding-right: var(--cv-bleed-r, 0px);
	scroll-padding-left: var(--cv-bleed-l, 0px);
	overflow-x: auto;
	/* Horizontal only: overflow-x alone makes the y axis scrollable too,
	   which traps vertical wheel/touch scrolling as you move down the page */
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.ccg-villas.is--carousel .ccg-villas__items::-webkit-scrollbar { display: none; }
@media (min-width: 600px) {
	.ccg-villas.is--carousel .ccg-villas__items {--cv-view: 2.15;}
}
@media (min-width: 1000px) {
	.ccg-villas.is--carousel .ccg-villas__items { --cv-view: var(--cv-cols); }
}
.ccg-villas.is--carousel .villa-tile { scroll-snap-align: start; }
/* Phones and tablets: a swipe moves one card, rather than a flick flying
   past several and snapping back */
@media (hover: none) and (pointer: coarse) {
	.ccg-villas.is--carousel .villa-tile { scroll-snap-stop: always; }
}
/* Focus ring inside the card, so the track doesn't clip it */
.ccg-villas.is--carousel .villa-tile__link:focus-visible { outline-offset: -2px; }

.ccg-villas__items.is--dragging {
	scroll-snap-type: none;
	cursor: grabbing;
	user-select: none;
}
.ccg-villas__items.is--dragging .villa-tile { pointer-events: none; }

.ccg-villas__nav {
	display: flex;
	align-items: center;
	gap: 25px;
	margin-top: 45px;
}
.ccg-villas__progress {
	position: relative;
	flex: 1;
	height: 2px;
	overflow: hidden;
	background: var(--v-line);
}
.ccg-villas__progress span {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--nectar-extra-color-2);
	/* No transition: it follows the swipe frame by frame */
}
.ccg-villas__arrows { display: flex; gap: 10px; margin-left: auto; }
.ccg-villas__arrow {
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--v-line-strong);
	border-radius: 50%;
	background: transparent;
	transition: background-color .25s, border-color .25s, color .25s, opacity .25s;
}
.ccg-villas__arrow .ccg-villas__icon { width: 20px; height: 20px; }
.ccg-villas__arrow.is--prev .ccg-villas__icon { transform: rotate(180deg); }
.ccg-villas__arrow:hover:not(:disabled) { background: var(--v-accent); border-color: var(--v-accent); color: var(--v-accent-ink); }
.ccg-villas__arrow:disabled { opacity: .3; cursor: default; }

/* ---------- Load more / empty ---------- */

.ccg-villas__more { display: flex; justify-content: center; margin-top: 48px; }
.ccg-villas.is--loading-more .ccg-villas__more .ccg-villas__btn { opacity: .5; pointer-events: none; }

.ccg-villas__empty {
	display: grid;
	justify-items: center;
	gap: 20px;
	padding: 64px 0;
	text-align: center;
}
.ccg-villas__empty p { color: var(--v-muted); }

/* ---------- Filters dialog ---------- */

.ccg-villas__dialog {
	width: min(675px, calc(100vw - 32px));
	max-width: none;
	max-height: min(88dvh, 920px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--v-line);
	border-radius: var(--v-radius);
	background: var(--v-surface);
	color: var(--v-text);
}
.ccg-villas__dialog[open] {
	display: flex;
	flex-direction: column;
	animation: ccg-villas-in .35s var(--v-ease);
}
.ccg-villas__dialog::backdrop {
	background: rgba(0, 0, 0, .7);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.ccg-villas__form {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	margin: 0;
}

.ccg-villas__dialog-head,
.ccg-villas__dialog-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 1.1rem 1.45rem 1.1rem;
}
.ccg-villas__dialog-head { border-bottom: 1px solid var(--v-line); }
.ccg-villas__dialog-foot { border-top: 1px solid var(--v-line); }

.ccg-villas p.ccg-villas__dialog-title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 1.15rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.ccg-villas__dialog-title .ccg-villas__icon {color: var(--v-eyebrow);width: 1.15rem;height: 1.15rem;}

.ccg-villas__dialog-body {
	flex: 1;
	min-height: 0;
	padding: 0rem 1.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ccg-villas__dialog.is--counting [data-apply-label] { opacity: .5; }
.ccg-villas__dialog [data-apply-label] { transition: opacity .2s; }

.ccg-villas__group {padding: 1.25rem 0;border-bottom: 1px solid var(--v-line);}
.ccg-villas__group:last-child {border-bottom: 0;padding-bottom: 1.5rem;}
.ccg-villas__group--row {display: flex;align-items: center;justify-content: space-between;gap: 15px;}

.ccg-villas p.ccg-villas__group-title {
	margin-bottom: 1rem;
	font-size: .7rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--v-eyebrow);
}
.ccg-villas .ccg-villas__group--row p.ccg-villas__group-title { margin: 0; }
.ccg-villas p.ccg-villas__group-note {margin: -0.5rem 0rem 0.85rem;color: var(--v-muted);font-size: 0.75em;line-height: 1.2;}

/* Price */
.ccg-villas__price {display: grid;grid-template-columns: 1fr 1fr;gap: 0.9rem;}
.ccg-villas__field {
	display: block;
	margin: 0;
	padding: var(--field-padding-small);
	border: var(--button-border);
	border-color: var(--light-fade);
	cursor: text;
	transition: border-color .2s;
}
.ccg-villas__field:focus-within { border-color: var(--v-text); }
.ccg-villas__field-label {display: block;margin-bottom: 0.25rem;color: var(--v-muted);font-size: .65rem;line-height: 1;}
.ccg-villas__field-input {display: flex;align-items: center;gap: 4px;font-size: 1rem;line-height: 1;}
.ccg-villas__field-input > span { color: var(--v-muted); }

/* Beat Salient + the child theme's global field styles */
.ccg-villas .ccg-villas__field input[type="number"] {
	width: 100% !important;
	min-width: 0;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	color: var(--v-text) !important;
	font-size: 1rem !important;
	line-height: 1.1 !important;
	-moz-appearance: textfield;
	appearance: textfield;
}
.ccg-villas .ccg-villas__field input[type="number"]::-webkit-inner-spin-button,
.ccg-villas .ccg-villas__field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ccg-villas .ccg-villas__field input[type="number"]:focus { outline: none; }
.ccg-villas .ccg-villas__field input::placeholder { color: var(--v-muted); opacity: .7; }

/* Steppers */
.ccg-villas__stepper {display: flex;align-items: center;gap: 10px;}
.ccg-villas__step {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--v-line-strong);
	border-radius: 50%;
	background: transparent;
	transition: border-color .2s, opacity .2s;
}
.ccg-villas__step .ccg-villas__icon {width: 14px;height: 14px;}
.ccg-villas__step:hover { border-color: var(--v-text); }
.ccg-villas__step[aria-disabled="true"] { opacity: .3; cursor: default; border-color: var(--v-line-strong); }
.ccg-villas__step-value {min-width: 2.25em;text-align: center;font-size: 0.9rem;}

/* Checkboxes (round, like the reference) */
.ccg-villas__checks {display: grid;gap: 0.5rem 0.5rem;}
@media (min-width: 560px) {
	.ccg-villas__checks { grid-template-columns: 1fr 1fr; }
}
.ccg-villas .ccg-villas__check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	font-size: .9375rem;
	font-weight: 300 !important;
	line-height: 1.3;
	cursor: pointer;
	text-transform: none;
}
.ccg-villas .ccg-villas__check input {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	opacity: 0 !important;
	pointer-events: none;
}
.ccg-villas__check-box {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 1px solid var(--v-line-strong);
	border-radius: 50%;
	transition: background-color .2s, border-color .2s;
}
.ccg-villas__check-box .ccg-villas__icon {
	width: 14px;
	height: 14px;
	stroke: var(--v-accent-ink);
	stroke-width: 2.25;
	opacity: 0;
	transform: scale(.6);
	transition: opacity .2s, transform .2s;
}
.ccg-villas__check:hover .ccg-villas__check-box { border-color: var(--v-text); }
.ccg-villas__check input:checked + .ccg-villas__check-box { background: var(--v-accent); border-color: var(--v-accent); }
.ccg-villas__check input:checked + .ccg-villas__check-box .ccg-villas__icon { opacity: 1; transform: none; }
.ccg-villas__check input:focus-visible + .ccg-villas__check-box { outline: 2px solid var(--v-text); outline-offset: 2px; }

/* Phones: a sheet from the bottom */
@media (max-width: 640px) {
	.ccg-villas__dialog {
		width: 100vw;
		max-height: 94dvh;
		margin: auto 0 0;
		border-radius: var(--v-radius) var(--v-radius) 0 0;
	}
	.ccg-villas__dialog-head,
	.ccg-villas__dialog-foot { padding: 14px 20px; }
	.ccg-villas__dialog-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
	.ccg-villas__dialog-body { padding: 0 20px; }
	.ccg-villas__group { padding: 22px 0; }
	.ccg-villas__dialog-foot .ccg-villas__btn--primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ccg-villas *,
	.ccg-villas__dialog[open] { animation: none !important; transition: none !important; }
	.ccg-villas .villa-tile.is--new { animation: none; }
}



@media (max-width: 1300px) {
	.ccg-villas__items {
	    --cv-cols: 2.5;
	}
}


@media (max-width: 999px) {
	.ccg-villas.is--carousel .ccg-villas__items {
	    --cv-view: 1.5;
	    --cv-gap-x: 25px;
	}
	.ccg-villas.is--carousel .villa-tile {
		/* max-width: 450px; */
	}
}


@media (max-width: 690px) {
	.ccg-villas__arrow {
	    display: inline-grid;
	    place-items: center;
	    width: 40px;
	    height: 40px;
	}
	.ccg-villas__arrow .ccg-villas__icon {
	    width: 16px;
	    height: 16px;
	}
	.ccg-villas.is--carousel .ccg-villas__items {
	    --cv-view: 1.1;
	    --cv-gap-x: 15px;   /* the card width sum uses it too */
	}
	.ccg-villas.is--carousel .ccg-villas__items article.villa-tile {
	}
	/* Toolbar: the sort on top (the filled button, see "Sort menu"), then the
	   filters button, both full width (the count is hidden). Every villa and
	   boat listing, archives included. */
	.ccg-villas__bar {
	    flex-direction: column;
	    gap: 10px !important;
	    padding-bottom: 30px;
	}

	.ccg-villas__sort {
	    order: 1;
	    display: flex;
	    width: 100%;
	    text-align: center;
	}

	.ccg-villas__bar-start {
	    order: 2;
	    width: 100%;
	    text-align: center;
	    font-size: .75rem;
	}

	.ccg-villas__bar-start .ccg-villas__btn,
	.ccg-villas__bar-start button.ccg-villas__btn.ccg-villas__filters-btn {
	    width: 100%;
	    text-align: center;
	    font-size: .75rem;
	}

	.ccg-villas__bar-start p.ccg-villas__count {
	    display: none;
	}

	.ccg-villas__bar-start .ccg-villas__btn *,
	.ccg-villas__sort * {
	    font-size: 0.8rem !important;
	}
}