/* 
 * PROPERTIES SECTION STYLES
 * Stili dedicati alla sezione "Le Nostre Case" in stile Apple
 * My Place Malpensa - Copyright 2025
 */

:root {
  --property-card-radius: 16px;
  --property-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  --property-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  --property-transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  --property-card-bg: #ffffff;
  --property-card-border: 1px solid rgba(0, 0, 0, 0.03);
  --property-overlay-gradient: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75));
  --property-badge-bg: rgba(255, 255, 255, 0.92);
  --property-badge-color: #111;
  --property-text-primary: #111;
  --property-text-secondary: #555;
  --property-accent-color: #2196f3;
  --property-button-hover-bg: #0d8aea;
  --property-description-color: #666;
  --property-section-bg: #f9f9fb;
}

/* Sezione principale */
.properties-section {
  padding: 6rem 0;
  background-color: var(--property-section-bg);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.properties-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 20% 25%, rgba(240, 240, 240, 0.8) 0%, transparent 60%), 
                    radial-gradient(circle at 80% 85%, rgba(230, 240, 255, 0.7) 0%, transparent 55%);
  z-index: 1;
  opacity: 0.8;
}

.properties-section .container {
  position: relative;
  z-index: 2;
}

.properties-section h1, .properties-section h2, .properties-section h3, .properties-section .section-title {
  font-family: 'SF Pro Display', 'Helvetica Neue', 'Helvetica', sans-serif !important;
}

.properties-section h2 {
  font-size: 3.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--property-text-primary);
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 0.5rem;
}

.properties-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--property-accent-color);
  border-radius: 2px;
}

.properties-section .section-subtitle {
  font-size: 1.3rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 4rem;
  color: var(--property-text-secondary);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Griglia delle proprietà */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.8rem;
  margin-bottom: 4rem;
  position: relative;
  z-index: 5;
}

/* Card delle proprietà */
.property-card, .structure-card {
  position: relative;
  background-color: var(--property-card-bg);
  border-radius: var(--property-card-radius);
  overflow: hidden;
  box-shadow: var(--property-shadow);
  transition: var(--property-transition);
  border: var(--property-card-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  isolation: isolate; /* Per creare un nuovo contesto di stacking */
  transform-origin: center bottom;
  /* Assicuriamo che le card siano visibili per default e poi il JS le nasconderà immediatamente */
  opacity: 1;
  will-change: transform, opacity; /* Migliora performance su dispositivi mobili */
}

.property-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--property-hover-shadow);
  border-color: rgba(0, 0, 0, 0.08);
}

.property-card:hover .property-image img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.property-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-top-left-radius: var(--property-card-radius);
  border-top-right-radius: var(--property-card-radius);
}

.property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease, filter 0.5s ease;
  will-change: transform;
}

.property-details, .structure-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Fa in modo che questa sezione occupi lo spazio rimanente */
}

.property-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--property-badge-bg);
  color: var(--property-badge-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  letter-spacing: 0.01em;
}

.property-card:hover .property-badge {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.property-distance {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: var(--property-overlay-gradient);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.property-distance i {
  color: #fff;
  font-size: 0.875rem;
}

.property-details {
  padding: 1.5rem;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.property-location {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--property-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.property-location i {
  color: var(--property-accent-color);
  font-size: 0.875rem;
}

.property-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--property-text-primary);
  line-height: 1.2;
}

.property-card p {
  color: var(--property-description-color);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  font-weight: 400;
  /* Proprietà rimosse per garantire la piena visibilità del testo */
}

.property-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: 0.5rem;
  margin: 0.75rem auto;
  width: 85%;
  padding: 0.4rem 0;
  border-top: 1px solid rgba(229, 231, 235, 0.7);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.property-features span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem;
  color: var(--property-text-secondary);
  font-size: 0.85rem;
  line-height: 1.2;
}

.feature-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  white-space: normal; /* Permette al testo di andare a capo */
  line-height: 1.3; /* Aggiunto per una migliore leggibilità del testo a capo */
  max-width: 100%;
}

.property-features i {
  color: var(--property-accent-color);
  font-size: 1.125rem;
  display: block;
  margin-bottom: 0.3rem;
  height: 20px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Assicura spazio uniforme */
.property-features span:nth-child(1),
.property-features span:nth-child(2) {
  border-bottom: 1px dashed rgba(229, 231, 235, 0.5);
  padding-bottom: 0.5rem;
}

.property-features span:nth-child(3),
.property-features span:nth-child(4) {
  padding-top: 0.5rem;
}

.property-button, .structure-button {
  margin-top: auto; /* Spinge il pulsante in fondo al contenitore flex */
  display: inline-block;
  background-color: var(--property-accent-color);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  transition: var(--property-transition);
  width: 100%;
  margin-top: auto;
}

.property-button:hover {
  background-color: var(--property-button-hover-bg);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.property-button:active {
  transform: translateY(0);
}

/* Pulsante "Visualizza tutte le case" */
.view-all-container {
  text-align: center;
  margin-top: 2.5rem;
  animation: fadeIn 1s ease-out;
}

.view-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: transparent;
  color: var(--property-accent-color);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.95rem 2.25rem;
  border: 2px solid rgba(33, 150, 243, 0.35);
  border-radius: 12px;
  transition: all 0.4s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.view-all-button:hover {
  background-color: rgba(33, 150, 243, 0.08);
  border-color: rgba(33, 150, 243, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.15);
}

.view-all-button i {
  font-size: 1rem;
  transition: transform 0.4s ease;
}

.view-all-button:hover i {
  transform: translateX(5px);
}

.view-all-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(33, 150, 243, 0.07);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.view-all-button:hover::after {
  width: 300px;
  height: 300px;
}

.property-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.property-card:hover .property-button::before {
  left: 100%;
}

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

/* Animazioni per le property card */
.property-card-hidden {
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
}

.property-card-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  pointer-events: auto;
}

/* Coming Soon Card Style */
.property-card.coming-soon {
  background: linear-gradient(135deg, #f5f7fa 0%, #e9edf2 100%);
  border: 1px dashed rgba(0, 113, 227, 0.3);
}

.property-card.coming-soon .property-image {
  position: relative;
}

.property-card.coming-soon .property-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 113, 227, 0.1);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.property-card.coming-soon .coming-soon-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--property-accent-color);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

/* Placeholder per animazione di caricamento */
.property-image-placeholder {
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: placeholderShimmer 1.5s infinite;
}

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

/* Media Queries */
@media (max-width: 1200px) {
  .properties-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 991px) {
  .properties-section {
    padding: 4rem 0;
  }
  
  .properties-section h2 {
    font-size: 2.5rem;
  }
  
  .properties-section .section-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 768px) {
  .properties-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
  
  .property-image {
    height: 220px;
  }
  
  .property-card h3 {
    font-size: 1.35rem;
  }
}

@media (max-width: 576px) {

  .properties-section {
    padding: 3rem 0;
  }
  
  .properties-section h2 {
    font-size: 2rem;
  }
  
  .properties-grid {
    grid-template-columns: 1fr;
  }
  
  .property-details {
    padding: 1.25rem;
  }
  
  .property-button {
    width: 100%;
  }
}
