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

body {
  font-family: 'Lato', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-image: linear-gradient(to bottom, rgba(249, 249, 249, 0) 60%, #f9f9f9 100%), url('images/ui/sfondo-header.jpg');
  background-size: cover;
  background-position: center;
  padding: 100px 0;
  position: relative;
}

.logo-section {
  background-color: #ffffff;
  padding: 15px 30px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  max-width: fit-content;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  text-align: center;
}

.logo-image {
  width: 100%;
  max-width: 450px;
  height: auto;
  display: block;
}

.site-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 3em;
  font-weight: bold;
  color: #333;
  letter-spacing: 3px;
  margin: 20px 0;
}

.subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2em;
  color: #666;
  font-style: italic;
  margin-bottom: 40px;
}

.properties-section {
  background: white;
  padding: 40px 0;
}

.property-list {
  display: flex;
  flex-direction: column;
  gap: 120px; /* Distanza verticale ampia tra le due strutture */
  margin-bottom: 60px;
}

.property-block {
  width: 100%; /* Sfrutta tutta la larghezza consentita dal container */
}

.property-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 4.5em; /* Dimensione raddoppiata */
  color: #4a9d5f;
  margin-bottom: 20px;
  font-weight: bold;
}

.property-content {
  display: flex;
  align-items: center; /* Centra verticalmente galleria, icone e testo */
  justify-content: space-between;
  gap: 40px;
}

.property-content.reverse {
  flex-direction: row-reverse; /* Inverte l'ordine visuale per La Conte House */
}

.property-gallery {
  flex: 0 0 45%; /* Il carosello occupa il 45% fisso della riga */
}

.services-col {
  display: flex;
  flex-direction: column; /* Impila i servizi in verticale */
  gap: 30px;
  flex: 0 0 100px; /* Colonna stretta fissa interposta tra foto e testo */
  border: none;
  margin: 0;
  padding: 0;
}

.property-text {
  flex: 1; /* Il testo si espande per occupare tutto lo spazio rimanente verso il bordo */
  text-align: left;
}

.property-content.reverse .property-text {
  text-align: right; /* Specchia il testo per La Conte House */
}

.property-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.property-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8em;
  color: #4a9d5f;
  margin-bottom: 15px;
  font-weight: bold;
}

.property-description {
  font-size: 1em;
  line-height: 1.6;
  color: #555;
  text-align: justify;
}

.location-info {
  background: #f9f9f9;
  padding: 30px;
  margin: 40px 0;
  border-radius: 8px;
  text-align: justify;
  line-height: 1.7;
}

.map-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 40px 0;
  align-items: start;
}

.map-container {
  width: 100%;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.villa-details p {
  margin-bottom: 15px;
  text-align: justify;
  line-height: 1.7;
}

.contact-section {
  background: white;
  padding: 40px 0;
}

.contact-subtitle {
  font-family: 'Poppins', sans-serif;
  text-align: center;
  font-size: 1.2em;
  color: #666;
  font-style: italic;
  margin-bottom: 40px;
}

.contact-info {
  text-align: left;
  max-width: 400px;
  margin-left: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.contact-label {
  margin-right: 10px;
  font-weight: bold;
  min-width: 80px;
}

.image-gallery {
  position: relative;
  margin-bottom: 10px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  cursor: pointer;
  padding: 10px 15px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50%;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.carousel-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.carousel-btn i {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

#sticky-logo {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  transition: transform 0.3s ease;
}

#sticky-logo img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.email-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.email-link:hover { opacity: 0.7; }
.email-link .arrow { margin-left: 8px; font-weight: bold; }

.services-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px 10px;
  margin-top: 25px;
  margin-bottom: 15px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8em;
  color: #555;
  text-align: center;
}

.service-item i {
  font-size: 1.8em;
  margin-bottom: 8px;
  color: #4a9d5f;
}

/* OTTIMIZZAZIONE MOBILE (Media Queries) */
@media (max-width: 768px) {
  .property-grid, .map-section {
    grid-template-columns: 1fr;
  }
  .site-title {
    font-size: 1.8em;
  }
  .services-bar {
    flex-wrap: wrap; /* Fa andare a capo le icone se non entrano */
    gap: 20px;
  }
  .service-item {
    width: 40%; /* Due icone per riga su mobile */
  }
  #sticky-logo {
    display: none; /* Nasconde il logo fluttuante su piccoli schermi per non coprire testo */
  }
  .logo-image {
    max-width: 280px; 
  }
  .property-row, .property-row.reverse {
    flex-direction: column;
  }
  .property-block {
    width: 100%;
  }
  .property-content, .property-content.reverse {
    flex-direction: column;
  }
  .property-title {
    text-align: center !important;
  }
}

body.loading {
    overflow: hidden;
}

#loader-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #fdfbf7;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease;
}

