/* Widget Scopri il Quartiere */
#scopri-quartiere-widget {
    background: white;
    border-radius: 20px;
    border: 1px solid #e1e8f5;
    padding: 3rem !important;
    margin-bottom: 3rem;
}

#scopri-quartiere-widget h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: #2c4999;
    font-weight: 700;
}

#scopri-quartiere-widget .form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

#scopri-quartiere-widget .form-select {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    cursor: pointer;
    transition: border-color 0.2s;
}

#scopri-quartiere-widget .form-select:focus {
    border-color: #2c4999;
    box-shadow: 0 0 0 3px rgba(44, 73, 153, 0.1);
    outline: none;
}

/* Cookie Consent Popup (Compact Bottom-Right) */
.ml-cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    display: none;
    z-index: 9998;
    pointer-events: none;
}

.ml-cookie-popup {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: min(380px, calc(100% - 32px)); /* aumentato leggermente per accogliere i bottoni affiancati */
    display: none;
    z-index: 9999;
    font-family: inherit;
    color: #0f172a;
}

.ml-cookie-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
    padding: 12px 14px 12px; /* ridotto padding */
    position: relative;
    overflow: hidden;
}

.ml-cookie-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px; /* ridotto da 4px a 3px */
    background: #f2b400;
}

.ml-cookie-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px; /* ridotto da 12px */
    margin-top: 2px; /* ridotto da 4px */
}

.ml-cookie-title {
    margin: 0;
    font-size: 0.95rem; /* ridotto da 1.1rem */
    font-weight: 700;
    color: #1f4aa8;
}

.ml-cookie-close {
    border: none;
    background: transparent;
    color: #1f4aa8;
    font-size: 20px; /* ridotto da 22px */
    cursor: pointer;
    padding: 0 4px; /* ridotto da 5px */
}

.ml-cookie-text {
    margin: 6px 0 8px; /* ridotto da 8px 0 12px */
    color: #4b5563;
    font-size: .8rem; /* ridotto da .9rem */
    line-height: 1.4; /* ridotto da 1.45 */
}

.ml-cookie-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0 8px; /* ridotto da 6px 0 10px */
}

.ml-cookie-more-inner {
    max-height: 40vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fbfdff;
    font-size: .85rem;
    margin-bottom: 10px;
}

.ml-cookie-actions {
    display: flex;
    gap: 8px; /* ridotto da 10px */
    justify-content: flex-end;
}

.ml-cookie-btn {
    border-radius: 999px;
    padding: 6px 14px; /* ridotto da 8px 16px */
    cursor: pointer;
    font-size: .75rem; /* ridotto da .85rem */
    font-weight: 700;
    border: 1px solid #e5e7eb;
}

.ml-cookie-btn-primary {
    background: #f2b400;
    color: #163a86;
    border-color: #f2b400;
}

.ml-cookie-btn-secondary {
    background: #fff;
    color: #1f4aa8;
    border-color: rgba(31,74,168,.25);
}

.ml-cookie-popup.expanded {
    bottom: 18px;
}

/* Bold text utility */
.fw-bold-custom { font-weight: 700 !important; }


/* From Uiverse.io by wilsondesouza */ 
ul {
  list-style: none;
}

.example-2 {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 0;
  margin-top: 15px;
}
.example-2 .icon-content {
  margin: 0 15px 0 0;
  position: relative;
}
.example-2 .icon-content .tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 100;
}
.example-2 .icon-content:hover .tooltip {
  opacity: 1;
  visibility: visible;
  top: -50px;
}
.example-2 .icon-content a {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: #4d4d4d;
  background-color: #fff;
  transition: all 0.3s ease-in-out;
  border: 1px solid #e1e8f5;
}
.example-2 .icon-content a:hover {
  box-shadow: 3px 2px 45px 0px rgb(0 0 0 / 12%);
}
.example-2 .icon-content a svg {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
}
.example-2 .icon-content a:hover {
  color: white;
}
.example-2 .icon-content a .filled {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: #000;
  transition: all 0.3s ease-in-out;
}
.example-2 .icon-content a:hover .filled {
  height: 100%;
}

.example-2 .icon-content a[data-social="linkedin"] .filled,
.example-2 .icon-content a[data-social="linkedin"] ~ .tooltip {
  background-color: #0274b3;
}

.example-2 .icon-content a[data-social="instagram"] .filled,
.example-2 .icon-content a[data-social="instagram"] ~ .tooltip {
  background: linear-gradient(
    45deg,
    #405de6,
    #5b51db,
    #b33ab4,
    #c135b4,
    #e1306c,
    #fd1f1f
  );
}

/* User Type Switcher (Radio Buttons as Buttons) */
#scopri-quartiere-widget .btn-group {
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
    display: flex;
    gap: 5px;
}

#scopri-quartiere-widget .btn-check {
    display: none;
}

#scopri-quartiere-widget .btn-outline-primary {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    padding: 10px 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#scopri-quartiere-widget .btn-check:checked + .btn-outline-primary {
    background: white;
    color: #2c4999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Expert Box */
#scopri-quartiere-widget .expert-box {
    background: #f8faff;
    border-radius: 16px;
    padding: 1.5rem;
    border-left: 5px solid #2c4999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

#scopri-quartiere-widget .expert-box h5 {
    color: #2c4999;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

/* Insights Badges */
.insight-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* KPI Grid */
#kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi-card-v2 {
    background: #f8faff;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    text-align: center;
}

.kpi-card-v2 .kpi-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
}

.kpi-card-v2 .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.kpi-card-v2 .kpi-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* Flip Cards for QoL Indices */
.qol-container {
    perspective: 1000px;
    height: 200px;
}

.qol-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.qol-container:hover .qol-card-inner {
    transform: rotateY(180deg);
}

.qol-front, .qol-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.qol-front {
    background: white;
    border: 1px solid #eef2f7;
}

.qol-back {
    background: #2c4999;
    color: white;
    transform: rotateY(180deg);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* KPI Sidebar style matching */
.kpi-card-sidebar-style {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.kpi-card-sidebar-style:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #2c4999;
}

.kpi-card-sidebar-style .kpi-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.kpi-card-sidebar-style .kpi-info {
    flex: 1;
}

.kpi-card-sidebar-style .kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.kpi-card-sidebar-style .kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* Footer style adjustments */
.footer {
    padding: 6rem 2rem 2rem;
    background: #f8faff;
    border-top: 1px solid #e1e8f5;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

/* From Uiverse.io by wilsondesouza */ 
ul {
  list-style: none;
}

.example-2 {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 0;
  margin-top: 15px;
}
.example-2 .icon-content {
  margin: 0 10px 0 0;
  position: relative;
}
.example-2 .icon-content .tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 10;
}
.example-2 .icon-content:hover .tooltip {
  opacity: 1;
  visibility: visible;
  top: -50px;
}
.example-2 .icon-content a {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #4d4d4d;
  background-color: #fff;
  transition: all 0.3s ease-in-out;
  border: 1px solid #e1e8f5;
}
.example-2 .icon-content a:hover {
  box-shadow: 3px 2px 45px 0px rgb(0 0 0 / 12%);
}
.example-2 .icon-content a svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
}
.example-2 .icon-content a:hover {
  color: white;
}
.example-2 .icon-content a .filled {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: #000;
  transition: all 0.3s ease-in-out;
}
.example-2 .icon-content a:hover .filled {
  height: 100%;
}

.example-2 .icon-content a[data-social="linkedin"] .filled,
.example-2 .icon-content a[data-social="linkedin"] ~ .tooltip {
  background-color: #0274b3;
}

.example-2 .icon-content a[data-social="instagram"] .filled,
.example-2 .icon-content a[data-social="instagram"] ~ .tooltip {
  background: linear-gradient(
    45deg,
    #405de6,
    #5b51db,
    #b33ab4,
    #c135b4,
    #e1306c,
    #fd1f1f
  );
}

.footer-logo p {
    color: #64748b;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    justify-content: space-between;
}

.footer-col h4 {
    color: #1a1a2e;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col a {
    display: block;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 0.4rem;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #2c4999;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e1e8f5;
    color: #94a3b8;
    font-size: 0.9rem;
}
.btn-report-download {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #2c4999;
    color: white !important;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    margin-top: 10px;
}

