/* ==========================================================================
   HostDream — Motion 2.0 (Claude)
   Palette logo: Ottanio #004E64 · Ciano #00EBF5 · Bianco #FFFFFF
   File indipendente: per disattivare tutto basta rimuovere il <link>/<script>
   ========================================================================== */
:root {
  --hd-ottanio: #004E64;
  --hd-ottanio-deep: #00303E;
  --hd-teal: #009BB0;
  --hd-cyan: #00EBF5;
  --hd-cyan-soft: rgba(0, 235, 245, .18);
  --hd-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- 1. HERO: aurora, Ken Burns, canvas ---------- */
.hd-hero { isolation: isolate; overflow: hidden; }
.hd-hero-bg img { animation: hdKenBurns 28s ease-in-out infinite alternate; transform-origin: 60% 40%; will-change: transform; }
@keyframes hdKenBurns { from { transform: scale(1.04) translate3d(0,0,0); } to { transform: scale(1.16) translate3d(-1.5%, -1%, 0); } }

.hd-aurora { position: absolute; inset: -20%; pointer-events: none; z-index: 1; mix-blend-mode: screen; opacity: .75; }
.hd-aurora span { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.hd-aurora span:nth-child(1) { width: 46vw; height: 46vw; left: 2%; top: 8%; background: radial-gradient(circle, rgba(0,235,245,.55), transparent 65%); animation: hdBlobA 18s var(--hd-ease) infinite alternate; }
.hd-aurora span:nth-child(2) { width: 38vw; height: 38vw; right: 0; top: 30%; background: radial-gradient(circle, rgba(0,155,176,.6), transparent 65%); animation: hdBlobB 22s var(--hd-ease) infinite alternate; }
.hd-aurora span:nth-child(3) { width: 30vw; height: 30vw; left: 35%; bottom: 0; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); animation: hdBlobC 26s var(--hd-ease) infinite alternate; }
@keyframes hdBlobA { to { transform: translate3d(18vw, 10vh, 0) scale(1.2); } }
@keyframes hdBlobB { to { transform: translate3d(-20vw, -12vh, 0) scale(.85); } }
@keyframes hdBlobC { to { transform: translate3d(-10vw, -18vh, 0) scale(1.3); } }

#hd-constellation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* luce che segue il mouse nella hero */
.hd-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(600px circle at var(--hd-mx, 50%) var(--hd-my, 40%), rgba(0,235,245,.16), transparent 55%);
  transition: opacity .4s;
}
.hd-hero > .relative.z-10 { z-index: 10; }

/* ---------- 2. Titolo hero: parole che entrano + shimmer ---------- */
.hd-split .hd-w { display: inline-block; opacity: 0; transform: translate3d(0, .6em, 0) rotateX(-40deg); filter: blur(8px);
  animation: hdWordIn .9s var(--hd-ease) forwards; animation-delay: calc(var(--i) * 70ms + 150ms); transform-origin: 50% 100%; }
@keyframes hdWordIn { to { opacity: 1; transform: none; filter: blur(0); } }
.hd-split { perspective: 600px; }
.hd-shimmer .hd-w {
  background: linear-gradient(110deg, #FFFFFF 0%, #FFFFFF 40%, var(--hd-cyan) 50%, #FFFFFF 60%, #FFFFFF 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hdWordIn .9s var(--hd-ease) forwards, hdShimmer 6s linear 1.6s infinite;
  animation-delay: calc(var(--i) * 70ms + 150ms), calc(var(--i) * 70ms + 1.6s);
}
@keyframes hdShimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* ---------- 3. Reveal allo scroll ---------- */
.hd-reveal { opacity: 0; transform: translate3d(0, 34px, 0) scale(.985); transition: opacity .9s var(--hd-ease), transform .9s var(--hd-ease); transition-delay: var(--hd-d, 0ms); }
.hd-reveal.hd-in { opacity: 1; transform: none; }

/* Sottolineatura animata sotto i titoli di sezione */
.hd-h2 { position: relative; }
.hd-h2::after { content: ''; display: block; height: 3px; width: 0; margin: 14px auto 0; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--hd-cyan), var(--hd-teal), transparent);
  box-shadow: 0 0 12px rgba(0,235,245,.6); transition: width 1.1s var(--hd-ease) .25s; }
