:root {
  --navy: #044723;
  --navy-dark: #022f17;
  --brass: #b08a4a;
  --brass-dark: #8d6c33;
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #e7e2d9;
  --ok: #1f7a4d;
  --err: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(19, 36, 49, .06), 0 8px 24px rgba(19, 36, 49, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--navy); }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  color: var(--navy-dark);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.lead { font-size: 1.15rem; color: var(--muted); }

/* Header */
.site-header { background: #fff; border-bottom: 3px solid var(--navy); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 12px 0; }
.brand { display: block; line-height: 0; }
.brand img { height: 52px; width: auto; }
.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--navy-dark); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--brass-dark); text-decoration: underline; }
.nav a.btn { color: #fff; }
.nav a.btn:hover { color: #fff; text-decoration: none; }
@media (max-width: 600px) { .brand img { height: 40px; } .nav { gap: 14px; font-size: .95rem; } }

/* Bottoni */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--brass); color: #fff; font: inherit; font-weight: 600;
  padding: 12px 22px; border-radius: 8px;
}
.btn:hover { background: var(--brass-dark); color: #fff; }
.btn-small { padding: 7px 14px; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line); color: var(--navy-dark); }

/* Hero e ricerca */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; padding: 56px 0 64px; }
.hero h1 { color: #fff; }
.hero .lead { color: #d6dee5; max-width: 40rem; }
.search, .filters {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end; margin-top: 24px;
}
.search label, .filters label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.search label { color: #e8edf1; }
select, input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; }

.filters {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.filters-actions { display: flex; gap: 8px; }

/* Sezioni */
.section { padding: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.section-head h2 { margin-top: 0; }
.section h2:first-child { margin-top: 0; }
.cta { background: var(--surface); border-block: 1px solid var(--line); text-align: center; }
.empty { color: var(--muted); }
.results-count { color: var(--muted); margin: 20px 0 12px; }

/* Griglia e card */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card-img { position: relative; aspect-ratio: 4 / 3; background: #e9e4da; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .95rem; }
.noimg-large { aspect-ratio: 16 / 10; background: #e9e4da; border-radius: var(--radius); }
.tag {
  position: absolute; top: 10px; left: 10px; background: var(--navy-dark); color: #fff;
  font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.tag-state { left: auto; right: 10px; background: var(--brass); }
.card-body { padding: 14px 16px 16px; }
.card-price { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--navy-dark); }
.card-title { margin: 4px 0 2px; }
.card-place { margin: 0; color: var(--muted); font-size: .9rem; }
.card-facts { display: flex; gap: 14px; margin: 10px 0 0; color: var(--ink); font-size: .9rem; }

/* Paginazione */
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 32px; }

/* Scheda immobile */
.breadcrumb { margin: 0 0 12px; }
.detail { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .detail-side { position: sticky; top: 16px; }
}
.detail-place { color: var(--muted); margin-top: -.2em; }
.gallery-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: #e9e4da; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: 0 0 88px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--brass); }

.facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 88px; }
.facts strong { display: block; font-size: 1.3rem; color: var(--navy-dark); }
.facts span { font-size: .8rem; color: var(--muted); }

.specs { margin: 0; display: grid; gap: 0; grid-template-columns: 1fr; }
@media (min-width: 640px) { .specs { grid-template-columns: 1fr 1fr; column-gap: 32px; } }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.chips { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: #efe9dc; border-radius: 999px; padding: 4px 14px; font-size: .9rem; }
.plans { display: flex; gap: 12px; flex-wrap: wrap; }
.plans img { max-height: 220px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.price-box, .contact-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.price-box { margin-bottom: 16px; }
.price { margin: 0; font-size: 1.7rem; font-weight: 700; color: var(--navy-dark); }
.state { margin: 4px 0 0; color: var(--brass-dark); font-weight: 600; }
.contact-box h2 { margin-top: 0; font-size: 1.25rem; }
.contact-list { list-style: none; padding: 0; margin: 20px 0; }
.contact-list li { padding: 4px 0; }
.contact-list strong { display: inline-block; min-width: 90px; }

/* Form */
.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field-check label { display: flex; gap: 10px; font-weight: 400; align-items: flex-start; }
.field-check input { margin-top: 5px; flex: none; }
.has-error input, .has-error textarea { border-color: var(--err); }
.error { color: var(--err); font-size: .85rem; margin: 4px 0 0; }
.errorlist { color: var(--err); list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Messaggi */
.msg { margin: 16px 0 0; padding: 12px 16px; border-radius: 8px; background: #e7f4ec; color: var(--ok); border: 1px solid #bfe0cd; }
.msg-error { background: #fdecea; color: var(--err); border-color: #f5c2bd; }

.prose p { max-width: 65ch; }
.descr p { max-width: 70ch; }

/* Footer */
.site-footer { background: var(--navy-dark); color: #cfd8df; margin-top: 40px; padding: 28px 0; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-legal { text-align: right; }
@media (max-width: 600px) { .footer-legal { text-align: left; } }
