﻿/* ============================================================
   RB Grid — PI Sync
   Todas las clases prefijadas con rb_
   ============================================================ */

/* ── Variables ── */
:root {
    --rb-primary:    var(--e-global-color-primary);
    --rb-accent:     var(--e-global-color-accent);
    --rb-text:       var(--e-global-color-text);
    --rb-text-light: #666;
    --rb-bg:         #f5f6f8;
    --rb-white:      #fff;
    --rb-border:     #ebebeb;
    --rb-radius:     10px;
    --rb-radius-sm:  6px;
    --rb-shadow:     0 2px 16px rgba(0,0,0,0.07);
    --rb-shadow-md:  0 4px 24px rgba(0,0,0,0.12);
    --rb-gap:        35px;
    --rb-font:       var(--pi-font-body, inherit);
    --rb-badge-sale: var(--e-global-color-primary, #1b4f72);
    --rb-badge-rent: var(--e-global-color-accent);
    --rb-badge-feat: #f3c045;
}

.rb_wrap * { box-sizing: border-box; }
.rb_wrap {
	color: var(--e-global-color-text);
}

/* ============================================================
   FILTROS
   ============================================================ */
.rb_filters {
	margin-bottom: 24px;
	border-bottom: 1px solid var(--rb-border);
	padding-bottom: 25px;
}

/* Fila principal */
.rb_filters__row--main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buscador */
.rb_search_wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.rb_search_icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--rb-text-light);
    pointer-events: none;
    width: 20px;
}
.rb_search_input {
	width: 100%;
	padding: 12px 12px 12px 38px !important;
	border: 1px solid var(--rb-border) !important;
	border-radius: var(--rb-radius-sm) !important;
	outline: none;
	transition: border-color 0.2s;
}
.rb_search_input:focus { border-color: var(--rb-primary); }

/* Pills */
.rb_pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.rb_pill {
	padding: 8px 14px !important;
	border: 1px solid var(--rb-border) !important;
	border-radius: var(--rb-radius-sm) !important;
	background: var(--rb-white);
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
	color: var(--rb-text);
	min-height: 50px;
}
.rb_pill:hover,
.rb_pill:focus,
.rb_pill--active {
    border-color: var(--rb-primary);
    color: #fff !important;
    background: var(--e-global-color-primary) !important;
}
.rb_pill--disabled,
.rb_pill--disabled:hover {
	opacity: 0.38;
	cursor: not-allowed;
	pointer-events: none;
}
/* Bloqueado visualmente igual al activo, pero sin acción hasta tener región */
.rb_pill--locked {
	cursor: default;
	position: relative;
}

/* Tooltip de aviso al tocar pill bloqueado */
.rb_lock_tip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: rgba(30,30,30,.88);
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
	padding: 5px 10px;
	border-radius: 6px;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s;
	z-index: 999;
}
.rb_lock_tip--show { opacity: 1; }
.rb_pill--icon {
    display: flex;
    align-items: center;
}
.rb_clear {
	background: none !important;
	border: none !important;
	cursor: pointer;
	padding: 10px !important;
}
.rb_clear:hover { color: var(--e-global-color-primary); }
/* Limpiar / Buscar: texto en desktop, solo ícono en mobile (ver @media 767px) */
.rb_pills .rb_btn_icon { display: none; }

/* Pill wrap — ancla el dropdown debajo del pill en desktop */
.rb_pill_wrap {
    position: relative;
}

/* Dropdowns */
.rb_dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-md);
    min-width: 220px;
}
.rb_dropdown.open { display: block; }
.rb_dropdown.none { display: none !important; }
.rb_dd_inner { padding: 1.5em; }
.rb_dd_label { display: none; }
.rb_dd_option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 5px 0;
    cursor: pointer;
}
.rb_dd_option:hover { color: var(--rb-primary); }
.rb_dd_option.rb_option--empty { color: #bbb; cursor: not-allowed; }
.rb_dd_option.rb_option--empty input { cursor: not-allowed; }

/* Price inputs en dropdown */
.rb_price_inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.rb_price_inputs input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    font-size: 13px;
    width: 80px;
}