.hd-h2.hd-in::after { width: 120px; }
.hd-h2-left::after { margin-left: 0; }

/* ---------- 4. Card: tilt 3D, spotlight, bordo luminoso rotante ---------- */
.hd-card { transform-style: preserve-3d; will-change: transform; transition: transform .5s var(--hd-ease), box-shadow .5s var(--hd-ease); position: relative; }
.hd-card.hd-tilting { transition: transform .12s linear, box-shadow .5s var(--hd-ease); }
.hd-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .35s;
  background: radial-gradient(380px circle at var(--hd-cx, 50%) var(--hd-cy, 50%), rgba(0,235,245,.20), transparent 50%); }
.hd-card::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 6; opacity: 0; transition: opacity .35s;
  background: conic-gradient(from var(--hd-ang, 0deg), transparent 0 60%, var(--hd-cyan) 75%, #fff 80%, var(--hd-teal) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: hdSpin 3.2s linear infinite; }
.hd-card:hover::before, .hd-card:hover::after { opacity: 1; }
.hd-card:hover { box-shadow: 0 30px 60px -18px rgba(0,78,100,.45), 0 0 0 1px rgba(0,235,245,.25), 0 0 40px -8px rgba(0,235,245,.35) !important; }
@property --hd-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes hdSpin { to { --hd-ang: 360deg; } }

/* foto: zoom cinematografico più morbido (escluse rigorosamente tessere e icone mappa Leaflet) */
.hd-card:not(:has(.leaflet-container)) img:not([class*="leaflet"]):not(.leaflet-tile):not(.leaflet-marker-icon),
.hd-card img:not([class*="leaflet"]):not(.leaflet-tile):not(.leaflet-marker-icon) {
  transition: transform 1.2s var(--hd-ease) !important;
}
.hd-card:not(:has(.leaflet-container)):hover img:not([class*="leaflet"]):not(.leaflet-tile):not(.leaflet-marker-icon) {
  transform: scale(1.09) !important;
}

/* Protezione assoluta Leaflet: nessun tilt 3D, nessuno spotlight né alterazioni coordinate tessere */
.leaflet-container,
.leaflet-container *,
.leaflet-pane,
.leaflet-pane *,
.leaflet-tile-container,
.leaflet-tile {
  transform-style: flat !important;
  -webkit-transform-style: flat !important;
}
.leaflet-tile,
img.leaflet-tile,
img.leaflet-tile-loaded,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  transition: none !important;
  animation: none !important;
  max-width: none !important;
  max-height: none !important;
}
.hd-card:has(.leaflet-container),
.spotlight-card:has(.leaflet-container),
div:has(.leaflet-container) {
  transform: none !important;
  perspective: none !important;
  transform-style: flat !important;
}
.hd-card:has(.leaflet-container)::before,
.hd-card:has(.leaflet-container)::after,
.spotlight-card:has(.leaflet-container)::before,
.spotlight-card:has(.leaflet-container)::after {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
}

/* Icone feature: pulsazione luminosa */
.hd-icon { transition: transform .5s var(--hd-ease), box-shadow .5s; }
.group:hover .hd-icon, .hd-card:hover .hd-icon { transform: translateY(-4px) rotate(-6deg) scale(1.08); box-shadow: 0 10px 24px -6px rgba(0,235,245,.55); }

/* ---------- 5. Bottoni: shine + magnete ---------- */
.hd-btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .35s var(--hd-ease), box-shadow .35s; }
.hd-btn::after { content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); animation: hdShine 4.5s ease-in-out infinite; }
@keyframes hdShine { 0%, 70% { left: -120%; } 100% { left: 160%; } }
.hd-btn:hover { box-shadow: 0 10px 30px -6px rgba(0,235,245,.6), 0 0 0 1px rgba(0,235,245,.5); }

