@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --isb-accent:      #F97316;
  --isb-accent-dark: #ea6a05;
  --isb-accent-light:#fff7ed;
  --isb-border:      #e2e8f0;
  --isb-text:        #111827;
  --isb-muted:       #6b7280;
  --isb-font:        'Outfit', sans-serif;
}

/* ─── AZZERA margine/padding sezione Elementor che contiene la barra ─── */
#isb-hero-section,
#isb-hero-section .elementor-container,
#isb-hero-section .elementor-row,
#isb-hero-section .elementor-column,
#isb-hero-section .elementor-column-wrap,
#isb-hero-section .elementor-widget-wrap {
  padding-bottom: 0 !important;
  margin-bottom:  0 !important;
}


.isb-wrapper {
  font-family: var(--isb-font);
  width: 100%;
  position: relative;
  z-index: 100;
  display: block;
  line-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  box-shadow: none;
}

/* ─── BARRA: piena larghezza, angoli arrotondati top ─── */
.isb-bar {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 16px 16px 0 0;
  border-top:   1.5px solid var(--isb-border);
  border-left:  1.5px solid var(--isb-border);
  border-right: 1.5px solid var(--isb-border);
  border-bottom: none;
  box-shadow: none;
  overflow: hidden;
  min-height: 68px;
  width: 100%;
  line-height: normal;
}
.isb-bar.filtri-open {
  border-radius: 16px 16px 0 0;
}

/* ─── CAMPI ─── */
.isb-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  flex: 1;
  min-width: 0;
  background: #fff;
}
/* Campo zona più largo ma non troppo */
.isb-field:first-child { flex: 1.8; }