/* Botones dormitorios */
.rb_beds_btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.rb_bed_btn {
    padding: 5px 12px;
    border: 1px solid var(--rb-border);
    border-radius: 20px;
    background: var(--rb-white);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.rb_bed_btn.active,
.rb_bed_btn:hover {
    background: var(--rb-primary);
    color: var(--rb-white);
    border-color: var(--rb-primary);
}

/* Fila extra filtros */
.rb_filters__row--extra {
	display: none;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 10px;
	margin-top: 8px;
	padding-top: 12px;
	border-top: 0;
}
.rb_filters__row--extra.open { display: grid; }
.rb_extra_field select, .rb_extra_field input {
	width: 100%;
	padding: 8px 14px;
	border: 1px solid var(--rb-border);
	border-radius: var(--rb-radius-sm);
	height: 42px;
	background: transparent !important;
}

.rb_mobile_step_filter {
	display: none;
}

.rb_sidebar_overlay {
	display: none;
}

.rb_sidebar__mobile_head {
	display: none;
}

.rb_mobile_filter_title {
	display: none;
}

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */
.rb_layout {
	display: grid;
	grid-template-columns: 1fr 22%;
	gap: 3vw;
	align-items: start;
	margin: 2.5em 0;
}
@media (max-width: 900px) {
    .rb_layout { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
	.rb_filters__row--main {
		flex-wrap: wrap;
		align-items: center;
	}

	/* Buscador + 3 botones en una fila: el buscador toma lo que sobra, los botones solo su ancho. */
	.rb_search_wrap {
		min-width: 0;
		flex: 1 1 0%;
		width: auto;
	}

	.rb_pills {
		flex-wrap: nowrap;
		gap: 8px;
		flex: 0 0 auto;
		width: auto;
	}

	/* Sus pills (operación, tipo, comuna...) van ocultas en mobile: sin esto sus contenedores vacíos suman gaps. */
	.rb_pills .rb_pill_wrap {
		display: none;
	}

	.rb_orderby {
		width: 100%;
	}

	.rb_pill[data-filter="operation"],
	.rb_pill[data-filter="type"],
	.rb_pill[data-filter="commune"],
	.rb_pill[data-filter="region"],
	.rb_pill[data-filter="sector"] {
		display: none;
	}

	#rb_dd_operation,
	#rb_dd_type,
	#rb_dd_commune,
	#rb_dd_region,
	#rb_dd_sector {
		display: none !important;
	}

	.rb_clear {
		padding: 0 16px !important;
		height: 42px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 14px;
		border: 1px solid var(--rb-border) !important;
		border-radius: var(--rb-radius) !important;
		background: var(--rb-white) !important;
	}

	.rb_clear::before {
		content: none;
	}

	#rb_more_toggle {
		flex-shrink: 0;
		width: 38px;
		height: 38px;
		padding: 0 !important;
		justify-content: center;
		min-height: 38px;
	}

	.rb_pills .rb_btn_text { display: none; }
	.rb_pills .rb_btn_icon {
		display: block;
		font-size: 18px;
		line-height: 1;
	}
	.rb_pills .rb_clear,
	.rb_pills .rb_btn--primary {
		flex-shrink: 0;
		width: 38px;
		height: 38px;
		min-height: 38px;
		padding: 0 !important;
		justify-content: center;
	}
	.rb_pills .rb_btn--primary {
		display: inline-flex;
		align-items: center;
	}

	.rb_sidebar_overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,.35);
		opacity: 0;
		pointer-events: none;
		transition: opacity .25s ease;
		z-index: 9998;
	}

	.rb_sidebar_overlay.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	body.rb-sidebar-open {
		overflow: hidden;
	}

	.rb_sidebar {
		position: fixed;
		top: 0;
		right: 0;
		width: 70vw;
		height: 100vh;
		margin: 0;
		border-radius: 0 !important;
		z-index: 9999;
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform .28s ease;
		pointer-events: none;
		gap: 20px !important;
	}

	.rb_sidebar.is-open {
		transform: translateX(0);
		pointer-events: auto;
	}

	.rb_sidebar__mobile_head {
		display: none;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 0;
	}

	.rb_sidebar__close {
		width: 30px !important;
		height: 30px !important;
		border: 0 !important;
		border-radius: 50%;
		background: var(--rb-white);
		color: var(--rb-primary);
		font-weight: 700;
		cursor: pointer;
		padding: 0 !important;
	}

	.rb_search_summary { display: none !important; }

	/* Mirrors de radio: ocultos en mobile (reemplazados por selects) */
	.rb_sidebar__mirror { display: none !important; }

	.rb_sidebar__section--price { order: 1; }
	.rb_mobile_selects { order: 2; display: flex; flex-direction: column; gap: 0; }
	.rb_sidebar__mobile_fields { order: 3; }

	.rb_mobile_selects .rb_sidebar__section { padding: 8px 0; }
	.rb_mobile_selects .rb_dd_label { display: block; margin: 0 0 8px; font-size: 1.1em; color: var(--e-global-color-primary); font-weight: 600; }
	.rb_mobile_selects select {
		width: 100%;
		padding: 12px;
		padding-right: 36px;
		border: 0;
		border-radius: 5px;
		font-size: 14px;
		background: #fff 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 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
		-webkit-appearance: none;
		appearance: none;
		cursor: pointer;
	}
	.rb_mob_select--disabled { opacity: 1; }
	.rb_mob_select--disabled select { pointer-events: none; cursor: default; color: inherit; }
	.rb_mobile_selects select.rb_mob_placeholder {
		color: var(--e-global-color-primary);
		font-weight: 600;
	}
	.rb_mobile_selects select.rb_mob_placeholder option:not([value=""]) {
		color: initial;
		font-weight: normal;
	}

	#rb_code::placeholder {
		color: var(--e-global-color-primary);
		font-weight: 600;
		opacity: 1;
	}

	.rb_sidebar__mirror .rb_dd_inner {
		display: block;
		padding: 0;
	}

	.rb_sidebar__mirror .rb_dd_label {
		display: block;
		margin: 0 0 10px;
		font-size: 1.2em;
		color: var(--e-global-color-primary);
		font-weight: 600;
		text-transform: none;
		letter-spacing: 0;
	}

	.rb_sidebar__mirror .rb_dd_option {
		display: flex !important;
	}

	.rb_sidebar__mobile_fields .rb_filters__row--extra {
		display: grid !important;
		grid-template-columns: 1fr;
		margin: 0;
		padding-top: 0;
		gap: 20px;
	}

	.rb_mobile_filter_title {
		display: block;
		margin: 0 0 10px;
		font-size: 1.2em;
		color: var(--e-global-color-primary);
		font-weight: 600;
	}

	.rb_mobile_step_filter {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 8px;
		margin-top: 10px;
	}

	.rb_mobile_step_btn {
		height: 32px;
		border: 1px solid var(--rb-border);
		border-radius: var(--rb-radius-sm);
		background: var(--rb-white);
		color: var(--rb-text);
		cursor: pointer;
		font-weight: 600;
		transition: all .15s ease;
		padding: 5px !important;
		font-size: 1em;
	}

	.rb_mobile_step_btn.is-active {
		background: var(--rb-primary);
		border-color: var(--rb-primary);
		color: var(--rb-white);
	}

	.rb_extra_field--bathrooms select,
	.rb_extra_field--bedrooms select {
		display: none;
	}

	.rb_extra_field--bedrooms,
	.rb_extra_field--bathrooms {
		display: none;
	}

	#rb_more_filters .rb_mobile_filter_title {
		display: none;
	}

	.rb_extra_field select,
	.rb_extra_field input {
		border-radius: var(--rb-radius-sm);
		background: var(--rb-white) !important;
		color: var(--rb-text);
		font-weight: 600;
		padding: 18px 12px !important;
		font-size: 1em;
		border: 0;
	}

	.rb_extra_field--area-min,
	.rb_extra_field--area-max,
	#rb_favorites,
	.rb_communes {
		display: none !important;
	}

	/* Ocultar dormitorios y baños en mobile */
	.rb_sidebar__section:has(#rb_bedrooms_mob),
	.rb_sidebar__section:has(#rb_bathrooms_mob) {
		display: none;
	}
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.rb_sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: var(--e-global-color-809a6c7);
	padding: 1.5em;
	border-radius: 12px;
}

