/**
 * CBC API Integration – cuadrícula de propiedades
 */

:root {
	--cbc-brand-blue: #1f69ff;
	--cbc-filter-field-bg: #ced5e0;
	--cbc-filter-text: #475372;
}

.cbc-properties {
	--cbc-gap: 1.25rem;
	--cbc-radius: 8px;
	--cbc-border: 1px solid rgba(0, 0, 0, 0.08);
	margin-inline: auto;
	padding-block: 0.5rem;
}

.cbc-properties--error {
	padding: 1rem 1.25rem;
	border-radius: var(--cbc-radius);
	border: var(--cbc-border);
	background: #fff6f6;
	color: #5c1515;
}

.cbc-properties__empty {
	margin: 0;
	padding: 1rem 0;
	color: #555;
}

.cbc-properties__filters {
	margin: 0 0 1.25rem;
	padding: 1.25rem 0rem;
	border: var(--cbc-border);
	border-radius: 12px;
	background: #fff;
}

.cbc-properties__filters-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(7.5rem, max-content);
	gap: 0.75rem 1rem;
	align-items: end;
}

@media (max-width: 1024px) {
	.cbc-properties__filters-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cbc-properties__filter-actions {
		grid-column: 1 / -1;
		justify-content: stretch;
	}

	.cbc-properties__filter-submit {
		width: 100%;
		min-width: 0;
	}
}

@media (max-width: 560px) {
	.cbc-properties__filters-row {
		grid-template-columns: minmax(0, 1fr);
	}
}

.cbc-properties__filter {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.cbc-properties__filter-label {
	font-size: 1.2rem;
	color: var(--cbc-filter-text);
}

.cbc-properties__filter-control {
	width: 100%;
	min-height: 3rem;
	padding: 0.75rem 1.3rem;
	border-radius: 22px;
	border: 1px solid rgba(71, 83, 114, 0.18);
	background-color: var(--cbc-filter-field-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475372' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	color: var(--cbc-filter-text);
	font-size: 1.7rem;
	line-height: 1.35;
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2.5rem;
}

.cbc-properties__filter-control:focus {
	outline: 2px solid rgba(31, 105, 255, 0.45);
	outline-offset: 2px;
	border-color: rgba(31, 105, 255, 0.35);
}

.cbc-properties__filter-control--number {
	background-image: none;
	padding-right: 1.3rem;
	-webkit-appearance: auto;
	appearance: auto;
}

.cbc-properties__filter-actions {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	min-width: 0;
}

.cbc-properties__filter-submit {
	min-height: 3rem;
	width: auto;
	min-width: 7.25rem;
	padding: 0.65rem 1.15rem;
	border-radius: 12px;
	border: none;
	background: var(--cbc-brand-blue);
	color: #fff;
	font-size: 1.7rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(31, 105, 255, 0.25);
	white-space: nowrap;
}

.cbc-properties__filter-submit:hover,
.cbc-properties__filter-submit:focus-visible {
	filter: brightness(1.06);
}

.cbc-properties__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cbc-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	.cbc-properties__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.cbc-properties__grid {
		grid-template-columns: 1fr;
	}
}

.cbc-properties__card {
	margin: 0;
}

.cbc-properties__card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: var(--cbc-radius);
	border: 1px solid rgba(31, 105, 255, 0.28);
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(31, 105, 255, 0.08);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cbc-properties__card-link:hover,
.cbc-properties__card-link:focus-visible {
	box-shadow: 0 8px 24px rgba(31, 105, 255, 0.18);
	transform: translateY(-2px);
}

.cbc-properties__thumb {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	background: #e8eef8;
	overflow: hidden;
	flex-shrink: 0;
}

/* max-width/height:auto del tema rompen el relleno absoluto y dejan ver el fondo del thumb. */
.cbc-properties__thumb img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none;
	object-fit: cover !important;
	object-position: center;
}