/* ---------- 6. Sezioni: atmosfera viva ---------- */
.hd-sec { position: relative; isolation: isolate; overflow: hidden; }
.hd-sec-light::before { content: ''; position: absolute; z-index: -1; pointer-events: none; width: 55vw; height: 55vw; max-width: 760px; max-height: 760px; border-radius: 50%;
  top: -18%; right: -14%; background: radial-gradient(circle, rgba(0,235,245,.10), transparent 62%); filter: blur(10px); animation: hdDrift 20s ease-in-out infinite alternate; }
.hd-sec-light::after { content: ''; position: absolute; z-index: -1; pointer-events: none; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(0,78,100,.10) 1px, transparent 1.2px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 20% 80%, #000, transparent 60%); mask-image: radial-gradient(ellipse at 20% 80%, #000, transparent 60%); }
@keyframes hdDrift { to { transform: translate3d(-14vw, 22vh, 0) scale(1.15); } }

.hd-sec-dark::before { content: ''; position: absolute; inset: -40%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(0,235,245,.18) 60deg, transparent 120deg, rgba(0,155,176,.25) 200deg, transparent 260deg);
  filter: blur(60px); animation: hdRotate 30s linear infinite; }
.hd-sec-dark::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(0,235,245,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(0,235,245,.07) 1px, transparent 1px);
  background-size: 48px 48px; animation: hdGrid 14s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }
@keyframes hdRotate { to { transform: rotate(360deg); } }
@keyframes hdGrid { to { background-position: 48px 48px, 48px 48px; } }

/* ---------- 7. Navbar: linea di luce che scorre + compattamento ---------- */
.hd-nav { transition: box-shadow .4s, background-color .4s; }
.hd-nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--hd-cyan), #fff, var(--hd-cyan), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: hdNavLine 6s ease-in-out infinite; opacity: .9; }
@keyframes hdNavLine { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
.hd-nav.hd-scrolled {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 78, 100, 0.25), 0 0 0 1px rgba(0, 235, 245, 0.2) !important;
  border-bottom: 1px solid rgba(0, 78, 100, 0.08) !important;
}
.hd-nav.hd-scrolled > div > div:first-child,
.hd-nav.hd-scrolled > div > div.h-16 {
  height: 64px !important;
}

/* Mobile dropdown menu: altezza automatica e sfondo 100% bianco opaco per evitare trasparenze */
nav div.md\:hidden,
.hd-nav div.md\:hidden {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  background: #FFFFFF !important;
  border-radius: 0 0 16px 16px !important;
  box-shadow: 0 20px 40px -10px rgba(0, 48, 62, 0.25) !important;
  position: relative !important;
  z-index: 60 !important;
}