.btn-report-download:hover {
    background-color: #ebc217;
    color: #2c4999 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.report-section {
    padding: 20px;
    background: #f8faff;
    border-top: 1px solid #e1e8f5;
    margin-top: auto;
}
.mb-5 { margin-bottom: 3rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.p-5 { padding: 3rem !important; }
.text-center { text-align: center !important; }
.text-muted { color: #64748b !important; }
.fw-bold { font-weight: 700 !important; }
.display-6 { font-size: 2.5rem; }
.row { display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; padding: 0 15px; }
.col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 0 15px; }
.g-4 { gap: 1.5rem; }
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.gap-2 { gap: 0.5rem !important; }
.w-100 { width: 100% !important; }
.align-items-end { align-items: flex-end !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important; }
.rounded { border-radius: 0.25rem !important; }
.bg-white { background-color: #fff !important; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
}

/* Navbar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: white;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-container {
    z-index: 2;
}

/* Hide mobile nav related elements since we only want central links */
.hamburger-menu, .mobile-nav {
    display: none !important;
}

/* Mobile responsiveness for Landing Page */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem !important;
    }
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    .section-title {
        font-size: 2.2rem !important;
    }
    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    .how-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .mockup-container {
        order: -1;
        position: relative;
        top: 0;
    }
    /* Promo Section Improvements */
    .promo-map-mini {
        height: 180px !important;
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto;
    }
    .promo-container-v2 {
        padding: 1.5rem !important;
    }
    .hero-video-bg {
        z-index: 0;
    }
    .price-promo-section {
        position: relative;
        z-index: 1;
        background: white;
    }

    /* How it works reordering */
    .mobile-only-title {
        display: block !important;
    }
    .desktop-only-title {
        display: none !important;
    }
    .how-it-works {
        padding: 4rem 1rem !important;
    }

    /* Vertical buttons for tools */
    .info-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    .info-card {
        width: 100% !important;
    }

    /* Map redesign: Table full, Map collapsible */
    .map-content-wrapper {
        flex-direction: column-reverse !important; /* Table first */
    }
    .sidebar {
        height: auto !important;
        min-height: 60vh;
        overflow: visible !important;
    }
    .map-container {
        height: 40px !important; /* Collapsed state height */
        transition: height 0.3s ease;
        overflow: hidden;
        position: relative;
        cursor: pointer;
    }
    .map-container.expanded {
        height: 50vh !important;
    }
    .map-container::after {
        content: 'Espandi Mappa ▽';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 40px;
        background: #2c4999;
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: bold;
        z-index: 1001;
    }
    .map-container.expanded::after {
        content: 'Chiudi Mappa △';
    }

    /* Header/Footer fixes */
    .navbar {
        padding: 0.5rem !important;
        height: 60px;
    }
    .footer {
        padding: 3rem 1rem !important;
    }
    .footer-container {
        text-align: center;
    }
    .footer-logo-container {
        justify-content: center !important;
    }
}

/* Sezione Come Funziona (Design Screenshot) */
.how-it-works {
    padding: 8rem 2rem;
    background: #f8faff;
}

.how-it-works .container {
    max-width: 1200px;
    margin: 0 auto;
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
}

.steps-list {
    display: flex;
    flex-direction: column;
}

.step-item {
    border-bottom: 1px solid #e1e8f5;
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-item:first-child {
    border-top: 1px solid #e1e8f5;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.step-header h3 {
    font-size: 1.25rem;
    color: #1a1a2e;
    font-weight: 500;
    margin: 0;
}

.step-toggle {
    font-size: 1.25rem;
    color: #1a1a2e;
    font-weight: 300;
}

.step-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.step-item.active .step-content {
    max-height: 200px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Video Mockup Stack */
.mockup-container {
    position: sticky;
    top: 120px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.video-mockup {
    width: 100%;
    max-width: 550px;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 40px;
    padding: 0;
    box-shadow: 0 40px 80px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.video-stack {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 40px;
    overflow: hidden;
    background: #fff;
}

.video-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
    background: #fff;
}

.video-layer.is-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .how-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .mockup-container {
        position: relative;
        top: 0;
        min-height: auto;
    }
    .video-mockup {
        aspect-ratio: 16 / 9;
    }
}

.step-content p {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 992px) {
    .how-grid {
        grid-template-columns: 1fr;
    }
    .mockup-container {
        order: -1;
    }
}

/* Sezione Domande Frequenti Originale */
.qa-section {
    padding: 6rem 2rem;
    background: white;
}

.qa-container {
    max-width: 900px;
    margin: 0 auto;
}

.qa-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 3rem;
}

.qa-item {
    background: #f8faff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qa-item:hover {
    background: #f0f4ff;
}

.qa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.qa-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2a5e;
    margin: 0;
    line-height: 1.4;
}

.qa-toggle, .step-toggle {
    transition: transform 0.3s ease;
}

.qa-item.active .qa-toggle, .step-item.active .step-toggle {
    transform: rotate(180deg);
}

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 0;
}

.qa-item.active .qa-answer {
    max-height: 300px;
    margin-top: 1.2rem;
}

.qa-answer p {
    color: #4a5568;
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    --size: 30px;
    --first-block-clr: #2c4999;
    --second-block-clr: #ebc217;
    width: 100px;
    height: 100px;
    position: relative;
}

.spinner::after, .spinner::before {
    box-sizing: border-box;
    position: absolute;
    content: "";
    width: var(--size);
    height: var(--size);
    top: 50%;
    left: 50%;
    background: var(--first-block-clr);
    animation: up 2.4s cubic-bezier(0, 0, 0.24, 1.21) infinite;
}

.spinner::after {
    background: var(--second-block-clr);
    top: calc(50% - var(--size));
    left: calc(50% - var(--size));
    animation: down 2.4s cubic-bezier(0, 0, 0.24, 1.21) infinite;
}

@keyframes down { 0%, 100% { transform: none; } 25% { transform: translateX(100%); } 50% { transform: translateX(100%) translateY(100%); } 75% { transform: translateY(100%); } }
@keyframes up { 0%, 100% { transform: none; } 25% { transform: translateX(-100%); } 50% { transform: translateX(-100%) translateY(-100%); } 75% { transform: translateY(-100%); } }

.loading-text {
    margin-top: 2rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.footer-logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
    margin-bottom: 1rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #2c4999;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #ebc217;
}

.partner-logo {
    font-weight: 600;
    color: #1a1a2e;
}

.hero {
    min-height: 70vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8rem 3rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent; /* Nessun filtro colore */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    color: white;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 2rem;
    margin-top: 12px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

.hero h1 .highlight {
    font-style: italic;
    color: white;
}

/* Pulsante ANALISI INFRASTRUTTURALE - Inizialmente Blu con scritta Gialla, poi Giallo con scritta Blu */
.infra-button, .btn-vai-quartiere {
  padding: 12px 24px !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: 700 !important;
  color: #ebc217 !important;
  background-color: #2c4999 !important;
  border: 2px solid #2c4999 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  transform: none !important;
}

.infra-button:hover, .btn-vai-quartiere:hover {
  background-color: #ebc217 !important;
  border-color: #ebc217 !important;
  color: #2c4999 !important;
  transform: none !important;
  box-shadow: none !important;
}

.infra-button img, .infra-button .btn-icon-img {
    display: none !important;
}

/* Global Button Styles - Adapted from Uiverse.io by cssbuttons-io */
button, .cta-button, .map-toggle-btn, .view-tpl-map-btn {
  padding: 1.3em 3em;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 600;
  color: #fff;
  background-color: #2c4999;
  border: 2px solid #2c4999;
  border-radius: 45px;
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease 0s;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover, .cta-button:hover, .map-toggle-btn:hover, .view-tpl-map-btn:hover {
  background-color: #fff;
  box-shadow: 0px 15px 20px rgba(44, 73, 153, 0.4);
  color: #2c4999;
  transform: translateY(-7px);
}

button:active, .cta-button:active, .map-toggle-btn:active, .view-tpl-map-btn:active {
  transform: translateY(-1px);
}

/* Pulsante Esplora V2 (Stile Scopri il Quartiere) */
.button-esplora-v2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  background: #2c4999;
  color: white;
  padding: 0.8em 1.8em;
  padding-left: 1.2em;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
}

.button-esplora-v2 span {
  display: block;
  margin-left: 0.3em;
  transition: all 0.3s ease-in-out;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.button-esplora-v2 svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
  color: white;
}

.button-esplora-v2:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.button-esplora-v2:hover svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
  color: #2c4999;
}

.button-esplora-v2:hover span {
  transform: translateX(100%);
  opacity: 0;
}

.button-esplora-v2:active {
  transform: scale(0.95);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }
  to {
    transform: translateY(-0.1em);
  }
}

.button-esplora-v2:hover {
  background-color: #ebc217;
  color: #2c4999;
}

.btn-vai-quartiere {
    background: #2c4999;
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(44, 73, 153, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-vai-quartiere:hover {
    background: #ebc217;
    color: #2c4999 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(235, 194, 23, 0.4);
}

.btn-vai-quartiere::after {
    content: "→";
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-vai-quartiere:hover::after {
    transform: translateX(5px);
}

.report-section-modern {
    margin-top: 30px;
    border-top: 2px dashed #e2e8f0 !important;
    padding-top: 30px !important;
}
.button-esplora-v2 svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
  color: white;
}

.button-esplora-v2:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.button-esplora-v2:hover svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
  color: #2c4999;
}

.button-esplora-v2:hover span {
  transform: translateX(100%);
  opacity: 0;
}

.button-esplora-v2:active {
  transform: scale(0.95);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }
  to {
    transform: translateY(-0.1em);
  }
}

.button-esplora-v2:hover {
  background-color: #ebc217;
  color: #2c4999;
}