@media (min-width: 768px) {
	.rb_mobile_selects { display: none; }
}

.rb_search_summary {
	font-size: 1em;
	font-style: italic;
	color: var(--e-global-color-primary);
	line-height: 1.3;
	margin-bottom: 1.2em;
}

.rb_sidebar__mirror {
	display: none;
}

.rb_sidebar__mirror.is-open {
	display: none;
}

.rb_sidebar__operation .rb_dd_inner,
.rb_sidebar__type .rb_dd_inner {
	padding: 0;
}

.rb_sidebar__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--rb-primary);
}

#rb_favorites { margin-bottom: 0.75em; }

.rb_favorites__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rb_favorites__empty {
	margin: 0;
	color: var(--rb-text-light);
	font-size: 14px;
}

.rb_favorites__item {
	display: grid;
	grid-template-columns: 60px 1fr auto;
	gap: 12px;
	align-items: center;
	border-bottom: 1px solid #c7c7c7;
	padding-bottom: 12px;
}
.rb_favorites__item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.rb_favorites__thumb {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eef1f5;
	color: var(--rb-primary);
	text-decoration: none;
	flex-shrink: 0;
	border: 1px solid #9F9F9F;
	padding: 2px;
}

.rb_favorites__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.rb_favorites__thumb--empty {
	font-size: 18px;
}