nav:has(div.md\:hidden),
.hd-nav:has(div.md\:hidden) {
  background: #FFFFFF !important;
}
.hd-nav.hd-scrolled [data-testid="nav-logo"] img {
  height: 48px !important;
}
#scroll-progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: 0 50%; z-index: 99999; pointer-events: none;
  background: linear-gradient(90deg, var(--hd-ottanio), var(--hd-teal), var(--hd-cyan), #fff); box-shadow: 0 0 14px rgba(0,235,245,.8); transition: none !important; }

/* ---------- 8. Chip ricerche popolari ---------- */
.hd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hd-chip { font: 500 .8rem/1 Inter, sans-serif; color: #fff; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(10px); animation: hdWordIn .7s var(--hd-ease) forwards; animation-delay: calc(var(--i) * 80ms + 900ms);
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s; }
.hd-chip:hover { background: rgba(0,235,245,.22); border-color: var(--hd-cyan); color: var(--hd-cyan); box-shadow: 0 0 18px rgba(0,235,245,.45); }

/* Indicatore "scorri" in fondo alla hero */
.hd-scroll-cue { position: absolute; left: 50%; bottom: 28px; z-index: 11; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255,255,255,.7); border-radius: 14px; pointer-events: none; }
.hd-scroll-cue::before { content: ''; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--hd-cyan); box-shadow: 0 0 8px var(--hd-cyan); animation: hdCue 1.8s var(--hd-ease) infinite; }
@keyframes hdCue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Accessibilità e dispositivi touch ---------- */
@media (hover: none), (pointer: coarse) { .hd-card::after { animation: none; } }
@media (max-width: 768px) { .hd-aurora span { filter: blur(50px); } .hd-scroll-cue { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hd-hero-bg img, .hd-aurora span, .hd-btn::after, .hd-nav::after, .hd-sec-light::before, .hd-sec-dark::before, .hd-sec-dark::after, .hd-card::after, .hd-scroll-cue::before { animation: none !important; }
  .hd-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hd-split .hd-w, .hd-chip { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  #hd-constellation { display: none !important; }
}

/* ---------- 10. FOOTER: layout responsive compatto + hover nella palette logo ---------- */
footer .grid.grid-cols-1 > div > ul > li { margin-top: 0 !important; }
footer .grid.grid-cols-1 > div > ul { display: grid; gap: 10px; }
footer .grid.grid-cols-1 h4 { margin-bottom: 14px; letter-spacing: .08em; }
footer .grid.grid-cols-1 > div > ul a { position: relative; display: inline-flex; padding-bottom: 2px; transition: color .25s; }
footer .grid.grid-cols-1 > div > ul a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--hd-ottanio), var(--hd-cyan)); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--hd-ease); }
footer .grid.grid-cols-1 > div > ul a:hover { color: var(--hd-ottanio) !important; }
footer .grid.grid-cols-1 > div > ul a:hover::after { transform: scaleX(1); }
footer .grid.grid-cols-1 > :first-child a[href^="mailto"] { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: rgba(0,235,245,.10); border: 1px solid rgba(0,155,176,.25); transition: background .25s, box-shadow .25s; }
footer .grid.grid-cols-1 > :first-child a[href^="mailto"]:hover { color: var(--hd-ottanio) !important; background: rgba(0,235,245,.18); box-shadow: 0 0 16px rgba(0,235,245,.35); }
footer > div:last-child > .border-t a:hover { color: var(--hd-ottanio) !important; }