.cbc-properties__body {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 1.7rem 2rem 2rem;
	background: var(--cbc-brand-blue);
	color: #fff;
	flex: 1;
}

.cbc-properties__title {
	font-size: 2.1rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.cbc-properties__meta {
	font-size: 1.75rem;
	color: rgba(255, 255, 255, 0.95);
	line-height: 1.35;
}

.cbc-properties__pagination {
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: var(--cbc-border);
}

.cbc-properties__pagination-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cbc-properties__page-link,
.cbc-properties__page-current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 0.5rem;
	border-radius: 6px;
	font-size: 0.9rem;
	line-height: 1;
}

.cbc-properties__page-link {
	text-decoration: none;
	color: #1a1a1a;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #fff;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.cbc-properties__page-link:hover,
.cbc-properties__page-link:focus-visible {
	background: #f7f7f7;
	border-color: rgba(0, 0, 0, 0.2);
}

.cbc-properties__page-current {
	font-weight: 600;
	border: 1px solid rgba(0, 0, 0, 0.35);
	background: #1a1a1a;
	color: #fff;
}

.cbc-properties__page-ellipsis {
	display: inline-flex;
	align-items: center;
	padding: 0 0.25rem;
	color: #777;
	user-select: none;
}

.cbc-properties__page-link--prev,
.cbc-properties__page-link--next {
	min-width: auto;
	padding-inline: 0.75rem;
}

/* --- Ficha de propiedad individual [cbc_property_detail] --- */

.cbc-property-detail {
	--cbc-prop-radius: 16px;
	--cbc-prop-blue: var(--cbc-brand-blue);
	--cbc-prop-blue-light: #3d7cff;
	margin-inline: auto;
	padding-block: 1rem 2rem;
}

.cbc-property-detail--error {
	padding: 1rem 1.25rem;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: #fff6f6;
	color: #5c1515;
}

.cbc-property-detail__hero {
	border-radius: var(--cbc-prop-radius);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
	background: #0a0a0a;
	margin-bottom: 6.5rem;
}

.cbc-property-detail__slider {
	position: relative;
	z-index: 1;
	aspect-ratio: 21 / 9;
	min-height: 220px;
	background: #111;
	overflow: hidden;
}

@media (max-width: 768px) {
	.cbc-property-detail__slider {
		aspect-ratio: 4 / 3;
	}
}

.cbc-property-detail__slider--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
	padding: 2rem;
}

.cbc-property-detail__slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.cbc-property-detail__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.cbc-property-detail__slide.is-active {
	opacity: 1;
	z-index: 1;
	pointer-events: auto;
}

.cbc-property-detail__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cbc-property-detail__slider-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cbc-property-detail__slider-btn--prev {
	left: 12px;
}

.cbc-property-detail__slider-btn--next {
	right: 12px;
}

.cbc-property-detail__slider-btn:hover,
.cbc-property-detail__slider-btn:focus-visible {
	filter: brightness(1.05);
}

.cbc-property-detail__slider-dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	display: flex;
	gap: 8px;
}

.cbc-property-detail__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.85);
	background: transparent;
	padding: 0;
	cursor: pointer;
}

.cbc-property-detail__dot.is-active {
	background: #fff;
}

.cbc-property-detail__stats-banner {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem 1rem;
	padding: 2.15rem 2.35rem;
	background: linear-gradient(135deg, var(--cbc-prop-blue) 0%, var(--cbc-prop-blue-light) 100%);
	color: #fff;
}

@media (max-width: 900px) {
	.cbc-property-detail__stats-banner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.cbc-property-detail__stats-banner {
		grid-template-columns: 1fr;
	}
}