.rb_favorites__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rb_favorites__title {
	color: var(--rb-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
}

.rb_favorites__title:hover {
	color: var(--e-global-color-primary) !important;
}

.rb_favorites__price {
	color: var(--e-global-color-primary);
	font-weight: 600;
	font-size: 13px;
}

.rb_favorites__remove {
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: #f1f3f6;
	color: var(--rb-text-light) !important;
	cursor: pointer;
	display: inline-flex;
	align-items: start;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 0;
	transition: all .15s ease;
}

.rb_favorites__remove:hover {
	color: var(--e-global-color-primary) !important;
	background: none !important;
}

/* Slider de precio */
.rb_price_slider_label {
	font-size: 1.2em;
	color: var(--e-global-color-primary);
	margin: 0 0 25px;
	font-weight: 600;
}
.rb_slider_track {
	position: relative;
	height: 4px;
	background: var(--rb-border);
	border-radius: 2px;
	margin: 22px 0 22px;
}
.rb_slider_fill {
    position: absolute;
    height: 100%;
    background: var(--e-global-color-accent);
    border-radius: 2px;
    pointer-events: none;
    top: 0;
}
.rb_slider_track input[type="range"] {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    outline: none;
}
.rb_slider_track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--rb-white);
    border: 2px solid var(--rb-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.1s;
    position: relative;
    z-index: 2;
}
.rb_slider_track input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--rb-white);
    border: 2px solid var(--e-global-color-accent);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.rb_slider_track input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
/* El segundo range necesita z-index mayor para ser clickeable */
.rb_slider_track input[type="range"]:last-of-type {
    z-index: 1;
}
.rb_slider_track input[type="range"]:first-of-type {
    z-index: 1;
}
/* Cuando el thumb mínimo está en el máximo, darle z-index mayor */
.rb_slider_track input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.3);
    z-index: 3;
}
.rb_slider_values {
	display: flex;
	justify-content: space-between;
	color: var(--rb-text-light);
	margin-bottom: 12px;
	margin-top: 18px;
}

/* Carrusel sidebar */
/* ============================================================
   MAIN — results bar + grid
   ============================================================ */
.rb_results_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}
.rb_count { color: var(--e-global-color-text); }
.rb_count strong {
	font-weight: 600;
	color: var(--e-global-color-primary);
	font-size: 150%;
	margin-right: 2px;
}

.rb_orderby {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    border: 1px solid var(--rb-border);
    padding: 0 12px;
    border-radius: var(--rb-radius-sm);
    justify-content: space-between;
}
.rb_orderby label { width: 150px; }
.rb_orderby select {
    padding: 8px;
    border-radius: var(--rb-radius-sm);
    background: var(--rb-white);
    cursor: pointer;
    border: 0;
    width: 60%;
    font-size: 1em;
}

/* Grid */
.rb_grid {
    display: grid;
    gap: 30px;
}
.rb_cols_2 { grid-template-columns: repeat(2, 1fr); }
.rb_cols_3 { grid-template-columns: repeat(3, 1fr); }
.rb_cols_4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
    .rb_cols_3, .rb_cols_4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .rb_cols_2, .rb_cols_3, .rb_cols_4 { grid-template-columns: 1fr; }
}

