.speech {
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 110px;
  position: relative;
  border: 1.5px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.speech-price {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}
.speech-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.speech-tag {
  font-size: 10px;
  font-weight: 600;
  background: #f3f0eb;
  color: #5a4e40;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.2;
}
.speech-tag.green {
  background: #dcf5e9;
  color: #0f6e3a;
}
.speech-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ccc;
}
.speech-sub {
  font-size: 10px;
  color: #888;
  font-weight: 500;
}
.pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pin {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pin:hover {
  transform: scale(1.13) translateY(-4px);
}
.speech {
  min-width: 140px;
  width: auto;
  flex: 0 0 auto;
  white-space: normal;
}

body {
  font-family: "Montserrat", sans-serif;
  color: #111827;
}

.card-hover {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.14);
  border-color: #d1a15a;
}
.card-hover:hover .card-img {
  transform: scale(1.05);
}
.card-img {
  transition: transform 0.4s ease;
}

.annuncio-card {
  position: relative;
}
.annuncio-card--mine {
  border-color: rgba(184, 106, 0, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(184, 106, 0, 0.08);
  background: linear-gradient(to bottom right, #fffdf9, #ffffff);
}
.annuncio-card--mine:hover {
  border-color: rgba(184, 106, 0, 0.55) !important;
  box-shadow:
    0 0 0 3px rgba(184, 106, 0, 0.12),
    0 20px 40px rgba(17, 24, 39, 0.14);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-grid > * {
  animation: fadeUp 0.5s ease both;
}
.animate-grid > *:nth-child(1) {
  animation-delay: 0.05s;
}
.animate-grid > *:nth-child(2) {
  animation-delay: 0.1s;
}
.animate-grid > *:nth-child(3) {
  animation-delay: 0.15s;
}
.animate-grid > *:nth-child(4) {
  animation-delay: 0.2s;
}
.animate-grid > *:nth-child(5) {
  animation-delay: 0.25s;
}
.animate-grid > *:nth-child(6) {
  animation-delay: 0.3s;
}

#filtri-avanzati {
  display: none;
}
#filtri-avanzati.open {
  display: block;
}

.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

.annuncio-title-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.22;
  min-height: calc(1.22em * 2);
}

input,
select,
button,
a {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
input:focus,
select:focus {
  outline: none !important;
  border-color: #b86a00 !important;
  box-shadow: 0 0 0 3px rgba(184, 106, 0, 0.15) !important;
}

.badge-avvisami {
  background: #fff7ed;
  color: #b86a00;
  border: 1px solid rgba(184, 106, 0, 0.18);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}
.badge-preferiti {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}
.badge-contatta {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.16);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}
.owner-badge {
  background: #fff7ed;
  color: #b86a00;
  border: 1px solid rgba(184, 106, 0, 0.18);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid #e7ded0;
  background: #faf7f2;
  color: #5b6472;
}
.meta-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.meta-badge--mine {
  background: #fff7ed;
  color: #b86a00;
  border-color: rgba(184, 106, 0, 0.18);
}
.meta-badge--success {
  background: #ecfdf5;
  color: #059669;
  border-color: rgba(5, 150, 105, 0.16);
}
.meta-badge--neutral {
  background: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
}

.info-chip {
  background: #f8f5ef;
  border: 1px solid #e6ddcf;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
}
.info-chip-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.info-chip-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

/* ── ADVANCED FILTERS REDESIGN ── */
.filter-section {
  background: #fafaf9;
  border: 1px solid #ede8df;
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.filter-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.filter-section-title svg {
  width: 12px;
  height: 12px;
}

/* Accessori pill toggle */
.acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #e5ddd0;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  white-space: nowrap;
}
.acc-pill:hover {
  border-color: #d1a15a;
  color: #92400e;
  background: #fffbf5;
}
.acc-pill.active {
  background: #fff7ed;
  border-color: #d97706;
  color: #92400e;
}
.acc-pill input {
  display: none;
}
.acc-pill-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #d1a15a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
}
.acc-pill.active .acc-pill-check {
  background: #d97706;
  border-color: #d97706;
}
.acc-pill.active .acc-pill-check::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* Pill tutti (reset) */
.acc-pill-all {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.acc-pill-all:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}
.acc-pill-all.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

