/*
 * Pantalla B base: opt-in preview only.
 * Pantalla A remains unchanged unless the URL includes ?ooc_screen_b=1.
 */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell {
	grid-template-columns: minmax(250px, 24fr) minmax(360px, 38fr) minmax(360px, 38fr);
}

/* Pantalla B: remove the non-essential agency/date footer and its empty panel. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .item-footer {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
}

/* Houzez renders agency/agent and age outside .item-footer in list cards. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .item-author,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .item-author-image,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .item-date,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .item-body > .d-flex.align-items-center.justify-content-start.d-none.d-md-flex.gap-3 {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
}

/* Keep Details in normal card flow in Screen B's two-column grid. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results .listing-view.grid-view .btn-item {
	position: static !important;
	float: none !important;
	clear: both;
	display: inline-flex;
	margin-top: 10px;
}

/* Screen B top selects: uniform inset arrow without changing their geometry. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-a-quick-select[aria-label="Ubicación"],
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-a-quick-select[aria-label="Tipo de vivienda"],
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-a-quick-select[aria-label="Dormitorios"],
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-property-sort select,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-recent-filter select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 34px !important;
	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 d='M1 1.25 6 6.25l5-5' fill='none' stroke='%23203547' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 10px auto;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-a-sidebar {
	display: block;
	grid-column: 1;
	grid-row: 1;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results {
	grid-column: 3;
	grid-row: 1;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-map {
	grid-column: 2;
	grid-row: 1;
	width: 100%;
	min-height: 620px;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-map iframe {
	width: 100%;
	min-height: 560px;
}

/* Narrow result column: stack each existing list card without changing its content. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .listing-view > [class*="col-"] {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-wrap > .d-flex {
	flex-direction: column !important;
	align-items: stretch !important;
	min-width: 0;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-header,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-body,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .listing-image-wrap,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .listing-gallery-wrap,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .houzez-listing-carousel,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .slick-list {
	width: 100% !important;
	max-width: 100%;
	min-width: 0;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-body {
	padding: 14px;
	overflow: hidden;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-title,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-address,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-price-wrap,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-footer,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .labels-wrap {
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-footer,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .labels-wrap,
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell:not(.ooc-screen-a-filters-closed) .ooc-screen-b-results .item-amenities {
	flex-wrap: wrap;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-a-filters-closed {
	grid-template-columns: minmax(520px, 1.1fr) minmax(420px, 0.9fr);
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-a-filters-closed .ooc-screen-a-sidebar {
	display: none;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-a-filters-closed .ooc-screen-b-map {
	grid-column: 1;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-a-filters-closed .ooc-screen-b-results {
	grid-column: 2;
}

/* Pantalla B third state: reuse the current map and filters, without results. */
body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map {
	grid-template-columns: minmax(250px, 24fr) minmax(0, 76fr);
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-b-results {
	display: none !important;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-a-sidebar {
	display: block;
	grid-column: 1;
	grid-row: 1;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-b-map {
	grid-column: 2;
	grid-row: 1;
	height: calc(100vh - 190px);
	min-height: 620px;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-b-map iframe {
	height: calc(100% - 58px);
	min-height: 562px;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map.ooc-screen-a-filters-closed {
	grid-template-columns: minmax(0, 1fr);
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map.ooc-screen-a-filters-closed .ooc-screen-a-sidebar {
	display: none;
}

body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map.ooc-screen-a-filters-closed .ooc-screen-b-map {
	grid-column: 1;
}

@media (max-width: 1100px) {
	body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell {
		grid-template-columns: 1fr;
	}

	body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-results,
	body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-map {
		grid-column: 1;
	}

	body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-a-sidebar,
	body.page-id-31.ooc-screen-b-preview.ooc-screen-b-ready .ooc-screen-b-shell.ooc-screen-b-full-map .ooc-screen-b-map {
		grid-column: 1;
	}
}
