/**
 * IONIO RE-SOLUTIONS - Mobile Styles
 * CSS pulito e ottimizzato per dispositivi mobili
 * Breakpoint principale: 768px
 */

/* ============================================
   VARIABILI E BASE
   ============================================ */

@media screen and (max-width: 768px) {
    :root {
        --header-height: 60px;
        --spacing-sm: 12px;
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 16px;
    }
}

/* Previene zoom su input iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Safe area per notch */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ============================================
   HEADER MOBILE
   ============================================ */

@media screen and (max-width: 768px) {
    .header {
        height: var(--header-height);
        padding: 0;
    }

    .header-container {
        padding: 0 var(--spacing-sm);
    }

    /* Logo */
    .logo img {
        height: 32px;
    }

    /* Header actions */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Telefono - solo icona */
    .header-phone {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        background: rgba(36, 87, 139, 0.1);
        border-radius: var(--radius-sm);
    }

    .header-phone span {
        display: none;
    }

    .header-phone svg {
        width: 20px;
        height: 20px;
    }

    /* WhatsApp verde */
    .header-whatsapp {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #25D366;
        border-radius: var(--radius-sm);
        color: white;
    }

    .header-whatsapp svg {
        width: 22px;
        height: 22px;
    }

    /* Hamburger */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 8px;
        width: 40px;
        height: 40px;
        justify-content: center;
        align-items: center;
        background: transparent;
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--dark, #1e293b);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

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

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

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

/* ============================================
   MENU MOBILE - Fullscreen dall'alto
   ============================================ */

@media screen and (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: white;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s;
        z-index: 1000;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        padding-top: calc(var(--header-height) + 20px);
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Lista navigazione centrata */
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 30px var(--spacing-lg);
        align-items: center;
        text-align: center;
    }

    .nav-list li {
        width: 100%;
        max-width: 300px;
    }

    .nav-link {
        display: block;
        padding: 18px 20px;
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--dark, #1e293b);
        border-bottom: 1px solid #f0f0f0;
        transition: color 0.2s, background 0.2s;
    }

    .nav-link:hover,
    .nav-link:active {
        color: var(--primary, #24578B);
        background: rgba(36, 87, 139, 0.05);
    }

    .nav-link.active {
        color: var(--primary, #24578B);
    }

    .nav-list li:last-child .nav-link {
        border-bottom: none;
    }

    /* Dropdown - inline sotto il link */
    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown .nav-link {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .nav-dropdown .nav-link::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.3s;
        flex-shrink: 0;
    }

    .nav-dropdown.open .nav-link::after {
        transform: rotate(-135deg);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        padding: 0;
        background: #f8f9fa;
        border-radius: var(--radius-sm);
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        border-bottom: none;
    }

    .dropdown-menu a {
        display: block;
        padding: 14px 20px;
        font-size: 1rem;
        font-weight: 500;
        color: var(--gray, #64748b);
        text-align: center;
    }

    .dropdown-menu a:hover,
    .dropdown-menu a:active {
        color: var(--primary, #24578B);
        background: rgba(36, 87, 139, 0.08);
    }

    /* Contatti rapidi nel menu */
    .nav-contact {
        margin-top: auto;
        padding: 30px var(--spacing-lg);
        border-top: 1px solid #f0f0f0;
        text-align: center;
    }

    .nav-contact a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 24px;
        margin: 6px;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .nav-contact .nav-phone {
        background: rgba(36, 87, 139, 0.1);
        color: var(--primary, #24578B);
    }

    .nav-contact .nav-whatsapp {
        background: #25D366;
        color: white;
    }
}

/* ============================================
   HERO MOBILE - Compatto, ricerca secondaria
   ============================================ */

@media screen and (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 24px) var(--spacing-md) var(--spacing-lg);
    }

    /* Nascondi elementi decorativi */
    .hero-shapes,
    .hero-image {
        display: none;
    }

    .hero-content {
        padding: 0;
    }

    /* Testo hero - primo focus */
    .hero-text {
        margin-bottom: var(--spacing-lg);
        text-align: center;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
        margin-bottom: var(--spacing-sm);
    }

    .hero-title {
        font-size: 1.6rem;
        line-height: 1.25;
        margin-bottom: var(--spacing-sm);
    }

    .hero-title br {
        display: none;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
        color: var(--gray, #64748b);
    }

    /* Hero Bottom Bar - Solo Social su mobile */
    .hero-bottom-bar {
        padding: 10px 16px;
        margin: 12px auto 16px;
        border-radius: var(--radius-full);
    }

    .hero-divider {
        display: none;
    }

    /* Nascondi stats su mobile */
    .hero-stats {
        display: none;
    }

    /* Search box - secondario, sotto le stats */
    .search-box {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .search-tabs {
        display: flex;
        gap: 6px;
        margin-bottom: var(--spacing-sm);
        background: #f5f5f5;
        padding: 4px;
        border-radius: var(--radius-sm);
    }

    .search-tab {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 6px;
        text-align: center;
        background: transparent;
        color: var(--gray, #64748b);
        font-weight: 600;
    }

    .search-tab.active {
        background: white;
        color: var(--primary, #24578B);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    /* Campi compatti su 2 colonne */
    .search-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .search-field {
        width: 100%;
    }

    .search-field label {
        display: none;
    }

    .search-field select {
        width: 100%;
        padding: 11px 28px 11px 12px;
        font-size: 14px;
        border-radius: var(--radius-sm);
        background-color: #f8f9fa;
        border: 1px solid #e8e8e8;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
    }

    .search-btn {
        grid-column: 1 / -1;
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }

    .search-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Hero Social Links - Mobile */
    .hero-social {
        justify-content: center;
    }

    .hero-social-label {
        font-size: 0.75rem;
    }

    .hero-social-link {
        width: 32px;
        height: 32px;
    }

    .hero-social-link svg {
        width: 17px;
        height: 17px;
    }

    /* Footer Social Links - Mobile */
    .footer-social {
        margin-top: 1rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-link {
        width: 38px;
        height: 38px;
    }

    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* Schermi molto piccoli */
@media screen and (max-width: 380px) {
    .hero-title {
        font-size: 1.4rem;
    }

    .search-fields {
        grid-template-columns: 1fr;
    }

    .hero-bottom-bar {
        padding: 8px 12px;
    }

    .hero-social {
        gap: 0.4rem;
    }

    .hero-social-label {
        font-size: 0.65rem;
    }

    .hero-social-link {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   SEZIONI GENERICHE
   ============================================ */

@media screen and (max-width: 768px) {
    .section {
        padding: 40px 0;
    }

    .section-header {
        margin-bottom: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }

    .section-label {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

/* ============================================
   SLIDER ARROWS - Frecce navigazione
   ============================================ */

@media screen and (max-width: 768px) {
    /* Container slider con frecce */
    .slider-container {
        position: relative;
    }

    .slider-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        background: white;
        border: none;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.2s ease;
    }

    .slider-arrow svg {
        width: 18px;
        height: 18px;
        color: var(--dark, #1e293b);
    }

    .slider-arrow:active {
        transform: translateY(-50%) scale(0.95);
        background: #f0f0f0;
    }

    .slider-arrow-left {
        left: 6px;
    }

    .slider-arrow-right {
        right: 6px;
    }

    .slider-arrow:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
}

/* ============================================
   SLIDER ORIZZONTALI - Fix scroll verticale
   ============================================ */

@media screen and (max-width: 768px) {
    /* Wrapper per contenere gli slider */
    .properties-section .container,
    .why-section .container,
    .testimonials-section .container {
        padding: 0;
    }

    .properties-section .section-header,
    .why-section .section-header,
    .testimonials-section .section-header {
        padding: 0 var(--spacing-md);
    }

    /* Stile comune per slider orizzontali - con padding per centratura */
    .properties-grid,
    .why-grid,
    .testimonials-slider {
        display: flex;
        gap: var(--spacing-sm);
        /* Padding laterale per far vedere parzialmente le card adiacenti */
        padding: 8px calc(50% - 135px) 20px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
    }

    .properties-grid::-webkit-scrollbar,
    .why-grid::-webkit-scrollbar,
    .testimonials-slider::-webkit-scrollbar {
        display: none;
    }

    /* Property cards - centrate con snap */
    .property-card {
        flex: 0 0 270px;
        scroll-snap-align: center;
        margin: 0;
    }

    .property-image {
        height: 170px;
    }

    .property-badge {
        top: 10px;
        left: 10px;
        padding: 5px 10px;
        font-size: 0.65rem;
    }

    .property-price {
        bottom: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 0.95rem;
    }

    .property-content {
        padding: 14px;
    }

    .property-title {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }

    .property-location {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .property-features {
        gap: 12px;
        padding-top: 10px;
    }

    .property-feature {
        font-size: 0.75rem;
    }

    /* Properties tabs */
    .properties-tabs {
        display: flex;
        gap: 8px;
        padding: 0 var(--spacing-md);
        margin-bottom: var(--spacing-md);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .properties-tabs::-webkit-scrollbar {
        display: none;
    }

    .properties-tab {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Section CTA */
    .section-cta {
        margin-top: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }

    .section-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   WHY CARDS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Why grid con centratura */
    .why-grid {
        padding: 8px calc(50% - 110px) 20px;
    }

    .why-card {
        flex: 0 0 220px;
        scroll-snap-align: center;
        padding: 20px 16px;
    }

    .why-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }

    .why-icon svg {
        width: 24px;
        height: 24px;
    }

    .why-card h3 {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .why-card p {
        font-size: 0.8rem;
        line-height: 1.5;
    }
}

/* ============================================
   TESTIMONIALS
   ============================================ */

@media screen and (max-width: 768px) {
    /* Testimonials con centratura */
    .testimonials-slider {
        padding: 8px calc(50% - 140px) 20px;
    }

    .testimonial-card {
        flex: 0 0 280px;
        scroll-snap-align: center;
        padding: 18px;
    }

    .testimonial-stars {
        margin-bottom: 10px;
    }

    .testimonial-stars svg {
        width: 14px;
        height: 14px;
    }

    .testimonial-text {
        font-size: 0.85rem;
        margin-bottom: 14px;
        line-height: 1.6;
    }

    .testimonial-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .testimonial-info strong {
        font-size: 0.9rem;
    }

    .testimonial-info span {
        font-size: 0.75rem;
    }
}

/* ============================================
   CTA SECTION
   ============================================ */

@media screen and (max-width: 768px) {
    .cta-section {
        padding: 40px var(--spacing-md);
    }

    .cta-content h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .cta-content p {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-lg);
    }

    .cta-buttons {
        flex-direction: column;
        gap: 10px;
        max-width: 300px;
        margin: 0 auto;
    }

    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   CONTACT SECTION
   ============================================ */

@media screen and (max-width: 768px) {
    .contact-section {
        padding: 40px var(--spacing-md);
    }

    .contact-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .contact-info .section-label,
    .contact-info .section-title {
        text-align: center;
    }

    .contact-info > p {
        text-align: center;
        margin-bottom: var(--spacing-lg);
    }

    .contact-details {
        gap: 10px;
    }

    .contact-item {
        padding: 14px;
    }

    .contact-icon {
        width: 42px;
        height: 42px;
    }

    .contact-icon svg {
        width: 18px;
        height: 18px;
    }

    .contact-item div strong {
        font-size: 0.75rem;
    }

    .contact-item div span {
        font-size: 0.85rem;
    }

    .founder-info {
        padding: 14px;
    }

    .founder-avatar {
        width: 46px;
        height: 46px;
        font-size: 0.9rem;
    }

    .contact-map {
        height: 220px;
        border-radius: var(--radius-md);
    }
}

/* ============================================
   FOOTER
   ============================================ */

@media screen and (max-width: 768px) {
    .footer {
        padding: 40px var(--spacing-md) 30px;
    }

    .footer-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .footer-brand {
        text-align: center;
    }

    .footer-logo {
        height: 45px;
        margin: 0 auto 12px;
    }

    .footer-brand p {
        font-size: 0.85rem;
    }

    .footer-social {
        justify-content: center;
        margin-top: 14px;
    }

    .footer-links,
    .footer-contact {
        text-align: center;
    }

    .footer-links h4,
    .footer-contact h4 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .footer-links ul {
        gap: 8px;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .footer-contact p {
        font-size: 0.85rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding-top: var(--spacing-md);
    }

    .footer-bottom p {
        font-size: 0.75rem;
    }
}

/* ============================================
   MOBILE ACTION BAR - Nascosta
   ============================================ */

.mobile-action-bar {
    display: none !important;
}

/* ============================================
   IMMOBILI LIST PAGE
   ============================================ */

@media screen and (max-width: 768px) {
    /* Page header compatto - override inline styles */
    .page-header {
        padding: calc(var(--header-height) + 16px) var(--spacing-md) 16px !important;
        margin-top: 0 !important;
    }

    .page-header .breadcrumb {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
    }

    .page-header h1,
    .page-header .page-title {
        font-size: 1.3rem !important;
        margin-bottom: 4px !important;
    }

    .page-header p,
    .page-header .page-subtitle {
        font-size: 0.8rem !important;
        margin-bottom: 0 !important;
    }

    /* Filtri sidebar - collassabili e compatti */
    .filters-sidebar {
        background: white !important;
        border-radius: var(--radius-md) !important;
        padding: 0 !important;
        margin: 0 var(--spacing-sm) var(--spacing-md) !important;
        border: 1px solid #e8e8e8 !important;
        overflow: hidden !important;
    }

    /* Toggle button per filtri */
    .filters-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 16px;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--dark, #1e293b);
        background: #f8f9fa;
        border: none;
        border-bottom: 1px solid #e8e8e8;
        cursor: pointer;
        text-align: left;
    }

    .filters-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.3s ease;
        color: var(--gray, #64748b);
    }

    .filters-sidebar.open .filters-toggle svg {
        transform: rotate(180deg);
    }

    /* Form collassato di default */
    .filters-form {
        display: none !important;
        padding: var(--spacing-sm) !important;
        margin: 0 !important;
        background: transparent !important;
    }

    .filters-sidebar.open .filters-form {
        display: block !important;
    }

    .filter-group {
        margin-bottom: var(--spacing-sm) !important;
        padding-bottom: var(--spacing-sm) !important;
        border-bottom: 1px solid #f0f0f0;
    }

    .filter-group:last-of-type {
        border-bottom: none;
        margin-bottom: 0 !important;
    }

    .filter-group h4 {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--gray, #64748b) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 8px !important;
    }

    /* Radio options inline */
    .filter-options {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .filter-option {
        display: inline-flex !important;
        align-items: center !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        background: #f5f5f5 !important;
        border-radius: 20px !important;
        border: none !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
    }

    .filter-option input {
        display: none !important;
    }

    .filter-option:has(input:checked),
    .filter-option.active {
        background: var(--primary, #24578B) !important;
        color: white !important;
    }

    .filter-select {
        width: 100% !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: var(--radius-sm) !important;
        background: white !important;
    }

    .filters-form .btn {
        margin-top: var(--spacing-sm) !important;
    }

    .filters-form .btn-block + .btn-block {
        margin-top: 8px !important;
    }

    /* Filters section */
    .filters-section {
        padding: var(--spacing-md);
        background: #f8f9fa;
    }

    .filters-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 14px;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .filters-content {
        display: none;
        margin-top: var(--spacing-md);
    }

    .filters-content.active {
        display: block;
    }

    .filters-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group label {
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        margin-bottom: 4px;
        color: #555;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 11px 12px;
        font-size: 16px;
        border: 1px solid #e0e0e0;
        border-radius: var(--radius-sm);
        background: white;
    }

    /* Lista immobili - griglia 2 colonne */
    .immobili-list .properties-grid,
    .listing-results .properties-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 var(--spacing-sm) 30px;
        overflow-x: visible;
        overflow-y: visible;
        touch-action: auto;
    }

    .immobili-list .property-card,
    .listing-results .property-card {
        flex: none;
        width: 100%;
    }

    /* Card compatte per griglia 2 colonne */
    .immobili-list .property-card .property-image,
    .listing-results .property-card .property-image {
        height: 120px;
    }

    .immobili-list .property-card .property-content,
    .listing-results .property-card .property-content {
        padding: 10px;
    }

    .immobili-list .property-card .property-title,
    .listing-results .property-card .property-title {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .immobili-list .property-card .property-location,
    .listing-results .property-card .property-location {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .immobili-list .property-card .property-features,
    .listing-results .property-card .property-features {
        gap: 8px;
        padding-top: 8px;
    }

    .immobili-list .property-card .property-feature,
    .listing-results .property-card .property-feature {
        font-size: 0.7rem;
    }

    .immobili-list .property-card .property-badge,
    .listing-results .property-card .property-badge {
        padding: 3px 6px;
        font-size: 0.55rem;
        top: 8px;
        left: 8px;
    }

    .immobili-list .property-card .property-price,
    .listing-results .property-card .property-price {
        padding: 4px 8px;
        font-size: 0.8rem;
        bottom: 8px;
        left: 8px;
    }

    /* Filtri compatti */
    .filters-sidebar,
    .filters-form {
        background: #f8f9fa;
        border-radius: var(--radius-md);
        padding: var(--spacing-sm);
        margin: 0 var(--spacing-sm) var(--spacing-md);
    }

    .filter-group {
        margin-bottom: var(--spacing-sm);
    }

    .filter-group h4 {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .filter-options {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-option {
        font-size: 0.75rem;
        padding: 6px 10px;
        background: white;
        border-radius: 6px;
        border: 1px solid #e0e0e0;
    }

    .filter-option.active,
    .filter-option:has(input:checked) {
        background: var(--primary, #24578B);
        color: white;
        border-color: var(--primary, #24578B);
    }

    .filter-select {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: var(--radius-sm);
    }

    .filters-form .btn {
        padding: 10px;
        font-size: 0.85rem;
    }

    /* Pagination */
    .pagination {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: var(--spacing-md);
        flex-wrap: wrap;
    }

    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
        font-size: 0.85rem;
    }

    .pagination a {
        background: white;
        border: 1px solid #e0e0e0;
    }

    .pagination a.active,
    .pagination span.current {
        background: var(--primary, #24578B);
        color: white;
    }

    /* Listing layout */
    .listing-layout {
        display: block;
    }

    .filters-sidebar {
        position: static;
        margin-bottom: var(--spacing-md);
    }

    .listing-header {
        padding: 0 var(--spacing-md);
        margin-bottom: var(--spacing-md);
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .results-count {
        font-size: 0.85rem;
    }

    .listing-sort {
        width: 100%;
    }

    .listing-sort select {
        flex: 1;
        padding: 10px;
        font-size: 16px;
    }
}

/* ============================================
   PROPERTY DETAIL PAGE
   ============================================ */

@media screen and (max-width: 768px) {
    .property-detail {
        padding-top: var(--header-height);
        padding-bottom: 90px;
    }

    .property-detail .container {
        padding: 0;
    }

    .property-detail .breadcrumb {
        padding: 0 var(--spacing-md);
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    /* Gallery - full width senza bordi */
    .property-gallery {
        margin: 0 calc(-1 * var(--spacing-md)) var(--spacing-md);
        width: calc(100% + 2 * var(--spacing-md));
    }

    .gallery-main {
        height: 280px;
        border-radius: 0 !important;
    }

    .gallery-main .property-badge {
        top: 12px !important;
        left: 12px !important;
    }

    .gallery-thumbs {
        display: flex;
        gap: 8px;
        padding: 8px var(--spacing-md);
        overflow-x: auto;
        scrollbar-width: none;
        touch-action: pan-x;
    }

    .gallery-thumbs::-webkit-scrollbar {
        display: none;
    }

    .gallery-thumbs img {
        width: 65px;
        height: 45px;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
        opacity: 0.7;
    }

    .gallery-thumbs img.active {
        opacity: 1;
    }

    /* Property info */
    .property-info,
    .property-main {
        padding: 0 var(--spacing-md);
    }

    .property-layout {
        display: block;
    }

    .property-header {
        margin-bottom: var(--spacing-md);
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .property-code {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .property-detail .property-title {
        font-size: 1.25rem;
    }

    .property-detail .property-location {
        font-size: 0.85rem;
    }

    .property-price-box {
        width: 100%;
        padding: 14px;
        background: linear-gradient(135deg, var(--primary, #24578B), var(--primary-light, #3a7bc8));
        border-radius: var(--radius-md);
        color: white;
        text-align: left;
    }

    .property-price-box .price-label {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.75rem;
    }

    .property-price-box .price-value {
        color: white;
        font-size: 1.4rem;
    }

    /* Specs */
    .property-specs,
    .property-quick-features {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: var(--spacing-md);
        background: #f8f9fa;
        border-radius: var(--radius-md);
        margin-bottom: var(--spacing-lg);
    }

    .property-specs .spec,
    .quick-feature {
        text-align: center;
        padding: 10px;
        background: white;
        border-radius: var(--radius-sm);
    }

    .property-specs .spec-value,
    .quick-feature strong {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--primary, #24578B);
    }

    .property-specs .spec-label,
    .quick-feature span {
        font-size: 0.7rem;
        color: #666;
    }

    /* Description */
    .property-section {
        margin-bottom: var(--spacing-lg);
    }

    .property-section h2 {
        font-size: 1.05rem;
        padding-bottom: 8px;
    }

    .property-description {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    /* Features */
    .features-list,
    .property-amenities {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .features-list li,
    .amenity-item {
        padding: 10px 12px;
        background: #f8f9fa;
        border-radius: var(--radius-sm);
        font-size: 0.85rem;
    }

    /* Details table */
    .details-table {
        border-radius: var(--radius-md);
    }

    .detail-row {
        padding: 12px 14px;
    }

    .detail-label {
        font-size: 0.8rem;
    }

    .detail-value {
        font-size: 0.9rem;
    }

    /* Sidebar */
    .property-sidebar {
        position: static;
        margin-top: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }

    .contact-card {
        padding: 18px;
        border-radius: var(--radius-md);
    }

    .contact-card h3 {
        font-size: 1rem;
    }

    .contact-card > p {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-md);
    }

    .contact-card .form-group input,
    .contact-card .form-group textarea {
        padding: 12px;
        font-size: 16px;
        border-radius: var(--radius-sm);
    }

    /* Button spacing - WhatsApp e altri btn-block */
    .contact-card .btn-block + .btn-block,
    .contact-form-wrapper .btn-block + .btn-block,
    .btn-block + .btn-whatsapp,
    .btn + .btn-whatsapp {
        margin-top: 12px !important;
    }

    .btn-whatsapp {
        background: #25D366 !important;
        color: white !important;
        border: none !important;
    }

    /* Fixed CTA bar */
    .property-cta-fixed {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        gap: 8px;
        padding: 10px var(--spacing-md);
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: white;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    .property-cta-fixed .btn {
        flex: 1;
        justify-content: center;
        padding: 12px;
    }

    /* Lightbox */
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 1.8rem;
    }

    .lightbox-counter {
        bottom: 16px;
        font-size: 0.8rem;
    }
}

/* ============================================
   CHI SIAMO PAGE
   ============================================ */

@media screen and (max-width: 768px) {
    .about-hero {
        padding: calc(var(--header-height) + 30px) var(--spacing-md) 40px;
    }

    .about-hero h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .about-hero p {
        font-size: 0.9rem;
    }

    /* Intro */
    .about-intro {
        padding: 40px var(--spacing-md);
    }

    .about-intro-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .about-intro-image {
        order: -1;
        border-radius: var(--radius-md);
    }

    .about-intro-image img {
        height: 200px;
    }

    .about-intro-content h2 {
        font-size: 1.3rem;
        margin-bottom: 14px;
    }

    .about-intro-content p {
        font-size: 0.85rem;
        line-height: 1.7;
        margin-bottom: 12px;
    }

    /* Values - scrollview orizzontale (override inline styles con !important) */
    .about-values {
        padding: 40px 0 !important;
    }

    .about-values .container {
        padding: 0 !important;
    }

    .about-values .section-header {
        padding: 0 var(--spacing-md) !important;
    }

    .values-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: var(--spacing-sm) !important;
        padding: 8px calc(50% - 130px) 20px !important;
        margin-top: var(--spacing-md) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
    }

    .values-grid::-webkit-scrollbar {
        display: none;
    }

    .value-card {
        flex: 0 0 260px !important;
        scroll-snap-align: center;
        padding: 24px 20px !important;
        border-radius: var(--radius-md) !important;
        width: 260px !important;
        min-width: 260px !important;
    }

    .value-icon {
        width: 56px !important;
        height: 56px !important;
        margin: 0 auto 14px !important;
    }

    .value-icon svg {
        width: 26px !important;
        height: 26px !important;
    }

    .value-card h3 {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }

    .value-card p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    /* Stats */
    .about-stats {
        padding: 40px var(--spacing-md);
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-item {
        padding: 18px 14px;
        text-align: center;
    }

    .stat-item h3 {
        font-size: 1.8rem;
        margin-bottom: 4px;
    }

    .stat-item p {
        font-size: 0.75rem;
    }

    /* Team */
    .about-team {
        padding: 40px var(--spacing-md);
    }

    .team-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: var(--spacing-lg);
    }

    .team-card {
        border-radius: var(--radius-md);
    }

    .team-card-image {
        height: 180px;
    }

    .team-card-content {
        padding: 18px;
    }

    .team-card-content h3 {
        font-size: 1.05rem;
    }

    .team-card-content .role {
        font-size: 0.8rem;
    }

    .team-card-content p {
        font-size: 0.8rem;
    }

    .team-card-socials a {
        width: 36px;
        height: 36px;
    }

    /* Mission */
    .about-mission {
        padding: 40px var(--spacing-md);
    }

    .mission-content h2 {
        font-size: 1.3rem;
        margin-bottom: 14px;
    }

    .mission-content p {
        font-size: 0.85rem;
        line-height: 1.7;
    }

    .mission-content blockquote {
        padding: 20px 18px;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
        margin-top: var(--spacing-lg);
    }

    /* CTA */
    .about-cta {
        padding: 40px var(--spacing-md);
    }

    .about-cta h2 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .about-cta p {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-lg);
    }

    .about-cta .cta-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .about-cta .cta-buttons .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
}

/* ============================================
   CONTATTI PAGE
   ============================================ */

@media screen and (max-width: 768px) {
    .contact-hero,
    .contatti-hero {
        padding: calc(var(--header-height) + 30px) var(--spacing-md) 40px;
    }

    .contact-hero h1,
    .contatti-hero h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .contact-hero p,
    .contatti-hero p {
        font-size: 0.9rem;
    }

    /* Contact section */
    .contatti-content {
        padding: 40px var(--spacing-md);
    }

    .contatti-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .contatti-form {
        order: -1;
    }

    .contatti-form h2 {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-md);
    }

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .form-group {
        width: 100%;
        margin-bottom: 12px;
    }

    .form-group label {
        display: block;
        font-size: 0.8rem;
        font-weight: 500;
        margin-bottom: 4px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border: 1px solid #e0e0e0;
        border-radius: var(--radius-sm);
        background: white;
    }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    .form-checkbox {
        margin-bottom: var(--spacing-md);
    }

    .form-checkbox label {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    .form-submit .btn,
    .contatti-form .btn {
        width: 100%;
        justify-content: center;
    }

    /* Contact form wrapper - sfondo colorato */
    .contact-form-wrapper {
        padding: 20px;
        border-radius: var(--radius-md);
        background: #f8f9fa;
        border: 1px solid #e8ecf0;
    }

    .contact-form-wrapper h2 {
        font-size: 1.2rem;
        margin-bottom: 6px;
        color: var(--dark, #1e293b);
    }

    .contact-form-wrapper > p {
        font-size: 0.85rem;
        margin-bottom: var(--spacing-md);
        color: var(--gray, #64748b);
    }

    .contact-form-wrapper .form-group input,
    .contact-form-wrapper .form-group textarea,
    .contact-form-wrapper .form-group select {
        background: white;
        border: 1px solid #dce1e6;
    }

    .contact-form-wrapper .form-group input:focus,
    .contact-form-wrapper .form-group textarea:focus,
    .contact-form-wrapper .form-group select:focus {
        border-color: var(--primary, #24578B);
        outline: none;
        box-shadow: 0 0 0 3px rgba(36, 87, 139, 0.1);
    }

    /* Alert */
    .alert {
        padding: 12px 14px;
        font-size: 0.85rem;
        margin-bottom: var(--spacing-md);
    }

    /* Info cards */
    .contatti-info h2 {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-md);
    }

    .info-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .info-card {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
        background: #f8f9fa;
        border-radius: var(--radius-sm);
    }

    .info-card-icon {
        width: 40px;
        height: 40px;
        background: var(--primary, #24578B);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .info-card-icon svg {
        width: 18px;
        height: 18px;
        color: white;
    }

    .info-card h4 {
        font-size: 0.8rem;
        color: #666;
        margin-bottom: 2px;
    }

    .info-card p,
    .info-card a {
        font-size: 0.9rem;
    }

    /* Quick contact */
    .quick-contact {
        padding: 40px var(--spacing-md);
    }

    .quick-contact-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .quick-contact-card {
        padding: 20px 18px;
        border-radius: var(--radius-md);
    }

    .quick-contact-icon {
        width: 54px;
        height: 54px;
    }

    .quick-contact-icon svg {
        width: 26px;
        height: 26px;
    }

    .quick-contact-card h3 {
        font-size: 1rem;
    }

    .quick-contact-card p {
        font-size: 0.8rem;
    }

    /* Map */
    .contatti-map,
    .contact-map {
        height: 240px;
        border-radius: var(--radius-md);
        overflow: hidden;
        margin-top: var(--spacing-lg);
    }

    .map-wrapper {
        height: 260px;
        border-radius: var(--radius-md);
    }
}

/* ============================================
   UTILITY
   ============================================ */

@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

@media screen and (max-width: 768px) {
    .properties-loading {
        padding: 40px 20px;
    }

    .spinner {
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .header,
    .footer,
    .mobile-action-bar,
    .property-cta-fixed,
    .menu-toggle,
    .nav {
        display: none !important;
    }

    body {
        padding: 0 !important;
    }
}