/* ============================================================
   CARD
   ============================================================ */
.rb_card {
    background: var(--rb-white);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}
.rb_card:hover {
    box-shadow: var(--rb-shadow-md);
}
/* Media wrapper — contiene image_wrap + eye */
.rb_card__media { position: relative; }
.rb_card__image_wrap {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f0f0f0;
    text-decoration: none;
}

.rb_card:hover .rb_card__image { transform: scale(1.04); }
.rb_card__no_image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: #ccc;
}

/* Badges */
/* Badges — overrides de contexto sobre cards-shared.css */
.rb_card__badges .pi-badge--temporary_rent { background: var(--e-global-color-accent); color: var(--e-global-color-primary, #1b4f72); }

/* Precio overlay */
.rb_card__price_overlay {
    position: absolute;
    bottom: 0; left: 0;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--rb-white);
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    width: 100%;
}
.rb_card__month { font-size: 12px; font-weight: 400; opacity: 0.85; }

/* Ojo */
.rb_card__eye {
    position: absolute;
    bottom: 10px; right: 10px;
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--rb-primary);
    text-decoration: none;
    transition: background 0.15s;
    z-index: 2;
    font-size: 14px;
}
.rb_card__eye:hover { background: var(--rb-white); }

/* Card body */
.rb_card__body {
    padding: 13px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
/* Title — override de color sobre cards-shared.css */
/* Specs — override de color sobre cards-shared.css */
.rb_card__body .pi-specs { font-size: 11px; color: var(--rb-text); }
.rb_card__body .pi-specs i { color: var(--rb-primary); }
.rb_card__footer { margin-top: auto; padding-top: 6px; }

/* ============================================================
   RB cards visual alignment with destacadas
   Scoped to rb_grid_results to avoid side effects
   ============================================================ */
#rb_grid_results .pid_card {
    background: #fff;
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease;
}

#rb_grid_results .rb_card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
}

#rb_grid_results .pid_card__media {
    position: relative;
}

#rb_grid_results .rb_card__image_wrap {
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #f0f0f0;
	overflow: hidden;
	height: 240px;
}

#rb_grid_results .rb_card__image {
	transition: transform .35s ease;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#rb_grid_results .pid_card:hover .rb_card__image {
    transform: scale(1.04);
}

#rb_grid_results .rb_card__no_image {
    background: #e8e8e8;
    color: #bcbcbc;
}

#rb_grid_results .rb_card__badges .pi-badge {
    position: absolute;
    left: auto;
}

#rb_grid_results .rb_card__badges .pi-badge--featured {
    left: -38px;
    right: auto;
    top: 35px;
    transform: rotate(270deg);
    border-radius: 0 10px 0 5px;
    width: 105px;
    text-align: center;
}

#rb_grid_results .rb_card__price_overlay {
	background: linear-gradient( to bottom, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.32) 40%, rgba(0, 0, 0, 0.02) 100%, rgba(0, 0, 0, 0) 100% );
	font-size: 135%;
	padding: 0.5em 1em;
	z-index: 4;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
}

#rb_grid_results .rb_card__month {
    font-size: 11px;
    font-weight: 400;
    opacity: .85;
    margin-left: 2px;
}


#rb_grid_results .rb_card__body {
    padding: 1.5em;
    gap: 10px;
}

#rb_grid_results .pid_card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
}


#rb_grid_results .rb_card__body .pi-specs {
	font-size: 90%;
	gap: 15px;
	font-weight: 500;
}

#rb_grid_results .rb_card__body .pi-specs i {
    color: var(--e-global-color-primary);
}

#rb_grid_results .rb_card__body .pi-specs li {
    white-space: nowrap;
}

#rb_grid_results .rb_card__footer {
    padding-top: 0;
}

#rb_grid_results .pid_type {
    border-radius: 4px;
    display: inline-block;
    margin-top: auto;
    font-size: 80%;
    background: transparent;
    color: var(--rb-text);
    padding: 0;
    font-weight: 400;
}

