/* ==========================================================================
   TEOREMA RE - DESIGN SYSTEM & STILE UNIFICATO
   Agenzia Immobiliare di Franco Perissinotto - Annone Veneto (VE)
   Tipografia: Outfit (Headings) & Plus Jakarta Sans (Body)
   Palette: Navy Blue (#072a44, #0a3d62, #1e5f8a), Ambra/Oro (#d97706), WhatsApp (#25d366)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0a3d62;
    --primary-dark: #072a44;
    --primary-light: #1e5f8a;
    --accent: #d97706;
    --accent-hover: #b45309;
    --wa-green: #25d366;
    --wa-hover: #1eb956;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 6px 20px rgba(10,61,98,0.08);
    --shadow-lg: 0 12px 35px rgba(10,61,98,0.12);
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-title, .property-price, .counter-number {
    font-family: 'Outfit', sans-serif;
}

/* ==========================================================================
   1. TOPBAR ISTITUZIONALE
   ========================================================================== */
.topbar {
    background: var(--primary-dark);
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-container {
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.topbar-info a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}
.topbar-info a:hover {
    color: #fff;
}
.admin-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.admin-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==========================================================================
   2. MAIN NAVBAR
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.nav-container {
    max-width: 1200px;
    margin: auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.brand-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(10,61,98,0.25);
    font-family: 'Outfit', sans-serif;
}
.brand-logo-img {
    height: 46px;
    width: auto;
    max-height: 46px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.brand:hover .brand-logo-img {
    transform: scale(1.03);
}
.brand-text h1, .brand-text .brand-title {
    font-size: 1.35rem;
    color: var(--primary-dark);
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    display: block;
}
.brand-text span, .brand-text .brand-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 22px;
}
.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding: 4px 0;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}
.btn-header-wa {
    background: var(--wa-green);
    color: #fff !important;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(37,211,102,0.25);
    transition: transform 0.2s, background 0.2s;
}
.btn-header-wa:hover {
    background: var(--wa-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   3. HERO BANNER INTERNO PAGINE
   ========================================================================== */
.page-hero {
    position: relative;
    background: linear-gradient(145deg, #072a44 0%, #0a3d62 65%, #1e5f8a 100%);
    color: #fff;
    padding: 50px 20px;
    overflow: hidden;
    text-align: center;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(217, 119, 6, 0.15) 0%, transparent 60%);
    pointer-events: none;
}
.page-hero-container {
    max-width: 1100px;
    margin: auto;
    position: relative;
    z-index: 2;
}
.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #fde68a;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.15);
}
.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}
.page-hero p {
    font-size: 1.15rem;
    color: #cbd5e1;
    max-width: 720px;
    margin: auto;
    line-height: 1.6;
}

/* ==========================================================================
   3.1 BARRA CONTATORI ISTITUZIONALI
   ========================================================================== */
.counters-bar {
    background: #ffffff;
    margin-top: -40px;
    position: relative;
    z-index: 10;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 30px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
    text-align: center;
    border: 1px solid var(--border);
}
.counter-item {
    padding: 10px 15px;
    border-right: 1px solid var(--border);
}
.counter-item:last-child {
    border-right: none;
}
.counter-num {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    margin-bottom: 6px;
}
.counter-desc {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.35;
}

/* ==========================================================================
   4. LAYOUT CONTENUTI & GRIGLIA
   ========================================================================== */
.main-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ==========================================================================
   5. CARDS IMMOBILI (Catalogo & Vetrina)
   ========================================================================== */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 28px;
}
.property-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.property-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.property-image-wrap {
    position: relative;
    height: 220px;
    background: #e2e8f0;
    overflow: hidden;
}
.property-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.property-card:hover .property-image {
    transform: scale(1.05);
}
.property-badge-contract {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(10,61,98,0.92);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
.property-badge-ref {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15,23,42,0.85);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}
.property-content {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.property-location {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.property-title {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
}
.property-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.spec-col strong {
    color: var(--text-main);
}
.property-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.property-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}
.btn-view-prop {
    background: var(--bg-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
}
.property-card:hover .btn-view-prop {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
footer {
    background: #071c2e;
    color: #94a3b8;
    padding: 60px 20px 30px 20px;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 60px;
}
.footer-grid {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 18px;
}
.footer-col p {
    line-height: 1.8;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #fff;
}
.footer-bottom {
    max-width: 1200px;
    margin: auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
}

/* ==========================================================================
   7. FLOATING WHATSAPP
   ========================================================================== */
.floating-wa {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--wa-green);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.45);
    z-index: 999;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s;
}
.floating-wa:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37,211,102,0.6);
}