.cbc-property-detail__stat {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.cbc-property-detail__stat-label {
	font-size: 1.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
	opacity: 0.9;
}

.cbc-property-detail__stat-value {
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.25;
	word-break: break-word;
}

.cbc-property-detail__columns {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
	gap: 2rem;
	margin-bottom: 6.5rem;
	align-items: start;
}

@media (max-width: 900px) {
	.cbc-property-detail__columns {
		grid-template-columns: 1fr;
	}
}

.cbc-property-detail__title {
	font-size: clamp(2rem, 4.2vw, 2.75rem);
	margin: 0 0 1.15rem;
	line-height: 1.18;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.cbc-property-detail__description {
	font-size: 1.8rem;
	line-height: 1.7;
	color: #3a3f4a;
}

.cbc-property-detail__description p {
	margin: 0 0 1em;
}

.cbc-property-detail__aside-title {
	font-size: clamp(1.35rem, 2.2vw, 1.65rem);
	font-weight: 700;
	margin: 0 0 1rem;
	line-height: 1.25;
}

.cbc-property-detail__aside {
	padding: 1.25rem;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: #f8fafc;
}

.cbc-property-detail__brokers {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
}

.cbc-property-detail__broker-name {
	font-size: 1.7rem;
	font-weight: 700;
	margin: 0 0 0.35rem;
}

.cbc-property-detail__broker-label {
	font-size: 1.5rem;
	letter-spacing: 0.08em;
	color: #555;
	margin: 0 0 0.75rem;
}

.cbc-property-detail__broker-line {
	margin: 0.35rem 0;
}

.cbc-property-detail__broker-line a {
	color: var(--cbc-prop-blue);
	text-decoration: none;
}

.cbc-property-detail__broker-line a:hover {
	text-decoration: underline;
}

.cbc-property-detail__section-title {
	font-size: clamp(1.45rem, 2.5vw, 1.85rem);
	font-weight: 700;
	margin: 0 0 1.15rem;
	line-height: 1.22;
	letter-spacing: -0.015em;
}

.cbc-property-detail__empty {
	color: #666;
}

.cbc-property-detail__table-wrap {
	overflow-x: auto;
	border-radius: 14px;
	border: 1px solid rgba(31, 105, 255, 0.14);
	box-shadow:
		0 4px 6px rgba(31, 105, 255, 0.06),
		0 12px 32px rgba(31, 105, 255, 0.1);
	background: #fff;
}

.cbc-property-detail__table {
	width: 100%;
	min-width: 900px;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 1.2rem;
	margin: 0;
}

.cbc-property-detail__spaces {
	margin-bottom: 6.5rem;
}

.cbc-property-detail__table th,
.cbc-property-detail__table td {
	padding: 0.85rem 1rem;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid rgba(31, 105, 255, 0.1);
}

.cbc-property-detail__table thead th {
	background: var(--cbc-brand-blue);
	color: #fff;
	font-weight: 600;
	white-space: nowrap;
	border-bottom: none;
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.cbc-property-detail__table thead tr:first-child th:first-child {
	border-top-left-radius: 13px;
}

.cbc-property-detail__table thead tr:first-child th:last-child {
	border-top-right-radius: 13px;
}

.cbc-property-detail__table tbody tr {
	background: #fff;
	transition: background 0.15s ease;
}

.cbc-property-detail__table tbody tr:nth-child(even) {
	background: rgba(31, 105, 255, 0.04);
}

.cbc-property-detail__table tbody tr:hover {
	background: rgba(31, 105, 255, 0.1);
}

.cbc-property-detail__table tbody tr:last-child td {
	border-bottom: none;
}

.cbc-property-detail__table tbody tr:last-child td:first-child {
	border-bottom-left-radius: 13px;
}

.cbc-property-detail__table tbody tr:last-child td:last-child {
	border-bottom-right-radius: 13px;
}

.cbc-property-detail__location-sub {
	font-size: 1.8rem;
	color: #444;
	margin: 0 0 1rem;
}

.cbc-property-detail__map {
	width: 100%;
	height: 360px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: #e8eef5;
}

.cbc-property-detail__map-note {
	font-size: 0.9rem;
	color: #666;
	margin: 0;
}

.cbc-property-detail__related {
	--cbc-detail-related-gap: 1.25rem;
	margin-top: 6.5rem;
	margin-bottom: 3rem;
}

.cbc-property-detail__related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cbc-detail-related-gap);
}

.cbc-property-detail__related-cell {
	min-width: 0;
}

@media (max-width: 1023px) {
	.cbc-property-detail__related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 639px) {
	.cbc-property-detail__related-grid {
		grid-template-columns: 1fr;
	}
}

/* --- Carruseles por tipo [cbc_slider_*] / [cbc_properties_slider] --- */

.cbc-type-slider {
	--cbc-ts-gap: 1.25rem;
	position: relative;

	margin: 0 auto 2.5rem;
	padding: 0 3rem;
}

.cbc-type-slider--error,
.cbc-type-slider--empty {
	padding: 1rem 1.25rem;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: #f8fafc;
	color: #444;
}

.cbc-type-slider__viewport {
	overflow: hidden;
	width: 100%;
}

.cbc-type-slider__track {
	display: flex;
	gap: var(--cbc-ts-gap);
	transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
	will-change: transform;
}

.cbc-type-slider__slide {
	flex: 0 0 calc((100% - 2 * var(--cbc-ts-gap)) / 3);
	min-width: 0;
}

@media (max-width: 1023px) {
	.cbc-type-slider__slide {
		flex: 0 0 calc((100% - var(--cbc-ts-gap)) / 2);
	}
}

@media (max-width: 639px) {
	.cbc-type-slider {
		padding: 0 2.75rem;
	}

	.cbc-type-slider__slide {
		flex: 0 0 100%;
	}
}

.cbc-type-slider__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	border-radius: 26px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	min-height: 260px;
	text-decoration: none;
	color: #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.cbc-type-slider__card:focus-visible {
	outline: 3px solid var(--cbc-brand-blue);
	outline-offset: 3px;
}

