/* Bundled CSS for Performance */

/* --- Core Styles --- */
:root {
    /* Color Palette */
    --color-primary: #e67e22; /* Arancio */
    --color-primary-dark: #d35400;
    --color-secondary: #3498db; /* Blue Mare */
    --color-accent: #f1c40f; /* Giallo Sole */
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-background: #fdfefe;
    --color-white: #ffffff;
    --color-sand: #fcf3cf;
    
    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    
    /* Shadows & Border Radius */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Animation */
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
    font-weight: 500;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.section {
    padding: var(--space-lg) 0;
}

/* ============ HEADER & NAVIGATION ============ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.header__logo img {
    height: 70px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.header__logo:hover img {
    transform: scale(1.05);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav__link {
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    padding: 0.5rem 0;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.nav__link:hover,
.nav__link.active {
    color: var(--color-primary);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

/* Hide desktop nav on mobile/tablet */
@media (max-width: 992px) {
    .nav {
        display: none;
    }
}

/* ============ MOBILE MENU OVERLAY ============ */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-white);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
}

.mobile-menu__link {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

.mobile-menu__link:hover,
.mobile-menu__link.active {
    color: var(--color-primary);
}

.mobile-menu__link--cta {
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 1.2rem;
    background-color: var(--color-primary);
    color: white !important;
    padding: 1rem 3rem;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
}

.mobile-menu-open {
    overflow: hidden;
}

/* Typography Utilities */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 3.5rem 0; }
    #benvenuti { margin-top: 2rem !important; display: block; scroll-margin-top: 100px; }
}

/* --- PageSpeed Optimization & CLS Fixes --- */

/* Hero section - layout containment */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout;  /* Previene propagazione layout shift */
    color: var(--color-white);
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: 1; /* Background layer */
    contain: strict;  /* Isolamento totale */
}

.hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35); /* Dark overlay for text contrast */
}

.hero__media img,
.hero__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;  /* Riserva spazio prima del caricamento */
    will-change: transform;  /* GPU compositing */
}