/* Desktop: colonna brand più larga */
@media (min-width: 1024px) {
  footer .grid.grid-cols-1 { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; }
  footer .grid.grid-cols-1 > :first-child p { max-width: 300px; }
}
/* Tablet: brand su tutta la riga, link su 3 colonne */
@media (min-width: 768px) and (max-width: 1023px) {
  footer .grid.grid-cols-1 { grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
  footer .grid.grid-cols-1 > :first-child { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; padding-bottom: 28px; border-bottom: 1px solid rgba(0,78,100,.10); }
  footer .grid.grid-cols-1 > :first-child > * { margin: 0 !important; }
  footer .grid.grid-cols-1 > :first-child p { flex: 1 1 280px; }
}
/* Mobile: 2 colonne, riferimenti su riga intera in 2 colonne, barra finale centrata */
@media (max-width: 767px) {
  footer > div:last-child { padding-top: 36px !important; padding-bottom: 32px !important; }
  footer .grid.grid-cols-1 { grid-template-columns: 1fr 1fr; gap: 30px 18px; }
  footer .grid.grid-cols-1 > :first-child { grid-column: 1 / -1; padding-bottom: 26px; border-bottom: 1px solid rgba(0,78,100,.10); }
  footer .grid.grid-cols-1 > :first-child img { height: 42px; margin-bottom: 12px; }
  footer .grid.grid-cols-1 > :first-child p { margin-bottom: 14px; }
  footer .grid.grid-cols-1 > :last-child { grid-column: 1 / -1; }
  footer .grid.grid-cols-1 > :last-child > ul { grid-template-columns: 1fr 1fr; gap: 10px 18px; }
  footer .grid.grid-cols-1 h4 { font-size: .74rem; margin-bottom: 12px; }
  footer .grid.grid-cols-1 > div > ul { font-size: .9rem; }
  footer > div:last-child > .border-t { margin-top: 30px !important; padding-top: 22px !important; }
}
/* Barra finale (copyright + policy): centrata e senza a-capo nei link sotto il desktop */
@media (max-width: 1023px) {
  footer > div:last-child > .border-t { flex-direction: column !important; text-align: center; gap: 14px; }
  footer > div:last-child > .border-t > div { flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
  footer > div:last-child > .border-t > div a { white-space: nowrap; }
}

/* ---------- 11. FIX contrasto hover "Come funziona" (e altri riquadri group-hover) ----------
   Una regola precedente `span.text-primary.font-bold { color: … !important }` vinceva su
   group-hover:text-white → numero ottanio su fondo ottanio. Qui il bianco torna a vincere. */
.group:hover .group-hover\:text-white { color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF; text-shadow: 0 0 12px rgba(0,235,245,.55) !important; }
.group:hover [class*="w-14"].group-hover\:bg-primary,
.group:hover [class*="w-12"].group-hover\:bg-primary { background: linear-gradient(135deg, var(--hd-ottanio) 0%, var(--hd-teal) 100%) !important;
  box-shadow: 0 10px 26px -6px rgba(0,235,245,.55), 0 0 0 1px rgba(0,235,245,.35); transform: translateY(-4px) scale(1.06); }
[class*="w-14"].group-hover\:bg-primary, [class*="w-12"].group-hover\:bg-primary { transition: transform .45s var(--hd-ease), box-shadow .45s, background .3s !important; }

/* ---------- 12. Barra filtri pagina Immobili: due livelli ordinati ----------
   Riga 1: ricerca (larga) · Tutti/Affitto/Vendita · Filtri + viste a destra
   Riga 2: categorie a piena larghezza, scorrevoli con sfumatura (niente scrollbar grigia) */
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) { flex-wrap: wrap; row-gap: 10px; align-items: center; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.relative { order: 1; flex: 1 1 260px; min-width: 220px; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.relative input { background: #FFFFFF; border-color: rgba(0,78,100,.18); transition: border-color .25s, box-shadow .25s; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.relative input:focus { border-color: var(--hd-teal); box-shadow: 0 0 0 3px rgba(0,235,245,.22); }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.flex:not(.overflow-x-auto):not(.items-center) { order: 2; flex: 0 0 auto; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.items-center { order: 3; flex: 0 0 auto; margin-left: auto; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.overflow-x-auto {
  order: 4; flex: 1 1 100%; width: 100%; max-width: 100%; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x proximity; scroll-padding: 0 24px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%); }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.overflow-x-auto::-webkit-scrollbar { display: none; }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.overflow-x-auto > button { flex: 1 0 auto; scroll-snap-align: start; }
/* pillole: hover e selezione nella palette del logo */
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.flex.bg-gray-100 > button:hover:not(.bg-white) { color: var(--hd-ottanio); background: rgba(0,235,245,.12); }
#root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.flex.bg-gray-100 > button.bg-white { box-shadow: 0 2px 10px -3px rgba(0,78,100,.35), inset 0 -2px 0 var(--hd-cyan); }
/* Telefono: ogni gruppo a tutta larghezza */
@media (max-width: 639px) {
  #root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > * { width: 100%; flex: 0 0 auto !important; min-width: 0; margin-left: 0; }
  #root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.flex:not(.overflow-x-auto):not(.items-center) > button { flex: 1 1 0; }
  #root div.flex.flex-col:has(> div.relative > input):has(> div.overflow-x-auto) > div.items-center > button:first-child { flex: 1 1 auto; justify-content: center; }
}

/* ---------- 13. Freccia "torna su" (sopra la volpina Dina) ---------- */
#hd-totop { position: fixed; right: 30px; bottom: 104px; z-index: 9985; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #0B7F96 0%, var(--hd-ottanio) 70%); color: #FFFFFF;
  box-shadow: 0 12px 26px -8px rgba(0,48,62,.55), 0 0 0 1px rgba(0,235,245,.35);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.8);
  transition: opacity .35s var(--hd-ease), transform .45s var(--hd-ease), box-shadow .3s, visibility 0s .45s; }