.isb-field.isb-divider {
  border-right: 1.5px solid var(--isb-border);
}
.isb-icon { width: 18px; height: 18px; color: #9ca3af; flex-shrink: 0; }

.isb-field input[type="text"],
.isb-field select {
  border: none; outline: none; background: transparent;
  font-family: var(--isb-font);
  font-size: 15px;
  font-weight: 500;
  color: var(--isb-text);
  width: 100%;
  appearance: none; -webkit-appearance: none;
}
.isb-field input[type="text"]::placeholder { color: #9ca3af; font-weight: 400; }
.isb-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='6' viewBox='0 0 11 6'%3E%3Cpath d='M1 1l4.5 4 4.5-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 18px;
  cursor: pointer;
  min-width: 130px;   /* abbastanza per "Vendita / Affitto" */
}

/* ─── BOTTONE FILTRI ─── */
.isb-btn-filtri-wrap {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1.5px solid var(--isb-border);
  background: #fff;
  flex-shrink: 0;
}
.isb-btn-filtri {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--isb-accent-light);
  border: 1.5px solid #fed7aa;
  border-radius: 999px;
  font-family: var(--isb-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--isb-accent);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.isb-btn-filtri svg { width: 15px; height: 15px; }
.isb-btn-filtri:hover { background: #ffe4c4; }
.isb-btn-filtri.active { background: #fed7aa; border-color: var(--isb-accent); }

/* ─── BOTTONE CERCA: alto, ben proporzionato ─── */
.isb-btn-cerca {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  min-width: 120px;
  align-self: stretch;       /* occupa tutta l'altezza della barra */
  background: var(--isb-accent);
  border: none;
  font-family: var(--isb-font);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.isb-btn-cerca:hover  { background: var(--isb-accent-dark); }
.isb-btn-cerca:active { opacity: 0.9; }
.isb-btn-cerca svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── FILTRI AVANZATI ─── */
.isb-filtri-avanzati {
  background: #fff;
  border: 1.5px solid var(--isb-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
}
.isb-filtri-avanzati.open { max-height: 160px; padding: 18px 24px 22px; }
.isb-filtri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.isb-filter-group { display: flex; flex-direction: column; gap: 5px; }
.isb-filter-group label {
  font-size: 11px; font-weight: 700; color: var(--isb-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.isb-filter-group input[type="number"] {
  border: 1.5px solid var(--isb-border); border-radius: 10px;
  padding: 8px 12px; font-family: var(--isb-font); font-size: 14px;
  color: var(--isb-text); outline: none; transition: border-color 0.15s;
}
.isb-filter-group input[type="number"]:focus {
  border-color: var(--isb-accent); box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

/* ─── RISULTATI ─── */
.isb-results {
  margin-top: 6px;
  background: #fff;
  border: 1.5px solid var(--isb-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  animation: isbFadeIn 0.22s ease;
}
@keyframes isbFadeIn { from{opacity:0;transform:translateY(-5px)} to{opacity:1;transform:translateY(0)} }

.isb-results-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; border-bottom: 1.5px solid var(--isb-border); background: #fafafa;
}
.isb-results-count { font-size: 12px; font-weight: 700; color: var(--isb-muted); text-transform: uppercase; letter-spacing: 0.05em; line-height: normal; }
.isb-results-count strong { color: var(--isb-accent); font-size: 16px; }
.isb-results-close {
  display: flex; align-items: center; gap: 5px; background: var(--isb-accent);
  border: none; font-family: var(--isb-font); font-size: 13px; font-weight: 600;
  color: #fff; cursor: pointer; padding: 6px 14px; border-radius: 999px;
  transition: background 0.15s; line-height: normal;
}
.isb-results-close:hover { background: var(--isb-accent-dark); }

.isb-results-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-height: 600px; overflow-y: auto;
  padding: 16px; gap: 14px; background: #f8fafc;
}
.isb-results-grid::-webkit-scrollbar { width: 5px; }
.isb-results-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── CARD ─── */
.isb-card {
  display: flex; flex-direction: column; text-decoration: none;
  color: var(--isb-text); background: #fff; border-radius: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1.5px solid transparent;
}
.isb-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.11); border-color: #fed7aa; }
.isb-card:hover .isb-card-img img { transform: scale(1.05); }

.isb-card-img { width:100%; height:165px; overflow:hidden; background:#f1f5f9; position:relative; flex-shrink:0; }
.isb-card-img img { width:100%; height:100%; object-fit:cover; transition:transform 0.35s ease; display:block; }
.isb-card-no-img { display:flex; align-items:center; justify-content:center; width:100%; height:100%; color:#cbd5e1; font-size:40px; }

/* Badge — solo arancione */
.isb-card-badge {
  position:absolute; top:9px; left:9px;
  font-family:var(--isb-font); font-size:10px; font-weight:800;
  letter-spacing:0.07em; text-transform:uppercase; color:#fff;
  padding:4px 11px; border-radius:999px;
  background: var(--isb-accent);
}
.isb-card-badge--vendita,
.isb-card-badge--affitto,
.isb-card-badge--default { background: var(--isb-accent); }

.isb-card-body { padding:13px 14px 15px; display:flex; flex-direction:column; gap:4px; flex:1; line-height:normal; }
.isb-card-tipologia { font-size:10px; font-weight:800; color:var(--isb-accent); text-transform:uppercase; letter-spacing:0.06em; }
.isb-card-title { font-size:14px; font-weight:700; color:var(--isb-text); line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.isb-card-meta { display:flex; flex-wrap:wrap; gap:5px; margin-top:4px; }
.isb-card-meta-item { display:flex; align-items:center; gap:3px; font-size:11px; color:var(--isb-muted); font-weight:600; background:#f1f5f9; padding:3px 7px; border-radius:6px; }
.isb-card-meta-item svg { width:11px; height:11px; flex-shrink:0; }

/* Città: sempre su riga separata */
.isb-card-location {
  display: flex; width: 100%; align-items: center;
  gap: 4px; font-size: 11px; color: var(--isb-muted);
  margin-top: 6px; line-height: 1.4;
}
.isb-card-location svg { width:11px; height:11px; flex-shrink:0; color:var(--isb-accent); }

.isb-card-footer { display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:9px; border-top:1px solid #f1f5f9; }
.isb-card-prezzo { font-size:17px; font-weight:800; color:var(--isb-accent); line-height:1; }
.isb-card-cta { font-size:10px; font-weight:700; color:var(--isb-accent); text-transform:uppercase; letter-spacing:0.05em; opacity:0.55; transition:opacity 0.15s; }
.isb-card:hover .isb-card-cta { opacity:1; }

/* ─── EMPTY / LOADER ─── */
.isb-no-results { padding:48px 20px; text-align:center; color:var(--isb-muted); font-size:14px; grid-column:1/-1; background:#fff; border-radius:12px; line-height:normal; }
.isb-no-results svg { display:block; margin:0 auto 12px; width:40px; height:40px; opacity:0.2; }
.isb-no-results small { display:block; margin-top:5px; font-size:12px; opacity:0.7; }
.isb-results-loader { display:none; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:44px; font-size:14px; color:var(--isb-muted); font-weight:500; line-height:normal; }
.isb-results-loader.visible { display:flex; }
.isb-spinner { width:32px; height:32px; border:3px solid #fed7aa; border-top-color:var(--isb-accent); border-radius:50%; animation:isbSpin 0.65s linear infinite; }
@keyframes isbSpin { to { transform:rotate(360deg); } }

/* ─── RESPONSIVE ─── */
/* ─── TABLET ─── */
@media (max-width:1024px) {
  .isb-results-grid { grid-template-columns:repeat(3,1fr); }
}

/* Gruppi di righe per mobile */
.isb-row-group {
  display: contents;   /* su desktop si comporta come se non esistesse */
}

/* ─── MOBILE ─── */
@media (max-width:768px) {

  .isb-bar {
    flex-direction: column;
    border-radius: 16px 16px 0 0;
    min-height: auto;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  /* row-group diventa flex row su mobile */
  .isb-row-group {
    display: flex;
    width: 100%;
    border-bottom: 1.5px solid var(--isb-border);
  }

  /* Campo zona: piena larghezza */
  .isb-row-full {
    width: 100%;
    min-height: 56px;
    border-right: none !important;
  }

  /* Tutti i campi dentro row-group: 50% */
  .isb-row-group .isb-field {
    flex: 1;
    min-height: 52px;
    border-bottom: none;   /* il border lo mette il row-group */
  }
  .isb-row-group .isb-field.isb-divider {
    border-right: 1.5px solid var(--isb-border);
  }

  /* Filtri dentro row-group */
  .isb-row-group .isb-btn-filtri-wrap {
    flex-shrink: 0;
    padding: 0 14px;
    border-right: none;
    border-bottom: none;
    display: flex;
    align-items: center;
  }

  /* Bottone Cerca: piena larghezza, prominente */
  .isb-btn-cerca {
    width: 100%;
    justify-content: center;
    padding: 0;
    font-size: 17px;
    height: 58px;
    border-radius: 0;
    align-self: auto;
  }

  /* Risultati */
  .isb-results-grid { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .isb-filtri-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }

  /* Card orizzontale su mobile */
  .isb-card { flex-direction: row; height: 110px; }
  .isb-card-img { width: 120px; height: 110px; flex-shrink: 0; }
  .isb-card-body { padding: 10px 12px; gap: 3px; overflow: hidden; }
  .isb-card-tipologia { font-size: 10px; }
  .isb-card-title { font-size: 13px; -webkit-line-clamp: 1; }
  .isb-card-meta { gap: 4px; }
  .isb-card-meta-item { font-size: 10px; padding: 2px 6px; }
  .isb-card-location { font-size: 10px; margin-top: 3px; }
  .isb-card-footer { padding-top: 6px; }
  .isb-card-prezzo { font-size: 15px; }
  .isb-card-cta { display: none; }
  .isb-card-badge { font-size: 9px; padding: 3px 8px; top: 7px; left: 7px; }
}

@media (max-width: 480px) {
  .isb-results-header { padding: 10px 14px; }
  .isb-results-count { font-size: 11px; }
  .isb-filtri-avanzati.open { padding: 14px 16px 18px; }
  .isb-filtri-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
