/* Confronto droni: pagina /confronta, pulsante "Confronta" nelle schede e barra in basso.
   Stesso linguaggio del sito (navy, oro, Inter); l'unico segno proprio è il tondo "vs" navy e oro,
   che ritorna nella testata, nello stato vuoto, nei confronti suggeriti e nella barra. */

/* ------------------------------------------------------------ pulsante "Confronta" (schede e scheda prodotto) */
.cf-btn{display:inline-flex;align-items:center;gap:8px;align-self:flex-start;min-height:32px;margin-top:6px;padding:4px 2px;
  font-size:.82rem;font-weight:600;color:var(--muted);text-decoration:none;border-radius:6px;cursor:pointer;user-select:none}
.cf-btn:hover{color:var(--accent)}
.cf-btn-box{position:relative;flex:none;width:18px;height:18px;border:1.5px solid #8792a2;border-radius:5px;background:#fff;transition:background .15s,border-color .15s}
.cf-btn:hover .cf-btn-box{border-color:var(--accent)}
.cf-btn[aria-pressed="true"]{color:var(--accent)}
.cf-btn[aria-pressed="true"] .cf-btn-box{background:var(--accent);border-color:var(--accent)}
.cf-btn[aria-pressed="true"] .cf-btn-box::after{content:"";position:absolute;left:4.5px;top:1.5px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.cf-btn-pdp{font-size:.92rem;margin:0 0 14px;color:var(--ink)}

/* ------------------------------------------------------------ tondo "vs" */
.cf-vs,.cf-vs-t,.cf-sugg-img i{display:inline-grid;place-items:center;border-radius:50%;background:var(--navy);color:var(--gold);
  font-weight:800;font-style:normal;letter-spacing:-.02em;line-height:1}
.cf-vs-t{width:1.5em;height:1.5em;font-size:.55em;vertical-align:.3em;margin:0 .1em}

/* ------------------------------------------------------------ intestazione */
.cf-intro{margin:8px 0 22px;max-width:62rem}
.cf-intro h1{margin-bottom:.3em;text-wrap:balance}
.cf-lead{color:var(--muted);max-width:62ch;margin:0}
.cf-best-demo{white-space:nowrap;box-shadow:inset 0 -3px 0 var(--gold);color:var(--ink);font-weight:600}

/* ------------------------------------------------------------ stato vuoto: scegli due droni */
.cf-scegli{display:grid;gap:14px;align-items:center;justify-items:stretch;max-width:860px;margin:6px 0 40px}
.cf-slot{display:grid;gap:8px;justify-items:center;text-align:center;padding:22px 18px;border:1.5px dashed #c5cdd9;border-radius:var(--r);background:var(--soft)}
.cf-slot img,.cf-slot-ph{width:132px;height:132px;object-fit:contain;border-radius:var(--r);background:#fff}
.cf-slot-ph{display:grid;place-items:center;color:#9aa6b6}
.cf-slot-ph svg{width:64px;height:64px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.cf-slot label{font-size:.85rem;color:var(--muted);margin-top:4px}
.cf-slot select{max-width:320px}
.cf-vs{width:46px;height:46px;font-size:1rem;justify-self:center;box-shadow:0 0 0 5px #fff}
.cf-scegli-go{display:grid;justify-items:center;gap:4px}
.cf-scegli-go p{margin:0;min-height:1.2em;color:var(--ko);font-weight:600}
@media (min-width:700px){
  .cf-scegli{grid-template-columns:1fr auto 1fr}
  .cf-vs{margin:0 -24px;position:relative;z-index:1}
  .cf-scegli-go{grid-column:1/-1}
}

/* ------------------------------------------------------------ confronti suggeriti */
.cf-sugg{margin:8px 0 44px}
.cf-sugg h2{font-size:1.2rem}
.cf-sugg ul{list-style:none;margin:0;padding:0;display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.cf-sugg a{display:flex;flex-direction:column;gap:10px;height:100%;padding:14px;border:1px solid var(--line);border-radius:var(--r);text-decoration:none;background:#fff}
.cf-sugg a:hover{border-color:#c5cdd9;box-shadow:var(--shadow);color:inherit}
.cf-sugg-img{display:flex;align-items:center;justify-content:center}
.cf-sugg-img img{width:84px;height:84px;object-fit:contain}
.cf-sugg-img i{width:28px;height:28px;font-size:.72rem;margin:0 -4px;position:relative;z-index:1;flex:none}
.cf-sugg-t{font-weight:650;font-size:.92rem;text-align:center}

/* ------------------------------------------------------------ tabella di confronto */
.cf{position:relative;margin-bottom:36px}
.cf-scroll{position:relative}
.cf-tab{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:.94rem}
.cf-col-k{width:22%}
.cf-tab th,.cf-tab td{text-align:left;vertical-align:top}

/* testata con le schede dei droni */
.cf-tab thead td,.cf-tab thead th{padding:0 14px 20px;border-bottom:2px solid var(--navy)}
.cf-angolo{vertical-align:bottom!important;padding-left:0!important}
.cf-d{position:relative;font-weight:400}
.cf-d>*{display:block}
.cf-d+.cf-d{border-left:1px solid var(--line)}
.cf-d+.cf-d::before{content:"vs";content:"vs"/"";position:absolute;left:-16px;top:78px;z-index:2;display:grid;place-items:center;width:32px;height:32px;
  border-radius:50%;background:var(--navy);color:var(--gold);font-size:.8rem;font-weight:800;box-shadow:0 0 0 4px #fff}
.cf-d-img{position:relative;aspect-ratio:1;max-width:220px;margin:0 auto 10px;padding:6px}
.cf-d-img img{width:100%;height:100%;object-fit:contain}
.cf-d-img .tag{top:4px;left:4px}
.cf-d .card-brand{margin-bottom:2px}
.cf-d-nome{font-size:1.06rem;font-weight:700;line-height:1.25;text-decoration:none;color:var(--ink);margin-bottom:6px}
.cf-d-nome:hover{color:var(--accent)}
.cf-d-prezzo{margin-bottom:2px}
.cf-d-prezzo .price{font-size:1.2rem}
.cf-d-prezzo s{color:var(--muted);font-size:.85rem}
.cf-d .disp{margin-bottom:8px}
.cf-chips{margin:0 0 12px}
.cf-chips li{font-size:.74rem}
.cf-d-cta .btn{width:100%}
.cf-d-cta .btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.cf-togli{position:absolute!important;top:0;right:6px;z-index:2;display:grid!important;place-items:center;width:34px;height:34px;border-radius:50%;
  color:var(--muted);background:rgba(255,255,255,.9);border:1px solid var(--line)}
.cf-togli:hover{color:var(--ko);border-color:currentColor}
.cf-togli svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}

/* colonna "Aggiungi un drone" */
.cf-tab thead td.cf-col-add{vertical-align:middle}
.cf-add{display:grid;gap:8px;justify-items:center;text-align:center;padding:22px 14px;border:1.5px dashed #b9c3d1;border-radius:var(--r);background:var(--soft)}
.cf-add-ico{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;background:#fff;color:var(--accent);border:1.5px solid var(--line)}
.cf-add-ico svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.cf-add label{font-weight:700;font-size:.95rem;gap:2px}
.cf-add label small{display:block;font-size:.8rem;font-weight:400}
.cf-add select{min-height:40px;font-size:.88rem}
.cf-add .btn{width:100%}
.cf-add-m{display:none}

/* gruppi e righe */
.cf-gr th{padding:30px 0 8px;font-size:1.08rem;font-weight:750;color:var(--navy);border-bottom:1px solid var(--navy)}
.cf-gr th span{position:sticky;left:0}
.cf-r>*{padding:11px 14px;border-bottom:1px solid var(--line)}
.cf-r td+td{border-left:1px solid var(--line)}
.cf-r th{padding-left:0;color:var(--muted);font-weight:550;font-size:.9rem}
.cf-r td{font-weight:500;overflow-wrap:anywhere}
.cf-r:hover>*{background:var(--soft)}
.cf-r td.cf-col-add{background:none!important}
.cf-best{color:var(--navy);font-weight:750!important;box-shadow:inset 3px 0 0 var(--gold)}
.cf-r:hover>.cf-best{box-shadow:inset 3px 0 0 var(--gold)}
.cf-nd{color:var(--muted);font-size:.85rem;font-weight:400}
.cf-si,.cf-no{display:inline-flex;align-items:center;gap:6px}
.cf-si svg,.cf-no svg{width:18px;height:18px;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.cf-si svg{stroke:var(--ok)}
.cf-no{color:var(--muted);font-weight:400}.cf-no svg{stroke:#8792a2}

/* solo le differenze: funziona con il solo CSS, il JS ricorda la scelta */
.cf:has(#cf-diff:checked) .cf-uguale,.cf.solo-diff .cf-uguale{display:none}
.cf-switch{display:flex;align-items:center;gap:12px;cursor:pointer;font-weight:650;font-size:.92rem;line-height:1.3}
.cf-switch small{display:block;font-weight:400;color:var(--muted);font-size:.8rem;margin-top:2px}
.cf-switch input{position:absolute;opacity:0;width:1px;height:1px}
.cf-switch-ui{position:relative;flex:none;width:42px;height:24px;border-radius:999px;background:#c5cdd9;transition:background .15s}
.cf-switch-ui::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .15s}
.cf-switch input:checked+.cf-switch-ui{background:var(--accent)}
.cf-switch input:checked+.cf-switch-ui::after{transform:translateX(18px)}
.cf-switch input:focus-visible+.cf-switch-ui{outline:3px solid var(--accent);outline-offset:2px}

/* testata compatta, fissa sotto l'header mentre si scorre (confronta.js aggiunge .on) */
.cf-mini{position:sticky;top:var(--hh,64px);height:0;z-index:25;overflow-x:clip;overflow-y:visible}
.cf-mini-in{display:grid;grid-template-columns:22% repeat(var(--ncol),minmax(0,1fr));align-items:center;
  background:rgba(255,255,255,.97);backdrop-filter:blur(6px);border-bottom:2px solid var(--navy);box-shadow:0 8px 18px -10px rgba(11,27,51,.35);
  visibility:hidden;opacity:0;translate:0 -6px;transition:opacity .15s,translate .15s,visibility 0s .15s}
.cf-mini.on .cf-mini-in{visibility:visible;opacity:1;translate:0 0;transition:opacity .15s,translate .15s}
.cf-mini-k{font-size:.8rem;color:var(--muted);font-weight:600}
.cf-mini-d{display:flex;align-items:center;gap:10px;min-width:0;padding:8px 14px;text-decoration:none}
.cf-mini-d+.cf-mini-d{border-left:1px solid var(--line)}
.cf-mini-d img{width:40px;height:40px;object-fit:contain;flex:none}
.cf-mini-d span{min-width:0}
.cf-mini-d b{display:block;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cf-mini-d small{color:var(--muted);font-weight:600;font-size:.8rem}

/* nota a piè di tabella */
.cf-nota{margin-top:20px;padding:16px 18px;border-radius:var(--r);background:var(--soft);font-size:.88rem;color:var(--muted);max-width:80ch}
.cf-nota p{margin:0 0 .5em}.cf-nota p:last-child{margin:0}
.cf-nota a{color:var(--accent);font-weight:600}

/* ------------------------------------------------------------ telefono: righe a due livelli (etichetta sopra, valori sotto) */
@media (max-width:599px){
  .cf-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .cf-tab{min-width:calc(var(--nd) * 138px);font-size:.9rem}
  .cf-tab,.cf-tab thead,.cf-tab tbody{display:block}
  .cf-tab colgroup{display:none}
  .cf-tab tr{display:grid;grid-template-columns:repeat(var(--nd),minmax(0,1fr))}
  .cf-tab .cf-col-add{display:none}
  .cf-angolo,.cf-gr th,.cf-r th{grid-column:1/-1}
  .cf-tab thead .cf-angolo{border-bottom:0;padding:0 0 16px}
  .cf-tab thead th{padding:0 10px 16px}
  .cf-tab thead th:first-of-type{padding-left:0}
  .cf-tab thead th:last-of-type{padding-right:0}
  .cf-d+.cf-d::before{top:58px;left:-13px;width:26px;height:26px;font-size:.7rem;box-shadow:0 0 0 3px #fff}
  .cf-d-img{max-width:150px;margin-bottom:6px}
  .cf-togli{right:0;width:32px;height:32px}
  .cf-d-nome{font-size:.95rem}
  .cf-d-prezzo .price{font-size:1.05rem}
  .cf-d .disp{font-size:.76rem}
  .cf-chips li{font-size:.7rem;padding:2px 8px}
  .cf-d-cta .btn{padding:8px 10px;font-size:.84rem}
  .cf-gr th{padding-top:22px}
  .cf-r>*{border-bottom:0}
  .cf-r{border-bottom:1px solid var(--line)}
  .cf-r th{padding:10px 0 2px;font-size:.78rem;font-weight:600}
  .cf-r th span{position:sticky;left:0}
  .cf-r td{padding:2px 10px 10px}
  .cf-r td:first-of-type{padding-left:0}
  .cf-r td+td{border-left:1px solid var(--line)}
  .cf-r:hover>*{background:none}
  .cf-r:hover>.cf-best,.cf-best{box-shadow:none;background:linear-gradient(var(--gold),var(--gold)) 10px calc(100% - 4px)/22px 3px no-repeat}
  .cf-r td.cf-best:first-of-type{background-position:0 calc(100% - 4px)}
  .cf-mini-in{grid-template-columns:repeat(var(--nd),minmax(0,1fr))}
  .cf-mini-k,.cf-mini-vuoto{display:none}
  .cf-mini-d{padding:6px 8px;gap:6px}
  .cf-mini-d:first-of-type{padding-left:0}
  .cf-mini-d img{width:32px;height:32px}
  .cf-mini-d b{font-size:.8rem}
  .cf-mini-d small{font-size:.74rem}
  .cf-add-m{display:block;margin:20px 0 0}
  .cf-add-m .cf-add{grid-template-columns:auto 1fr;justify-items:stretch;text-align:left;align-items:center;padding:12px;column-gap:12px}
  .cf-add-m .cf-add-ico{width:40px;height:40px}
  .cf-add-m .cf-add label{gap:0}
  .cf-add-m .cf-add select,.cf-add-m .cf-add .btn{grid-column:1/-1}
}
@media (min-width:600px) and (max-width:899px){
  .cf-col-k{width:24%}
  .cf-mini-in{grid-template-columns:24% repeat(var(--ncol),minmax(0,1fr))}
  .cf-tab thead td,.cf-tab thead th,.cf-r>*{padding-left:10px;padding-right:10px}
  .cf-angolo,.cf-r th{padding-left:0!important}
}

/* ------------------------------------------------------------ barra di confronto in basso */
.cfbar{position:fixed;left:0;right:0;bottom:0;z-index:34;background:var(--navy);color:#fff;box-shadow:0 -6px 24px rgba(11,27,51,.25);
  padding:10px 0 calc(10px + env(safe-area-inset-bottom))}
.cfbar-in{display:flex;align-items:center;gap:14px 20px}
.cfbar-t{margin:0;font-size:1rem;font-weight:700;color:#fff;display:flex;flex-direction:column;line-height:1.2;flex:none}
.cfbar-n{font-size:.78rem;font-weight:600;color:var(--gold)}
.cfbar-list{list-style:none;margin:0;padding:0;display:flex;gap:10px;flex:1;min-width:0}
.cfbar-list li{position:relative;display:flex;align-items:center;gap:10px;min-width:0;flex:0 1 240px;padding:5px 40px 5px 5px;border-radius:10px;background:rgba(255,255,255,.08)}
.cfbar-list img{width:44px;height:44px;object-fit:contain;background:#fff;border-radius:7px;flex:none;padding:2px}
.cfbar-nome{font-size:.86rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cfbar-x{position:absolute;right:4px;top:50%;translate:0 -50%;display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:50%;background:transparent;color:#cdd7e4;cursor:pointer}
.cfbar-x:hover{background:rgba(255,255,255,.14);color:#fff}
.cfbar-x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.cfbar-list li.cfbar-vuoto{padding:0;min-height:54px;background:none;border:1.5px dashed rgba(255,255,255,.28)}
.cfbar-hint{margin:0;font-size:.82rem;color:#cdd7e4;flex:none}
.cfbar-azioni{display:flex;align-items:center;gap:12px;flex:none}
.cfbar-go{background:var(--gold);color:var(--navy)}
.cfbar-go:hover{background:#f6c460;color:var(--navy)}
.cfbar-go[aria-disabled="true"]{background:rgba(255,255,255,.16);color:#cdd7e4;cursor:not-allowed}
.cfbar-svuota{background:none;border:0;padding:8px 4px;color:#cdd7e4;font-size:.85rem;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.cfbar-svuota:hover{color:#fff}
.cfbar :focus-visible{outline-color:var(--gold)}
body.cf-on{padding-bottom:var(--cfh,76px)}
body.cf-on .wa-float{bottom:calc(var(--cfh,76px) + 16px)}
body.cf-on .toast{bottom:calc(var(--cfh,76px) + 24px)}
@media (prefers-reduced-motion:no-preference){
  .cfbar-scuoti .cfbar-list{animation:cfbar-scuoti .35s}
  @keyframes cfbar-scuoti{25%{translate:-6px 0}50%{translate:5px 0}75%{translate:-3px 0}}
}
@media (max-width:899px){
  .cfbar{bottom:calc(58px + env(safe-area-inset-bottom));padding:8px 0;box-shadow:0 -4px 16px rgba(11,27,51,.2)}
  .cfbar-in{gap:10px}
  .cfbar-t{font-size:.85rem}
  .cfbar-list{gap:6px}
  .cfbar-list li{flex:0 0 auto;padding:3px 30px 3px 3px;gap:0}
  .cfbar-list li.cfbar-vuoto{width:46px;min-height:46px}
  .cfbar-list img{width:38px;height:38px}
  .cfbar-nome,.cfbar-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .cfbar-x{right:0;width:30px;height:30px}
  .cfbar-svuota{display:none}
  .cfbar-go{padding:8px 12px}
  body.cf-on{padding-bottom:calc(62px + var(--cfh,60px) + env(safe-area-inset-bottom))}
  body.cf-on .wa-float{bottom:calc(74px + var(--cfh,60px) + env(safe-area-inset-bottom))}
  body.cf-on .toast{bottom:calc(76px + var(--cfh,60px) + env(safe-area-inset-bottom))}
  body.cf-on:has(.sticky-buy:not([hidden])) .cfbar{bottom:calc(116px + env(safe-area-inset-bottom))}
  body.cf-on:has(.sticky-buy:not([hidden])) .wa-float{bottom:calc(130px + var(--cfh,60px) + env(safe-area-inset-bottom))}
}
@media (max-width:380px){.cfbar-t{display:none}}
@media print{.cfbar,.cf-btn,.cf-mini,.cf-togli,.cf-add,.cf-d-cta{display:none!important}}