#animated-logo {
    width: 60%; /* Logo grande e leggibile */
    max-width: 500px;
    height: auto;
}

/* Sequenza animazioni */
#anim-green-group, #anim-sun-group { opacity: 0; }

#anim-green-group { 
    animation: fadeIn 1s ease forwards 0.2s; 
}

#anim-sun-group { 
    animation: sunPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.8s;
    transform-origin: 917px 259px; 
}

@keyframes fadeIn { to { opacity: 1; } }

@keyframes sunPop {
    from { opacity: 0; transform: scale(0) translateY(50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

main > section, main > div.container {
  opacity: 0;
  animation: microIntro 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

main > .properties-section { animation-delay: 3.1s; }
main > div.container { animation-delay: 3.3s; }
main > .contact-section { animation-delay: 3.5s; }

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

.loader-hidden { opacity: 0; pointer-events: none; }

/* Stile Menù Orizzontale */
.main-nav {
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.main-nav .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 100px;
}


.nav-btn {
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1em;
  color: #888;
  cursor: pointer;
  padding: 20px 10px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  color: #4a9d5f;
}

.nav-btn.active {
  color: #4a9d5f;
  font-weight: 600;
  border-bottom: 3px solid #4a9d5f;
}

/* Gestione visibilità delle schede (SPA) */
.content-section {
  display: none;
  padding-top: 40px;
  animation: fadeInTab 0.4s ease forwards;
}

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

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

@media (max-width: 768px) {
  .main-nav .container { gap: 15px; }
  .nav-btn { font-size: 0.95em; padding: 15px 5px; }
}

/* Form di Prenotazione */
.booking-form-container {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.booking-form .form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.booking-form .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 20px;
}

.booking-form label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
  font-family: 'Lato', sans-serif;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
  background-color: #fcfcfc;
  transition: border-color 0.3s;
}

.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
  outline: none;
  border-color: #4a9d5f;
}

.submit-btn {
  background-color: #4a9d5f;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  padding: 15px 30px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: background-color 0.3s;
}

.submit-btn:hover {
  background-color: #3b824e;
}

@media (max-width: 768px) {
  .booking-form .form-row {
    flex-direction: column;
    gap: 0;
  }
  .booking-form .form-group {
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
    .services-col {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        margin: 20px 0;
        width: 100%;
    }
    .service-item {
        margin-bottom: 0;
    }
}

/* Language Selector */
.lang-selector {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lang-select {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9em;
  color: #555;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}
.lang-select:hover {
  border-color: #4a9d5f;
}

/* Scroll Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-in-up.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Blog Section */
.blog-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
}
.blog-card {
  max-width: 400px;
  width: 100%;
}

.blog-card {
  background: #ffffff;
  border: 1px solid #e8e0d5;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.blog-image {
  width: 100%;
  height: 200px;
  background-image: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  background-size: cover;
  background-position: center;
}
.blog-card:nth-child(2) .blog-image {
  background-image: url('https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
}
.blog-card:nth-child(3) .blog-image {
  background-image: url('https://images.unsplash.com/photo-1499793983690-e29da59ef1c2?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
}
.blog-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5em;
  color: #4a9d5f;
  margin-bottom: 15px;
}
.blog-content p {
  color: #666;
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}
.read-more {
  color: #4a9d5f;
  font-weight: bold;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9em;
  transition: color 0.3s;
}
.read-more:hover {
  color: #3b824e;
}

/* Fixed Lang Selector */
.lang-selector-fixed {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: #fff;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  z-index: 10;
  transition: background 0.3s;
}
.modal-close:hover {
  background: #fff;
  color: #d14949;
}
.modal-header {
  height: 300px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 30px;
  position: relative;
}
.modal-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.modal-header h2 {
  position: relative;
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 3em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  margin: 0;
}
.modal-body {
  padding: 40px;
}
.modal-body h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8em;
  color: #4a9d5f;
  margin-top: 30px;
  margin-bottom: 15px;
}
.modal-body p {
  color: #444;
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 20px;
}
.blog-card {
  cursor: pointer;
}

/* FAQ Accordion Styling */
.faq-accordion {
    text-align: left;
    margin-top: 30px;
}
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 15px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 500;
    color: #4a9d5f;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}
.faq-question:hover {
    color: #3b824e;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0;
}
.faq-answer p {
    color: #666;
    margin: 0;
    padding-bottom: 15px;
    line-height: 1.6;
}
.faq-question.active i {
    transform: rotate(180deg);
    transition: transform 0.3s;
}
.faq-question i {
    transition: transform 0.3s;
}

/* REVIEWS GRID CSS */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.review-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}
.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.review-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #4a9d5f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 15px;
}
.review-meta {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.review-author {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #333;
}
.review-source {
    font-size: 0.8em;
    color: #666;
}
.review-body p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}
.review-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05em;
    font-weight: 600;
    margin: 5px 0 10px 0;
}
.review-rating {
    font-weight: bold;
    font-size: 1.2em;
}

/* Specific Styles */
.google-card { border-top: 4px solid #ea4335; }
.google-stars { color: #fbbc05; margin-bottom: 10px; font-size: 0.9em; }

.booking-card { border-top: 4px solid #003580; }
.review-rating-box {
    background: #003580;
    color: white;
    border-radius: 6px 6px 6px 0;
    padding: 5px 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.airbnb-card { border-top: 4px solid #ff5a5f; }
.airbnb-stars { color: #ff5a5f; margin-bottom: 10px; font-size: 0.9em; }

/* Carousel Categories */
.carousel-categories {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}
.carousel-categories::-webkit-scrollbar { height: 6px; }
.carousel-categories::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }
.carousel-cat-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.85em;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}
.carousel-cat-btn:hover { background: #e0e0e0; }
.carousel-cat-btn.active { background: #4a9d5f; color: white; }

/* === LIGHTBOX MODAL === */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.property-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.property-image:hover {
    transform: scale(1.02);
}

/* === NEW CAROUSEL & LIGHTBOX CONTROLS === */
.carousel-label {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(43, 48, 52, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    pointer-events: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 3rem;
    cursor: pointer;
    padding: 30px 20px;
    user-select: none;
    z-index: 10001;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 768px) {
    .lightbox-nav { font-size: 2rem; padding: 15px 10px; }
    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}

/* === CRITICAL MOBILE FIXES === */
@media (max-width: 768px) {
  .nav-tabs {
    gap: 15px; /* Reduce massive gap that forces horizontal scroll */
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-btn {
    padding: 10px 5px;
    font-size: 1rem;
  }

  .logo-section {
    padding: 15px;
    max-width: 90%;
  }

  .logo-image {
    max-width: 100%;
  }
  
  /* Assicuriamoci che niente causi scroll orizzontale */
  body, html {
    overflow-x: hidden;
    width: 100%;
  }
}
