/* Barra ricerca immobili — pill orizzontali stile portale, palette Immovare */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.property-search-bar {
  position: relative;
  background: linear-gradient(135deg, #e8f7f8 0%, #f8fcfc 48%, #fff 100%);
  border-bottom: 1px solid rgba(46, 93, 99, 0.12);
  box-shadow: 0 12px 40px rgba(13, 115, 119, 0.08);
  padding: 16px 20px 18px;
  z-index: 100;
}

.property-search-bar::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(102, 210, 223, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.property-search-bar__inner {
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
}

.property-search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Location */
.property-search-location__input {
  position: relative;
  display: flex;
  align-items: center;
}

.property-search-location__icon {
  position: absolute;
  left: 16px;
  color: #2e5d63;
  pointer-events: none;
  z-index: 1;
}

.property-search-location input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 1px solid #c5e0e2;
  border-radius: 14px;
  background: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 0.95rem;
  color: #1a4a4d;
  box-shadow: 0 2px 10px rgba(26, 74, 77, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-search-location input:focus {
  outline: none;
  border-color: #3cb4b8;
  box-shadow: 0 0 0 4px rgba(60, 180, 184, 0.18);
}

/* Pills row */
.property-search-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.property-search-pills__scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 93, 99, 0.25) transparent;
}

.property-search-pills__scroll::-webkit-scrollbar {
  height: 4px;
}

.property-search-pills__scroll::-webkit-scrollbar-thumb {
  background: rgba(46, 93, 99, 0.25);
  border-radius: 999px;
}

.property-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(60, 180, 184, 0.35);
  border-radius: 999px;
  background: rgba(232, 247, 248, 0.95);
  color: #1a5c62;
  font-family: Montserrat, sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.property-search-pill svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.property-search-pill:hover {
  background: #dff3f5;
  transform: translateY(-1px);
}

.property-search-pill.is-active,
.property-search-pill--filters.is-active {
  background: rgba(60, 180, 184, 0.18);
  border-color: rgba(60, 180, 184, 0.55);
  color: #0d7377;
}

.property-search-pill--filters {
  background: rgba(60, 180, 184, 0.14);
  border-color: rgba(60, 180, 184, 0.45);
}

.property-search-pill--muted {
  background: #fff;
  border-color: rgba(46, 93, 99, 0.18);
  color: #2e5d63;
}

.property-search-pill--muted.is-active {
  background: #f3fafb;
  border-color: rgba(60, 180, 184, 0.45);
  color: #1a5c62;
}

.property-search-pill__chev {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: -2px;
}

.property-search-pills__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Flyout panel — sopra Leaflet (pane fino a ~1000) */
.property-search-flyout {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 24px;
  background: rgba(15, 45, 48, 0.35);
}

.property-search-flyout[hidden] {
  display: none;
}

.property-search-flyout__panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(15, 45, 48, 0.22);
  animation: psFlyoutIn 0.22s ease;
}

@keyframes psFlyoutIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.property-search-flyout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #eef4f5;
  color: #1a4a4d;
}

.property-search-flyout__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f7f9;
  cursor: pointer;
  font-size: 1rem;
  color: #2e5d63;
}

.property-search-flyout__body {
  padding: 16px 18px;
}

.property-search-flyout__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid #eef4f5;
}

.property-search-flyout__footer .property-search-submit {
  flex: 1;
  max-width: 220px;
  margin-left: auto;
}

/* Filter fields */
.property-search-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-search-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.property-search-field-group[hidden] {
  display: none;
}

.property-search-field-group__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2e5d63;
  opacity: 0.85;
}

.property-search-field-group select,
.property-search-field-group input[type='number'] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #c5e0e2;
  border-radius: 12px;
  background: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 0.92rem;
  color: #1a4a4d;
}

.property-search-field-group select:focus,
.property-search-field-group input:focus {
  outline: none;
  border-color: #3cb4b8;
  box-shadow: 0 0 0 3px rgba(60, 180, 184, 0.16);
}

.property-search-field-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.property-search-field-sep {
  color: #8aa5a8;
  font-weight: 600;
}

.property-search-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.property-search-extra-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #2e5d63;
  font-weight: 600;
}

.property-search-extra-item--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #d7e7ea;
  border-radius: 12px;
  background: #fafcfd;
  cursor: pointer;
}

.property-search-extra-item--check input {
  width: 18px;
  height: 18px;
  accent-color: #3cb4b8;
}

/* Drawer (mobile) */
.property-search-drawer-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-search-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.property-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f7e733 0%, #ece819 100%);
  color: #1a4a4d;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(236, 232, 25, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.property-search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(236, 232, 25, 0.4);
}

.property-search-submit--compact {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.85rem;
}

.property-search-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3cb4b8 0%, #2e9a9e 100%);
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(60, 180, 184, 0.35);
  transition: transform 0.15s ease;
}

.property-search-save:hover {
  transform: translateY(-1px);
}

.property-search-reset {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #c5e0e2;
  color: #5a7a7c;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}

.property-search-reset:hover {
  background: #f8fcfc;
  color: #1a4a4d;
}

.property-search-reset--icon {
  width: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  font-size: 1.1rem;
}

.property-search-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.property-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 93, 99, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #2e5d63;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
}

.property-search-chip:hover {
  background: #fff;
}

/* Suggestions */
.property-search-bar .suggestions-box {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d7e7ea;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(26, 74, 77, 0.14);
  overflow: hidden;
  z-index: 1200;
  display: none;
}

.property-search-bar .suggestions-box.show {
  display: block;
}

