/* Belvedere Immobiliare · CasaMatch — pagina pubblica (swipe)
   © 2026 MoP Dev — https://mop.dev */
body.cm { background: var(--bg); }
.cm-top { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.cm-top .brand { font-size: 14px; }
.cm-top .brand .cmname { color: var(--accent); }
.cm-top .brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; }
.cm-top .brand .mark .ic { stroke: var(--on-primary); }
.cm-top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cm-wrap { max-width: 1360px; margin: 0 auto; padding: 16px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .cm-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 12px; } .cm-side { order: 2; } }

/* barra impostazioni (prima foto, filtri) */
.cm-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cm-bar .lbl { margin-right: 2px; }
.cm-bar .spacer { flex: 1; }
.cm-bar .progress { font-size: 12px; color: var(--muted); }

/* pila di card */
.deck { position: relative; height: calc(100vh - 178px); min-height: 520px; max-height: 940px; }
.swipe-card {
  position: absolute; inset: 0; margin: 0 auto; max-width: 900px;
  background: var(--surface); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; overflow: hidden; user-select: none; touch-action: pan-y; will-change: transform;
  transition: transform .25s ease, opacity .25s ease;
}
.swipe-card.top { cursor: grab; z-index: 3; }
.swipe-card.top:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (min-width: 901px) {
  .swipe-card .img { flex: 1 1 62%; }
  .swipe-card .info { padding: 14px 22px 10px; gap: 5px; }
  .swipe-card .info .price { font-size: 26px; }
  .swipe-card .info .t { font-size: 18px; }
  .swipe-card .info .z { font-size: 14px; }
  .swipe-card .info .chips .chip { font-size: 13px; padding: 4px 11px; }
  .swipe-card .why-line { font-size: 13px; }
  .swipe-card .acts { padding: 10px 22px 18px; gap: 18px; }
  .swipe-card .acts .rb { width: 60px; height: 60px; }
  .swipe-card .acts .rb .ic { width: 26px; height: 26px; }
  .swipe-card .acts .open { padding: 12px 22px; font-size: 15px; }
  .cm-bar { margin-bottom: 10px; }
  .kbd-hint kbd { margin: 0 2px; }
}
.swipe-card.top.drag { transition: none; cursor: grabbing; }
.swipe-card.under { z-index: 2; transform: scale(.96) translateY(14px); opacity: .9; }
.swipe-card.under2 { z-index: 1; transform: scale(.92) translateY(28px); opacity: .7; }
.swipe-card.out-l { transform: translate(-130%, 20px) rotate(-20deg); opacity: 0; }
.swipe-card.out-r { transform: translate(130%, 20px) rotate(20deg); opacity: 0; }
.swipe-card .img { position: relative; flex: 1 1 55%; min-height: 0; background: var(--surface-2); }
.swipe-card .img svg { width: 100%; height: 100%; }
.swipe-card .info .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swipe-card .info .top .badge.tag { font-size: 10.5px; }
.swipe-card .mode-toggle .btn { padding: 3px 7px; }
.swipe-card .mode-toggle .btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.swipe-card .why-line { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--accent); }
.swipe-card .why-line.var { color: var(--violet); }
.swipe-card .why-line .ic { width: 14px; height: 14px; }
.swipe-card .stamp { position: absolute; top: 24px; font-size: 26px; font-weight: 800; letter-spacing: .08em; padding: 6px 14px; border: 4px solid; border-radius: 10px; opacity: 0; transform: rotate(-12deg); text-transform: uppercase; z-index: 5; pointer-events: none; }
.swipe-card .stamp.like { right: 20px; color: var(--ok); border-color: var(--ok); transform: rotate(12deg); }
.swipe-card .stamp.nope { left: 20px; color: var(--danger); border-color: var(--danger); }
.swipe-card .info { padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 4px; }
.swipe-card .info .price { font-size: 20px; font-weight: 750; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 8px; }
.swipe-card .info .price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.swipe-card .info .t { font-weight: 600; font-size: 15px; }
.swipe-card .info .z { color: var(--text-2); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.swipe-card .info .chips { margin-top: 4px; }
.swipe-card .acts { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 16px 14px; }
.swipe-card .acts .rb { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-1); transition: transform .12s; }
.swipe-card .acts .rb:hover { transform: scale(1.08); }
.swipe-card .acts .rb .ic { width: 24px; height: 24px; }
.swipe-card .acts .rb.no { color: var(--danger); }
.swipe-card .acts .rb.yes { color: var(--ok); }
.swipe-card .acts .open { padding: 10px 18px; font-size: 14px; }
.deck .end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px; }

