/**
 * Card immobili — layout rh_prop_card (hello-elementor-child)
 */

:root {
  --agim-listing-brand: #002c50;
  --agim-listing-brand-rgb: 0, 44, 80;
}

/* Immobili di lusso */
body.luxury {
  --agim-listing-brand: #121212;
  --agim-listing-brand-rgb: 18, 18, 18;
}

/* Griglia: card tutte alla stessa altezza */
.agim-listing #elenco-immo.agim-listing-grid,
.agim-listing #elenco-immo.con-griglia,
.agim-listing #elenco-immo.col2,
.agim-listing #elenco-immo.col3,
.agim-listing #elenco-immo.col4 {
  align-items: stretch !important;
}

.agim-listing #elenco-immo:not(.agim-listing-list) .item.rh_prop_card,
.agim-listing #elenco-immo.agim-listing-grid .item.rh_prop_card,
.agim-listing #elenco-immo.con-griglia .item.rh_prop_card,
.agim-listing #elenco-immo.col2 .item.rh_prop_card,
.agim-listing #elenco-immo.col3 .item.rh_prop_card,
.agim-listing #elenco-immo.col4 .item.rh_prop_card {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

.agim-listing #elenco-immo:not(.agim-listing-list) .rh_prop_card .rh_prop_card__wrap,
.agim-listing #elenco-immo.agim-listing-grid .rh_prop_card .rh_prop_card__wrap,
.agim-listing #elenco-immo.con-griglia .rh_prop_card .rh_prop_card__wrap,
.agim-listing #elenco-immo.col2 .rh_prop_card .rh_prop_card__wrap,
.agim-listing #elenco-immo.col3 .rh_prop_card .rh_prop_card__wrap,
.agim-listing #elenco-immo.col4 .rh_prop_card .rh_prop_card__wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

/* Griglia: foto 250px */
.agim-listing #elenco-immo:not(.agim-listing-list) .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing #elenco-immo.agim-listing-grid .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing #elenco-immo.con-griglia .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing #elenco-immo.col2 .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing #elenco-immo.col3 .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing #elenco-immo.col4 .rh_prop_card .rh_prop_card__thumbnail {
  flex-shrink: 0;
  margin: 0;
  min-height: 250px;
  height: 250px;
  aspect-ratio: auto;
  /* visible: il tooltip preferiti non deve essere tagliato a destra */
  overflow: visible;
}

.agim-listing #elenco-immo:not(.agim-listing-list) .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.agim-listing-grid .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.con-griglia .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.col2 .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.col3 .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.col4 .rh_prop_card .rh_figure_property_one {
  position: relative;
  height: 250px;
  min-height: 250px;
  overflow: hidden;
}

.agim-listing #elenco-immo:not(.agim-listing-list) .rh_prop_card .rh_figure_property_one > a,
.agim-listing #elenco-immo.agim-listing-grid .rh_prop_card .rh_figure_property_one > a,
.agim-listing #elenco-immo.con-griglia .rh_prop_card .rh_figure_property_one > a,
.agim-listing #elenco-immo.col2 .rh_prop_card .rh_figure_property_one > a,
.agim-listing #elenco-immo.col3 .rh_prop_card .rh_figure_property_one > a,
.agim-listing #elenco-immo.col4 .rh_prop_card .rh_figure_property_one > a {
  display: block;
  height: 250px;
  min-height: 250px;
}

.agim-listing #elenco-immo:not(.agim-listing-list) .rh_prop_card .rh_figure_property_one img,
.agim-listing #elenco-immo.agim-listing-grid .rh_prop_card .rh_figure_property_one img,
.agim-listing #elenco-immo.con-griglia .rh_prop_card .rh_figure_property_one img,
.agim-listing #elenco-immo.col2 .rh_prop_card .rh_figure_property_one img,
.agim-listing #elenco-immo.col3 .rh_prop_card .rh_figure_property_one img,
.agim-listing #elenco-immo.col4 .rh_prop_card .rh_figure_property_one img {
  display: block;
  width: 100%;
  height: 250px;
  min-height: 250px;
  object-fit: cover;
  object-position: center;
}

/* Corpo card — meta e prezzo in basso */
.agim-listing .rh_prop_card .rh_prop_card__details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 1rem 1.15rem 1.2rem;
}

.agim-listing .rh_prop_card .rh_prop_card__head {
  flex: 1 1 auto;
  min-height: 0;
}

