:root {
  --ink: #18211b;
  --green: #385c43;
  --green2: #587861;
  --cream: #f5f1e9;
  --line: #dedfd9;
  --white: #fff;
  --shadow: 0 18px 45px rgba(24, 33, 27, 0.12);
}

/* =========================================================
   RESET E BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: #fbfbf8;
}

body.modal-open {
  overflow: hidden;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 180px 1fr 160px;
  align-items: center;
  gap: 24px;
  height: 82px;
  padding: 10px 4vw;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.agency-logo img {
  width: auto;
  height: 58px;
  object-fit: contain;
}

.piazza-logo {
  justify-self: end;
}

.piazza-logo img {
  width: auto;
  height: 42px;
  object-fit: contain;
}

.site-header nav {
  display: flex;
  justify-content: center;
  gap: 34px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-header nav a:hover {
  color: var(--green);
}

/* =========================================================
   HERO E SLIDER
   ========================================================= */

.hero {
  position: relative;
  height: min(720px, calc(100vh - 82px));
  min-height: 560px;
  overflow: hidden;
}

.hero-slider,
.slide,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s;
}

.slide.active {
  opacity: 1;
}

.hero-overlay {
  background: linear-gradient(
    90deg,
    rgba(14, 23, 17, 0.82),
    rgba(14, 23, 17, 0.36) 55%,
    rgba(14, 23, 17, 0.12)
  );
}

.hero-content {
  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
  justify-content: center;

  width: 100%;
  height: 100%;
  max-width: none;

  padding: 45px 6vw;

  color: #fff;
}

.eyebrow {
  display: inline-block;
  width: fit-content;
  margin-bottom: 18px;

  color: #b77a43;

  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero h1,
.section h2,
.agency h2,
.contact-card h2,
.map-info h2 {
  margin: 0;

  font-family: "Playfair Display", serif;
  line-height: 1.05;
}

.hero h1 {
  width: 100%;
  max-width: 1050px;
  margin: 0 0 24px;

  font-size: clamp(58px, 6.5vw, 98px);
  line-height: 0.94;
  letter-spacing: -0.025em;
}

.hero-content > p {
  width: 100%;
  max-width: 900px;
  margin: 0;

  font-size: clamp(20px, 1.8vw, 27px);
  line-height: 1.45;
}

.hero-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* =========================================================
   BOTTONI
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  background: var(--green);
}

.btn.primary:hover {
  background: #294832;
}

.btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn.outline {
  color: var(--green);
  background: #fff;
  border-color: var(--green);
}

.btn.small {
  min-height: 40px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
}

/* =========================================================
   SEZIONI GENERALI
   ========================================================= */

.section {
  padding: 90px 6vw;
}

.section-heading {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: end;
  gap: 50px;
  margin-bottom: 40px;
}

.section-heading h2 {
  font-size: clamp(38px, 5vw, 60px);
}

.section-heading p {
  color: #59625c;
  font-size: 17px;
  line-height: 1.7;
}

/* =========================================================
   GRIGLIA IMMOBILI
   ========================================================= */

.property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.property-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.property-image {
  position: relative;
  height: 390px;
  overflow: hidden;
}

.property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s;
}

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

.status {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status.inline {
  position: static;
  display: inline-block;
}

.property-body {
  padding: 28px;
}

.property-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #6f7771;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.property-body h3 {
  margin: 12px 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 31px;
}

.location {
  color: #66706a;
}

/* =========================================================
   DATI TECNICI
   ========================================================= */

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 24px 0;
  border: 1px solid var(--line);
}