.cbc-type-slider__card-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.cbc-type-slider__card-bg--placeholder {
	background: linear-gradient(160deg, #dbe7ff 0%, #a8c4ff 100%);
}

.cbc-type-slider__card-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(31, 105, 255, 0.96) 0%,
		rgba(31, 105, 255, 0.5) 30%,
		rgba(31, 105, 255, 0) 50%
	);
	pointer-events: none;
}

.cbc-type-slider__card-content {
	position: relative;
	z-index: 1;
	padding: 1.85rem 1.75rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	text-align: left;
}

.cbc-type-slider__card-title {
	font-size: clamp(1.3rem, 3vw, 1.8rem);
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.cbc-type-slider__card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: flex-start;
}

.cbc-type-slider__card-meta--location-only {
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.35rem;
	max-width: 100%;
}

.cbc-type-slider__card-meta--location-only .cbc-type-slider__card-value {
	word-break: break-word;
}

.cbc-type-slider__card-col {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
	flex: 1 1 120px;
}

.cbc-type-slider__card-label {
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.92;
}

.cbc-type-slider__card-value {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.25;
}

.cbc-type-slider__arrow {
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	z-index: 3;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: var(--cbc-brand-blue);
	color: #fff;
	font-size: 1.65rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(31, 105, 255, 0.45);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.cbc-type-slider__arrow:hover:not(:disabled),
.cbc-type-slider__arrow:focus-visible:not(:disabled) {
	filter: brightness(1.08);
	transform: translateY(-50%) scale(1.05);
}

.cbc-type-slider__arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.cbc-type-slider__arrow--prev {
	left: 0;
}

.cbc-type-slider__arrow--next {
	right: 0;
}

.cbc-type-slider__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.cbc-type-slider__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: #c8c8c8;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.cbc-type-slider__dot.is-active {
	background: #1a1a1a;
	transform: scale(1.15);
}