.hero__content {
    position: relative;
    z-index: 2; /* Content layer on top */
    text-align: center;
    max-width: 800px;
    padding: var(--space-md);
    /* Optional: background darken for contrast */
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-lg);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.hero__title {
    font-size: 3.5rem;
    margin-bottom: var(--space-sm);
    color: var(--color-white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero__subtitle {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: rgba(255,255,255,0.9);
}

/* Card images with fixed aspect ratio */
.card__image {
    position: relative;
    height: 250px; /* Restored desktop height */
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.card__image img,
.card__image picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Animazioni sicure (solo transform e opacity) */
[data-animate] {
    opacity: 0;
    will-change: opacity, transform;
}

[data-animate].animated {
    animation: fadeInUp 0.8s ease forwards;
}

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

/* Utility Classes */
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.items-center { align-items: center; }
.bg-sand { background-color: var(--color-sand); }
.bg-primary { background-color: var(--color-primary); color: white; }
.text-white { color: white; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-4xl { font-size: 2.5rem; }
.opacity-80 { opacity: 0.8; }
.d-block { display: block; }
.columns-2 { columns: 2; }
.max-w-800 { max-width: 800px; }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.bg-white-20 { background: rgba(255,255,255,0.2); }
.border-white { border-color: white !important; }
.text-light { color: var(--color-text-light) !important; }

.map-container {
    background: #eee;
    height: 450px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}


/* --- css/components.css --- */
.mobile-menu__link {
    font-size: 1.2rem;
}


/* Global Components */
/* ============ FOOTER ============ */
.footer {
    background-color: var(--color-text);
    color: #ecf0f1;
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
    margin-top: auto;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer__title {
    color: var(--color-primary);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-primary);
}

.footer p {
    color: #bdc3c7;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-logo {
    height: 70px;
    width: auto;
    margin-bottom: 1.5rem;
    background: white;
    padding: 5px;
    border-radius: 4px;
}

.footer-info-details {
    display: block;
    margin-top: 0.5rem;
    color: #95a5a6;
    font-size: 0.85rem;
}

.footer__links {
    padding: 0;
}

.footer__links li {
    margin-bottom: 0.75rem;
}

.footer__links a {
    color: #bdc3c7;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.footer__links a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.footer__bottom a {
    color: #bdc3c7;
}

.footer__bottom a:hover {
    color: var(--color-white);
    text-decoration: underline;
}
.hero--small {
    height: 40vh !important;
    min-height: 0 !important;
}

.hero--half {
    height: 50vh !important;
    min-height: 0 !important;
}


.card-image--auto {
    height: auto !important;
    border-radius: var(--radius-lg);
}

.small-gray-text {
    font-size: 0.9rem;
    color: #718096;
}

.error-details-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border-radius: 6px;
    border: 1px solid #feb2b2;
}

.error-details-text {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.btn--gray {
    background-color: #4a5568 !important;
    color: white !important;
}

.btn--gray:hover {
    background-color: #2d3748 !important;
}


.gallery-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .gallery-4-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 10px;
}

/* Language Selector */
.lang-selector {
    display: flex;
    gap: 15px; /* Increased gap for better touch target separation */
    margin-left: 15px;
    align-items: center;
}

.lang-selector a {
    display: flex; /* Remove text alignment issues */
    transition: transform 0.2s;
    text-decoration: none;
    opacity: 0.8; /* Slight transparency for unhovered state */
}

.lang-selector a:hover {
    transform: scale(1.1);
    opacity: 1;
}

.lang-selector img {
    width: 24px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: block;
}

/* Utilities */
.mb-0 { margin-bottom: 0 !important; }

.welcome-section-spacing {
    scroll-margin-top: 100px;
    padding-top: 5rem;
}



/* 
   GALLERY & LAYOUT ROBUSTNESS FIX 
   - Enforces 4-col desktop / 2-col mobile grid
   - Prevents layout overlaps using flow-root
*/

.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 4rem; /* Safe spacing */
    width: 100%;
}

.gallery-container img,
.gallery-container picture img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

/* 
   CRITICAL: flow-root creates a strict Block Formatting Context.
   This forces the section to expand to contain ALL children,
   preventing any content from spilling out or overlapping.
*/
.section {
    display: flow-root; 
    position: relative;
    width: 100%;
}

.gallery-container > *:hover img,
.gallery-container > img:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem; /* Slightly larger gap for clarity */
        margin-bottom: 3rem;
    }
    
    .gallery-container img,
    .gallery-container picture img {
        height: 150px;
    }
    
    /* Ensure sections have clear boundaries on mobile */
    .section {
        padding-bottom: 3rem;
        border-bottom: 1px solid transparent; /* Force containment */
    }

    /* 
       FIX ORDER INCONSISTENCY 
       Force Image (which is usually first in HTML) to stay first.
       Disable desktop reordering classes.
    */
    .card__order-first,
    .card__order-last {
        order: unset !important;
    }
    
    /* Extra safety: if using flex/grid, prevent reordering */
    .grid > div {
        order: unset !important;
    }
}



/* --- css/mobile.css --- */
/* ===========================================
   MOBILE OPTIMIZATION - Villa Arancio
   Breakpoints:
   - Tablet: 992px
   - Mobile Large: 768px
   - Mobile Small: 576px
   - Mobile XS: 480px
   =========================================== */

/* ============ BASE MOBILE IMPROVEMENTS ============ */

/* Touch-friendly tap targets (min 44px) */
a, button, input, select, textarea {
    min-height: 44px;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

/* Improve text readability on mobile */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    body {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    /* Larger paragraphs for readability */
    p {
        font-size: 1rem;
        line-height: 1.8;
    }
}

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

@media (max-width: 768px) {
    .header {
        height: 70px;
        padding: 0 1rem;
    }
    
    .header__inner {
        padding: 0 0.5rem;
    }
    
    .header__logo img {
        height: 40px;
    }
    
    /* Ensure hamburger is visible and clickable */
    .mobile-menu-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }
}