/* Toggle migliorato */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.toggle-track {
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
input:checked ~ .toggle-track {
  background: #b86a00;
}
input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* Bottone apri filtri avanzati */
.btn-filtri-avanzati {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1.5px solid #e5ddd0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-filtri-avanzati:hover {
  border-color: #b86a00;
  color: #b86a00;
  background: #fff7ed;
}
.btn-filtri-avanzati.open {
  border-color: #b86a00;
  color: #b86a00;
  background: #fff7ed;
}

/* Input field migliorato */
.filter-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid #e5ddd0;
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.filter-input-wrap:focus-within {
  border-color: #b86a00;
  box-shadow: 0 0 0 3px rgba(184, 106, 0, 0.12);
}
.filter-input-wrap svg {
  color: #9ca3af;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}
.filter-input-wrap input,
.filter-input-wrap select {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #111827;
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
}

/* Range pair */
.range-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-pair input {
  width: 100%;
  border: 1.5px solid #e5ddd0;
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.range-pair input:focus {
  border-color: #b86a00;
  box-shadow: 0 0 0 3px rgba(184, 106, 0, 0.12);
}
.range-pair-sep {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 600;
  flex-shrink: 0;
}
.range-min {
  z-index: 2;
}

.range-max {
  z-index: 1;
}

.range-min.active,
.range-max.active {
  z-index: 3;
}
.info-chip {
  background: #f8f5ef;
  border: 1px solid #e6ddcf;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  min-width: 0;
  overflow: hidden;
}

.info-chip-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
* {
  box-sizing: border-box;
}

.info-chip-label {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.range-card {
  background: #fbf8f3;
  border: 1px solid #ece3d4;
  border-radius: 14px;
  padding: 14px 16px 12px;
  transition: border-color 0.15s ease;
}
.range-card:hover {
  border-color: #dccfbe;
}
.range-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.range-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #8a8071;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.range-card-label svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.range-card-value {
  font-size: 12px;
  font-weight: 700;
  color: #b86a00;
  background: rgba(184, 106, 0, 0.09);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.dual-range {
  position: relative;
  height: 28px;
}

.dual-range input[type="range"] {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.dual-range input[type="range"]:focus {
  outline: none;
}

/* Trace (Piste) */
.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}

.dual-range input[type="range"]::-moz-range-progress {
  background: transparent;
  border: none;
}

/* =========================================================
   CURSORE (THUMB) - FORMA A PILLOLA / RETTANGOLO ARROTONDATO
   ========================================================= */

/* 1. WebKit (Chrome, Safari, Edge) */
.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 14px; /* Larghezza rettangolo */
  height: 22px; /* Altezza rettangolo (effetto pillola) */
  border-radius: 6px; /* Angoli morbidi */
  background: #e8850c; /* Colore arancione solido */
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(184, 106, 0, 0.45);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

/* 2. Gecko (Firefox) - Separato per evitare errori di parsing */
.dual-range input[type="range"]::-moz-range-thumb {
  -moz-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 14px;
  height: 22px;
  border-radius: 6px;
  background: #e8850c;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(184, 106, 0, 0.45);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

/* Hover & Focus State - WebKit */
.dual-range input[type="range"]::-webkit-slider-thumb:hover,
.dual-range input[type="range"]:focus::-webkit-slider-thumb {
  transform: scale(1.15);
  background: #f4a536;
  box-shadow: 0 2px 6px rgba(232, 133, 12, 0.4);
}

/* Hover & Focus State - Firefox */
.dual-range input[type="range"]::-moz-range-thumb:hover,
.dual-range input[type="range"]:focus::-moz-range-thumb {
  transform: scale(1.15);
  background: #f4a536;
  box-shadow: 0 2px 6px rgba(232, 133, 12, 0.4);
}

/* Traccia e riempimento sotto i cursori */
.dual-range-track {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 4px;
  background: #e6decf;
  border-radius: 2px;
}

.dual-range-fill {
  position: absolute;
  top: 20px;
  height: 4px;
  background: linear-gradient(90deg, #e8850c, #f4a536);
  border-radius: 2px;
}

.dual-range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #8a8071;
  font-weight: 700;
  margin-top: 2px;
}
@media (max-width: 640px) {
  .info-chip-value {
    font-size: 0.82rem;
  }
}
@media (max-width: 768px) {
  .filter-section {
    padding: 1rem;
  }
  .acc-pill {
    font-size: 11px;
    padding: 5px 11px;
  }
}
/* Contenitore per dare spaziatura adeguata al drag */
.noui-slider-wrapper {
  padding: 10px 0;
  margin-bottom: 6px;
}

/* Azzeriamo la grafica di base di noUiSlider */
.noui-slider-wrapper .noUi-target {
  background: #e6decf;
  border: none;
  box-shadow: none;
  height: 4px;
  border-radius: 2px;
}

/* Colore della traccia selezionata (arancione sfumato) */
.noui-slider-wrapper .noUi-connect {
  background: linear-gradient(90deg, #e8850c, #f4a536);
}

/* Cursore (Thumb) a forma di pillola rettangolare arrotondata */
.noui-slider-wrapper .noUi-handle {
  width: 14px !important;
  height: 22px !important;
  right: -7px !important;
  top: -9px !important;
  border-radius: 6px !important;
  background: #e8850c !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 1px 4px rgba(184, 106, 0, 0.45) !important;
  cursor: pointer !important;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease;
}

/* Rimuove le due liniette trasversali default di noUiSlider */
.noui-slider-wrapper .noUi-handle::before,
.noui-slider-wrapper .noUi-handle::after {
  display: none !important;
}

/* Effetto Hover e Focus sulle manopole */
.noui-slider-wrapper .noUi-handle:hover,
.noui-slider-wrapper .noUi-handle:focus {
  transform: scale(1.15);
  background: #f4a536 !important;
  box-shadow: 0 2px 6px rgba(232, 133, 12, 0.4) !important;
  outline: none;
}
