/* V2 — interface "verre dépoli" (glassmorphism), transitions douces, recherche de lots. */
:root {
  --glass2: rgba(18, 22, 24, 0.46);
  --glass2-strong: rgba(16, 19, 21, 0.62);
  --edge: rgba(255, 255, 255, 0.14);
  --edge-hi: rgba(255, 255, 255, 0.28);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow2: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.panel, .modes, .compass, .finder, .lot-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 40%), var(--glass2) !important;
  border: 1px solid var(--edge) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--shadow2);
}
.panel { transition: width 0.45s var(--ease-out), padding 0.45s var(--ease-out), opacity 0.4s ease; animation: v2-in 0.9s var(--ease-out) both; }
.panel h1 { font-size: 40px; }
.panel dl div, .cal select, .avail-all, .floors button, .quality {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.cal select { background: rgba(10, 12, 14, 0.55) !important; }
.avail-all, .floors button, .quality button, .modes button, .finder button {
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s var(--ease-out), box-shadow 0.25s ease;
}
.avail-all:hover, .floors button:hover, .modes button:hover { transform: translateY(-1px); }
.avail-all.on { background: #f4efe6 !important; }
.floors button.on { background: var(--copper) !important; }
.floors.is-open button.on { background: #f4efe6 !important; }
details.adv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
details.adv.adv-inner { margin-top: 6px; }
details.adv summary {
  cursor: pointer; list-style: none; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 4px 0; user-select: none;
}
details.adv summary::before { content: "+"; display: inline-block; width: 14px; color: var(--copper); transition: transform 0.3s var(--ease-out); }
details.adv[open] summary::before { transform: rotate(45deg); }

/* Barre du bas : ambiances + heure + visite */
.modes {
  bottom: 20px !important; padding: 6px 8px !important; gap: 10px !important; align-items: center;
  border-radius: 20px !important; animation: v2-up 0.9s 0.2s var(--ease-out) both;
}
.modes .seg { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.18); }
.modes .seg button { padding: 7px 12px; font-size: 12.5px; white-space: nowrap; }
.modes .seg button.on { box-shadow: 0 6px 16px rgba(226, 161, 92, 0.35); }
.modes .tod { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.modes .tod input { width: 170px; }
.modes .tod b { min-width: 42px; color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; }
.modes input[type="range"] { accent-color: var(--copper); }

/* Recherche de lots */
.finder {
  position: fixed; z-index: 3; top: 100px; right: 22px; width: min(320px, calc(100vw - 44px));
  max-height: calc(100vh - 200px); display: flex; flex-direction: column;
  border-radius: 20px; color: var(--paper); font-family: Outfit, sans-serif; overflow: hidden;
  transition: transform 0.55s var(--ease-out), opacity 0.45s ease, filter 0.45s ease;
  animation: v2-in-r 0.9s 0.15s var(--ease-out) both;
}
body.lot-open .finder { transform: translateX(calc(100% + 40px)); opacity: 0; filter: blur(6px); pointer-events: none; }
.fd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 14px 16px; background: transparent; border: 0; color: inherit; cursor: pointer; text-align: left;
}
.fd-head em { display: block; font-style: normal; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.fd-head b { font-family: Fraunces, serif; font-weight: 560; font-size: 22px; letter-spacing: -0.02em; }
.fd-count { font-style: normal; min-width: 38px; text-align: center; padding: 4px 10px; border-radius: 999px; background: var(--copper); color: #23180e; font-weight: 700; font-size: 13px; }
.fd-body { padding: 0 16px 14px; overflow: auto; transition: max-height 0.5s var(--ease-out), opacity 0.35s ease; max-height: 70vh; }
.finder.is-collapsed .fd-body { max-height: 0; opacity: 0; padding-bottom: 0; }
.fd-label { margin: 6px 0 6px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-chips button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: var(--paper);
  font: 500 12px Outfit, sans-serif; cursor: pointer;
}
.fd-chips button i { width: 8px; height: 8px; border-radius: 50%; }
.fd-chips button small { color: var(--muted); font-size: 10.5px; }
.fd-chips button.on { background: #f4efe6; color: #1c160f; border-color: transparent; }
.fd-chips button.on small { color: rgba(28, 22, 15, 0.6); }
.fd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.fd-grid label { display: flex; flex-direction: column; gap: 4px; }
.fd-grid label span:not(.fd-dual) { color: var(--paper); font-variant-numeric: tabular-nums; }
.fd-grid .fd-wide { grid-column: 1 / -1; }
.fd-grid select { padding: 6px 8px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(10, 12, 14, 0.55); color: var(--paper); font: 500 12.5px Outfit, sans-serif; }
.fd-dual { position: relative; height: 22px; display: block; }
.fd-dual input { position: absolute; inset: 0; width: 100%; margin: 0; pointer-events: none; background: none; accent-color: var(--copper); }
.fd-dual input::-webkit-slider-thumb { pointer-events: auto; }
.fd-dual input::-moz-range-thumb { pointer-events: auto; }
.fd-actions { display: flex; justify-content: flex-end; margin: 8px 0 4px; }
.fd-actions button { background: none; border: 0; color: var(--copper); font: 600 12px Outfit, sans-serif; cursor: pointer; }
.fd-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.fd-list button {
  width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 9px; border-radius: 10px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.04);
  color: var(--paper); font: 400 12.5px Outfit, sans-serif; text-align: left; cursor: pointer;
}
.fd-list button:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--edge-hi); transform: translateX(2px); }
.fd-list i { width: 8px; height: 8px; border-radius: 50%; }
.fd-list em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-more { font-size: 11.5px; color: var(--muted); padding: 6px 4px; }

/* Fiche lot : ouverture/fermeture plus douce (glissé + flou) */
.lot-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 40%), var(--glass2-strong) !important;
  transform: translateX(calc(100% + 40px)) scale(0.98); filter: blur(8px);
  transition: transform 0.6s var(--ease-out), opacity 0.45s ease, filter 0.5s ease !important;
}
.lot-panel.open { transform: none; filter: none; }
.lot-panel .lp-body > * { animation: v2-in 0.6s var(--ease-out) both; }