/* side panel: profilo appreso */
.cm-side .card + .card { margin-top: 14px; }
.pref { display: flex; flex-direction: column; gap: 8px; }
.pref .pr { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.pref .pr .k { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pref .pr .v { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.liked { list-style: none; margin: 0; padding: 0; }
.liked li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 12.5px; }
.liked li:last-child { border-bottom: 0; }
.liked li .th { width: 54px; height: 40px; border-radius: 4px; overflow: hidden; flex: none; background: var(--surface-2); }
.liked li .th svg { width: 100%; height: 100%; }
.liked li b { display: block; }
.liked li span { color: var(--muted); }

/* pagina casa */
.house { max-width: 1120px; margin: 0 auto; padding: 18px 16px 90px; }
.house .back { margin-bottom: 12px; }
.house .hero { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .house .hero { grid-template-columns: minmax(0, 1fr); } }
.house .media { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.house .media .big { aspect-ratio: 16 / 10; position: relative; background: var(--surface-2); }
.house .media .big svg { width: 100%; height: 100%; }
.house .media .big .viewer, .house .media .big .map3d { aspect-ratio: auto; height: 100%; border-radius: 0; border: 0; }
.house .media .thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: var(--surface); }
.house .media .thumbs .th { width: 92px; height: 64px; border-radius: 6px; overflow: hidden; flex: none; border: 2px solid transparent; cursor: pointer; background: var(--surface-2); position: relative; }
.house .media .thumbs .th.active { border-color: var(--primary); }
.house .media .thumbs .th svg { width: 100%; height: 100%; }
.house .media .thumbs .th .lb { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; background: rgba(13,20,32,.65); color: #fff; padding: 1px 5px; text-align: center; }
.house .media .thumbs .th.sp { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-soft); }
.house .cta { position: sticky; top: 72px; }
.house .cta .price { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.house .cta .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.house .desc { margin-top: 20px; }
.house h1 { font-size: 22px; margin: 14px 0 4px; }
.house .feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.house .feat > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; font-size: 12px; color: var(--muted); }
.house .feat > div b { display: block; color: var(--text); font-size: 13.5px; }
.ext-note { font-size: 12.5px; border: 1px dashed var(--warn); background: var(--warn-soft); color: var(--warn); padding: 9px 11px; border-radius: var(--r); display: flex; gap: 8px; align-items: flex-start; }
:root:not([data-theme="dark"]) .ext-note { color: #6d4410; }

/* bottom bar mobile (pagina casa) */
.house .mobile-cta { display: none; }
@media (max-width: 900px) {
  .house .cta { position: static; }
  .house .mobile-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 0; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--border); z-index: 50; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .house .mobile-cta .btn { flex: 1; justify-content: center; }
}
.cm-foot { max-width: 1120px; margin: 20px auto 0; padding: 0 16px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ── Telefono ─────────────────────────────────────────────────────────── */
@media (hover: none) { .kbd-hint { display: none; } }
@media (max-width: 760px) {
  html, body.cm { overflow-x: hidden; }
  .cm-top { padding: 0 10px; gap: 6px; height: 52px; }
  .cm-top .brand .agname { display: none; }
  .cm-top .right { gap: 4px; }
  .cm-top .right .btn span { display: none; }
  .cm-top .right .btn { padding: 8px; }
  .cm-wrap { padding: 10px 10px 32px; gap: 14px; }
  .cm-bar { gap: 6px; margin-bottom: 8px; }
  .cm-bar .lbl { display: none; }
  .cm-bar .btn-group .btn .txt { display: none; }
  .cm-bar .btn-group .btn { padding: 7px 9px; }
  .cm-bar .cm-filters .select.sm { min-height: 34px; font-size: 14px; }
  .cm-bar .progress { width: 100%; text-align: right; font-size: 11.5px; }
  .kbd-hint { display: none; }
  .deck { height: calc(100vh - 200px); min-height: 540px; max-height: 760px; }
  .swipe-card { border-radius: 14px; }
  .swipe-card .img { flex: 1 1 62%; }
  .swipe-card .info { padding: 8px 12px 4px; gap: 2px; }
  .swipe-card .info .price { font-size: 18px; }
  .swipe-card .info .t { font-size: 14px; }
  .swipe-card .info .z { font-size: 12px; }
  .swipe-card .info .chips { flex-wrap: nowrap; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .swipe-card .info .chips .chip { flex: none; }
  .swipe-card .why-line { font-size: 11.5px; }
  .swipe-card .acts { padding: 6px 12px 12px; gap: 14px; }
  .swipe-card .acts .rb { width: 50px; height: 50px; }
  .swipe-card .acts .open { padding: 9px 16px; font-size: 13.5px; }
  .house { padding: 10px 10px 90px; }
  .house h1 { font-size: 19px; }
  .house .media .thumbs .th { width: 82px; height: 58px; }
  .house .feat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .house .cta { margin-top: 14px; }
}

/* Galleria sulla carta: indicatori, didascalia, zone di navigazione */
.swipe-card .img .dots { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; pointer-events: none; }
.swipe-card .img .dots i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .45); box-shadow: 0 0 2px rgba(0, 0, 0, .35); }
.swipe-card .img .dots i.on { background: #fff; }
.swipe-card .img .slide-cap { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 11.5px; font-weight: 600; color: #fff; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .45); pointer-events: none; }
.swipe-card .img .nav { position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; display: flex; align-items: center; border: 0; background: none; color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0 8px; }
.swipe-card .img .nav .ic { width: 28px; height: 28px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.swipe-card .img .nav.l { left: 0; justify-content: flex-start; }
.swipe-card .img .nav.r { right: 0; justify-content: flex-end; }
.swipe-card.top .img:hover .nav, .swipe-card .img .nav:focus-visible { opacity: .95; }
@media (hover: none) { .swipe-card .img .nav { opacity: .7; } }
.swipe-card .img svg, .swipe-card .img img { pointer-events: none; }