/* Styled Buttons (like PriceLens) - for Comparatore and Scopri Quartiere */
.map-bar-btn.styled-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    background: white;
    border: 2px solid #e1e8f5;
    border-radius: 50px;
    padding: 10px 24px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(44, 73, 153, 0.08);
}

.map-bar-btn.styled-btn:hover {
    border-color: #2c4999;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 73, 153, 0.15);
}

.map-bar-btn.styled-btn .brand-text {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'Inter', sans-serif;
}

.map-bar-btn.styled-btn .blue-text {
    color: #2c4999;
    font-weight: 600;
    font-size: 1rem;
    font-style: italic;
}

.map-bar-btn.styled-btn .yellow-text {
    color: #ebc217;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PriceLens Button Static Style */
.esplora-btn-soft-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    min-width: 130px;
    background: white;
    border: 1.5px solid #2c4999;
    border-radius: 50px;
    padding: 4px 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(44, 73, 153, 0.1);
}

.esplora-btn-soft-custom:hover {
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 73, 153, 0.15);
}

.esplora-logo-static {
    max-height: 16px;
    width: auto;
    display: block;
}


.cta-button.secondary:hover, .infra-button:hover, .view-tpl-map-btn:hover, .search-box button:hover {
  background-color: #fff;
  color: #2c4999;
  box-shadow: 0px 15px 20px rgba(44, 73, 153, 0.4);
}

.search-box button {
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  letter-spacing: normal;
}

.map-section {
    position: relative;
    z-index: 10;
    margin-top: 0;
    padding: 0;
    background: #f8f9fa;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.map-content-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.map-container {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    width: 100%;
}

/* Mobile: layout mappa sopra sidebar */
.mobile-map-collapse {
    display: none;
}

@media (max-width: 768px) {
    .map-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        flex-direction: column;
    }

    .map-container {
        flex: 0 0 45vh;
        height: 45vh;
        border-bottom: 1px solid #e9eef6;
        transition: flex-basis 0.3s ease, height 0.3s ease;
    }

    .map-container.hide-main-map {
        flex: 0 0 0;
        height: 0;
        overflow: hidden;
        border-bottom: none;
    }

    .sidebar {
        width: 100%;
        flex: 1;
        height: auto;
    }

    .mobile-map-collapse {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        margin: 12px auto;
        padding: 0;
        border-radius: 12px;
        border: 2px solid #2c4999;
        background: #fff;
        color: #2c4999;
        font-size: 24px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(44, 73, 153, 0.2);
        transition: all 0.2s ease;
        z-index: 100;
    }

    .mobile-map-collapse:hover {
        background: #2c4999;
        color: #fff;
        transform: scale(1.05);
    }

    .mobile-map-collapse:active {
        transform: scale(0.95);
    }
}

.standalone-map-bar-section {
    background: white;
    padding: 30px 0;
    border-top: 1px solid #eef2f7;
}

.map-button-bar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

.map-button-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.map-bar-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.map-bar-btn:hover {
    transform: translateY(-2px);
}

.map-bar-btn span {
    font-size: 14px;
    font-weight: 600;
    color: #2c4999;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f0f4ff;
    transition: all 0.3s;
}

.map-bar-btn:hover span {
    background: #2c4999;
    color: white;
}

.map-bar-btn img {
    height: 28px;
}

.map-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border-radius: 12px;
    background: white;
    border: 2px solid #e1e8f5;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-bar-btn:hover {
    border-color: #2c4999;
    box-shadow: 0 4px 15px rgba(44, 73, 153, 0.1);
    transform: translateY(-2px);
}

.map-bar-btn img {
    height: 24px;
    width: auto;
}