.tip { background: rgba(14, 16, 18, 0.62) !important; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: var(--edge) !important; }
#loading { transition: opacity 1.1s ease, filter 1.1s ease !important; }
#loading.hide { filter: blur(14px); }
#loading .load-card h2 { letter-spacing: -0.02em; }

@keyframes v2-in { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes v2-in-r { from { opacity: 0; transform: translateX(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes v2-up { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 720px) {
  .modes { left: 8px !important; right: 8px; transform: none !important; bottom: 8px !important; flex-wrap: wrap; justify-content: center; gap: 6px !important; animation: none; }
  .modes .seg button { padding: 6px 9px; font-size: 11.5px; }
  .modes .tod input { width: 120px; }
  .finder { top: auto; bottom: 112px; right: 8px; left: 8px; width: auto; max-height: 52vh; }
  .attrib { display: none; }
  .panel { max-height: calc(100vh - 250px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Mobile : sélecteur d'étages flottant */
#m-floors { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  #m-floors:not([hidden]) {
    display: flex; position: fixed; z-index: 40; left: 8px; right: 8px; top: 56px;
    gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x;
    padding: 6px 8px; border-radius: 14px; background: rgba(10, 18, 28, 0.82);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); align-items: center;
  }
  #m-floors span { flex: none; color: #f4efe6; font: 700 12px Outfit, sans-serif; padding-right: 4px; }
  #m-floors button {
    flex: none; min-width: 40px; min-height: 36px; padding: 6px 10px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color: #f4efe6;
    font: 600 13px Outfit, sans-serif; touch-action: manipulation;
  }
  #m-floors button.on { background: #f4efe6; color: #1c160f; border-color: transparent; }
  .floors button { min-height: 36px; touch-action: manipulation; }
}