/* ============================================================
   TAGS & BOTONES
   ============================================================ */
.rb_tag {
    display: inline-block;
    font-size: 11px;
    background: #f0f0f0;
    color: var(--rb-text-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.rb_btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0 !important;
	gap: 6px;
	border-radius: var(--rb-radius-sm);
	cursor: pointer;
	color: var(--e-global-color-primary) !important;
	text-decoration: none;
	transition: all 0.15s;
	padding: 8px 16px !important;
	white-space: nowrap;
	background: var(--e-global-color-accent) !important;
	min-height: 50px;
}
.rb_btn:hover, .rb_btn:focus {
    background: var(--e-global-color-primary) !important;
    color:var(--e-global-color-accent) !important;
}
.rb_btn--primary {
    background: var(--rb-primary);
    color: var(--rb-white);
    border-color: var(--rb-primary);
}
.rb_btn--primary:hover { filter: brightness(1.1); }
.rb_btn--outline {
    background: transparent;
    color: var(--rb-primary);
    border-color: var(--rb-primary);
}
.rb_btn--outline:hover { background: var(--rb-primary); color: var(--rb-white); }
.rb_btn--sm { padding: 6px 12px; font-size: 12px; }
.rb_btn--full { width: 100%; }

/* ============================================================
   SIN RESULTADOS
   ============================================================ */
.rb_no_results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: var(--rb-white);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    color: var(--rb-text-light);
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.rb_pagination { margin-top: 3em; }
.rb_pagination ul {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    border: 0;
}
.rb_pagination ul li a,
.rb_pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    font-size: 13px;
    text-decoration: none;
    color: var(--rb-text);
    transition: all 0.15s;
}
.rb_pagination ul li a:hover { border-color: var(--rb-primary); color: var(--rb-primary); }
.rb_pagination .fi { font-size: 16px; line-height: 1; display: flex; }
.rb_pagination .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rb_pagination ul li .current {
    background: #254167;
    border-color: var(--rb-primary);
    color: var(--rb-white);
    font-weight: 700;
}

/* ============================================================
   BLOQUE COMUNAS
   ============================================================ */
