/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Colors */
  --background: hsl(0, 0%, 98%);
  --foreground: hsl(0, 0%, 12%);
  --card: hsl(0, 0%, 96%);
  --card-foreground: hsl(0, 0%, 12%);
  --primary: hsl(38, 70%, 45%);
  --primary-foreground: hsl(0, 0%, 100%);
  --muted: hsl(30, 8%, 90%);
  --muted-foreground: hsl(30, 5%, 32%);
  --border: hsl(0, 0%, 88%);
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  --radius: 0.5rem;
}

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.2;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Navigation */
.navigation {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.logo img {
  width: 8.75rem;
  height: auto;
  display: block;
}

.navigation .logo img {
  max-height: 5.875rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--foreground);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

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

.mobile-menu-toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

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

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

/* Hero Section */
.hero {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.4), rgba(0,0,0,0.6));
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  max-width: 900px;
  padding: 0 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--spacing-lg);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: var(--spacing-xl);
  font-weight: 300;
  opacity: 0.95;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections */
.section {
  padding: 6rem 2rem;
}

.section-alt {
  background-color: var(--card);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.container-sm {
  max-width: 900px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

/* Grid */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Feature Cards */
.feature-card {
  text-align: center;
  padding: 2rem;
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background-color: rgba(38, 70%, 45%, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* Property Cards */
.property-card {
  position: relative;
  display: block;
  background: white;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.45s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.property-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px -12px rgba(0, 0, 0, 0.14), 0 8px 18px -6px rgba(0, 0, 0, 0.08);
}

.property-media {
  position: relative;
  overflow: hidden;
}

.property-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.property-card:hover .property-image {
  transform: scale(1.045);
}

/* Elegant badge positioned on image */
.property-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
  white-space: nowrap;
}

.property-content {
  padding: 1.65rem 1.5rem 1.5rem;
}

.property-title {
  font-size: 1.55rem;
  margin-bottom: 0.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.property-location {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.property-location svg {
  color: var(--primary);
  opacity: 0.85;
}

.property-price {
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.1rem;
  letter-spacing: -0.015em;
}

.property-details {
  display: flex;
  gap: 1.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.property-details span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.property-details span svg {
  opacity: 0.75;
}

/* ==================== FEATURED PROPERTIES — LUXURY SURPRISE ==================== */
#featured-properties {
  gap: 2.25rem;
}

#featured-properties .property-card {
  position: relative;
  border: 1px solid hsl(38, 25%, 82%);
  box-shadow: 0 4px 25px -8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
  background: #fff;
  border-radius: 10px;
  /* Pre-animation state — cards start slightly below + transparent */
  opacity: 0;
  transform: translateY(22px);
}

#featured-properties .property-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 70px -18px rgba(0, 0, 0, 0.16), 0 12px 28px -6px rgba(184, 134, 11, 0.12);
  border-color: hsl(38, 45%, 72%);
}

#featured-properties .property-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), #c5a26b, var(--primary));
  opacity: 0.75;
  z-index: 3;
  transition: opacity 0.3s ease;
}

#featured-properties .property-card:hover::before {
  opacity: 1;
}

/* Richer image treatment for featured: soft vignette + frame */
#featured-properties .property-media {
  box-shadow: inset 0 0 0 1px rgba(184, 134, 11, 0.12);
}

#featured-properties .property-image {
  filter: saturate(1.02) contrast(1.01);
}

#featured-properties .property-card:hover .property-image {
  transform: scale(1.065);
}

/* Premium badge on featured */
#featured-properties .property-badge {
  top: 1.05rem;
  left: 1.05rem;
  padding: 0.32rem 0.95rem;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  background: linear-gradient(145deg, var(--primary), #a67c00);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* More generous and elegant content rhythm */
#featured-properties .property-content {
  padding: 1.85rem 1.65rem 1.65rem;
}

#featured-properties .property-title {
  font-size: 1.72rem;
  margin-bottom: 0.55rem;
}

#featured-properties .property-price {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

/* Elegant details with refined separators */
#featured-properties .property-details {
  gap: 1.1rem;
  padding-top: 1rem;
}

#featured-properties .property-details span {
  gap: 0.38rem;
  position: relative;
  padding-right: 0.9rem;
}

#featured-properties .property-details span:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-45%);
  width: 1px;
  height: 13px;
  background: var(--border);
}

/* Staggered luxury entrance animation for featured cards (triggered by .animate class) */
#featured-properties.animate .property-card {
  opacity: 0;
  transform: translateY(22px);
  animation: featuredCardEnter 0.72s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

#featured-properties.animate .property-card:nth-child(1) { animation-delay: 70ms; }
#featured-properties.animate .property-card:nth-child(2) { animation-delay: 170ms; }
#featured-properties.animate .property-card:nth-child(3) { animation-delay: 265ms; }

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

/* Elegant hover "discover" hint purely via CSS (no extra markup) */
#featured-properties .property-card::after {
  content: 'Scopri di più';
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -40%);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
  white-space: nowrap;
}

