/* =========================================
   1. RESET & VARIABILI
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background-color: #f9f9f7;
  color: #222;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* FIX GLOBALE IMMAGINI */
img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
    object-fit: cover; 
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. NAVBAR DESKTOP
   ========================================= */
.navbar {
  background-color: #ffffff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 100px;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

/* FIX LOGO NAVBAR TAGLIATO */
.logo img {
  height: auto;
  max-height: 80px; 
  width: auto;
  object-fit: contain;
}

.hamburger {
  display: none; 
  font-size: 2rem;
  color: #003049;
  cursor: pointer;
}

.nav-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #003049;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

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

.lang-switcher { display: flex; gap: 5px; }
.lang-switcher button {
  border: 1px solid #003049;
  background: #003049;
  color: white;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
}
.lang-switcher button:hover { background: #d62828; border-color: #d62828; }

/* =========================================
   3. HERO SECTION (MODIFICA PER VISIBILITÀ TASTI)
   ========================================= */
.hero {
  position: relative;
  /* Cambio da altezza fissa a padding per contenere logo e tasti su ogni PC */
  min-height: 85vh; 
  height: auto; 
  padding: 80px 0;
  background: url('../images/vista-notturna.jpg') no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-overlay {
  background-color: rgba(0, 0, 0, 0.2); 
  position: absolute; top:0; left:0; width:100%; height:100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    z-index: 3;
    position: relative;
}

.hero-png {
  max-width: 850px;
  width: 80%;
  filter: drop-shadow(0 0 15px rgba(0,0,0,0.6));
  margin-bottom: 25px; /* Aumentato leggermente per respiro */
}

.hero-buttons-wrapper {
    margin-top: 5px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-button {
    background-color: #bda87f; color: white; padding: 15px 35px; border-radius: 50px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border: 2px solid #bda87f;
    transition: 0.3s; display: inline-block;
}
.cta-button:hover { background-color: transparent; color: white; }

.cta-button-outline {
    background-color: transparent; color: white; padding: 15px 35px; border-radius: 50px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border: 2px solid white;
    transition: 0.3s; display: inline-block;
}
.cta-button-outline:hover { background-color: white; color: #003049; }

/* =========================================
   4. LAYOUT GENERALE
   ========================================= */
.section { padding: 90px 0; }
.light-bg { background-color: #fff; box-shadow: 0 0 15px #eaeaea; margin: 40px 0; }

h2.section-title {
  text-align: center; color: #003049; margin-bottom: 50px;
  font-weight: 700; font-size: 2.5rem; font-family: 'Playfair Display', serif;
}

.villa-content, .contact-section, .servizi-columns {
  display: flex; gap: 60px; align-items: center; flex-wrap: wrap;
}
.villa-text, .villa-image, .form-wrapper, .contact-info {
  flex: 1; min-width: 300px;
}
.villa-image { align-self: stretch; }
.villa-image img { 
  width: 100%; height: 100%; object-fit: cover; 
  border-radius: 8px; box-shadow: 0 15px 30px rgba(0,0,0,0.15); 
  min-height: 400px;
}

/* =========================================
   5. NUOVI SERVIZI (GRIGLIA ICONE)
   ========================================= */
.amenities-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px;
}
.amenity-card {
    background-color: #ffffff; border: 1px solid #eee; border-radius: 8px; padding: 25px 15px;
    text-align: center; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
}
.amenity-card i { font-size: 2rem; color: #bda87f; transition: transform 0.3s; }
.amenity-card span { font-family: 'Montserrat', sans-serif; font-weight: 500; color: #333; font-size: 1rem; }
.amenity-card:hover { border-color: #bda87f; box-shadow: 0 5px 15px rgba(189, 168, 127, 0.15); transform: translateY(-5px); }
.amenity-card:hover i { transform: scale(1.1); }

/* =========================================
   6. GALLERIE & ESPLORA
   ========================================= */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; margin-bottom: 40px;
}
.gallery-grid img {
  width: 100%; height: 280px; object-fit: cover; border-radius: 8px; 
  cursor: pointer; transition: transform 0.4s;
}
.gallery-grid img:hover { transform: scale(1.03); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

.scroll-gallery {
  display: flex; gap: 30px; overflow-x: auto; padding: 40px 10px;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #bda87f transparent;
}
.room-card {
  min-width: 350px; flex: 0 0 auto; background: white; border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08); text-align: center; padding-bottom: 25px;
  scroll-snap-align: center; transition: transform 0.4s;
}
.room-card:hover { transform: translateY(-10px); }
.room-card img { width: 100%; height: 280px; object-fit: cover; border-radius: 12px 12px 0 0; }
.room-card h3 { color: #003049; margin: 20px 0 10px; font-family: 'Playfair Display', serif; font-size: 1.5rem; }
.room-card p { padding: 0 20px; color: #666; font-size: 0.95rem; }

/* =========================================
   7. PRENOTA (CARD STYLES)
   ========================================= */
.booking-section { background: linear-gradient(to bottom, #ffffff, #f4f4f4); text-align: center; padding-bottom: 80px; }
.booking-header { max-width: 700px; margin: 0 auto 50px; }
.booking-subtitle { color: #666; font-size: 1.1rem; margin-top: -20px; }
.booking-links { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }

.booking-card {
    background: white; border-radius: 16px; padding: 30px 40px; min-width: 280px;
    display: flex; flex-direction: column; align-items: center; text-decoration: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: all 0.4s; border: 2px solid transparent;
}
.card-icon { font-size: 3rem; margin-bottom: 20px; transition: transform 0.3s; }
.booking-text h3 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: #333; margin-bottom: 10px; }
.cta-text { font-family: 'Montserrat', sans-serif; font-size: 0.9rem; font-weight: 600; color: #bda87f; text-transform: uppercase; letter-spacing: 1px; }

.airbnb-card .card-icon { color: #ff5a5f; }
.airbnb-card:hover { border-color: #ff5a5f; transform: translateY(-10px); box-shadow: 0 20px 40px rgba(255, 90, 95, 0.15); }
.booking-card-style .card-icon { color: #003580; }
.booking-card-style:hover { border-color: #003580; transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 53, 128, 0.15); }
.vrbo-card .card-icon { color: #2a6ebb; }
.vrbo-card:hover { border-color: #2a6ebb; transform: translateY(-10px); box-shadow: 0 20px 40px rgba(42, 110, 187, 0.15); }
.booking-card:hover .card-icon { transform: scale(1.1); }
.booking-note { margin-top: 40px; font-size: 0.9rem; color: #888; background: white; display: inline-block; padding: 10px 20px; border-radius: 50px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* =========================================
   8. INSTAGRAM WIDGET
   ========================================= */
.insta-header { text-align: center; margin-bottom: 40px; }
.insta-handle { display: inline-block; font-family: 'Playfair Display', serif; color: #bda87f; font-size: 1.2rem; font-style: italic; text-decoration: none; margin-top: 10px; font-weight: 600; }
.insta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.insta-item { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 8px; }
.insta-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.insta-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 48, 73, 0.6); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.insta-overlay i { color: white; font-size: 2rem; transform: scale(0); transition: transform 0.3s ease; }
.insta-item:hover img { transform: scale(1.1); }
.insta-item:hover .insta-overlay { opacity: 1; }
.insta-item:hover .insta-overlay i { transform: scale(1); }

/* =========================================
   9. FOOTER & WIDGETS
   ========================================= */
.footer { background-color: #003049 !important; color: white !important; text-align: center; padding: 80px 10px; margin-top: 60px; }
.footer img { height: 130px !important; width: auto !important; max-width: 300px; opacity: 1 !important; margin-bottom: 25px; display: inline-block; }
.company-details { font-size: 0.95rem; line-height: 1.8; color: #e0e0e0; }
.footer a { color: #ccc; text-decoration: none; transition: 0.3s; }
.footer a:hover { color: #d62828; }
.legal-links { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; margin-top: 30px; display: flex; justify-content: center; gap: 15px; }

.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #fff; padding: 20px; box-shadow: 0 -5px 15px rgba(0,0,0,0.1); z-index: 9999; display: none; border-top: 4px solid #003049; }
.cookie-content { max-width: 1000px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.cookie-buttons { margin-left: auto; display: flex; gap: 10px; }
.btn-cookie { padding: 10px 20px; border-radius: 4px; border: none; cursor: pointer; font-weight: 600;}
.btn-primary { background: #003049; color: white; }
.btn-secondary { background: #eee; color: #333; }
.cookie-revoke { position: fixed; bottom: 20px; left: 20px; width: 45px; height: 45px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); cursor: pointer; z-index: 9998; color: #003049; font-size: 1.2rem; }

.lightbox { position: fixed; top:0; left:0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 10000; display: none; justify-content: center; align-items: center; flex-direction: column; }
.lightbox-content { max-width: 90%; max-height: 85vh; border-radius: 5px; }
.lightbox-caption { color: white; margin-top: 15px; font-size: 1.2rem; }
.close { position: absolute; top: 25px; right: 25px; color: white; font-size: 45px; cursor: pointer; }


/* =========================================
   10. MEDIA QUERY (FIX DIVISO)
   ========================================= */

@media (max-width: 1400px) {
  .navbar { height: 70px; padding: 0 15px; }
  .logo img { max-height: 50px; }
  .hamburger { display: block !important; }

  .nav-menu-wrapper {
      position: fixed;
      top: 70px; right: -100%;
      width: 100%; height: calc(100vh - 70px);
      background: #fff; flex-direction: column; align-items: center;
      padding-top: 40px; transition: 0.4s; z-index: 1000;
      gap: 30px;
  }
  .nav-menu-wrapper.active { right: 0; }
  .nav-links { flex-direction: column; gap: 25px; font-size: 1.2rem; }
  .lang-switcher { margin-top: 25px; transform: scale(1.1); }
  
  /* Hero adjustments per laptop piccoli */
  .hero { padding: 60px 0; min-height: 500px; }
  .hero-png { max-width: 500px; }
}

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: 1fr; margin-top: 0; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .insta-grid { grid-template-columns: repeat(2, 1fr); }
  .amenities-grid { grid-template-columns: repeat(2, 1fr); }
  
  .booking-links { flex-direction: column; align-items: center; }
  .booking-card { flex-direction: row; text-align: left; width: 100%; }
  .card-icon { margin-bottom: 0; margin-right: 20px; }
  
  .villa-content, .contact-section { flex-direction: column; }
  .hero-png { width: 90%; }
  .hero { height: auto; min-height: 60vh; }
}
/* FASE 2: MOBILE E TABLET PICCOLI (< 1024px) */
@media (max-width: 1024px) {
  
  /* ... altre regole ... */

  /* FIX SPECIFICO PER IPHONE "INGRANDITO" */
  .room-card { 
      min-width: 280px !important; 
      max-width: 280px !important; /* Blocca la larghezza */
      flex: 0 0 280px !important;  /* Impedisce ad iOS di espanderla */
  }

  .room-card img { 
      height: 200px !important;    /* Forza l'altezza su iPhone */
      width: 100% !important;
      object-fit: cover !important; /* Taglia l'immagine correttamente senza distorcerla */
  }
  
  .scroll-gallery {
      padding: 20px 10px !important;
      display: flex !important;
      flex-direction: row !important; /* Forza l'allineamento orizzontale */
  }
}
/* FLUIDITY & PERFORMANCE FIX */

html {
    scroll-behavior: smooth; /* Rende lo scorrimento ai link interni più dolce */
}

body {
    -webkit-font-smoothing: antialiased; /* Rende i font più puliti, meno peso di rendering */
    overflow-x: hidden; /* Evita scivolamenti laterali indesiderati */
}

/* Forza lo scorrimento fluido su iPhone (Momentum Scrolling) */
.scroll-gallery {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; /* Aiuta le card a "fermarsi" in posizione */
}

/* Ottimizzazione immagini durante lo scroll */
img {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Avvisa il browser di ottimizzare le immagini che hanno transizioni */
    will-change: transform; 
}

/* Disattiva gli effetti hover pesanti su dispositivi touch (causano lag) */
@media (hover: none) {
    .room-card:hover, .gallery-grid img:hover, .gallery-link:hover img {
        transform: none !important;
    }
}