.agim-listing .rh_prop_card .rh_prop_card__details h3 {
  margin: 0 0 0.5rem;
  line-height: 1.35;
  font-size: 1.15rem;
  font-weight: 600;
  min-height: calc(1.35em * 2);
}

.agim-listing .rh_prop_card .rh_prop_card__details h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--agim-listing-brand, #002c50);
  text-decoration: none;
}

.agim-listing .rh_prop_card .rh_prop_card__details h3 a:hover {
  color: #004a7c;
}

.agim-listing .rh_prop_card .rh_prop_card__excerpt {
  margin: 0 0 0.75rem;
  min-height: calc(1.5em * 2);
  font-size: 1.3rem;
  line-height: 1.5;
  color: #64748b;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.agim-listing .rh_prop_card .rh_prop_card__excerpt--empty {
  visibility: hidden;
}

.agim-listing .rh_prop_card .rh_prop_card__foot {
  margin-top: auto;
  flex-shrink: 0;
}

.agim-listing .rh_prop_card__meta_wrap {
  margin-top: 0;
}

.agim-listing .rh_prop_card_meta_theme_stylish {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agim-listing .rh_card_meta_item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.agim-listing .rh_card_meta_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: rgba(var(--agim-listing-brand-rgb), 0.08);
}

.agim-listing .rh_card_meta_icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--agim-listing-brand, #002c50);
}

.agim-listing .rh_card_meta_value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--agim-listing-brand, #002c50);
  line-height: 1;
}

.agim-listing .rh_card_meta_label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

.agim-listing .rh_prop_card__priceLabel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid #e2e8f0;
}