.rb_communes {
	overflow: hidden;
	margin-top: 12px;
}
.rb_communes__title {
    font-size: 1.2em;
  color: var(--e-global-color-text);
  margin: 0 0 18px;
  font-weight: 600;
}
/* 1 columna — una card visible, scroll si hay más */
.rb_communes__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	color: var(--e-global-color-primary);
}
.rb_communes__tab {
	border: 0 !important;
	background: none !important;
	padding: 0 !important;
	font: inherit;
	color: var(--e-global-color-text) !important;
	cursor: pointer;
}
.rb_communes__tab.is-active,
.rb_communes__tab:hover {
	color: var(--e-global-color-primary) !important;
}
.rb_communes__grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0;
	display: none;
}
.rb_communes__grid.is-active {
	display: flex;
}
.rb_commune_card {
	position: relative;
	height: 120px;
	flex-shrink: 0;
	display: flex;
    align-items: flex-end;
    justify-content: space-between;
    text-decoration: none;
    background: var(--rb-primary);
    background-size: cover;
    background-position: center;
	transition: filter .2s;
	padding: 1.3em;
	border-radius: 10px;
	overflow: hidden;
	isolation: isolate;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.rb_commune_card:first-child { border-top: none; }
.rb_commune_card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: inherit;
	background-size: cover;
	background-position: center;
	transition: transform .35s ease;
	z-index: 0;
}
.rb_commune_card:hover { filter: brightness(1.1); }
.rb_commune_card:hover::before { transform: scale(1.06); }
.rb_commune_card.is-active {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 0;
}
.rb_commune_card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.2) 100%);
	transition: opacity .2s;
	z-index: 1;
}
.rb_commune_card:hover .rb_commune_card__overlay { opacity: .9; }
.rb_commune_card__name {
	position: relative;
	z-index: 2;
	color: var(--rb-white);
	font-size: 13px;
	font-weight: 700;
	text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.rb_commune_card__count {
	position: relative;
	z-index: 2;
	color: rgba(255,255,255,.8);
	font-size: 11px;
	font-weight: 500;
}
.rb_commune_card--noimg {
	background: #2d3748;
}
.rb_commune_card--noimg::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='xMidYMax meet'%3E%3Cg fill='%23fff' opacity='0.13'%3E%3Cpath d='M0 106 Q30 99 60 104 Q90 109 120 104 Q150 99 180 104 Q210 109 240 104 Q270 99 300 104 Q330 109 360 104 Q385 99 400 104 L400 120 L0 120Z'/%3E%3Crect x='25' y='73' width='32' height='40'/%3E%3Cpolygon points='20,73 62,73 41,54'/%3E%3Crect x='71' y='77' width='26' height='36'/%3E%3Cpolygon points='67,77 102,77 84,60'/%3E%3Crect x='163' y='61' width='38' height='52'/%3E%3Cpolygon points='158,61 206,61 182,33'/%3E%3Crect x='180' y='24' width='4' height='12'/%3E%3Crect x='176' y='28' width='12' height='3'/%3E%3Crect x='218' y='75' width='30' height='38'/%3E%3Cpolygon points='213,75 253,75 233,57'/%3E%3Crect x='262' y='71' width='28' height='42'/%3E%3Cpolygon points='257,71 295,71 276,53'/%3E%3Crect x='304' y='76' width='34' height='37'/%3E%3Cpolygon points='299,76 343,76 321,58'/%3E%3Crect x='357' y='45' width='16' height='58'/%3E%3Cpolygon points='353,45 377,45 365,28'/%3E%3Crect x='353' y='61' width='24' height='5'/%3E%3Cpolygon points='110,113 123,76 136,113'/%3E%3Cpolygon points='112,91 123,66 134,91'/%3E%3Crect x='7' y='67' width='5' height='46'/%3E%3Cpath d='M9 66 C-2 53-6 41-4 35 C-2 43 4 55 9 66Z'/%3E%3Cpath d='M11 66 C22 53 26 41 24 35 C22 43 16 55 11 66Z'/%3E%3Cpath d='M10 65 C10 51 7 39 4 33 C7 45 9 57 10 65Z'/%3E%3Cpath d='M50 105 Q70 101 90 105 L86 111 L54 111Z'/%3E%3Crect x='68' y='93' width='3' height='12'/%3E%3Cpolygon points='71,93 84,99 71,105'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 100% auto;
	background-position: bottom center;
	background-repeat: no-repeat;
}

/* ============================================================
   VISTA LISTA
   ============================================================ */
.rb_view_list {
    grid-template-columns: 1fr !important;
    gap: 12px;
}
.rb_view_list .rb_card {
    flex-direction: row;
    height: 140px;
}
.rb_view_list .rb_card__media {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    height: 100%;
}
.rb_view_list .rb_card__image_wrap {
    width: 100%; 
    aspect-ratio: unset;
    height: 100%;
    border-radius: var(--rb-radius) 0 0 var(--rb-radius);
}
.rb_view_list .rb_card__body {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rb_view_list .pi-title { font-size: 15px; margin-bottom: 4px; }
.rb_view_list .rb_card__location { font-size: 12px; margin-bottom: 6px; }
.rb_view_list .pi-specs { margin-top: auto; }
.rb_view_list .rb_card__footer { margin-top: 6px; }
.rb_view_list .rb_card__price_overlay {
    top: auto;
    bottom: 10px;
    left: 10px;
    font-size: 14px;
    padding: 4px 10px;
}
.rb_view_list .rb_card__eye { display: none; }
@media (max-width: 600px) {
    .rb_view_list .rb_card { flex-direction: column; height: auto; }
    .rb_view_list .rb_card__image_wrap { width: 100%; min-width: unset; height: 180px; border-radius: var(--rb-radius) var(--rb-radius) 0 0; }
}


/* Cards en mobile — al final para ganar a las reglas base de #rb_grid_results */
@media (max-width: 767px) {
	#rb_grid_results .rb_card__body {
		padding: 1.25em 1em;
	}

	#rb_grid_results .rb_card__body .pi-specs {
		font-size: 90%;
		gap: 10px;
		font-weight: 500;
	}

	.rb_card__body .pi-title {
		line-height: 1 !important;
		margin-bottom: 2px;
	}

	#rb_grid_results .rb_card__image_wrap {
		height: 202px;
	}
}