#featured-properties .property-card:hover::after {
  opacity: 0.95;
  transform: translate(-50%, -30%);
}

/* A delicate gold line that underlines the reveal text on hover */
#featured-properties .property-card:hover::after {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #d4af37;
  text-decoration-thickness: 1px;
}

/* Luxury Featured Section Header */
.featured-header {
  text-align: center;
  margin-bottom: 3.25rem;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(184, 134, 11, 0.08);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
  font-weight: 500;
}

/* Elegant centered grid for 2-3 featured cards (beautiful on any count) */
.featured-grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

/* Service Cards */
.service-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.service-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-content {
  padding: 2rem;
}

.service-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.service-description {
  color: var(--muted-foreground);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.service-fee {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: white;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

.form-submit {
  width: 100%;
}

/* Footer */
.footer {
  background-color: var(--foreground);
  color: rgba(255, 255, 255, 0.9);
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-logo img {
  width: 10rem;
  filter: invert(1);
  opacity: 0.92;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 0.75rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--muted) 25%,
    var(--card) 50%,
    var(--muted) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-card {
  height: 440px;
}

/* Featured grid skeleton polish */
#featured-properties .skeleton-card {
  border-radius: 10px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  animation: slideIn 0.3s;
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-body {
  padding: 2rem;
}

.section-primary {
  background-color: var(--muted);
}

.container-md {
  max-width: 900px;
  margin: 0 auto;
}

/* Icon wrapper for service lists */
.icon-wrapper {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.icon-wrapper.active {
  background: rgba(184, 134, 11, 0.1);
}

.icon-wrapper.inactive {
  background: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  .container, .container-sm, .container-md {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-container {
    padding: 0.75rem 1rem;
  }

  .logo img {
    width: 6.75rem;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--background);
    flex-direction: column;
    gap: 0;
    padding: 5rem 2rem 2rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease, visibility 0s 0.3s;
    z-index: 100;
    visibility: hidden;
  }
  
  .nav-links.is-open {
    right: 0;
    visibility: visible;
    transition: right 0.3s ease;
  }
  
  .nav-links li {
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    pointer-events: none;
  }
  
  .mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Limit overlay width to not cover the menu */
    width: calc(100% - 280px);
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .section {
    padding: 3rem 1rem;
  }
  
  .service-card {
    grid-template-columns: 1fr;
  }
  
  .service-image {
    height: 250px;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  /* Mobile Service Cards Improvements */
  .grid {
    gap: 1.25rem;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .card h3 {
    font-size: 1.625rem;
    margin-bottom: 0.75rem;
  }
  
  /* Mobile pricing display */
  .card-body > div:first-child {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .card ul {
    margin-top: 1rem;
  }
  
  .card ul li {
    margin-bottom: 0.625rem;
  }
  
  .icon-wrapper {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
  }
  
  .icon-wrapper svg {
    width: 14px !important;
    height: 14px !important;
  }
  
  .card ul li span {
    font-size: 0.8125rem;
    line-height: 1.5;
  }
  
  /* Service content cards */
  .service-content {
    padding: 1.5rem;
  }
  
  .service-title {
    font-size: 1.5rem;
  }
  
  .service-description {
    font-size: 0.9375rem;
    line-height: 1.6;
  }
  
  .service-fee {
    font-size: 1.25rem;
  }

  /* Featured section on mobile — keep the magic */
  .featured-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  #featured-properties .property-card {
    border-radius: 8px;
  }

  #featured-properties .property-title {
    font-size: 1.45rem;
  }

  #featured-properties .property-price {
    font-size: 1.65rem;
  }
  
  /* Mobile-friendly header section */
  .section-primary {
    padding: 2.5rem 1rem;
  }
  
  .section-primary h1 {
    font-size: clamp(2rem, 8vw, 2.5rem) !important;
  }
  
  .section-primary p {
    font-size: 1rem !important;
  }
  
  /* Improve buttons on mobile */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.8125rem;
  }
  
  /* Mobile card improvements */
  .card:hover {
    transform: none;
  }

  /* Hide fancy reveal label on touch (hover not reliable) */
  #featured-properties .property-card::after {
    display: none;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

.hidden {
  display: none;
}

/* ── Stato della villa (sostituisce il badge "In Vendita") ──
   I selettori con #featured-properties servono a battere il gradiente
   applicato ai badge delle card in homepage. */
.property-badge.status-under-construction,
#featured-properties .property-badge.status-under-construction {
  background: #5a6270;
  color: #fff;
}
.property-badge.status-ready-to-live,
#featured-properties .property-badge.status-ready-to-live {
  background: #4f6a46;
  color: #fff;
}
.property-badge.status-under-negotiation,
#featured-properties .property-badge.status-under-negotiation {
  background: #b06a1f;
  color: #fff;
}
.property-badge.status-sold,
#featured-properties .property-badge.status-sold {
  background: #8a3f32;
  color: #fff;
}

/* Badge usato fuori dalla card (pagina dettaglio): flusso normale, non sovrapposto */
.property-badge-inline {
  position: static;
  display: inline-block;
}
