/* Bontrato propiedad shortcodes. Colors and fonts use the Elementor V4 variables, with the brand values as fallback. */

.bontrato-photos,
.bontrato-stats,
.bontrato-facts,
.bontrato-member-bar {
	--bt-teja: var(--Teja, #893213);
	--bt-marfil: var(--Marfil, #f5f3f0);
	--bt-arena: var(--Arena, #e2d0ba);
	--bt-madera: var(--Madera, #4f4030);
	--bt-tierra: var(--Tierra, #5e4e3d);
	--bt-serif: var(--font-serif, "Instrument Serif"), Georgia, serif;
	--bt-sans: var(--font-sans, "Instrument Sans"), "Helvetica Neue", sans-serif;
}

/* Photos */

.bontrato-photos {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 40px 24px;
	width: 100%;
}

/*
 * Two classes beat Elementor's ".e-paragraph-base a { all: unset }" and ".elementor img { height: auto }", which
 * otherwise drop the clipping and the full-height image, so photos keep their own ratio and spill over the grid.
 */

.bontrato-photos .bontrato-photos__item {
	display: block;
	overflow: hidden;
	background: var(--bt-arena);
	cursor: zoom-in;
}

.bontrato-photos .bontrato-photos__item[hidden] {
	display: none;
}

.bontrato-photos .bontrato-photos__image {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.bontrato-photos__item:hover .bontrato-photos__image {
	transform: scale(1.02);
}

.bontrato-photos--hero {
	position: relative;
	display: block;
}

.bontrato-photos--hero .bontrato-photos__item--1 {
	height: 720px;
}

.bontrato-photos__counter {
	position: absolute;
	right: 20px;
	bottom: 20px;
	padding: 6px 12px;
	background: var(--bt-marfil);
	color: var(--bt-madera);
	font-family: var(--bt-sans);
	font-size: 13px;
	letter-spacing: 0.08em;
	pointer-events: none;
}

.bontrato-photos--tour .bontrato-photos__item--1 {
	grid-column: span 7;
	grid-row: span 2;
	height: 620px;
}

.bontrato-photos--tour .bontrato-photos__item--2,
.bontrato-photos--tour .bontrato-photos__item--3 {
	grid-column: span 5;
	height: 290px;
}

.bontrato-photos--tour .bontrato-photos__item--4,
.bontrato-photos--tour .bontrato-photos__item--5,
.bontrato-photos--tour .bontrato-photos__item--6 {
	grid-column: span 4;
	height: 380px;
}

.bontrato-photos--details .bontrato-photos__item {
	height: 520px;
}

.bontrato-photos--details .bontrato-photos__item--1 {
	grid-column: span 5;
}

.bontrato-photos--details .bontrato-photos__item--2 {
	grid-column: span 4;
}

.bontrato-photos--details .bontrato-photos__item--3 {
	grid-column: span 3;
}

/* Stats strip */

.bontrato-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	width: 100%;
	border-top: 1px solid var(--bt-madera);
	border-bottom: 1px solid var(--bt-madera);
}

.bontrato-stats__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 28px 24px;
	border-left: 1px solid var(--bt-arena);
}

.bontrato-stats__item:first-child {
	padding-left: 0;
	border-left: 0;
}

.bontrato-stats__value {
	color: var(--bt-madera);
	font-family: var(--bt-serif);
	font-size: 48px;
	line-height: 1;
}

.bontrato-stats__label {
	color: var(--bt-tierra);
	font-family: var(--bt-sans);
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* Facts */

.bontrato-facts {
	display: grid;
	width: 100%;
	font-family: var(--bt-sans);
}

.bontrato-facts--details {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 48px;
}

.bontrato-facts__row {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding: 16px 0;
	border-bottom: 1px solid color-mix(in srgb, var(--bt-madera) 25%, transparent);
	font-size: 16px;
	line-height: 1.4;
}

.bontrato-facts__label {
	color: var(--bt-tierra);
}

.bontrato-facts__value {
	color: var(--bt-madera);
	text-align: right;
}

/* Feature chips */

.bontrato-features {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: 100%;
}

.bontrato-features__chip {
	display: inline-block;
	padding: 10px 18px;
	border: 1px solid var(--Madera, #4f4030);
	color: var(--Madera, #4f4030);
	font-family: var(--font-sans, "Instrument Sans"), sans-serif;
	font-size: 15px;
	line-height: 1.3;
}

/* Club labels */

.bontrato-badge {
	display: inline-block;
	padding: 6px 12px;
	font-family: var(--font-sans, "Instrument Sans"), sans-serif;
	font-size: 12px;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bontrato-badge--teja {
	background: var(--Teja, #893213);
	color: var(--Marfil, #f5f3f0);
}

.bontrato-badge--arena {
	background: var(--Arena, #e2d0ba);
	color: var(--Madera, #4f4030);
}

.bontrato-badge--madera {
	background: var(--Madera, #4f4030);
	color: var(--Marfil, #f5f3f0);
}

.bontrato-badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bontrato-club-note {
	color: var(--Teja, #893213);
	font-family: var(--font-sans, "Instrument Sans"), sans-serif;
	font-size: 14px;
}

/*
 * Staggered card grid. Elementor V4 renders global classes with their label as the class name, so the loop layout
 * gets the "bt-stagger" class and each card photo the "bt-photo" class.
 */

.bt-stagger > :nth-child(4n + 1) {
	grid-column: 1 / span 7;
}

.bt-stagger > :nth-child(4n + 2) {
	grid-column: 9 / span 4;
	margin-top: 200px;
}

.bt-stagger > :nth-child(4n + 3) {
	grid-column: 2 / span 5;
}

.bt-stagger > :nth-child(4n + 4) {
	grid-column: 8 / span 5;
	margin-top: 200px;
}

.bt-stagger > :nth-child(4n + 1) .bt-photo {
	height: 760px;
}

/* The club listing ("bt-stagger-club") uses a shorter lead photo. */

@media (min-width: 1025px) {
	.bt-stagger.bt-stagger-club > :nth-child(4n + 1) .bt-photo {
		height: 720px;
	}
}

/*
 * Option chips built with e-form radio buttons ("bt-choice" on each option box): the radio stays in the form but is
 * hidden, the label covers the whole chip, and the checked option is filled.
 */

.elementor .bt-choice input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.elementor .bt-choice label::after {
	content: "";
	position: absolute;
	inset: 0;
	cursor: pointer;
}

.elementor .bt-choice:has(input:checked) {
	background-color: var(--Madera, #4f4030);
}

.elementor .bt-choice:has(input:checked) label {
	color: var(--Marfil, #f5f3f0);
}

.elementor .bt-choice:has(input:focus-visible) {
	outline: 2px solid var(--Teja, #893213);
	outline-offset: 2px;
}

/*
 * Atomic forms with "bt-form" follow the design boards: Tierra placeholders, Madera focus and checked box, and the
 * mobile sizes. "bt-form-dark" is the variant on Teja sections (Marfil lines, Marfil checked box with a Teja tick).
 * Local styles cannot target ::placeholder, :checked or Elementor's grey ":focus" default, so these live here.
 */

.elementor .bt-form input::placeholder,
.elementor .bt-form textarea::placeholder {
	color: var(--Tierra, #5e4e3d);
	opacity: 1;
}

.elementor .bt-form input:focus,
.elementor .bt-form textarea:focus {
	border-color: var(--Madera, #4f4030);
}

.elementor .bt-form input:is([type="text"], [type="tel"], [type="email"]):focus,
.elementor .bt-form textarea:focus {
	box-shadow: inset 0 -1px 0 var(--Madera, #4f4030);
}

.elementor .bt-form input[type="checkbox"] {
	border-color: var(--Madera, #4f4030);
	color: var(--Marfil, #f5f3f0);
}

.elementor .bt-form input[type="checkbox"]:checked {
	background-color: var(--Madera, #4f4030);
}

.elementor .bt-form input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--Teja, #893213);
	outline-offset: 2px;
}

.elementor .bt-form.bt-form-dark input::placeholder,
.elementor .bt-form.bt-form-dark textarea::placeholder {
	color: inherit;
	opacity: 0.6;
}

/* El método board draws its placeholders at 65% ("bt-form-soft" on its form). */
.elementor .bt-form-soft.bt-form-dark input::placeholder {
	opacity: 0.65;
}

.elementor .bt-form.bt-form-dark input:focus,
.elementor .bt-form.bt-form-dark textarea:focus {
	border-color: var(--Marfil, #f5f3f0);
}

.elementor .bt-form.bt-form-dark input:is([type="text"], [type="tel"], [type="email"]):focus,
.elementor .bt-form.bt-form-dark textarea:focus {
	box-shadow: inset 0 -1px 0 var(--Marfil, #f5f3f0);
}

.elementor .bt-form.bt-form-dark input[type="checkbox"] {
	border-color: var(--Marfil, #f5f3f0);
	color: var(--Teja, #893213);
}

.elementor .bt-form.bt-form-dark input[type="checkbox"]:checked {
	background-color: var(--Marfil, #f5f3f0);
}

.elementor .bt-form.bt-form-dark input[type="checkbox"]:focus-visible,
.elementor .bt-form-dark .bt-choice:has(input:focus-visible) {
	outline-color: var(--Marfil, #f5f3f0);
}

.elementor .bt-form-dark .bt-choice:has(input:checked) {
	background-color: var(--Marfil, #f5f3f0);
}

.elementor .bt-form-dark .bt-choice:has(input:checked) label {
	color: var(--Teja, #893213);
}

@media (max-width: 767px) {
	.elementor .bt-form input:is([type="text"], [type="tel"], [type="email"]),
	.elementor .bt-form textarea {
		font-size: 16px;
	}

	.elementor .bt-form .e-con:has(> .e-form-label-base + :is(.e-form-input-base, .e-form-textarea-base)) {
		gap: 6px;
	}

	.elementor .bt-form input[type="checkbox"] {
		width: 18px;
		height: 18px;
		margin-block-start: 1px;
	}

	.elementor .bt-form .e-form-submit-button-base {
		align-self: stretch;
		width: 100%;
		min-height: 54px;
	}
}

/* "Ver más viviendas": the loop's pagination link, so it has no local style. Full width on mobile, as in the design. */

.elementor .bt-list-foot .bt-btn-outline {
	padding-inline: 40px;
}

@media (max-width: 767px) {
	.elementor .bt-list-foot .bt-btn-outline {
		width: 100%;
		min-height: 54px;
		justify-content: center;
	}
}

/* Filter chips built with e-tabs: Elementor marks the open tab with "e--selected", which local styles cannot target. */

.elementor .bt-chip.e--selected {
	border-color: var(--Madera, #4f4030);
	background-color: var(--Madera, #4f4030);
	color: var(--Marfil, #f5f3f0);
}

/*
 * The tabs are <button>s, so the kit's button:hover/:focus (Madera fill, Teja text) reaches them, and a local hover
 * that clears the background left the selected tab's Marfil label invisible. The label stays Madera on hover and
 * focus, and the selected tab keeps its fill.
 */
.elementor .e-tab-base.bt-chip:is(:hover, :focus) {
	color: var(--Madera, #4f4030);
}

.elementor .e-tab-base.bt-chip:focus:not(.e--selected) {
	background-color: transparent;
}

.elementor .e-tab-base.bt-chip.e--selected:is(:hover, :focus) {
	background-color: var(--Madera, #4f4030);
	color: var(--Marfil, #f5f3f0);
}

/* Member bar */

.bontrato-member-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	width: 100%;
	color: var(--bt-marfil);
	font-family: var(--bt-sans);
	font-size: 14px;
}

.bontrato-member-bar__area {
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bontrato-member-bar__user {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
}

.bontrato-member-bar__hello {
	color: var(--bt-arena);
}

/* Two classes so the kit's link color, serif family and size do not win. */
.bontrato-member-bar .bontrato-member-bar__user a {
	color: var(--bt-marfil);
	font-family: var(--bt-sans);
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	text-decoration: none;
}

.bontrato-member-bar .bontrato-member-bar__user a:hover {
	opacity: 0.75;
}

@media (max-width: 1024px) {
	.bontrato-photos--hero .bontrato-photos__item--1,
	.bontrato-photos--tour .bontrato-photos__item--1 {
		height: 480px;
	}

	.bontrato-photos--tour .bontrato-photos__item,
	.bontrato-photos--details .bontrato-photos__item {
		height: 300px;
	}
}

@media (max-width: 1024px) {
	.bt-stagger > :nth-child(n) {
		grid-column: span 3;
		margin-top: 0;
	}

	.bt-stagger > :nth-child(4n + 1) .bt-photo {
		height: 480px;
	}
}

@media (max-width: 767px) {
	.bt-stagger > :nth-child(n) {
		grid-column: auto;
	}

	.bt-stagger > :nth-child(4n + 1) .bt-photo {
		height: 360px;
	}

	.bt-stagger.bt-stagger-club > :nth-child(n) .bt-photo {
		height: 420px;
	}

	.bontrato-photos {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.bontrato-photos .bontrato-photos__item {
		grid-column: auto;
		grid-row: auto;
		height: 280px;
	}

	.bontrato-photos--hero .bontrato-photos__item--1 {
		height: 360px;
	}

	.bontrato-stats__item {
		padding: 20px 16px 20px 0;
		border-left: 0;
	}

	.bontrato-stats__value {
		font-size: 34px;
	}

	.bontrato-facts--details {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Members-only links (the "Mi cuenta" footer link, the Colección club banner): Bontrato_Club adds the body class. */
body:not(.bontrato-club-member) :is(#footer-account, #coleccion-club) {
	display: none !important;
}

/* Links to the disabled Club page (Propiedades > Configuración); Bontrato_Club also hides any other link to it by URL. */
body.bontrato-club-page-disabled :is(#footer-club, #coleccion-club) {
	display: none !important;
}

/* Home featured property ([bontrato_featured_property]). The section hides itself when no property is starred. */
section:has(.bontrato-featured-empty) {
	display: none !important;
}

.bontrato-featured__link {
	color: inherit;
	text-decoration: none;
}

.bontrato-featured__link:is(:hover, :focus) {
	color: inherit;
}

.bontrato-featured__image {
	display: block;
	width: 100%;
	height: 760px;
	object-fit: cover;
	background-color: var(--Arena);
}

@media (max-width: 1024px) {
	.bontrato-featured__image {
		height: 560px;
	}
}

@media (max-width: 767px) {
	.bontrato-featured__image {
		height: 460px;
	}
}