/* ============ HERO SECTION MOBILE ============ */

@media (max-width: 768px) {
    .hero {
        height: 85vh;
        min-height: 500px;
        padding-top: 70px; /* Account for fixed header */
    }
    
    .hero__content {
        padding: 1.5rem;
        margin: 0 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .hero__title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero__subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero__actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .hero__actions .btn {
        width: 100%;
        text-align: center;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 80vh;
        min-height: 450px;
    }
    
    .hero__title {
        font-size: 1.75rem;
    }
    
    .hero__subtitle {
        font-size: 0.9rem;
    }
}

/* ============ BUTTONS MOBILE ============ */

@media (max-width: 768px) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        display: block;
        text-align: center;
    }
    
    .btn--primary,
    .btn--outline {
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============ HAMBURGER MENU ICON (Modern Style) ============ */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.hamburger-line {
    width: 26px;
    height: 2px; /* Thinner lines */
    background-color: var(--color-primary); /* Use primary color for premium feel */
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 3px 0;
}

/* Animation state */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============ GRID & LAYOUT MOBILE ============ */

@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 1.5rem 0;
    }
    
    .container {
        padding: 0 0.75rem;
    }
}

/* ============ TYPOGRAPHY MOBILE ============ */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Inline styles override */
    [style*="font-size: 2.5rem"] {
        font-size: 1.75rem !important;
    }
    
    [style*="font-size: 1.5rem"] {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 768px) {
    /* Hide desktop nav, show mobile toggle */
    .nav { display: none !important; }
    .mobile-menu-toggle { display: flex !important; }
    
    /* Adjust header for mobile */
    .header__inner {
        width: 100%;
    }
    
    .hero { 
        height: 90vh !important; 
        min-height: 550px;
    }
    
    .hero__content {
        padding: 2rem 1.5rem;
        background: rgba(0, 0, 0, 0.45);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }

    .card {
        margin-bottom: 2.5rem !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .card__image {
        height: 280px !important; /* Larger images for mobile */
        aspect-ratio: unset !important;
    }

    .card__content {
        padding: 1.5rem !important;
        text-align: left;
    }

    .card__title {
        font-size: 1.4rem !important;
        margin-bottom: 0.75rem !important;
    }

    .card__content p {
        font-size: 1.05rem !important;
        line-height: 1.6 !important;
    }
}

@media (max-width: 480px) {
    .card__image {
        height: 280px !important; /* Larger images for mobile */
        aspect-ratio: unset !important;
    }
}

@media (max-width: 480px) {
    .card__image {
        height: 240px !important; /* Slightly smaller for very small screens but still large */
    }
}

/* ============ GALLERY GRID MOBILE ============ */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .gallery-grid img {
        height: 120px !important;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .gallery-grid img {
        height: 200px !important;
    }
}

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

@media (max-width: 992px) {
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer__title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer__links li {
        margin-bottom: 0.5rem;
    }
    
    .footer__links a {
        font-size: 0.95rem;
        display: inline-block;
        padding: 0.25rem 0;
    }
    
    .footer__bottom {
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .footer__bottom p {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* ============ LISTS MOBILE ============ */

@media (max-width: 768px) {
    ul[style*="columns: 2"] {
        columns: 1 !important;
    }
    
    ul li {
        margin-bottom: 0.5rem;
        line-height: 1.6;
    }
}

/* ============ IMAGES MOBILE ============ */

@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure inline-styled images are responsive */
    img[style*="border-radius"] {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ============ FORMS MOBILE ============ */

@media (max-width: 768px) {
    input, 
    select, 
    textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 0.875rem 1rem;
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        display: block;
    }
}

/* ============ CONTACT PAGE MOBILE ============ */

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .contact-info,
    .contact-form-container {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .form-row,
    .form-row.three-cols {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem !important;
    }
    
    .contact-hero {
        padding: 100px 1rem 40px !important;
    }
    
    .consent-section {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .checkbox-group {
        font-size: 0.9rem;
    }
}

/* ============ MAP IFRAME MOBILE ============ */

@media (max-width: 768px) {
    iframe[src*="maps.google"] {
        height: 300px !important;
    }
    
    div[style*="height: 450px"] {
        height: 300px !important;
    }
}

/* ============ SPACING UTILITIES MOBILE ============ */

@media (max-width: 768px) {
    /* Override inline margin/padding */
    [style*="margin-bottom: var(--space-lg)"] {
        margin-bottom: 1.5rem !important;
    }
    
    [style*="margin-top: var(--space-lg)"] {
        margin-top: 1.5rem !important;
    }
    
    [style*="padding: var(--space-lg)"] {
        padding: 1.5rem !important;
    }
    
    /* Center content better */
    [style*="max-width: 800px"] {
        max-width: 100% !important;
        padding: 0 1rem;
    }
}

/* ============ APPARTAMENTI PAGE MOBILE ============ */

@media (max-width: 768px) {
    /* Fix two-column apartment layouts */
    .grid.grid-2[style*="align-items: center"] {
        gap: 1.5rem;
    }
    
    /* Reorder image and text on mobile */
    .grid.grid-2 > div[style*="order: 2"],
    .grid.grid-2 > div[style*="order: 1"] {
        order: unset !important;
    }
    
    /* Apartment info lists */
    section ul {
        padding-left: 0;
        list-style: none;
    }
    
    section ul li {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    /* CIN/CIR codes smaller */
    div[style*="font-size: 0.8rem"] {
        font-size: 0.75rem !important;
    }
}

/* ============ AMENITIES GRID MOBILE ============ */

@media (max-width: 768px) {
    .grid.grid-4.text-center {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .grid.grid-4.text-center span[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .grid.grid-4.text-center {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============ PRIVACY/POLICY PAGE MOBILE ============ */

@media (max-width: 768px) {
    .policy-content {
        margin: 80px auto 2rem !important;
        padding: 1.5rem !important;
    }
    
    .policy-content h1 {
        font-size: 1.5rem;
    }
    
    .policy-content h2 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .policy-content h3 {
        font-size: 1.1rem;
    }
    
    .policy-content ul {
        padding-left: 1.25rem;
    }
}

/* ============ CTA SECTIONS MOBILE ============ */

@media (max-width: 768px) {
    section[style*="background-color: var(--color-primary)"] {
        padding: 2rem 1rem !important;
    }
    
    section[style*="background-color: var(--color-primary)"] h2 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    section[style*="background-color: var(--color-primary)"] p {
        font-size: 1rem !important;
        margin-bottom: 1.25rem !important;
    }
}

/* ============ TOUCH IMPROVEMENTS ============ */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }
    
    .card:hover .card__image img {
        transform: none;
    }
    
    /* Add active states instead */
    .card:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Larger tap targets */
    .nav__link,
    .footer__links a {
        padding: 0.5rem;
    }
}

/* ============ SAFE AREA INSETS (iPhone X+) ============ */

@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
    
    .mobile-menu {
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* ============ LANDSCAPE MODE ============ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 80px 1rem 2rem;
    }
    
    .hero__title {
        font-size: 1.75rem;
    }
    
    .hero__subtitle {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .mobile-menu__nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .mobile-menu__link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* ============ PRINT STYLES (For completeness) ============ */

@media print {
    .header,
    .mobile-menu,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .hero {
        height: auto;
        min-height: 200px;
    }
    
    body {
        font-size: 12pt;
    }
}