/* BOTTONE HAMBURGER MOBILE ACCORDION */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.25s ease;
}
.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}
.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}
.admin-link-mobile {
    display: none;
}

/* Sezione Chi Siamo / Pagina Istituzionale */
.about-intro-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 45px;
    align-items: start;
    margin-bottom: 70px;
}
.about-contact-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 35px 28px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 90px;
}

/* Filtri Catalogo */
.catalog-filter-box {
    background: #fff;
    padding: 25px 30px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 40px;
}
.filter-accordion-toggle {
    display: none;
}
.catalog-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) auto;
    gap: 15px;
    align-items: end;
}
.filter-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 900px) {
    /* RIMUOVI PRIMA FASCIA BLU SU MOBILE */
    .topbar {
        display: none !important;
    }

    /* NAVBAR ACCORDION MOBILE */
    .site-header {
        padding: 0;
    }
    .nav-container {
        flex-wrap: wrap;
        padding: 10px 15px;
        align-items: center;
    }
    .brand {
        gap: 8px;
    }
    .brand-badge {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
        border-radius: 8px;
    }
    .brand-logo-img {
        height: 38px;
        max-height: 38px;
    }
    .brand-text h1, .brand-text .brand-title {
        font-size: 1.1rem;
    }
    .brand-text span, .brand-text .brand-sub {
        font-size: 0.65rem;
    }

    .menu-toggle {
        display: flex;
    }

    /* MENU A FISARMONICA (ACCORDION) */
    .nav-menu {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s ease-in-out, opacity 0.25s ease-in-out;
        background: #ffffff;
        border-top: 1px solid transparent;
        padding: 0;
        margin-top: 6px;
    }
    .nav-menu.open {
        max-height: 480px;
        opacity: 1;
        visibility: visible;
        border-top: 1px solid var(--border);
        padding: 10px 0 15px 0;
    }
    .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 12px 14px;
        font-size: 0.98rem;
        font-weight: 600;
        border-radius: 8px;
        border-bottom: 1px solid #f1f5f9;
        color: var(--text-main);
    }
    .nav-link:hover, .nav-link.active {
        background: #f8fafc;
        color: var(--primary);
    }
    .btn-header-wa {
        margin-top: 12px;
        justify-content: center;
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
    }
    .admin-link-mobile {
        display: block;
        text-align: center;
        margin-top: 12px;
        padding: 8px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.82rem;
        font-weight: 600;
    }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .page-hero h1 { font-size: 1.85rem; }
    .about-intro-grid { grid-template-columns: 1fr; gap: 35px; margin-bottom: 45px; }
    .about-contact-card { position: static; top: auto; padding: 28px 20px; }
    .about-intro-grid h2 { font-size: 1.75rem !important; }

    /* Filtri Catalogo Accordion Mobile (chiuso di default) */
    .catalog-filter-box { padding: 14px 18px; margin-bottom: 25px; }
    .filter-accordion-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: transparent;
        border: none;
        padding: 4px 0;
        cursor: pointer;
        font-family: inherit;
        color: var(--primary-dark);
        font-size: 1.05rem;
        font-weight: 700;
        text-align: left;
    }
    .filter-toggle-left { display: flex; align-items: center; gap: 8px; }
    .filter-toggle-arrow {
        font-size: 1.25rem;
        transition: transform 0.25s ease;
        color: var(--text-muted);
        line-height: 1;
    }
    .filter-accordion-toggle.active .filter-toggle-arrow {
        transform: rotate(180deg);
        color: var(--primary);
    }
    .filter-badge-count {
        background: #e0f2fe;
        color: #0369a1;
        font-size: 0.72rem;
        padding: 2px 8px;
        border-radius: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .filter-accordion-content {
        display: none;
        padding-top: 16px;
        margin-top: 12px;
        border-top: 1px solid var(--border);
    }
    .filter-accordion-content.open { display: block; }
    .catalog-filter-form { grid-template-columns: 1fr; gap: 14px; }
    .filter-actions { display: flex; gap: 10px; margin-top: 5px; }
    .filter-actions button, .filter-actions a { flex: 1; text-align: center; justify-content: center; }
}