.agim-listing .rh_prop_card__status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 4px;
  background-color: var(--agim-listing-brand, #002c50);
  color: #fafafa !important;
  font-family: "Lato", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agim-listing .rh_prop_card__price {
  margin: 0;
  text-align: right;
  line-height: 0;
}

.agim-listing .rh_prop_card__price .price {
  font-family: "Lato", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--agim-listing-brand, #002c50);
  white-space: nowrap;
}

.agim-listing .rh_prop_card__price--negotiation .negotiation,
.agim-listing .rh_prop_card__price .negotiation {
  font-family: "Lato", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  font-style: italic;
  color: #64748b;
}

/* Preferiti — mostra solo aggiungi O rimuovi */
.agim-listing .rh_prop_card .rh_prop_card__btns {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  top: auto;
  z-index: 3;
}

.agim-listing .rh_prop_card .rh_prop_card__thumbnail {
  position: relative;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  cursor: pointer;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property .add,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property .remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property .remove,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property .favorite-placeholder {
  display: none !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .add,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .add-to-favorite {
  display: none !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .remove,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .favorite-placeholder {
  display: flex !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property .rh_svg {
  fill: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  transition: fill 0.2s ease;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property:hover .add .rh_svg {
  fill: #ffffff;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .remove .rh_svg,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .favorite-placeholder .rh_svg {
  fill: #e11d48;
}

/* Nessuna icona duplicata da RealHomes (::before / tooltip) */
.agim-listing .rh_prop_card .rh_prop_card__btns .add-to-favorite::before,
.agim-listing .rh_prop_card .rh_prop_card__btns .favorite-placeholder::before,
.agim-listing .rh_prop_card .rh_prop_card__btns .add-to-favorite::after,
.agim-listing .rh_prop_card .rh_prop_card__btns .favorite-placeholder::after {
  display: none !important;
  content: none !important;
}

.agim-listing .ui-tooltip svg,
.agim-listing .rh-ui-tooltip svg {
  display: none !important;
}

/* Preferiti — bookmark + tooltip non tagliato a destra */
.agim-listing .rh_prop_card .bookmark,
.agim-listing .rh_prop_card .bg-bookmark,
.slick-slide .rh_prop_card .bookmark,
.slick-slide .rh_prop_card .bg-bookmark {
  overflow: visible;
  z-index: 6;
}

.agim-listing .rh_prop_card .bookmark [data-tooltip],
.slick-slide .rh_prop_card .bookmark [data-tooltip],
.rh_prop_card__thumbnail .bookmark [data-tooltip] {
  position: relative;
}

/* Tooltip sopra il cuore, allineato a destra (non esce dal bordo destro) */
.agim-listing .rh_prop_card .bookmark [data-tooltip]::before,
.slick-slide .rh_prop_card .bookmark [data-tooltip]::before,
.rh_prop_card__thumbnail .bookmark [data-tooltip]::before {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  bottom: calc(100% + 8px) !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0.35rem 0.65rem;
  background: #1e293b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.agim-listing .rh_prop_card .bookmark [data-tooltip]:hover::before,
.slick-slide .rh_prop_card .bookmark [data-tooltip]:hover::before,
.rh_prop_card__thumbnail .bookmark [data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Evita tooltip duplicato da stili legacy (::after) */
.agim-listing .rh_prop_card .bookmark [data-tooltip]::after,
.slick-slide .rh_prop_card .bookmark [data-tooltip]::after,
.rh_prop_card__thumbnail .bookmark [data-tooltip]::after {
  content: none !important;
  display: none !important;
}

/* jQuery UI / RealHomes tooltip: non superare la viewport */
.agim-listing .ui-tooltip,
.agim-listing .rh-ui-tooltip,
.ui-tooltip.rh-ui-tooltip {
  max-width: min(240px, calc(100vw - 2rem));
}

/* Legacy markup — agente e blocchi vecchi nascosti */
.agim-listing .agente-incaricato,
.agim-listing .rh_prop_card .caratteristiche.box,
.agim-listing .rh_prop_card .caratteristiche:not(.rh_prop_card_meta_theme_stylish) {
  display: none !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property:not(.saved) .remove,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property:not(.saved) .favorite-placeholder {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property:not(.saved) .add,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property:not(.saved) .add-to-favorite {
  display: flex !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .add,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .add-to-favorite {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .remove,
.agim-listing .rh_prop_card .rh_prop_card__btns .save_property.saved .favorite-placeholder {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Vetrina / slider */
.agim-listing .rh_prop_card.rh_prop_card--vetrina {
  height: 100%;
}

.agim-listing .vetrina .rh_prop_card,
.agim-listing .slick-slide .rh_prop_card {
  height: 100%;
}

/* Vetrina mosaic: 5 immobili per slide su 2 righe → 2 grandi sopra, 3 piccoli sotto */
.agim-vetrina--mosaic-5x2:not(.slick-initialized) {
  display: block !important;
  grid-template-columns: none !important;
}

.agim-vetrina--mosaic-5x2.vetrina.slick-slider .slick-slide > div,
.agim-vetrina--mosaic-5x2.vetrina.slick-initialized .slick-slide > div {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

.agim-vetrina--mosaic-5x2.vetrina.slick-initialized .slick-slide {
  width: 100% !important;
  float: none !important;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-slide {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto;
  column-gap: var(--agim-vetrina-gap, 12px);
  row-gap: var(--agim-vetrina-row-gap, 20px);
  width: 100%;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell {
  min-width: 0;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(1) {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(2) {
  grid-column: 4 / span 3;
  grid-row: 1;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(3) {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(4) {
  grid-column: 3 / span 2;
  grid-row: 2;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(5) {
  grid-column: 5 / span 2;
  grid-row: 2;
}

.agim-vetrina--mosaic-5x2.slick-initialized .slick-slide > .agim-vetrina-mosaic-slide,
.agim-vetrina--mosaic-5x2.slick-slider .slick-slide > .agim-vetrina-mosaic-slide,
.agim-vetrina--mosaic-5x2.slick-initialized .slick-slide > div > .agim-vetrina-mosaic-slide,
.agim-vetrina--mosaic-5x2.slick-slider .slick-slide > div > .agim-vetrina-mosaic-slide {
  display: grid !important;
  width: 100%;
  height: auto;
}

.agim-vetrina--mosaic-5x2.slick-initialized .slick-slide,
.agim-vetrina--mosaic-5x2.slick-slider .slick-slide {
  padding-bottom: var(--agim-vetrina-row-gap, 20px) !important;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell .rh_prop_card,
.agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell .item {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_prop_card__thumbnail,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one > a,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one img {
  min-height: 320px;
  height: 320px;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_prop_card__thumbnail,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one > a,
.agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one img {
  min-height: 210px;
  height: 210px;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_prop_card__details h3 {
  font-size: 1.2rem;
}

.agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_prop_card__details h3 {
  font-size: 1rem;
}

@media (max-width: 991px) {
  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(1),
  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(2) {
    grid-column: span 1;
    grid-row: auto;
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(3),
  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(4),
  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(5) {
    grid-column: span 1;
    grid-row: auto;
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_prop_card__thumbnail,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one > a,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one img {
    min-height: 260px;
    height: 260px;
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_prop_card__thumbnail,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one > a,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one img {
    min-height: 190px;
    height: 190px;
  }
}

@media (max-width: 640px) {
  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-slide {
    grid-template-columns: 1fr;
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-mosaic-cell:nth-child(n) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_prop_card__thumbnail,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one > a,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--large .rh_figure_property_one img,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_prop_card__thumbnail,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one > a,
  .agim-vetrina--mosaic-5x2 .agim-vetrina-card--small .rh_figure_property_one img {
    min-height: 220px;
    height: 220px;
  }
}

/* Vista elenco — foto a sinistra, dati a destra */
.agim-listing #elenco-immo.agim-listing-list,
.agim-listing.agim-listing--view-elenco #elenco-immo {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  gap: 1rem;
  grid-template-columns: none !important;
  width: 100% !important;
}

.agim-listing #elenco-immo.agim-listing-list .item,
.agim-listing #elenco-immo.agim-listing-list .item.rh_prop_card,
.agim-listing.agim-listing--view-elenco #elenco-immo .item,
.agim-listing.agim-listing--view-elenco #elenco-immo .item.rh_prop_card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__wrap,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100%;
  height: auto;
  min-height: 200px;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__thumbnail,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__thumbnail {
  order: 1;
  flex: 0 0 280px;
  width: 280px;
  min-width: 200px;
  max-width: 38%;
  height: auto !important;
  min-height: 200px !important;
  max-height: none !important;
  aspect-ratio: auto;
  align-self: stretch;
  margin: 0;
  overflow: visible;
  position: relative;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one,
.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one > a,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one > a {
  display: block;
  height: 100% !important;
  min-height: 200px !important;
  overflow: hidden;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one img,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one img {
  width: 100%;
  height: 100% !important;
  min-height: 200px !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__details,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__details {
  order: 2;
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
  min-height: 200px;
  padding: 1rem 1.25rem 1.15rem;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__head,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__head {
  flex: 1 1 auto;
  min-height: 0;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__details h3,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__details h3 {
  min-height: 0;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__excerpt,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__excerpt {
  min-height: 0;
  -webkit-line-clamp: 3;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card_meta_theme_stylish,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card_meta_theme_stylish {
  flex-wrap: wrap;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__foot,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__foot {
  margin-top: auto;
  flex-shrink: 0;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__priceLabel,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__priceLabel {
  margin-top: 0.75rem;
}

.agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__btns,
.agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__btns {
  bottom: 0.75rem;
  right: 0.75rem;
}

@media (max-width: 640px) {
  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__wrap,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__wrap {
    flex-direction: column !important;
    min-height: 0;
  }

  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__thumbnail,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__thumbnail {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    aspect-ratio: 4 / 3;
    min-height: 0 !important;
    height: auto !important;
  }

  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one,
  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one > a,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one > a,
  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_figure_property_one img,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_figure_property_one img {
    min-height: 0 !important;
    height: 100% !important;
  }

  .agim-listing #elenco-immo.agim-listing-list .rh_prop_card .rh_prop_card__details,
  .agim-listing.agim-listing--view-elenco #elenco-immo .rh_prop_card .rh_prop_card__details {
    min-height: 0;
  }

  .agim-listing .rh_prop_card__price .price {
    font-size: 1.2rem;
  }
}

/* Paginazione — pulsanti rotondi */
.agim-listing .agim-listing-pager .paged ul,
.agim-listing .paged ul {
  gap: 0.65rem;
}

.agim-listing .agim-listing-pager .paged li,
.agim-listing .paged li {
  margin: 0;
  padding: 0;
}

.agim-listing .agim-listing-pager .paged li a,
.agim-listing .agim-listing-pager .paged li span,
.agim-listing .paged li a,
.agim-listing .paged li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
}

.agim-listing .agim-listing-pager .paged li a i,
.agim-listing .paged li a i {
  font-size: 1.4rem;
  line-height: 1;
}

/* Toolbar elenco — ordina per, conteggio, switch griglia/elenco */
.agim-listing .agim-listing-count,
.agim-listing .agim-listing-count-number {
  font-size: 15px !important;
  line-height: 1.4;
}

.agim-listing .property-listing-header select,
.agim-listing .agim-listing-order-select,
.agim-listing #header-properties .property-listing-header select {
  font-size: 15px !important;
  line-height: 1.4 !important;
  min-height: 2.5rem;
  height: auto;
  padding: 0.55rem 2rem 0.55rem 0.9rem !important;
}

.agim-listing #header-properties .sel-visu,
.agim-listing .agim-listing-view-switcher {
  gap: 0.5rem;
}

.agim-listing #header-properties .sel-visu .agim-listing-view-btn,
.agim-listing .agim-listing-view-switcher .agim-listing-view-btn {
  width: auto;
  min-width: 2.5rem;
  min-height: 2.5rem;
  height: auto;
  padding: 0.55rem 0.7rem !important;
  box-sizing: border-box;
}

.agim-listing #header-properties .sel-visu .agim-listing-view-btn i,
.agim-listing .agim-listing-view-switcher .agim-listing-view-btn i {
  font-size: 15px;
  line-height: 1;
}

.agim-listing #header-properties .sel-visu .agim-listing-view-btn.is-active,
.agim-listing .agim-listing-view-switcher .agim-listing-view-btn.is-active {
  padding: 0.55rem 0.7rem !important;
}

/* Titolo elenco: visibilità dal widget (show_title), non dalla mappa */
.agim-listing-header--no-title .agim-listing-title,
.agim-listing-header--no-title .uk-h4,
.agim-listing-header--no-title h2.uk-h4,
.agim-listing.agim-listing--no-title .agim-listing-title,
.agim-listing.agim-listing--no-title .uk-h4,
.agim-listing.agim-listing--no-title h2.uk-h4 {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.agim-listing-inner--map-external .agim-listing-below-map {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.agim-listing-inner--map-external .agim-listing-header--map-external,
.agim-listing.agim-listing--map-external .agim-listing-header--map-external,
.agim-listing.agim-listing--view-mappa .agim-listing-header--map-external {
  display: block;
  width: 100% !important;
  max-width: 1240px !important;
  margin: 0 auto 1rem !important;
  padding: 0 1rem 0.75rem !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid var(--agim-listing-card-border, #e8ecf1);
}

.agim-listing-inner--map-external #elenco-immo,
.agim-listing-inner--map-external #elenco-immo.vetrina,
.agim-listing-inner--map-external #elenco-immo.agim-listing-items,
.agim-listing-inner--map-external #elenco-immo.agim-listing-grid,
.agim-listing-inner--map-external #elenco-immo.agim-listing-list,
.agim-listing.agim-listing--map-external #elenco-immo,
.agim-listing.agim-listing--map-external #elenco-immo.vetrina,
.agim-listing.agim-listing--map-external #elenco-immo.agim-listing-items,
.agim-listing.agim-listing--view-mappa #elenco-immo,
.agim-listing.agim-listing--view-mappa #elenco-immo.vetrina,
.agim-listing.agim-listing--view-mappa #elenco-immo.agim-listing-items {
  width: 100% !important;
  max-width: 1240px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
}

.agim-listing-inner--map-external .agim-listing-pager,
.agim-listing.agim-listing--map-external .agim-listing-pager,
.agim-listing.agim-listing--view-mappa .agim-listing-pager {
  width: 100% !important;
  max-width: 1240px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box !important;
}

.agim-listing-inner--map-external #header-properties,
.agim-listing-inner--map-external .agim-listing-toolbar {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.agim-listing-inner--map-external #agim-listing-map.agim-listing-map--external {
  display: block !important;
  width: 100%;
  max-width: none;
  min-height: 420px;
  height: min(52vh, 560px);
  margin: 0 0 1.25rem;
  border: 1px solid var(--agim-listing-card-border, #e8ecf1);
  border-radius: 0px !important;
  overflow: hidden;
}

.agim-listing-inner--map-external .agim-listing-view-btn.mapspan {
  display: none !important;
}

.agim-listing.agim-listing--map-external .agim-listing-below-map,
.agim-listing.agim-listing--view-mappa .agim-listing-below-map {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* Popup marker mappa elenco */
.leaflet-popup-content .agim-map-popup,
.leaflet-popup-content .osm-popup-content.agim-map-popup {
  margin: 0;
  min-width: 220px;
  max-width: 280px;
}

.leaflet-popup-content .agim-map-popup .osm-popup-thumb {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.leaflet-popup-content .agim-map-popup .osm-popup-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.3;
}

.leaflet-popup-content .agim-map-popup .osm-popup-title a {
  color: inherit;
  text-decoration: none;
}

.leaflet-popup-content .agim-map-popup .osm-popup-title a:hover {
  text-decoration: underline;
}

.leaflet-popup-content .agim-map-popup .osm-popup-price {
  display: block;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.leaflet-popup-content .agim-map-popup-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--agim-listing-muted, #64748b);
}

.leaflet-popup-content .agim-map-popup-loading,
.leaflet-popup-content .agim-map-popup-error {
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}