.sidebar {
    width: 420px;
    height: 100%;
    background: white;
    border-left: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.map-floating-toggle {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(67, 97, 238, 0.2);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

/* From Uiverse.io by JaydipPrajapati1910 */ 
.cssbuttons-io-button {
  background: #0000FF;
  color: white;
  font-family: inherit;
  padding: 0.35em;
  padding-left: 1.5em;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0.9em;
  border: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  box-shadow: inset 0 0 1.6em -0.6em #0000FF;
  overflow: hidden;
  position: relative;
  height: 2.6em;
  padding-right: 3.8em;
  text-decoration: none;
}

.cssbuttons-io-button .icon {
  background: white;
  margin-left: 1em;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.8em;
  width: 1.8em;
  border-radius: 0.7em;
  box-shadow: 0.1em 0.1em 0.6em 0.2em #0000FF;
  right: 0.3em;
  transition: all 0.3s;
}

.cssbuttons-io-button:hover .icon {
  width: calc(100% - 0.6em);
}

.cssbuttons-io-button .icon svg {
  width: 1.1em;
  transition: transform 0.3s;
  color: #0000FF;
}

.cssbuttons-io-button:hover .icon svg {
  transform: translateX(0.1em);
}

.cssbuttons-io-button:active .icon {
  transform: scale(0.95);
}

/* --- OVERRIDES PER SPAZIATURA SEZIONI --- */
.section-description {
    margin-bottom: 30px !important;
}

.sidebar-section p {
    margin-bottom: 20px;
}

.kpi-main-section .section-description {
    margin-bottom: 25px;
}

.comparator-dedicated-section .section-description {
    margin-bottom: 25px;
}

.discover-section {
    padding: 1.5rem;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
}

.kpi-widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.kpi-widget-card {
    background: #f8faff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}

.badge-high { background: #e6fffa; color: #2c7a7b; }
.qol-container.small-qol {
    height: 120px;
    margin-bottom: 1rem;
}

.kpi-card-sidebar-style.small-kpi {
    padding: 0.75rem;
    gap: 0.5rem;
}

.kpi-card-sidebar-style.small-kpi .kpi-value {
    font-size: 0.9rem;
}

.small-kpi .kpi-info .kpi-label {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-view-column {
    border-right: 1px solid #eef2f7;
    padding: 0 20px;
}

.compare-view-column:last-child {
    border-right: none;
}

.nil-title-v2 {
    font-size: 1.2rem;
    color: #2c4999;
    padding-bottom: 10px;
    border-bottom: 2px solid #ebc217;
    margin-bottom: 20px !important;
}

.small-qol .qol-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.small-qol .qol-title {
    font-size: 0.75rem;
}

.small-qol .qol-score {
    font-size: 0.7rem;
    padding: 2px 6px;
}

.kpi-card-sidebar-style.small-kpi .kpi-icon {
    width: 24px;
    height: 24px;
}

#nil-compare-container .form-select {
    border-color: #ebc217;
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: #ebc217;
    border-color: #ebc217;
}

.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }

.bar-high { background: #38b2ac; }
.bar-medium { background: #ed8936; }
.bar-low { background: #e53e3e; }
.liquid-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #000;
    border-radius: 20px;
    margin: 1rem;
}

.map-section.hidden-map-section {
    display: none;
}

.toggle-labels {
    display: flex;
    justify-content: center;
    width: 22em;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 1.2rem;
    position: relative;
}

.liquid-3 {
  --primary: #000;
  --secondary: #fff;
  --time: 0.6s;
  appearance: none;
  position: relative;
  cursor: pointer;
  width: 3em;
  aspect-ratio: 2 / 1;
  background: var(--primary);
  border-radius: 20em;
  box-shadow: 0 0 0 0.15em var(--secondary);
  transform: translateX(0.5px);
  transition: transform var(--time) cubic-bezier(0.75, 0, 0.75, 50);
  filter: blur(0.1em) contrast(20);
  mix-blend-mode: lighten;
  overflow: hidden;
  outline: none;
  border: none;
}

.toggle-labels span {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.toggle-labels span.active {
    opacity: 1;
    transform: translateY(0);
}
/* Sezione Dedicata Comparatore Sidebar */
.comparator-dedicated-section {
    padding: 1.5rem;
    background: #fff;
    border-top: 1px solid #eef2f7;
}

.comparator-widget {
    margin-top: 1rem;
    border: 1px solid #e1e8f5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.comparator-form-v2 {
    padding: 0;
}

.comp-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comp-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comp-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c4999;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comp-group input, .comp-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s;
}

.comp-group input:focus {
    border-color: #2c4999;
}

.comp-filters {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

.btn-cerca-simili {
    width: 100%;
    background: #ebc217;
    color: #2c4999;
    border: none;
    padding: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
    letter-spacing: 1px;
    border-radius: 12px;
}

.btn-cerca-simili:hover:not(:disabled) {
    background: #d4ae15;
}

.btn-cerca-simili:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    color: #fff;
}

.valuation-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.valuation-box.under { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.valuation-box.linear { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.valuation-box.above { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.comp-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: transform 0.2s;
}

.comp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.comp-card.top {
    border: 2px solid #ebc217;
}

.badge-simili {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #ebc217;
    color: #1a1a2e;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.comp-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.comp-item {
    font-size: 0.8rem;
    color: #64748b;
}

.comp-item strong {
    color: #1e293b;
    display: block;
    font-size: 0.9rem;
}

.score-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: #2c4999;
}

.comp-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-comp-action {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comp-action:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .comp-row, .filter-row {
        flex-direction: column;
    }
}
.info-card {
  width: 250px;
  height: 320px;
  background: #2c4999;
  transition: all 0.4s;
  border-radius: 10px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
  font-weight: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: none;
}

.info-card:hover {
  border-radius: 15px;
  transform: scale(1.1);
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
  background: #1a2a5e;
}

.first-content {
  height: 100%;
  width: 100%;
  transition: all 0.4s;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
}

.first-content h3 {
  color: #ebc217;
  font-size: 1.5rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-card:hover .first-content {
  height: 0px;
  opacity: 0;
}

.second-content {
  height: 0%;
  width: 100%;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 15px;
  transition: all 0.4s;
  font-size: 0px;
  transform: rotate(90deg) scale(-1);
  padding: 2rem;
  text-align: center;
  background: #ebc217;
}

.second-content p {
  color: #2c4999;
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}

.info-card:hover .second-content {
  opacity: 1;
  height: 100%;
  font-size: 1.1rem;
  transform: rotate(0deg);
}

/* PriceLens Promo Section V2 */
.price-promo-section {
    padding: 6rem 2rem;
    background: white;
}

.promo-container-v2 {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Reduced from 1.5rem */
    align-items: center;
}

.promo-header-v2 {
    display: flex;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.promo-map-wrapper {
    flex: 0 0 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.promo-map-mini {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    background: white;
}

.promo-text-v2 {
    flex: 1;
    text-align: left;
}

.promo-text-v2 h2 {
    font-size: 2.8rem;
    color: #2c4999;
    margin-bottom: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.promo-text-v2 p {
    font-size: 1.2rem;
    color: #4a5568;
    line-height: 1.6;
}

.promo-footer-v2 {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 20px;
    flex-wrap: wrap;
}

.esplora-btn-soft-custom span {
    font-size: 13px;
    font-weight: 600;
    color: #2c4999;
}

@media (max-width: 991px) {
    .promo-header-v2 {
        flex-direction: column;
        text-align: center;
    }
    .promo-text-v2 {
        text-align: center;
    }
    .promo-map-wrapper {
        flex: 0 0 auto;
        width: 100%;
    }
}

.explanatory-section {
    padding: 8rem 2rem;
    background: #f8f9fa;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 3.5rem;
    font-weight: 700;
}

.info-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.liquid-3::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 100%;
    transform: translate(-25%, -50%);
    left: 50%;
    top: 50%;
    background: radial-gradient(
        closest-side circle at 12.5% 50%,
        var(--secondary) 50%,
        #0000 0
      ),
      radial-gradient(
        closest-side circle at 87.5% 50%,
        var(--secondary) 50%,
        #0000 0
      ),
      #f000;
    transition: transform var(--time) cubic-bezier(0.75, 0, 0.75, 1.3);
}

.liquid-3:checked {
    transform: translateX(-0.5px);
}

.liquid-3:checked::before {
    transform: translate(-75%, -50%);
}

.map-container {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.map-floating-toggle {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: auto;
}

/* Custom Simple Switcher Style */
.custom-switcher-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid #eee;
}

.switcher-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  transition: color 0.3s ease;
}

#label-tpl.active {
  color: #2c4999;
}

#label-mercato.active {
  color: #e67e22;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2c4999;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* From Uiverse.io by Shoh2008 */ 
.checkbox-wrapper-35 .switch {
  display: none;
}

.checkbox-wrapper-35 .switch + label {
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  color: #1a2a5e;
  cursor: pointer;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 15px;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkbox-wrapper-35 .switch + label::before,
  .checkbox-wrapper-35 .switch + label::after {
  content: '';
  display: block;
}

.checkbox-wrapper-35 .switch + label::before {
  background-color: #2c4999;
  border-radius: 500px;
  height: 20px;
  margin-right: 10px;
  -webkit-transition: background-color 0.125s ease-out;
  transition: background-color 0.125s ease-out;
  width: 40px;
  flex-shrink: 0;
}

.checkbox-wrapper-35 .switch + label::after {
  background-color: #fff;
  border-radius: 13px;
  box-shadow: 0 3px 1px 0 rgba(37, 34, 71, 0.05), 0 2px 2px 0 rgba(37, 34, 71, 0.1), 0 3px 3px 0 rgba(37, 34, 71, 0.05);
  height: 16px;
  left: 2px;
  position: absolute;
  top: 2px;
  -webkit-transition: -webkit-transform 0.125s ease-out;
  transition: -webkit-transform 0.125s ease-out;
  transition: transform 0.125s ease-out;
  transition: transform 0.125s ease-out, -webkit-transform 0.125s ease-out;
  width: 16px;
  z-index: 2;
}

.checkbox-wrapper-35 .switch:checked + label::after {
  -webkit-transform: translate3d(20px, 0, 0);
  transform: translate3d(20px, 0, 0);
}

.checkbox-wrapper-35 .switch:checked + label .switch-x-unchecked {
  opacity: 0;
  -webkit-transform: translate3d(0, -100%, 0);
  transform: translate3d(0, -100%, 0);
}

.checkbox-wrapper-35 .switch:checked + label .switch-x-checked {
  opacity: 1;
  -webkit-transform: none;
  transform: none;
}

.map-toggle-container {
    display: none;
}

.map-toggle-btn.active {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.map-toggle-btn .btn-icon-img {
    width: 2.5px;
    height: 2.5px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.info-card .first-content .info-icon-img.big-icon {
    width: 100px;
    height: 100px;
}

.faq-section {
    padding: 6rem 2rem;
    background: #fff;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: #2c4999;
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1a1a2e;
    background: #f8f9fa;
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 500px;
    border-top: 1px solid #e0e0e0;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2c4999;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s;
    border: none;
    padding: 0;
    line-height: 1;
}

.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    background: #2c4999;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -10px;
}

.marker-pin::after {
    content: '';
    width: 10px;
    height: 10px;
    margin: 5px 0 0 5px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

.house-marker {
    background: transparent;
    border: none;
}

.scopri-quartiere-sidebar h5 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.kpi-widget-card {
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-widget-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #2c4999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-widget-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-high { background: #e6fffa; color: #2c7a7b; }
.badge-medium { background: #fffaf0; color: #9c4221; }
.badge-low { background: #fff5f5; color: #9b2c2c; }

.kpi-widget-progress {
    height: 4px;
    background: #edf2f7;
    border-radius: 2px;
    overflow: hidden;
}

.kpi-widget-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-high { background: #38b2ac; }
.bar-medium { background: #ed8936; }
.bar-low { background: #e53e3e; }

.kpi-widget-desc {
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.3;
}

.footer {
    background: #1a1a2e;
    color: white;
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-logo p {
    margin-top: 1rem;
    color: #cbd5e0;
}

.footer-links {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: #ebc217;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #ebc217;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
}

.map-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
}

.map-container {
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
}

.sidebar {
    width: 100%;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    overflow: hidden; /* Elimina la barra esterna */
    height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid #eee;
    background: white;
    flex-shrink: 0;
    position: relative;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.search-box input:focus {
    outline: none;
    border-color: #4361ee;
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.quartieri-dropdown {
    position: absolute;
    top: 100%;
    left: 1.25rem;
    right: 1.25rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quartieri-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.quartieri-item:hover {
    background: linear-gradient(90deg, rgba(67, 97, 238, 0.1), rgba(67, 97, 238, 0.02));
}

.quartieri-item:last-child {
    border-bottom: none;
}

.quartieri-item .item-icon {
    margin-right: 8px;
}

.quartieri-divider {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    letter-spacing: 0.5px;
}

.quartieri-item.address-item {
    font-size: 0.9rem;
    color: #333;
}

.quartieri-item.address-loading {
    color: #888;
    font-style: italic;
    cursor: default;
}

.quartieri-item.no-results {
    color: #999;
    font-style: italic;
    cursor: default;
}

.quartieri-item.no-results:hover {
    background: transparent;
}

.address-marker {
    z-index: 1000 !important;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 150px !important;
}

@keyframes pulse-yellow {
    0% { transform: scale(1); box-shadow: 0 10px 30px rgba(235, 194, 23, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 15px 45px rgba(235, 194, 23, 0.9); }
    100% { transform: scale(1); box-shadow: 0 10px 30px rgba(235, 194, 23, 0.5); }
}

.sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    z-index: 1;
}

.sidebar-section:hover {
    box-shadow: 0 8px 30px rgba(67, 97, 238, 0.1);
    border-color: rgba(67, 97, 238, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(67, 97, 238, 0.1);
}

.section-header.small {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.section-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.section-icon.small {
    width: 28px;
    height: 28px;
}

.section-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
}

.section-header-subtitle {
    font-size: 0.75rem;
    color: #666;
    margin-left: auto;
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.case-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, white 100%);
}

.case-kpi-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.case-kpi-box {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.case-kpi-box .kpi-label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.case-kpi-box .kpi-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
}

.case-filters {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.75rem;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    min-width: 100px;
}

/* Range Input Styling - Sync with Neighborhood Ranking */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2c4999;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #1a306d;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2c4999;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.filter-row span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a2e;
    min-width: 100px;
    text-align: right;
}

.price-chart-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(67, 97, 238, 0.05);
}

.price-chart-container.enhanced {
    min-height: 280px;
}

.chart-wrapper {
    height: 200px;
    position: relative;
}

.chart-wrapper.small {
    height: 120px;
}

.price-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-nil-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.chart-current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #4361ee;
}

.chart-stats {
    display: flex;
    gap: 1rem;
}

.chart-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.prediction-chart-container {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

/* Nascondi Classifica TPL mantenendo il funzionamento */
.tpl-ranking-hidden-container {
    transform: scale(0.0001) !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.data-columns {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 1rem;
}

.table-cta-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8faff;
    border-radius: 12px;
    text-align: center;
    border: 1px dashed #2c4999;
}

.table-cta-text {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 10px;
    line-height: 1.4;
}

.table-cta-text strong {
    color: #2c4999;
}

.data-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    z-index: 1;
    padding-right: 0;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(67, 97, 238, 0.03) 100%);
    border-radius: 12px;
    border: 1px solid rgba(67, 97, 238, 0.08);
}

.column-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.column-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex: 1;
}

.ranking-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4361ee #f0f0f0;
    flex: 1;
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}

.ranking-table-container:hover {
    box-shadow: 0 6px 25px rgba(67, 97, 238, 0.12), 0 2px 6px rgba(0,0,0,0.06);
}

.ranking-table-container::-webkit-scrollbar {
    width: 6px;
}

.ranking-table-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.ranking-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4361ee, #3a0ca3);
    border-radius: 3px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ranking-table thead {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #f0f0f0 100%);
    z-index: 1;
}

.ranking-table th {
    padding: 0.6rem 0.4rem;
    text-align: left;
    font-weight: 700;
    color: #555;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border-bottom: 2px solid #e0e0e0;
}

.ranking-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.15s ease;
}

.ranking-table tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ranking-table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.ranking-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(67, 97, 238, 0.1), rgba(67, 97, 238, 0.03)) !important;
    transform: translateX(2px);
}

.ranking-table tbody tr:hover td {
    color: #1a1a2e;
}

/* Pulsante Esplora Uiverse.io */
.btn-esplora {
  position: relative;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: #2c4999;
  color: ghostwhite;
  overflow: hidden;
  padding: 0.5em 1em;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-esplora span {
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: block;
  margin-left: 0.3em;
}

.btn-esplora .svg-wrapper-1 {
  position: relative;
  z-index: 2;
}

.btn-esplora .svg-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-esplora svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.btn-esplora:hover {
  background: #2c4999;
}

.btn-esplora:hover span {
  transform: translateX(6em);
  opacity: 0;
}

.btn-esplora:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.btn-esplora:hover svg {
  transform: translateX(2.5em) rotate(45deg) scale(1.1);
}

.btn-esplora:active {
  transform: scale(0.95);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }
  to {
    transform: translateY(-0.1em);
  }
}

.ranking-table .active-row {
    background: linear-gradient(90deg, rgba(67, 97, 238, 0.18), rgba(67, 97, 238, 0.08)) !important;
    border-left: 4px solid #4361ee;
    box-shadow: inset 0 0 0 1px rgba(67, 97, 238, 0.15);
}

.ranking-table .active-row td {
    font-weight: 600;
    color: #1a1a2e;
}

/* KPI Buttons and Ranking Styles */
.kpi-details-layout {
    display: flex;
    flex-direction: column; /* Stack vertically to avoid overlap */
    gap: 25px;
    margin-top: 20px;
    width: 100%;
}

.kpi-buttons-side {
    width: 100%;
}

.kpi-vertical-ranking-side {
    width: 100%;
    max-width: none;
}

#kpi-button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.vertical-ranking-container {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    height: auto; /* Let it grow or fix it to a reasonable height */
    min-height: 200px;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #e2e8f0;
    gap: 30px;
    position: relative;
    overflow: visible;
}

.horizontal-rank-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    margin: 25px 0 35px;
}

.horizontal-rank-bar.small {
    height: 8px;
    margin: 15px 0 5px;
}

.rank-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.rank-fill {
    height: 100%;
    background: #2c4999;
    border-radius: 10px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rank-bubble {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: white;
    border: 3px solid #2c4999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2;
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rank-bubble.blue { border-color: #2c4999; width: 24px; height: 24px; }
.rank-bubble.red { border-color: #e11d48; width: 24px; height: 24px; }

.rank-bubble .bubble-rank {
    font-size: 10px;
    font-weight: 800;
    color: #2c4999;
}

.rank-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.kpi-button.selected {
    background: #ebc217 !important;
    border-color: #ebc217 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 194, 23, 0.3);
}

.kpi-button.selected .kpi-btn-label { color: #1a2a5e !important; }
.kpi-btn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.kpi-button .info-tooltip-container {
    margin-left: 5px;
}

.kpi-button .info-tooltip-content {
    text-transform: none;
    font-weight: 400;
    white-space: normal;
    width: 200px;
    font-size: 11px;
}

.kpi-button {
    background: #ffffff !important;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 8px;
    min-height: 115px;
    width: 100%;
}

.kpi-button:hover {
    border-color: #2c4999;
    background: #f8fafc !important;
}

.kpi-button.selected {
    background: #2c4999 !important;
    border-color: #2c4999 !important;
    box-shadow: 0 4px 12px rgba(44, 73, 153, 0.3);
}

.kpi-button.selected .kpi-btn-label {
    color: #ffffff !important;
}

.kpi-button.selected .kpi-btn-value {
    color: #ebc217 !important;
}

.kpi-button.selected .kpi-btn-value span {
    color: #ebc217 !important;
}

.kpi-button.selected .kpi-btn-value div span:first-child {
    color: #ffffff !important;
}

.kpi-button.selected .kpi-btn-value div span:last-child {
    color: #ebc217 !important;
}

.kpi-widget-card {
    display: flex;
    flex-direction: column;
}

.kpi-better-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    margin-bottom: 15px;
    margin-top: auto;
}

.kpi-button.selected .tooltip-icon {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.kpi-button.selected .kpi-icon-wrapper img {
    filter: brightness(0) invert(1) !important;
}

.kpi-button .kpi-icon-wrapper img {
    transition: filter 0.2s ease;
}

.analysis-description-box {
    margin: 15px 0;
    padding: 15px;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #0369a1;
}

.ranking-bubble {
    display: none !important;
}

.ranking-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2c4999;
}

.ranking-labels {
    position: absolute;
    top: 20px; /* Position below horizontal bar */
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    pointer-events: none;
    padding: 0;
}

.ranking-position-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
}

.rank-cell {
    font-weight: 700;
    color: #4361ee;
    width: 30px;
    text-align: center;
}

.nil-cell {
    font-weight: 500;
    color: #1a1a2e;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price-cell {
    color: #1a1a2e;
    font-weight: 600;
    font-family: 'Inter', monospace;
}

.increment-cell {
    font-weight: 700;
    font-size: 0.75rem;
}

.increment-cell.positive {
    color: #10b981;
}

.increment-cell.negative {
    color: #ef4444;
}

.impact-cell .impact-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.impact-badge.high {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.impact-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.impact-badge.low {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

.infra-legend {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 15px;
    gap: 10px;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.very-high { background-color: #059669; }
.legend-dot.high { background-color: #10b981; }
.legend-dot.medium { background-color: #f59e0b; }
.legend-dot.low { background-color: #64748b; }

.infra-table td.nil-cell {
    padding-left: 5px !important;
}

#riqualificazione-table td:nth-child(2) {
    padding-left: 5px !important;
}

.legend-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.legend-range {
    font-size: 0.75rem;
    color: #64748b;
}

.ranking-ball {
    display: none !important;
}

#riqualificazione-table tr {
    border-bottom: 1px solid #f1f5f9;
}

#riqualificazione-table td {
    border: none !important;
}

.view-tpl-map-btn {
    transform: scale(0.01) !important;
    transform-origin: top left !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0.1 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.infra-button-container {
    transform: scale(0.01) !important;
    transform-origin: top left !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0.1 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.infra-button .btn-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(10);
}

.btn-esplora {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 28px !important;
    background: #2c4999 !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    min-width: 160px !important;
    z-index: 10 !important;
}

.btn-esplora span {
    position: relative !important;
    z-index: 2 !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    display: inline-block !important;
}

.btn-esplora:hover span {
    opacity: 0 !important;
    transform: translateX(20px) !important;
}

.btn-esplora .svg-wrapper-1 {
    position: absolute !important;
    left: 20px !important;
    transition: all 0.3s ease !important;
    z-index: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-esplora:hover .svg-wrapper-1 {
    left: 50% !important;
    transform: translateX(-50%) scale(1.2) !important;
}

.btn-esplora:hover {
    background: #ebc217 !important;
    color: #1a2a5e !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

/* Tooltip personalizzati */
.info-tooltip-container {
    position: relative !important;
    display: inline-block !important;
    cursor: help !important;
}

.info-tooltip-content {
    visibility: hidden !important;
    width: 260px !important;
    background-color: #1a1a2e !important;
    color: #fff !important;
    text-align: left !important;
    border-radius: 12px !important;
    padding: 15px !important;
    position: absolute !important;
    z-index: 2000000 !important;
    bottom: 115% !important;
    left: auto !important;
    right: 0 !important;
    transform: translateY(10px) !important;
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    pointer-events: none !important;
    border: 1px solid rgba(235, 194, 23, 0.4) !important;
}

.info-tooltip-container:hover .info-tooltip-content {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.info-tooltip-content::after {
    content: "" !important;
    position: absolute !important;
    top: 100% !important;
    right: 10px !important;
    left: auto !important;
    border-width: 8px !important;
    border-style: solid !important;
    border-color: #1a1a2e transparent transparent transparent !important;
}

/* Tooltip specifico per Andamento Prezzi (Verso il basso se necessario, ma richiesto verso l'alto ora) */
.price-chart-section .info-tooltip-content {
    bottom: auto !important;
    top: 115% !important;
    transform: translateX(-50%) translateY(-10px) !important;
}

.price-chart-section .info-tooltip-content:hover {
    transform: translateX(-50%) translateY(0) !important;
}

.price-chart-section .info-tooltip-content::after {
    top: auto !important;
    bottom: 100% !important;
    border-color: transparent transparent #1a1a2e transparent !important;
}

.chart-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 10px;
    padding-left: 5px;
}

.kpi-ranking-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #10b981 #f0f0f0;
}

.kpi-ranking-container::-webkit-scrollbar {
    width: 5px;
}

.kpi-ranking-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.kpi-ranking-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 3px;
}

.kpi-details {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    animation: fadeIn 0.3s ease;
}

.kpi-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(16, 185, 129, 0.2);
}

.kpi-details-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.kpi-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.kpi-group {
    background: white;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 280px;
}

.kpi-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4361ee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.kpi-group-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.kpi-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(0,0,0,0.03);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-card-title {
    font-size: 0.65rem;
    color: #666;
    white-space: nowrap;
}

.kpi-card-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}

.view-tpl-map-btn .btn-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(10);
}

.kpi-details-layout {
    display: flex;
    gap: 1rem;
}

.kpi-groups-side {
    flex: 1;
    min-width: 0;
}

.kpi-ranking-side {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.kpi-ranking-side h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4361ee;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-selector {
    margin-bottom: 0.75rem;
}

.kpi-selector label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.25rem;
}

.kpi-selector select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    min-height: 80px;
    cursor: pointer;
}

.kpi-selector select option {
    padding: 0.25rem 0.5rem;
}

.kpi-selector select option:checked {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

.kpi-ranking-scroll {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4361ee #f0f0f0;
}

.kpi-ranking-scroll::-webkit-scrollbar {
    width: 5px;
}

.kpi-ranking-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.kpi-ranking-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4361ee, #3a0ca3);
    border-radius: 3px;
}

.kpi-rank-item {
    background: white;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRank 0.4s ease forwards;
}

.kpi-rank-item:nth-child(1) { animation-delay: 0s; }
.kpi-rank-item:nth-child(2) { animation-delay: 0.05s; }
.kpi-rank-item:nth-child(3) { animation-delay: 0.1s; }
.kpi-rank-item:nth-child(4) { animation-delay: 0.15s; }
.kpi-rank-item:nth-child(5) { animation-delay: 0.2s; }
.kpi-rank-item:nth-child(6) { animation-delay: 0.25s; }
.kpi-rank-item:nth-child(7) { animation-delay: 0.3s; }
.kpi-rank-item:nth-child(8) { animation-delay: 0.35s; }
.kpi-rank-item:nth-child(9) { animation-delay: 0.4s; }
.kpi-rank-item:nth-child(10) { animation-delay: 0.45s; }

@keyframes slideInRank {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.kpi-rank-item.highlighted {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid #4361ee;
}

.kpi-rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.kpi-rank-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a2e;
}

.kpi-rank-position {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4361ee;
    background: rgba(67, 97, 238, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

.kpi-rank-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.kpi-rank-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #4361ee 0%, #10b981 100%);
    width: 0%;
    transition: width 0.8s ease-out;
}

.kpi-ranking-result {
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border-radius: 8px;
    text-align: center;
    display: none;
}

.kpi-ranking-result.visible {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-ranking-result .result-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    display: block;
}

.kpi-ranking-result .result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.modal-content h2 {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

.modal-content h3 {
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    color: #4361ee;
    margin: 0;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.infra-map {
    height: 233px;
    width: 100%;
}

.infra-details {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 200px;
}

.infra-detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
}

.infra-detail-card h4 {
    color: #4361ee;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.infra-detail-card p {
    margin: 0.4rem 0;
    font-size: 0.9rem;
    color: #555;
}

.infra-detail-card strong {
    color: #1a1a2e;
}

.case-popup {
    padding: 0.25rem;
}

.case-popup strong {
    font-size: 0.9rem;
    color: #1a1a2e;
}

.case-popup .popup-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4361ee;
}

.case-popup .popup-nil {
    font-size: 0.8rem;
    color: #666;
}

/* Mercato Immobiliare Sliders */
.case-filters .filter-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.case-filters input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
    margin: 10px 0;
}

.case-filters input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4361ee;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.case-filters input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.case-filters input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4361ee;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: #4361ee;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.footer-col p {
    color: #ccc;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-links a {
    display: block;
    color: #ccc;
    text-decoration: none;
    margin-bottom: 0.6rem;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
}

.footer-tagline {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.partner-name {
    margin-top: 1rem;
    font-weight: 600;
    color: #4361ee;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.nil-tooltip {
    background: rgba(26, 26, 46, 0.95) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    color: white !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1400px) {
    .sidebar {
        width: 700px;
    }
    
    .kpi-group {
        flex: 1 1 100%;
    }
    
    .data-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .sidebar {
        width: 450px;
    }
    
    .chart-stats {
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .map-section {
        flex-direction: column;
    }
    
    .map-content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 60vh;
    }
    
    #map {
        height: 40vh;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .navbar {
        padding: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .map-toggle-container {
        flex-wrap: wrap;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sidebar-content {
        padding: 0.75rem;
    }
    
    .sidebar-section {
        padding: 0.75rem;
    }
    
    .section-header {
        flex-wrap: wrap;
    }
    
    .price-chart-header {
        flex-direction: column;
    }
    
    .chart-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .case-kpi-row {
        flex-wrap: wrap;
    }
    
    .case-kpi-box {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

.map-legend {
    background: rgba(26, 26, 46, 0.9);
    padding: 10px 14px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.map-legend .legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 6px;
}

.map-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.map-legend .legend-symbol {
    width: 14px;
    height: 14px;
    display: inline-block;
}

.map-legend .legend-symbol.metro {
    background: #e31a1c;
    border-radius: 50%;
    border: 2px solid white;
}

.map-legend .legend-symbol.tram {
    background: #ff9500;
    border-radius: 3px;
    border: 2px solid white;
}

.map-legend .legend-symbol.bus {
    background: #00b4d8;
    transform: rotate(45deg);
    border: 2px solid white;
}

/* From Uiverse.io by AbanoubMagdy1 - Modified for Vendita/Affitto */
.switch {
  font-size: 14px;
  position: relative;
  display: inline-block;
  width: 140px;
  height: 34px;
  overflow: hidden;
  border-radius: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0000FF; /* Blu */
  transition: .4s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 66px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  z-index: 2;
  border-radius: 20px;
}

input:checked + .slider {
  background-color: #ebc217; /* Giallo */
}

input:checked + .slider:before {
  transform: translateX(68px);
}

.switch .text {
  position: absolute;
  top: 50%;
  width: 50%;
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition: .4s;
  font-size: 10px;
  font-weight: 700;
  z-index: 3;
  color: #1a1a2e;
}

.switch .text.on {
  left: 50%;
  opacity: 0;
}

.switch .text.off {
  left: 0;
  opacity: 1;
}

input:checked ~ .text.on {
  opacity: 1;
}

input:checked ~ .text.off {
  opacity: 0;
}

.price-type-toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 0;
    background: transparent;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.price-type-toggle-container label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.price-type-toggle-container .toggle-label {
    font-weight: 600;
    color: #1a1a2e;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #4361ee;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.tpl-index-gauge {
    margin: 20px 0;
    position: relative;
}

.gauge-track {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    margin: 35px 0 20px;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #4361ee, #2c4999);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.gauge-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.marker-label {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    color: #2c4999;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.marker-rank {
    width: 28px;
    height: 28px;
    background: #2c4999;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}
/* From Uiverse.io by JaydipPrajapati1910 */ 
.cssbuttons-io-button {
  background: #2c4999;
  color: white;
  font-family: inherit;
  padding: 0.35em;
  padding-left: 1.2em;
  font-size: 17px;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(44, 73, 153, 0.2);
  overflow: hidden;
  position: relative;
  height: 2.8em;
  padding-right: 3.3em;
  cursor: pointer;
  width: auto;
  min-width: 200px;
  margin-top: 15px;
  justify-content: flex-start;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cssbuttons-io-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 73, 153, 0.3);
  background: #3a5bbd;
}

.cssbuttons-io-button .icon {
  background: white;
  margin-left: 1em;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  width: 2.2em;
  border-radius: 50%;
  right: 0.3em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cssbuttons-io-button:hover .icon {
  width: 2.2em;
  transform: rotate(360deg);
}

.cssbuttons-io-button .icon svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.3s;
  color: #2c4999;
}

.cssbuttons-io-button:hover .icon svg {
  transform: scale(1.1);
}

.cssbuttons-io-button:active {
  transform: scale(0.95);
}

/* --- OVERRIDES PER SPAZIATURA SEZIONI --- */
.section-description {
    margin-bottom: 30px !important;
}

.sidebar-section p {
    margin-bottom: 20px;
}

.kpi-main-section .section-description {
    margin-bottom: 25px;
}

.comparator-dedicated-section .section-description {
    margin-bottom: 25px;
}

/* Styles for the second toggle (Map) to avoid conflicts */
.switch-map {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-map input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-map {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider-map:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider-map {
  background-color: #2c4999;
}

input:checked + .slider-map:before {
  transform: translateX(20px);
}

/* Small Switch for Comparison Mode */
.switch-small {
  font-size: 10px;
  position: relative;
  display: inline-block;
  width: 80px;
  height: 24px;
  overflow: hidden;
  border-radius: 20px;
}

.switch-small input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-small {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0000FF; /* Blu */
  transition: .4s;
  border-radius: 20px;
}

.slider-small:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 36px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  z-index: 2;
  border-radius: 15px;
}

input:checked + .slider-small {
  background-color: #ebc217; /* Giallo */
}

input:checked + .slider-small:before {
  transform: translateX(38px);
}

.switch-small .text {
  position: absolute;
  top: 50%;
  width: 50%;
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition: .4s;
  font-size: 8px;
  font-weight: 700;
  z-index: 3;
  color: #1a1a2e;
}

.switch-small .text.on {
  left: 50%;
  opacity: 0;
}

.switch-small .text.off {
  left: 0;
  opacity: 1;
}

input:checked ~ .text.on {
  opacity: 1;
}

input:checked ~ .text.off {
  opacity: 0;
}

.switch-small input:checked + .slider-small {
  background-color: #2c4999; /* Blue for ON */
}

.switch-small .slider-small {
  background-color: #ebc217; /* Yellow for OFF */
}

/* space Grotesk or Inter font-family for strong */
.btn-space strong {
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 0 0 4px white;
}

/* space Grotesk or Inter font-family for strong */
.btn-space strong {
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 0 0 4px white;
}


/* SPACE Button Styles */
.btn-space-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  width: 100%;
}

.btn-space {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 13rem;
  overflow: hidden;
  height: 3rem;
  background-size: 300% 300%;
  cursor: pointer;
  backdrop-filter: blur(1rem);
  border-radius: 5rem;
  transition: 0.5s;
  animation: gradient_301 5s ease infinite;
  border: double 4px transparent;
  background-image: linear-gradient(#212121, #212121),
    linear-gradient(
      137.48deg,
      #ffdb3b 10%,
      #fe53bb 45%,
      #8f51ea 67%,
      #0044ff 87%
    );
  background-origin: border-box;
  background-clip: content-box, border-box;
  position: relative;
}

#container-stars {
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: 0.5s;
  backdrop-filter: blur(1rem);
  border-radius: 5rem;
}

.btn-space strong {
  z-index: 2;
  font-family: "Avalors Personal Use", sans-serif;
  font-size: 12px;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 0 0 4px white;
}

#glow {
  position: absolute;
  display: flex;
  width: 12rem;
}

.circle {
  width: 100%;
  height: 30px;
  filter: blur(2rem);
  animation: pulse_3011 4s infinite;
  z-index: -1;
}

.circle:nth-of-type(1) {
  background: rgba(254, 83, 186, 0.636);
}

.circle:nth-of-type(2) {
  background: rgba(142, 81, 234, 0.704);
}

.btn-space:hover #container-stars {
  z-index: 1;
  background-color: #212121;
}

.btn-space:hover {
  transform: scale(1.1);
}

.btn-space:active {
  border: double 4px #fe53bb;
  background-origin: border-box;
  background-clip: content-box, border-box;
  animation: none;
}

.btn-space:active .circle {
  background: #fe53bb;
}

#stars {
  position: relative;
  background: transparent;
  width: 200rem;
  height: 200rem;
}

#stars::after {
  content: "";
  position: absolute;
  top: -10rem;
  left: -100rem;
  width: 100%;
  height: 100%;
  animation: animStarRotate 90s linear infinite;
}

#stars::after {
  background-image: radial-gradient(#ffffff 1px, transparent 1%);
  background-size: 50px 50px;
}

#stars::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 170%;
  height: 500%;
  animation: animStar 60s linear infinite;
}

#stars::before {
  background-image: radial-gradient(#ffffff 1px, transparent 1%);
  background-size: 50px 50px;
  opacity: 0.5;
}

@keyframes animStar {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-135rem);
  }
}

@keyframes animStarRotate {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0);
  }
}

@keyframes gradient_301 {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse_3011 {
  0% {
    transform: scale(0.75);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }

  100% {
    transform: scale(0.75);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* Sidebar Report Button Styles */
.sidebar-report-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
}

.btn-space-sidebar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
  height: 2.6rem;
  background-size: 300% 300%;
  cursor: pointer;
  backdrop-filter: blur(1rem);
  border-radius: 5rem;
  transition: 0.5s;
  animation: gradient_301 5s ease infinite;
  border: double 4px transparent;
  background-image: linear-gradient(#212121, #212121),
    linear-gradient(
      137.48deg,
      #ffdb3b 10%,
      #fe53bb 45%,
      #8f51ea 67%,
      #0044ff 87%
    );
  background-origin: border-box;
  background-clip: content-box, border-box;
  position: relative;
  text-decoration: none;
  min-width: 160px;
}

.btn-space-sidebar strong {
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: #ffffff !important;
  text-shadow: 0 0 4px white;
}

.btn-space-sidebar:hover #container-stars {
  z-index: 1;
  background-color: #212121;
}

.btn-space-sidebar:hover {
  transform: scale(1.05);
}

/* RIMOZIONE ELEMENTI INDESIDERATI */
.tpl-modal, 
#tpl-modal,
.infra-modal-v2,
#infra-modal-new {
    display: none !important;
}
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
.close-modal:hover {
    color: #2c4999;
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    color: #2c4999;
    margin-bottom: 20px;
    font-weight: 700;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #2c4999;
    color: white;
    box-shadow: 0 4px 12px rgba(44, 73, 153, 0.2);
}

.infra-list {
    max-height: 350px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 5px;
}

.infra-item {
    background: #f8faff;
    padding: 18px;
    border-radius: 15px;
    border-left: 5px solid #2c4999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    cursor: pointer;
}

.infra-item:hover {
    transform: translateY(-3px);
    background: #f0f4ff;
}

.infra-item h4 {
    margin: 0 0 8px 0;
    color: #1a1a2e;
    font-size: 1.1rem;
}

.infra-item p {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.infra-item .badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}


/* === OVERRIDE SOLO PULSANTE "ANALISI INFRASTRUTTURALE" === */
#btn-visualizza-infra.infra-button{
  background-color: #2c4999 !important;
  border-color: #2c4999 !important;
  color: #ffffff !important;
  transform: none !important;
  box-shadow: none !important;
}
#btn-visualizza-infra.infra-button *{
  color: inherit !important;
}
#btn-visualizza-infra.infra-button:hover{
  background-color: #ebc217 !important; /* giallo */
  border-color: #ebc217 !important;
  color: #2c4999 !important;           /* blu */
  transform: none !important;
  box-shadow: none !important;
}
#btn-visualizza-infra.infra-button:active{
  transform: none !important;
}

/* From Uiverse.io by wilsondesouza */ 
ul {
  list-style: none;
}

.example-2 {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 0;
  margin-top: 15px;
}
.example-2 .icon-content {
  margin: 0 15px 0 0;
  position: relative;
}
.example-2 .icon-content .tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 100;
}
.example-2 .icon-content:hover .tooltip {
  opacity: 1;
  visibility: visible;
  top: -50px;
}
.example-2 .icon-content a {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: #4d4d4d;
  background-color: #fff;
  transition: all 0.3s ease-in-out;
  border: 1px solid #e1e8f5;
}
.example-2 .icon-content a:hover {
  box-shadow: 3px 2px 45px 0px rgb(0 0 0 / 12%);
}
.example-2 .icon-content a svg {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
}
.example-2 .icon-content a:hover {
  color: white;
}
.example-2 .icon-content a .filled {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background-color: #000;
  transition: all 0.3s ease-in-out;
}
.example-2 .icon-content a:hover .filled {
  height: 100%;
}

.example-2 .icon-content a[data-social="linkedin"] .filled,
.example-2 .icon-content a[data-social="linkedin"] ~ .tooltip {
  background-color: #0274b3;
}

.example-2 .icon-content a[data-social="instagram"] .filled,
.example-2 .icon-content a[data-social="instagram"] ~ .tooltip {
  background: linear-gradient(
    45deg,
    #405de6,
    #5b51db,
    #b33ab4,
    #c135b4,
    #e1306c,
    #fd1f1f
  );
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #2c4999;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none !important;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.mobile-nav.active {
    display: flex !important;
}

.mobile-nav a {
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
    color: #2c4999;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f0f4ff;
    transition: background 0.2s;
}

.mobile-nav a:hover {
    background: #f0f4ff;
}

/* Tablet Landscape (1024px) */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .how-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .info-grid {
        gap: 2rem;
    }
    
    .info-card {
        flex: 1 1 calc(50% - 1rem);
    }
    
    .qa-section {
        padding: 4rem 1.5rem;
    }
    
    .explanatory-section {
        padding: 5rem 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1.5rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .hero {
        padding-top: 80px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .map-section {
        flex-direction: column;
    }
    
    .map-content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        order: 2;
    }
    
    #map {
        height: 350px;
        order: 1;
        width: 100%;
        position: relative !important;
    }
    
    .map-container {
        order: 1;
        height: 350px !important;
        flex: none !important;
    }

    .map-content-wrapper {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .sidebar {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        order: 2;
        border-left: none !important;
        border-top: 1px solid #eef2f7 !important;
    }

    .map-section {
        height: auto !important;
        min-height: 100vh !important;
    }
    
    .data-columns {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        flex: 1 1 100%;
    }
    
    .how-it-works {
        padding: 4rem 1rem;
    }
    
    .qa-section {
        padding: 3rem 1rem;
    }
    
    .qa-item {
        padding: 1rem 1.25rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .example-2 {
        justify-content: center;
    }
    
    /* PriceLens responsive */
    .pricelens-main {
        flex-direction: column;
    }
    
    .pricelens-form-section {
        width: 100%;
        padding: 1.5rem;
    }
    
    .pricelens-map-section {
        width: 100%;
        height: 300px;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Large (600px) */
@media (max-width: 600px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .nav-logo-img {
        height: 35px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .sidebar-content {
        padding: 0.75rem;
    }
    
    .sidebar-section {
        padding: 0.75rem;
    }
    
    .section-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .section-title-inline {
        font-size: 0.9rem;
    }
    
    .price-chart-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chart-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .case-kpi-row {
        flex-wrap: wrap;
    }
    
    .case-kpi-box {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
    .ranking-table-container {
        font-size: 0.85rem;
    }
    
    .rank-table th, 
    .rank-table td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .comparator-form {
        flex-direction: column;
    }
    
    .comparator-input-group {
        width: 100%;
    }
    
    .explanatory-section {
        padding: 3rem 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .qa-question {
        font-size: 1rem;
    }
    
    .qa-answer {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 2rem 1rem;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
    }
    
    /* Scopri Quartiere Widget */
    #scopri-quartiere-widget {
        padding: 1.5rem !important;
        margin-bottom: 2rem;
    }
    
    #scopri-quartiere-widget h2 {
        font-size: 1.5rem;
    }
}

/* Mobile Small (480px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    #map {
        height: 40vh;
    }
    
    .sidebar {
        max-height: none;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-card {
        padding: 0.75rem;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .ml-cookie-popup {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 12px;
        width: min(260px, calc(100% - 32px));
    }
    
    .ml-cookie-card {
        padding: 12px;
    }
    
    .mobile-nav {
        top: 55px;
    }
    
    .table-cta-container {
        padding: 1rem;
    }
    
    .table-cta-text {
        font-size: 0.9rem;
    }
    
    /* Fix overflow on mobile */
    body {
        overflow-x: hidden;
    }
    
    .hero-content {
        width: 100%;
        padding: 0 0.5rem;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .qa-item:hover {
        background: #f8faff;
    }
    
    .nav-links a:hover,
    .footer-col a:hover {
        color: inherit;
    }
    
    .cta-button:hover {
        transform: none;
    }
}

/* =====================================================
   NAVBAR: keep main links visible on mobile
   ===================================================== */
/*
  We intentionally keep the central links (Home / Mappa / PriceLens)
  visible on mobile, without using the hamburger menu.
  Some responsive rules were setting `.nav-links { display: none; }`
  under 768px, which made the navbar empty on mobile.
*/

@media (max-width: 768px) {
    .nav-links {
        display: flex !important;
        position: static !important;
        transform: none !important;
        gap: 1.2rem;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Keep layout clean on small screens */
    .navbar {
        justify-content: center !important;
        padding: 0.5rem 1rem !important;
    }

    .logo-container {
        display: none;
    }
}


/* Ensure Leaflet map fills its container */
#map{height:100%;}


@media (max-width: 768px) {
  /* Force stack layout even if desktop rules set grid */
  .map-content-wrapper { grid-template-columns: 1fr !important; }
  .sidebar, #map { position: relative !important; top: auto !important; }
}



/* === ML PATCH: header sempre visibile + nav links sempre visibili su mobile === */
header{
  position: sticky !important;
  top: 0;
  z-index: 10000;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(6px);
}

.nav-links{
  display: flex !important;
}

@media (max-width: 900px){
  header{
    padding: 10px 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-links{
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  .nav-links a{
    white-space: nowrap;
  }
  .logo img{
    max-height: 44px;
    width: auto;
  }
}

/* Leaflet: evita rendering "tagliato" in contenitori flex */
.leaflet-container{ width:100%; height:100%; }


/* ===== HERO SEARCH: force full-width bar on desktop/tablet+ =====
   NOTE: We DO NOT rely on #hero id (may not exist). We target the actual DOM:
   .scopri-quartiere-btn-container > .search-box.hero-search-box
   and override any max-width constraints that keep it ~301px.
*/
@media (min-width: 700px) {
  /* allow the container to expand */
  .scopri-quartiere-btn-container{
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  /* make the whole search widget (input + button) as wide as you want */
  .scopri-quartiere-btn-container .search-box.hero-search-box{
    width: 1600px !important;
    max-width: 95vw !important;
    flex: 0 0 auto !important;
  }

  /* make input fill the available space */
  .scopri-quartiere-btn-container .search-box.hero-search-box #hero-search-input{
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* keep the icon button fixed */
  .scopri-quartiere-btn-container .search-box.hero-search-box #hero-search-btn{
    flex: 0 0 auto !important;
  }
}

/* Regola aggiuntiva per forzare la larghezza su schermi grandi */
@media (min-width: 1200px) {
  .scopri-quartiere-btn-container .search-box.hero-search-box{
    width: 1600px !important;
    max-width: 1600px !important;
  }
}



/* === COOKIE POPUP COMPACT PATCH (FOR PAGES WITHOUT INLINE COOKIE CSS) === */
.ml-cookie-popup{max-width:360px!important;width:360px!important;border-radius:14px!important}
.ml-cookie-card{padding:16px 18px!important}
.ml-cookie-title{font-size:1.05rem!important;font-weight:700!important}
.ml-cookie-text{font-size:.85rem!important;line-height:1.45!important;margin-bottom:12px!important}
.ml-cookie-divider{margin:10px 0!important}
.ml-cookie-actions{display:flex!important;gap:8px!important;justify-content:flex-end!important;align-items:center!important}
.ml-cookie-btn{padding:6px 14px!important;font-size:.75rem!important;border-radius:999px!important;font-weight:600!important;letter-spacing:.4px!important}
.ml-cookie-btn-primary{padding:6px 16px!important}
.ml-cookie-btn-secondary{opacity:.9!important}
@media (max-width:768px){
  .ml-cookie-popup{width:calc(100% - 32px)!important;max-width:calc(100% - 32px)!important;right:16px!important;bottom:16px!important}
}


/* === COOKIE POPUP COMPACT PATCH v2 (HALF SIZE) === */
.ml-cookie-popup {
    max-width: 240px !important;
    width: 240px !important;
    border-radius: 12px !important;
}

.ml-cookie-card {
    padding: 12px 14px !important;
}

.ml-cookie-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

.ml-cookie-text {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
}

.ml-cookie-divider {
    margin: 8px 0 !important;
}

.ml-cookie-actions {
    display: flex !important;
    gap: 6px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.ml-cookie-btn {
    padding: 6px 12px !important;
    font-size: 0.70rem !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    white-space: nowrap !important;
}

.ml-cookie-btn-primary {
    padding: 6px 14px !important;
}

@media (max-width: 768px) {
    .ml-cookie-popup {
        width: calc(100% - 32px) !important;
        max-width: calc(100% - 32px) !important;
        right: 16px !important;
        bottom: 16px !important;
    }
}