.facts div {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.facts div:last-child {
  border-right: 0;
}

.facts small {
  display: block;
  margin-bottom: 6px;
  color: #7b817d;
  font-size: 11px;
  text-transform: uppercase;
}

.facts strong {
  font-size: 14px;
}

.description {
  color: #4f5852;
  line-height: 1.7;
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chips span {
  flex: 0 0 auto;
  white-space: nowrap;

  padding: 8px 10px;
  background: var(--cream);

  font-size: 12px;
  font-weight: 600;
}

.property-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.price {
  font-size: 20px;
}

/* =========================================================
   AGENZIA
   ========================================================= */

.agency {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 70px;
  background: var(--cream);
}

.agency-photo img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.agency h2 {
  font-size: 58px;
}

.agency-copy p {
  color: #4c554f;
  font-size: 17px;
  line-height: 1.8;
}

.agency blockquote {
  margin: 30px 0;
  padding-left: 18px;
  border-left: 4px solid #b77a43;
  font-family: "Playfair Display", serif;
  font-size: 27px;
}

/* =========================================================
   CONTATTI
   ========================================================= */

.contact-section {
  padding: 75px 6vw;
  color: #fff;
  background: var(--green);
}

.contact-card {
  max-width: 1000px;
  margin: auto;
  text-align: center;
}

.contact-card h2 {
  font-size: 50px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 30px 0;
}

.contact-actions a {
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 700;
}

/* =========================================================
   MAPPA E ORARI
   ========================================================= */

.map-section {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  min-height: 620px;
}

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

.map-info {
  padding: 70px 6vw;
  background: #fff;
}

.map-info h2 {
  font-size: 48px;
}

.hours {
  margin-top: 35px;
  border-top: 1px solid var(--line);
}

.hours div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.hours span {
  font-weight: 700;
}

.hours strong {
  font-weight: 500;
  text-align: right;
}

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

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 30px;
  padding: 38px 6vw;
  color: #fff;
  background: #151c17;
  font-size: 13px;
}

footer img {
  height: 55px;
  padding: 4px;
  background: #fff;
}

.social {
  display: flex;
  gap: 18px;
}

/* =========================================================
   POPUP DETTAGLIO IMMOBILE
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 12, 0.75);
}

.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: 35% 65%;
  width: min(1500px, 96vw);
  height: min(92vh, 980px);
  margin: 4vh auto;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-panel > img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
}

.modal-content {
  min-width: 0;
  padding: 30px 34px;
  overflow-y: auto;
}

.modal-content h2 {
  margin: 12px 55px 4px 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(30px, 2.5vw, 42px);
  line-height: 1.05;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  background: #fff;
  font-size: 28px;
  cursor: pointer;
}

.modal .facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 20px;
}

.modal .facts div {
  min-width: 0;
  padding: 11px 12px;
}

.modal .facts div:nth-child(4n) {
  border-right: 0;
}

.modal .facts div:nth-child(-n + 4) {
  border-bottom: 1px solid var(--line);
}

.modal .facts strong {
  display: block;
  overflow-wrap: anywhere;
}

.modal-overview {
  display: none;
}

.detail-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin: 20px 0;
}

.detail-section {
  min-width: 0;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 21px;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
  columns: 1;
}

.detail-section li {
  margin-bottom: 7px;
  color: #4f5852;
  font-size: 13px;
  line-height: 1.4;
  break-inside: avoid;
}

.modal-content > .chips {
  margin-top: 16px;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 18px;
  padding: 16px 0 4px;
  background: #fff;
  border-top: 1px solid var(--line);
}

/* =========================================================
   RESPONSIVE TABLET
   ========================================================= */

@media (max-width: 1100px) {
  .modal-panel {
    grid-template-columns: 38% 62%;
    width: 96vw;
  }

  .detail-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-section:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 140px 1fr 110px;
  }

  .site-header nav {
    display: none;
  }

  .property-grid,
  .agency,
  .map-section {
    grid-template-columns: 1fr;
  }

  .property-image {
    height: 320px;
  }

  .agency-photo img {
    height: 360px;
  }

  .map-section iframe {
    height: 420px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero-content {
    justify-content: center;
    padding: 40px 5vw;
  }

  .hero h1 {
    max-width: 760px;
    font-size: clamp(52px, 8vw, 76px);
  }

  .hero-content > p {
    max-width: 680px;
    font-size: 21px;
  }

  footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  footer img {
    margin: auto;
  }

  .social {
    justify-content: center;
  }

  .modal-panel {
    grid-template-columns: 1fr;
    width: min(760px, 94vw);
    height: 92vh;
    margin: 4vh auto;
    overflow-y: auto;
  }

  .modal-panel > img {
    width: 100%;
    height: 280px;
    min-height: 280px;
  }

  .modal-content {
    overflow: visible;
    padding: 28px;
  }

  .detail-sections {
    grid-template-columns: 1fr;
  }

  .detail-section:last-child {
    grid-column: auto;
  }

  .modal-actions {
    bottom: 0;
  }
}

/* =========================================================
   RESPONSIVE MOBILE
   ========================================================= */

@media (max-width: 560px) {
  .site-header {
    grid-template-columns: 1fr auto;
    height: 70px;
    padding: 8px 16px;
  }

  .agency-logo img {
    height: 48px;
  }

  .piazza-logo img {
    height: 34px;
  }

  .hero {
    height: calc(100vh - 70px);
    min-height: 620px;
  }

  .hero-content {
    justify-content: center;
    padding: 35px 22px;
  }

  .hero h1 {
    max-width: 100%;
    margin-bottom: 20px;

    font-size: clamp(43px, 13vw, 60px);
    line-height: 0.98;
  }

  .hero-content > p {
    max-width: 100%;

    font-size: 18px;
    line-height: 1.5;
  }

  .section {
    padding: 65px 20px;
  }

  .property-grid {
    grid-template-columns: 1fr;
  }

  .property-body {
    padding: 22px;
  }

  .property-body h3 {
    font-size: 27px;
  }

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

  .facts div:nth-child(2n) {
    border-right: 0;
  }

  .facts div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .agency {
    gap: 35px;
    padding: 65px 20px;
  }

  .agency h2,
  .contact-card h2,
  .map-info h2 {
    font-size: 40px;
  }

  .map-info {
    padding: 55px 20px;
  }

  .contact-section {
    padding: 60px 20px;
  }

  .property-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .modal-panel {
    width: 96vw;
    height: 94vh;
    margin: 3vh auto;
  }

  .modal-panel > img {
    height: 220px;
    min-height: 220px;
  }

  .modal-content {
    padding: 22px;
  }

  .modal-content h2 {
    margin-right: 45px;
    font-size: 30px;
  }

  .modal .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal .facts div {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .modal .facts div:nth-child(2n) {
    border-right: 0;
  }

  .modal .facts div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .detail-sections {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}