.property-search-bar .suggestion-item {
  display: block;
  padding: 12px 16px;
  color: #1a4a4d;
  text-decoration: none;
  border-bottom: 1px solid #f0f5f6;
  font-size: 0.9rem;
}

.property-search-bar .suggestion-item:hover {
  background: #f1f9fa;
}

/* Mobile */
.property-search-mobile {
  display: none;
  gap: 10px;
  align-items: stretch;
}

.property-search-mobile .search-async {
  flex: 1;
  position: relative;
}

.property-search-mobile input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid #c5e0e2;
  border-radius: 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%232e5d63' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M17 17l-4.5-4.5'/%3E%3C/svg%3E") no-repeat 14px center;
}

.property-search-mobile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(60, 180, 184, 0.45);
  border-radius: 999px;
  background: rgba(60, 180, 184, 0.12);
  font-weight: 600;
  color: #1a4a4d;
  cursor: pointer;
  white-space: nowrap;
}

.property-search-drawer {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d7e7ea;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(26, 74, 77, 0.16);
  padding: 18px;
  z-index: 1500;
}

.property-search-drawer.is-open {
  display: block;
  animation: searchDrawerIn 0.25s ease;
}

@keyframes searchDrawerIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.property-search-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-weight: 700;
  color: #1a4a4d;
}

.property-search-drawer__close {
  border: none;
  background: #f1f7f9;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* Results strip */
.listing-results-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(60, 180, 184, 0.08), transparent);
  border-bottom: 1px solid #eef4f5;
}

.listing-results-strip strong {
  color: #1a4a4d;
}

.listing-results-strip span {
  color: #5a7a7c;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .property-search-form--desktop {
    display: none;
  }

  .property-search-mobile {
    display: flex;
  }

  .property-search-quicklinks {
    display: none;
  }
}

@media (min-width: 901px) {
  .property-search-mobile-wrap {
    display: none;
  }
}

@media (max-width: 640px) {
  .property-search-bar {
    padding: 12px 14px 14px;
  }

  .property-search-pills__actions .property-search-save span {
    display: none;
  }

  .property-search-toolbar__nav {
    display: none;
  }

  .property-search-toolbar .portal-user-name {
    display: none;
  }
}

/* Toolbar compatta logo + utente (lista e mappa) */
.property-search-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(46, 93, 99, 0.1);
}

.property-search-toolbar__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.property-search-toolbar__logo img {
  display: block;
  height: 32px;
  width: auto;
}

.property-search-toolbar__logo span {
  font-weight: 800;
  color: #1a4a4d;
  font-size: 1rem;
}

.property-search-toolbar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.property-search-toolbar__link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #2e5d63;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.property-search-toolbar__link:hover {
  background: rgba(60, 180, 184, 0.1);
}

.property-search-toolbar__link.is-active {
  background: rgba(60, 180, 184, 0.16);
  border-color: rgba(60, 180, 184, 0.35);
  color: #0d7377;
}

.property-search-toolbar__user {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.property-search-toolbar__login {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(60, 180, 184, 0.12);
  border: 1px solid rgba(60, 180, 184, 0.35);
  color: #1a5c62;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.property-search-toolbar .portal-user-menu {
  position: relative;
}

.property-search-toolbar .portal-user-trigger {
  min-height: 36px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(46, 93, 99, 0.15);
}

.property-search-toolbar .portal-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
}

/* Pagina ricerca classica /immobili */
body.search-list-page {
  margin: 0;
  overflow: hidden;
}

.search-list-page .immobili-listing {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.search-list-page .property-search-bar {
  position: relative;
  flex-shrink: 0;
  z-index: 1100;
  isolation: isolate;
  padding: 10px 16px 12px;
}

.search-list-page .property-search-mobile-wrap {
  position: relative;
  z-index: 1100;
}

.search-list-page .property-search-quicklinks {
  display: none;
}

.search-list-page .layout {
  flex: 1;
  min-height: 0;
  height: auto !important;
  position: relative;
  z-index: 1;
}

.search-list-page .map-dx {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.search-list-page .leaflet-container {
  z-index: 1 !important;
}

.search-list-page .suggestions-box,
.search-list-page .portal-user-dropdown {
  z-index: 1200;
}

.search-list-page .property-search-flyout {
  z-index: 3000;
}

.search-list-page .property-search-drawer {
  z-index: 2500;
}

/* Layout lista WOW — stesso linguaggio visivo di /immobili-mappa */
.search-list-page {
  background: #f4fafb;
  font-family: Montserrat, sans-serif;
}

.search-list-page .property-search-bar {
  box-shadow: 0 8px 28px rgba(13, 115, 119, 0.1);
}

.search-list-page .layout {
  display: flex;
  flex-direction: row;
}

.search-list-page .map-sidebar--lista {
  width: min(480px, 44vw);
  flex-shrink: 0;
}

.search-list-page .map-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
}

.search-list-page .map-dx,
.search-list-page #map {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.search-list-page .map-sidebar__card-wrap .property-card--horizontal,
.search-list-page .map-sidebar__card-wrap .property-card--compass {
  margin: 0;
}

.search-list-page .map-sidebar__card-wrap {
  margin: 0 12px 12px;
}

.map-sidebar-toggle {
  display: none;
}

.map-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .map-sidebar-backdrop {
    display: block;
  }
}

/* Modalità classica (switch admin ui_chromatic_mode = 0) */
body.theme-classic .property-search-bar {
  background: #fff;
  box-shadow: none;
  border-bottom: 1px solid #e5e7eb;
}

body.theme-classic .property-search-bar::before {
  display: none;
}

body.theme-classic .property-search-submit,
body.theme-classic .property-search-pills__actions .property-search-submit {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}