#hd-totop.hd-tt-on { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--hd-ease), transform .45s var(--hd-ease), box-shadow .3s; }
#hd-totop:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -8px rgba(0,48,62,.6), 0 0 0 1px var(--hd-cyan), 0 0 22px rgba(0,235,245,.55); }
#hd-totop:focus-visible { outline: 3px solid var(--hd-cyan); outline-offset: 3px; }
#hd-totop svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
#hd-totop .hd-tt-track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 3; }
#hd-totop .hd-tt-ring { fill: none; stroke: var(--hd-cyan); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(0,235,245,.8)); transition: stroke-dashoffset .12s linear; }
#hd-totop .hd-tt-arrow { fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transform-origin: 24px 24px; }
#hd-totop:hover .hd-tt-arrow { animation: hdTtUp .7s var(--hd-ease) infinite; }
@keyframes hdTtUp { 0% { transform: rotate(90deg) translateX(0); } 50% { transform: rotate(90deg) translateX(-3px); } 100% { transform: rotate(90deg) translateX(0); } }
/* senza Dina (pagine riservate / RTL a sinistra) scende nell'angolo; con la chat aperta o Dina a passeggio si fa da parte */
body:has(#hd-dina.dn-away) #hd-totop, body:not(:has(#hd-dina)) #hd-totop, body:has(#hd-dina[dir="rtl"]) #hd-totop { bottom: 24px; }
body:has(#hd-dina.dn-open) #hd-totop { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 639px) { #hd-totop { right: 22px; bottom: 98px; width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { #hd-totop, #hd-totop .hd-tt-ring { transition: none; } #hd-totop:hover .hd-tt-arrow { animation: none; } }

/* ---------- 14. Universal HostDream Sticky Property Bar: Rock-Solid Logo Alignment ---------- */
.hd-sticky-bar,
div.fixed.top-0:has(.hd-sticky-nav-lead),
div[class*="fixed"][class*="top-0"]:has(.hd-sticky-nav-lead) {
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 78, 100, 0.25), 0 0 0 1px rgba(0, 235, 245, 0.2) !important;
  border-bottom: 1px solid rgba(0, 78, 100, 0.08) !important;
  transform: none !important;
  animation: hdStickyBarFade 0.22s var(--hd-ease) forwards !important;
}

@keyframes hdStickyBarFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hd-sticky-bar > div,
div.fixed.top-0:has(.hd-sticky-nav-lead) > div,
div[class*="fixed"][class*="top-0"]:has(.hd-sticky-nav-lead) > div {
  max-width: 80rem !important; /* max-w-7xl identico al contenitore navbar */
  height: 64px !important;
  min-height: 64px !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

@media (min-width: 640px) {
  .hd-sticky-bar > div,
  div.fixed.top-0:has(.hd-sticky-nav-lead) > div,
  div[class*="fixed"][class*="top-0"]:has(.hd-sticky-nav-lead) > div {
    padding-left: 1.5rem !important; /* sm:px-6 */
    padding-right: 1.5rem !important;
  }
}

@media (min-width: 1024px) {
  .hd-sticky-bar > div,
  div.fixed.top-0:has(.hd-sticky-nav-lead) > div,
  div[class*="fixed"][class*="top-0"]:has(.hd-sticky-nav-lead) > div {
    padding-left: 2rem !important; /* lg:px-8 */
    padding-right: 2rem !important;
  }
}

.hd-sticky-nav-lead {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
  flex-shrink: 0;
  height: 100%;
}

.hd-sticky-logo-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.hd-sticky-logo-img {
  height: 48px !important;
  max-height: 52px !important;
  min-height: 44px !important;
  width: auto !important;
  object-fit: contain !important;
  display: block;
}

/* Solo gli elementi di dettaglio che compaiono fanno un ingresso morbido (morph) */
.hd-sticky-menu-btn,
.hd-sticky-bar .flex-1,
.hd-sticky-bar .flex.items-center.gap-3,
div.fixed.top-0:has(.hd-sticky-nav-lead) .flex-1,
div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 {
  animation: hdContentMorphIn 0.3s var(--hd-ease) forwards;
}

@keyframes hdContentMorphIn {
  from {
    opacity: 0;
    transform: translate3d(8px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hd-sticky-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(0, 78, 100, 0.08), rgba(0, 235, 245, 0.14));
  border: 1.5px solid rgba(0, 235, 245, 0.45);
  border-radius: 12px;
  color: var(--hd-ottanio);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--hd-ease);
  user-select: none;
  white-space: nowrap;
}
.hd-sticky-menu-btn:hover {
  background: linear-gradient(135deg, rgba(0, 78, 100, 0.16), rgba(0, 235, 245, 0.28));
  border-color: var(--hd-cyan);
  box-shadow: 0 0 16px rgba(0, 235, 245, 0.4);
  transform: translateY(-1px);
}
.hd-burger-bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 17px;
  height: 13px;
}
.hd-burger-bars span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--hd-ottanio);
  border-radius: 2px;
  transition: transform 0.25s var(--hd-ease), background-color 0.25s;
}
.hd-sticky-menu-btn:hover .hd-burger-bars span {
  background-color: var(--hd-teal);
}
@media (max-width: 768px) {
  /* Su mobile nascondi il titolo/citta nella sticky bar: evita sovrapposizione col prezzo */
  .hd-sticky-bar .flex-1,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex-1,
  div[class*="fixed"][class*="top-0"]:has(.hd-sticky-nav-lead) .flex-1 {
    display: none !important;
  }
  .hd-sticky-logo-img { height: 36px !important; }
  .hd-sticky-nav-lead { gap: 8px !important; margin-right: 8px !important; }
  .hd-sticky-menu-btn { padding: 6px 10px !important; }
  .hd-sticky-bar .flex.items-center.gap-3,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 {
    gap: 8px !important;
  }
  .hd-sticky-bar .flex.items-center.gap-3 span,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 span {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
  }
  .hd-sticky-bar .flex.items-center.gap-3 button,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 button {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 480px) {
  .hd-sticky-logo-img { height: 32px !important; }
  .hd-sticky-menu-btn .hd-burger-label { display: none !important; }
  .hd-sticky-menu-btn { padding: 6px 8px !important; }
  .hd-sticky-bar .flex.items-center.gap-3 span,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 span {
    font-size: 0.88rem !important;
  }
  .hd-sticky-bar .flex.items-center.gap-3 button,
  div.fixed.top-0:has(.hd-sticky-nav-lead) .flex.items-center.gap-3 button {
    padding: 5px 10px !important;
    font-size: 0.82rem !important;
  }
}

/* ---------- 15. Universal HostDream Navigation Drawer ---------- */
#hd-menu-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 32, 44, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--hd-ease);
}
#hd-menu-drawer-backdrop.hd-open {
  opacity: 1;
  pointer-events: auto;
}
#hd-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5FBFC 100%);
  border-right: 1px solid rgba(0, 235, 245, 0.35);
  box-shadow: 20px 0 50px rgba(0, 48, 62, 0.3);
  z-index: 99999;
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.35s var(--hd-ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 20px;
  box-sizing: border-box;
}
#hd-menu-drawer.hd-open {
  transform: translate3d(0, 0, 0);
}
.hd-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 78, 100, 0.1);
  margin-bottom: 18px;
}
.hd-drawer-close {
  background: rgba(0, 78, 100, 0.06);
  border: 1px solid rgba(0, 78, 100, 0.15);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--hd-ottanio);
  transition: all 0.2s;
}
.hd-drawer-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #DC2626;
}
.hd-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.hd-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #1F2937;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s var(--hd-ease);
}
.hd-drawer-link svg {
  width: 20px;
  height: 20px;
  color: var(--hd-ottanio);
  flex-shrink: 0;
  transition: color 0.2s;
}
.hd-drawer-link:hover {
  background: linear-gradient(90deg, rgba(0, 235, 245, 0.15), rgba(0, 78, 100, 0.05));
  color: var(--hd-ottanio);
  transform: translateX(4px);
}
.hd-drawer-link:hover svg {
  color: var(--hd-teal);
}
.hd-drawer-link.hd-active {
  background: linear-gradient(90deg, rgba(0, 235, 245, 0.22), rgba(0, 78, 100, 0.08));
  color: var(--hd-ottanio);
  font-weight: 700;
  border-left: 3px solid var(--hd-cyan);
}
.hd-drawer-account {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 78, 100, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hd-drawer-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #004E64, #007D96);
  color: #FFFFFF !important;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 78, 100, 0.3);
  transition: all 0.25s;
}
.hd-drawer-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 235, 245, 0.45);
  transform: translateY(-1px);
}
.hd-drawer-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 78, 100, 0.2);
  color: var(--hd-ottanio);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s;
}
.hd-drawer-btn-secondary:hover {
  background: rgba(0, 235, 245, 0.08);
  border-color: var(--hd-cyan);
}
.hd-drawer-langs {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 78, 100, 0.1);
}
.hd-drawer-langs-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #6B7280;
  margin-bottom: 8px;
}
.hd-drawer-langs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.hd-lang-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 8px;
  background: rgba(0, 78, 100, 0.04);
  border: 1px solid rgba(0, 78, 100, 0.1);
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}
.hd-lang-pill:hover, .hd-lang-pill.hd-active {
  background: rgba(0, 235, 245, 0.2);
  border-color: var(--hd-cyan);
  color: var(--hd-ottanio);
  font-weight: 700;
}
.hd-drawer-dina {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 235, 245, 0.16) 0%, rgba(0, 78, 100, 0.08) 100%);
  border: 1.5px solid rgba(0, 235, 245, 0.45);
  box-shadow: 0 4px 18px rgba(0, 78, 100, 0.08), inset 0 0 12px rgba(0, 235, 245, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.28s var(--hd-ease);
  user-select: none;
}
.hd-drawer-dina:hover {
  background: linear-gradient(135deg, rgba(0, 235, 245, 0.28) 0%, rgba(0, 78, 100, 0.14) 100%);
  border-color: var(--hd-cyan);
  box-shadow: 0 6px 24px rgba(0, 235, 245, 0.35), inset 0 0 16px rgba(0, 235, 245, 0.2);
  transform: translateY(-2px);
}
.hd-dina-badge-av {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #FFFFFF, #CFF8FC);
  box-shadow: 0 0 0 2px rgba(0, 235, 245, 0.8), 0 2px 8px rgba(0, 78, 100, 0.2);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--hd-ease);
}
.hd-drawer-dina:hover .hd-dina-badge-av {
  transform: scale(1.08) rotate(4deg);
}
.hd-dina-badge-av svg {
  position: absolute;
  left: 2px;
  top: 1px;
  width: 36px;
  height: 36px;
}
.hd-drawer-dina-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hd-drawer-dina-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--hd-ottanio);
  line-height: 1.25;
}
.hd-drawer-dina-sub {
  font-size: 0.72rem;
  color: #4B5563;
  margin-top: 2px;
  opacity: 0.9;
}
.hd-drawer-dina-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hd-teal);
  transition: transform 0.25s var(--hd-ease), color 0.25s;
}
.hd-drawer-dina:hover .hd-drawer-dina-arrow {
  color: var(--hd-ottanio);
  transform: translateX(3px);
}
