/* scheda annuncio - grafica nuova (galleria a mosaico, mappa Leaflet/OpenStreetMap) */
body:has(.scheda-page){background:#f5f6f8}
.scheda-page{background:#f5f6f8;color:#17223b;font-size:15px;line-height:1.55;padding:18px 0 30px}
.scheda-page a{color:inherit;text-decoration:none}

/* briciole e sfoglia */
.scheda-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.scheda-bc ol{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0;list-style:none;font-size:13px;color:#6b7488}
.scheda-bc li+li:before{content:"/";margin-right:6px;color:#c3c9d4}
.scheda-bc a:hover{color:#e85d09}
.scheda-bc li[aria-current]{color:#172541;font-weight:700}
.scheda-sfoglia{display:inline-flex;align-items:center;gap:6px;padding:4px;border:1px solid #e8ebf1;border-radius:999px;background:#fff;font-size:13px;font-weight:700;white-space:nowrap}
.scheda-sfoglia a{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;color:#172541}
.scheda-sfoglia a:hover{background:#f3f5f8;color:#e85d09}
.scheda-sfoglia span{padding:0 4px}

/* galleria a mosaico */
.scheda-galleria{position:relative;display:grid;grid-template-columns:2fr 1fr 1fr;grid-template-rows:1fr 1fr;gap:8px;height:clamp(300px,42vw,500px);border-radius:22px;overflow:hidden}
.scheda-galleria .g-item{position:relative;display:block;width:100%;height:100%;padding:0;border:0;overflow:hidden;background:#e4e8ef;cursor:zoom-in}
.scheda-galleria .g-0{grid-row:1 / 3}
.scheda-galleria .g-item img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .5s cubic-bezier(.2,.7,.2,1),filter .3s}
.scheda-galleria .g-item:hover img{transform:scale(1.04);filter:brightness(.92)}
.scheda-galleria .g-altre{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(23,37,65,.55);color:#fff;font-size:28px;font-weight:800}
.scheda-galleria .g-vuota{display:flex;align-items:center;justify-content:center;grid-column:1 / -1;color:#c3c9d4;font-size:72px;cursor:default}
.scheda-galleria.poche-1{grid-template-columns:1fr}
.scheda-galleria.poche-1 .g-0{grid-row:auto}
.scheda-galleria.poche-2{grid-template-columns:2fr 1fr}
.scheda-galleria.poche-2 .g-1{grid-row:1 / 3}
.scheda-galleria.poche-3{grid-template-columns:2fr 1fr}
.scheda-galleria.poche-4{grid-template-columns:2fr 1fr 1fr}
.scheda-galleria.poche-4 .g-3{grid-column:2 / 4}
.g-azioni{position:absolute;right:14px;bottom:14px;z-index:2;display:flex;flex-wrap:wrap;gap:8px}
.g-azioni button{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 14px;border:0;border-radius:999px;background:rgba(255,255,255,.95);color:#172541;font:700 13px Manrope,Arial,sans-serif;box-shadow:0 8px 20px rgba(0,0,0,.18);cursor:pointer;transition:background .2s,color .2s}
.g-azioni button:hover{background:#e85d09;color:#fff}
.g-azioni button span{color:#6b7488;font-weight:600}
.g-azioni button:hover span{color:#fff}

/* corpo: colonna principale + colonna con prezzo e mappa */
.scheda-corpo{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:26px;margin-top:22px;align-items:start}
.scheda-testa h1{margin:0;font-size:clamp(22px,2.2vw,30px);line-height:1.2;font-weight:800;letter-spacing:-.3px;color:#172541}
html:has(dialog.gl[open]){overflow:hidden}
.scheda-info{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 0}
.scheda-info span{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:999px;background:#fff;border:1px solid #e8ebf1;font-size:13.5px;color:#27324a}
.scheda-info i{color:#e85d09}
.scheda-info strong{color:#172541}
.scheda-prezzo-mob{margin-top:16px;padding:16px 18px;border-radius:18px;background:#fff;border:1px solid #e8ebf1}
.scheda-prezzo-mob p{margin:0}
.scheda-prezzo-mob .price1{font-size:22px;font-weight:800;color:#e85d09}
.scheda-prezzo-mob .price1 span{font-size:26px}
.scheda-prezzo-mob .ratapricemob{margin-top:4px;font-weight:700;color:#1272b8}
.scheda-prezzo-mob .price2{margin-top:4px;font-weight:700;color:#172541}
.scheda-prezzo-mob .price{font-size:20px;font-weight:800;color:#172541}

.scheda-box{margin-top:18px;padding:22px 24px;border-radius:20px;background:#fff;border:1px solid #e8ebf1;box-shadow:0 8px 28px rgba(23,37,65,.04)}
.scheda-box h2,.scheda-sez h2{margin:0 0 14px;font-size:18px;font-weight:800;letter-spacing:.2px;color:#172541;text-transform:lowercase}
.scheda-box h2::first-letter,.scheda-sez h2::first-letter{text-transform:uppercase}
.scheda-sez h2 span{text-transform:capitalize}
.scheda-box .description{margin:0;font-size:15px;line-height:1.75;color:#27324a;white-space:pre-line}
.scheda-box .ldp{font-weight:700;color:#e85d09}
.scheda-car{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px;margin:0;padding:0;list-style:none}
.scheda-car li{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #f0f2f6;font-size:14px}
.scheda-car li i{flex:none;width:1.25em;height:1.25em;color:#e85d09}
.scheda-car li span:nth-of-type(1){flex:1;color:#6b7488}
.scheda-car li span:nth-of-type(2){font-weight:700;color:#172541;text-align:right}
.scheda-h2-altre{margin-top:22px!important}
.othercar{display:flex;flex-wrap:wrap;gap:8px}
.othercar .badge{padding:6px 12px;border-radius:999px;background:#f3f5f8;font-size:13px;font-weight:600;color:#27324a}

.scheda-mutuo{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:18px;padding:24px 26px;border-radius:20px;background:linear-gradient(125deg,#141f38 0%,#1c3a6e 100%);color:#fff}
.scheda-mutuo h3{margin:0;font-size:19px;font-weight:800;color:#fff}
.scheda-mutuo h4{margin:4px 0 8px;font-size:12px;font-weight:800;letter-spacing:1.4px;color:#ff8a3d}
.scheda-mutuo p{margin:0;font-size:14px;color:rgba(255,255,255,.85)}
.scheda-mutuo p span{color:#ff8a3d;font-weight:800}
.scheda-page .btn-orange{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:48px;padding:0 22px;border:0;border-radius:14px;background:#e85d09;color:#fff!important;font:800 15px Manrope,Arial,sans-serif;white-space:nowrap;cursor:pointer;box-shadow:0 10px 22px rgba(232,93,9,.28);transition:background .2s}
.scheda-page .btn-orange:hover{background:#d65407}
.scheda-page .btn-orange strong,.scheda-page .btn-scuro strong{font-weight:800}
.scheda-page .btn-scuro{display:flex;align-items:center;justify-content:center;height:48px;border-radius:14px;background:#172541;color:#fff!important;font-weight:600;transition:background .2s}
.scheda-page .btn-scuro:hover{background:#0f1a31}

/* colonna destra */
.scheda-side{position:sticky;top:18px;display:flex;flex-direction:column;gap:16px}
.scheda-card-prezzo{padding:22px;border-radius:20px;background:#fff;border:1px solid #e8ebf1;box-shadow:0 12px 34px rgba(23,37,65,.07)}
.scheda-card-prezzo p{margin:0}
.cp-etichetta{font-size:11.5px;font-weight:800;letter-spacing:.9px;color:#6b7488;text-transform:uppercase}
.cp-prezzo{font-size:32px;line-height:1.15;font-weight:800;color:#172541}
.cp-riservata{font-size:22px}
.cp-rata{margin-top:6px!important;font-size:15px;font-weight:800;color:#e85d09}
.cp-tua{margin-top:4px!important;font-size:14px;font-weight:700;color:#1272b8}
.scheda-card-prezzo .btn-orange{width:100%;margin-top:18px}
.scheda-card-prezzo .btn-scuro{margin-top:10px}

/* mappa */
.scheda-mappa{position:relative;height:300px;border-radius:20px;overflow:hidden;border:1px solid #e8ebf1;background:#e9edf2}
.scheda-mappa #mapid{position:absolute;inset:0;z-index:0}
.mp-copertina{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:
 radial-gradient(circle at 30% 40%,rgba(255,255,255,.9) 0 2px,transparent 3px) 0 0/26px 26px,
 linear-gradient(115deg,transparent 46%,#fff 47% 51%,transparent 52%),
 linear-gradient(25deg,transparent 60%,#fff 61% 63%,transparent 64%),
 linear-gradient(160deg,#dfe7ee 0%,#e9eef3 50%,#dbe6df 100%)}
.mp-copertina button{display:inline-flex;align-items:center;gap:8px;height:46px;padding:0 20px;border:0;border-radius:999px;background:#172541;color:#fff;font:700 14px Manrope,Arial,sans-serif;box-shadow:0 12px 28px rgba(23,37,65,.3);cursor:pointer;transition:transform .2s,background .2s}
.mp-copertina button:hover{background:#e85d09;transform:translateY(-2px)}
.mp-espandi{position:absolute;right:12px;top:12px;z-index:500;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:12px;background:#fff;color:#172541;box-shadow:0 6px 16px rgba(23,37,65,.2);cursor:pointer}
.mp-espandi:hover{color:#e85d09}
.scheda-mappa.grande{position:fixed;inset:4vh 4vw;z-index:150;height:auto;border:0;box-shadow:0 30px 90px rgba(0,0,0,.45)}
.mp-velo{position:fixed;inset:0;z-index:149;background:rgba(23,37,65,.6)}
.scheda-side:has(.scheda-mappa.grande){z-index:150}
body.mappa-aperta{overflow:hidden}
.vq-pin span{display:block;width:34px;height:44px;background:#e85d09;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0C5.4 0 0 5.3 0 11.8 0 20.7 12 32 12 32s12-11.3 12-20.2C24 5.3 18.6 0 12 0zm0 16.5a4.6 4.6 0 1 1 0-9.2 4.6 4.6 0 0 1 0 9.2z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0C5.4 0 0 5.3 0 11.8 0 20.7 12 32 12 32s12-11.3 12-20.2C24 5.3 18.6 0 12 0zm0 16.5a4.6 4.6 0 1 1 0-9.2 4.6 4.6 0 0 1 0 9.2z'/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 4px 6px rgba(0,0,0,.3))}

/* simili e link */
.scheda-sez{margin-top:34px}
.simili{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.sim-card{position:relative;display:block;overflow:hidden;border:1px solid #e8ebf1;border-radius:18px;background:#fff;transition:box-shadow .2s,transform .2s}
.sim-card:hover{transform:translateY(-3px);box-shadow:0 14px 32px rgba(23,37,65,.10)}
.sim-card .card-img-top{display:block;width:100%;height:160px;object-fit:cover}
.sim-card .sim-vuota{display:flex;align-items:center;justify-content:center;background:#eef0f4;color:#c3c9d4;font-size:48px}
.sim-card .logo{position:absolute;left:10px;top:10px;padding:4px 6px;border-radius:8px;background:#fff}
.sim-card .logo img{max-width:70px;max-height:22px}
.sim-card .price{position:absolute;right:10px;top:126px;margin:0;padding:4px 10px;border-radius:999px;background:#172541;color:#fff;font-size:13px;font-weight:800}
.sim-card .card-body{padding:12px 14px 14px}
.sim-card .mq{margin:0;font-size:12px;font-weight:700;color:#6b7488}
.sim-card .card-title{display:-webkit-box;margin:4px 0 0;overflow:hidden;font-size:14px;line-height:1.35;font-weight:800;color:#172541;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.sim-card .card-text{margin:4px 0 0;font-size:12.5px;color:#6b7488}
.scheda-page .tips ul{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px;padding:0;list-style:none}
.scheda-page .tips li span{margin-right:4px;font-size:13px;font-weight:800;color:#172541}
.scheda-page .tips li a{display:inline-block;padding:7px 14px;border:1px solid #e8ebf1;border-radius:999px;background:#fff;font-size:13px;font-weight:600;transition:border-color .2s,color .2s}
.scheda-page .tips li a:hover{border-color:#e85d09;color:#e85d09}
.scheda-page .compl{display:block;margin-top:22px;font-size:12px;line-height:1.6;color:#6b7488}
.scheda-page .compl a{color:#1272b8;text-decoration:underline}

/* barra fissa su telefono */
.scheda-barra-mob{position:fixed;left:0;right:0;bottom:0;z-index:80;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);box-shadow:0 -8px 24px rgba(23,37,65,.12);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.scheda-barra-mob button,.scheda-barra-mob a{display:flex;align-items:center;justify-content:center;height:46px;border:0;border-radius:14px;font:600 14px Manrope,Arial,sans-serif;cursor:pointer}
.scheda-barra-mob button{background:#e85d09;color:#fff}
.scheda-barra-mob a{background:#172541;color:#fff!important}

/* galleria a schermo intero */
dialog.gl{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#0d1424;color:#fff}
dialog.gl::backdrop{background:#0d1424}
.gl{display:none}
.gl[open]{display:flex;flex-direction:column}
.gl-testa{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;font-size:14px;font-weight:700;color:rgba(255,255,255,.85)}
.gl-chiudi{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff;font-size:18px;cursor:pointer}
.gl-chiudi:hover{background:rgba(255,255,255,.2)}
.gl-palco{position:relative;flex:1;min-height:0}
.gl-track{display:flex;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.gl-track::-webkit-scrollbar{display:none}
.gl-slide{flex:0 0 100%;height:100%;display:flex;align-items:center;justify-content:center;padding:0 70px;scroll-snap-align:center}
.gl-slide img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px}
.gl-prev,.gl-next{position:absolute;top:50%;z-index:2;display:flex;align-items:center;justify-content:center;width:50px;height:50px;margin-top:-25px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:22px;cursor:pointer;transition:background .2s}
.gl-prev:hover,.gl-next:hover{background:#e85d09}
.gl-prev{left:14px}.gl-next{right:14px}
.gl.una .gl-prev,.gl.una .gl-next{display:none}
.gl-thumbs{display:flex;gap:8px;padding:12px 18px 18px;overflow-x:auto;scrollbar-width:none;justify-content:safe center}
.gl-thumbs::-webkit-scrollbar{display:none}
.gl-thumbs button{flex:none;width:84px;height:60px;padding:0;border:2px solid transparent;border-radius:10px;overflow:hidden;background:none;opacity:.55;cursor:pointer;transition:opacity .2s,border-color .2s}
.gl-thumbs button img{width:100%;height:100%;object-fit:cover}
.gl-thumbs button.on,.gl-thumbs button:hover{opacity:1;border-color:#e85d09}
.gl-video-box{flex:1;display:flex;align-items:center;justify-content:center;padding:0 18px 24px}
.gl-video-box iframe{width:min(100%,1100px);aspect-ratio:16/9;height:auto;border:0;border-radius:12px;background:#000}

/* finestra "Contatta l'agenzia" (prima Bootstrap) */
.scheda-page .modal{display:none;position:fixed;inset:0;z-index:160;overflow:auto;padding:24px 14px;background:rgba(23,37,65,.6)}
.scheda-page .modal.show{display:block}
body.modal-open{overflow:hidden}
.scheda-page .modal-dialog{position:relative;max-width:860px;margin:0 auto}
.scheda-page .modal-content{position:relative;border-radius:22px;background:#fff;box-shadow:0 24px 70px rgba(23,37,65,.35)}
.scheda-page .modal-body{padding:30px 30px 26px}
.scheda-page .modal .closedesk{position:absolute;right:16px;top:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:50%;background:#f1f3f7;color:#172541;cursor:pointer}
.scheda-page #backlogin{position:absolute;right:10px;top:8px;z-index:3;width:36px;height:36px;border:0;border-radius:50%;background:#fff;font-size:22px;line-height:1;cursor:pointer}
.scheda-page .modal .media{margin-bottom:22px}
.scheda-page .modal .media img{width:84px;height:auto;margin-right:18px;flex:none}
.scheda-page .modal h5{margin:0 0 6px;font-size:18px;color:#172541}
.scheda-page .modal .media p{margin:0;font-size:14px;color:#27324a}
.scheda-page .modal input[type=text],.scheda-page .modal input[type=email],.scheda-page .modal input[type=tel],.scheda-page .modal select,.scheda-page .modal textarea{width:100%;margin-bottom:12px;padding:12px 14px;border:1px solid #dfe3ea;border-radius:12px;background:#fff;font:600 15px Manrope,Arial,sans-serif;color:#17223b;outline:0}
.scheda-page .modal textarea{min-height:90px;resize:vertical}
.scheda-page .modal input:focus,.scheda-page .modal select:focus,.scheda-page .modal textarea:focus{border-color:#e85d09}
.scheda-page .modal .form-check{display:flex;gap:12px;align-items:flex-start;margin-bottom:10px}
.scheda-page .modal .form-check input{width:18px;height:18px;margin:3px 0 0;flex:none;accent-color:#e85d09}
.scheda-page .modal .form-check-label{flex:1;font-size:12.5px;line-height:1.55;color:#27324a}
.scheda-page .modal .form-check a{color:#1272b8;text-decoration:underline}
.scheda-page .modal .sendmex .btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:50px;border:0;border-radius:14px;background:#e85d09!important;color:#fff;font:800 15px Manrope,Arial,sans-serif;cursor:pointer}
.scheda-page .modal .rmutok{margin:0;font-weight:700;color:#172541}

/* tablet e telefono */
@media (max-width:1199.98px){
 .scheda-corpo{grid-template-columns:1fr}
 .scheda-side{position:static}
 .scheda-page{padding-bottom:90px}
}
@media (max-width:767.98px){
 .scheda-top{flex-direction:column;align-items:flex-start}
 .scheda-galleria{grid-template-columns:1fr 1fr;grid-template-rows:2fr 1fr;height:clamp(300px,95vw,460px);border-radius:18px}
 .scheda-galleria .g-0{grid-row:auto;grid-column:1 / 3}
 .scheda-galleria .g-3,.scheda-galleria .g-4{display:none}
 .g-azioni{left:10px;right:10px;bottom:10px}
 .g-azioni button{height:34px;padding:0 11px;font-size:12px}
 .scheda-box{padding:18px}
 .scheda-car{grid-template-columns:1fr}
 .scheda-mutuo{flex-direction:column;align-items:flex-start}
 .simili{grid-template-columns:repeat(2,minmax(0,1fr))}
 .gl-slide{padding:0 8px}
 .gl-prev,.gl-next{display:none}
}
@media (max-width:480px){.simili{grid-template-columns:1fr}}
