/* ============================================================
   FERAXI — Costa Smeralda Property — Mediterranean luxury theme
   ============================================================ */

:root {
  --ink: #1f2e2c;          /* deep cypress charcoal */
  --ink-soft: #54625e;     /* muted olive-grey */
  --line: #e7ddcb;         /* sand hairline */
  --paper: #faf6ed;        /* whitewashed sand */
  --paper-2: #f0e8d7;      /* warm sand */
  --gold: #c07a52;         /* terracotta clay */
  --gold-deep: #a85f39;    /* deep terracotta */
  --sea: #1f6470;          /* Mediterranean azure */
  --sea-deep: #134a55;     /* deep sea */
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(31, 46, 44, 0.12);
  --radius: 2px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  line-height: 1.6; font-weight: 300; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.eyebrow {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.32em;
  font-size: 0.68rem; font-weight: 500; color: var(--gold-deep);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.74rem;
  letter-spacing: 0.22em; text-transform: uppercase; font-weight: 500;
  padding: 16px 34px; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper); cursor: pointer; transition: all .25s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn--gold:hover { background: transparent; color: var(--gold-deep); border-color: var(--gold); }
.btn--light { border-color: #fff; background: transparent; color: #fff; }
.btn--light:hover { background: #fff; color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 237, 0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand { font-family: var(--serif); font-size: 1.7rem; letter-spacing: 0.42em; font-weight: 600; padding-left: 0.42em; }
.brand small {
  display: block; font-family: var(--sans); font-size: 0.52rem; letter-spacing: 0.46em;
  font-weight: 400; color: var(--gold-deep); margin-top: 2px; padding-left: 0.46em;
}
.nav { display: flex; gap: 36px; align-items: center; }
.nav a { font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 400; color: var(--ink-soft); transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav .btn { padding: 12px 24px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }

/* ---------- Language switcher (compact dropdown) ---------- */
.lang { position: relative; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-soft);
  font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.08em; font-weight: 500;
  padding: 6px 4px; transition: color .2s;
}
.lang__btn:hover, .lang.open .lang__btn { color: var(--ink); }
.lang__btn svg { flex: none; }
.lang__chev { transition: transform .2s ease; }
.lang.open .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
  background: var(--white); border: 1px solid var(--line); min-width: 150px;
  list-style: none; margin: 0; padding: 6px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease;
}
.lang.open .lang__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang__menu li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  font-size: 0.82rem; color: var(--ink-soft); transition: background .15s, color .15s;
}
.lang__menu li:hover { background: var(--paper-2); color: var(--ink); }
.lang__menu li[aria-selected="true"] { color: var(--gold-deep); }
.lang__code { font-weight: 500; letter-spacing: 0.08em; width: 22px; flex: none; }
.lang__name { font-weight: 300; }

/* ---------- WhatsApp (themed) ---------- */
.wa-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--sea); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(31, 46, 44, 0.28);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.wa-fab:hover { transform: translateY(-3px) scale(1.04); background: var(--sea-deep); box-shadow: 0 16px 34px rgba(31, 46, 44, 0.34); }
.wa-btn-inline {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; text-align: center; background: var(--sea); border-color: var(--sea); color: #fff;
}
.wa-btn-inline:hover { background: transparent; border-color: var(--sea); color: var(--sea-deep); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 88vh; display: flex; align-items: flex-end; color: #fff;
  background:
    linear-gradient(to top, rgba(15,40,46,.78) 0%, rgba(18,48,54,.18) 48%, rgba(20,40,44,.34) 100%),
    url("https://images.unsplash.com/photo-1505691938895-1758d7feb511?q=80&w=2000&auto=format&fit=crop") center/cover no-repeat;
}
.hero__inner { padding-bottom: 76px; max-width: 720px; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 5rem); margin: 18px 0 20px; letter-spacing: 0.01em; }
.hero p { font-size: 1.12rem; font-weight: 300; max-width: 540px; color: rgba(255,255,255,.9); }
.hero .eyebrow { color: #e7c9a6; }
.hero__cta { margin-top: 34px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section--tight { padding: 70px 0; }
.section--alt { background: var(--paper-2); }
.section-head { max-width: 640px; margin-bottom: 54px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 16px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Commission cards ---------- */
.commission { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); }
.commission__item { padding: 48px 36px; text-align: center; border-right: 1px solid var(--line); background: var(--white); }
.commission__item:last-child { border-right: 0; }
.commission__num { font-family: var(--serif); font-size: 3.6rem; color: var(--gold); line-height: 1; font-weight: 500; }
.commission__label { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem; font-weight: 500; margin: 16px 0 10px; }
.commission__desc { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Property grid / cards ---------- */
.grid { display: grid; gap: 34px; grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--white); border: 1px solid var(--line); overflow: hidden; transition: transform .3s ease, box-shadow .3s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__tag {
  position: absolute; top: 14px; left: 14px; background: rgba(250,246,237,.94); color: var(--ink);
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; padding: 7px 12px;
}
.card__tag--rent { background: var(--sea); color: #fff; }
.card__tour {
  position: absolute; bottom: 14px; right: 14px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(20,40,44,.78); color: #fff; font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 500; padding: 6px 10px; backdrop-filter: blur(2px);
}
.card__body { padding: 24px 24px 28px; flex: 1; display: flex; flex-direction: column; }
.card__loc { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }
.card__title { font-size: 1.5rem; margin: 8px 0 4px; }
.card__price { font-family: var(--serif); font-size: 1.45rem; color: var(--ink); margin-top: auto; padding-top: 14px; }
.card__price small { font-family: var(--sans); font-size: 0.7rem; color: var(--ink-soft); letter-spacing: .08em; }
.card__meta { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-soft); }
.card__meta span { display: flex; gap: 6px; align-items: center; }

/* ---------- Filters ---------- */
.filters {
  background: var(--white); border: 1px solid var(--line); padding: 26px; margin-bottom: 44px;
  display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 18px; align-items: end;
}
.field label { display: block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 500; color: var(--ink-soft); margin-bottom: 8px; }
.field select, .field input {
  width: 100%; padding: 12px 12px; border: 1px solid var(--line); background: var(--paper);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 300; color: var(--ink); border-radius: var(--radius);
}
.field select:focus, .field input:focus { outline: none; border-color: var(--gold); }
.filters .btn { padding: 13px 24px; }
.results-count { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 22px; }

/* ---------- Properties map ---------- */
.prop-map { height: 440px; width: 100%; margin-bottom: 40px; border: 1px solid var(--line); background: var(--paper-2); z-index: 1; }
.price-pin {
  background: var(--ink); color: #fff; font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.02em; padding: 6px 11px; white-space: nowrap; border: 0;
  box-shadow: 0 6px 16px rgba(31,46,44,.3); transform: translateY(-6px);
}
.price-pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink); }
.price-pin--rent { background: var(--sea); }
.price-pin--rent::after { border-top-color: var(--sea); }
.leaflet-popup-content-wrapper { border-radius: 2px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 0; width: 230px !important; }
.map-pop img { width: 100%; height: 130px; object-fit: cover; display: block; }
.map-pop__body { padding: 12px 14px 14px; }
.map-pop__loc { font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); }
.map-pop__title { font-family: var(--serif); font-size: 1.25rem; margin: 3px 0 2px; color: var(--ink); }
.map-pop__addr { font-size: 0.76rem; color: var(--ink-soft); margin-bottom: 8px; }
.map-pop__price { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.map-pop__price small { font-family: var(--sans); font-size: 0.62rem; color: var(--ink-soft); }
.map-pop__link { display: inline-block; margin-top: 10px; font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; color: var(--gold-deep); border-bottom: 1px solid var(--gold); padding-bottom: 2px; }

/* ---------- Detail page ---------- */
.detail-hero { aspect-ratio: 16/8; overflow: hidden; background: var(--paper-2); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.detail-gallery img { aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; margin-top: 56px; }
.detail-grid h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 10px 0 6px; }
.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); margin: 30px 0; }
.spec div { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.spec div:nth-child(odd) { border-right: 1px solid var(--line); }
.spec span { display: block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-soft); margin-bottom: 4px; }
.spec strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.aside-card { background: var(--white); border: 1px solid var(--line); padding: 32px; position: sticky; top: 100px; }
.aside-card .price { font-family: var(--serif); font-size: 2.4rem; color: var(--ink); }
.aside-card .price small { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); }
.feature-list { columns: 2; gap: 24px; margin-top: 8px; }
.feature-list li { list-style: none; padding: 7px 0 7px 20px; position: relative; font-size: 0.92rem; break-inside: avoid; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: 14px; width: 7px; height: 7px; background: var(--gold); }
.media-btn svg { vertical-align: -2px; margin-right: 8px; }

/* ---------- Contact / Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { margin-bottom: 18px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 500; margin-bottom: 8px; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 14px; border: 1px solid var(--line); background: var(--white);
  font-family: var(--sans); font-size: 0.92rem; font-weight: 300; color: var(--ink); border-radius: var(--radius);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--gold); }
.form-field textarea { min-height: 140px; resize: vertical; }
.form-note { display:none; margin-top:18px; padding:16px 18px; background: var(--sea); color:#fff; font-size:0.9rem; }

/* ---------- Split / feature blocks ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
.split img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.split h2 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); margin-bottom: 18px; }
.split p { color: var(--ink-soft); margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.stats .num { font-family: var(--serif); font-size: 3rem; color: var(--gold); }
.stats .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 72px 0 32px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; }
.site-footer .brand { color: #fff; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 18px; font-weight: 500; }
.site-footer a { display: block; padding: 5px 0; font-size: 0.9rem; transition: color .2s; }
.site-footer a:hover { color: var(--gold); }
.site-footer p { font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 54px; padding-top: 26px; display: flex; justify-content: space-between; font-size: 0.78rem; flex-wrap: wrap; gap: 10px; }

/* ---------- Media modal (video / floorplan) ---------- */
.tour-modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 25, 27, 0.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s ease;
}
.tour-modal.open { opacity: 1; }
.tour-dialog { width: min(1100px, 96vw); background: #11201f; color: #fff; border-radius: 3px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); transform: translateY(10px); transition: transform .25s ease; }
.tour-modal.open .tour-dialog { transform: translateY(0); }
.tour-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.tour-x { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.tour-stage { position: relative; aspect-ratio: 16/9; background: #0c1817; display: flex; align-items: center; justify-content: center; }
.tour-frame { width: 100%; height: 100%; border: 0; display: block; }
.tour-video { width: 100%; height: 100%; display: block; background: #000; }
.tour-stage--plan { background: var(--paper); aspect-ratio: auto; padding: 18px; }
.tour-stage--plan img { width: 100%; height: auto; max-height: 76vh; object-fit: contain; }
@media (max-width: 640px) {
  .tour-stage { aspect-ratio: 4/5; }
  .wa-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
}

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-l { margin-top: 44px; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid, .commission { grid-template-columns: repeat(2, 1fr); }
  .commission__item:nth-child(2) { border-right: 0; }
  .detail-grid, .split, .form-grid { grid-template-columns: 1fr; gap: 32px; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 36px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .aside-card { position: static; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 78px; left: 0; right: 0; flex-direction: column; background: var(--paper); padding: 24px 28px; gap: 20px; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .grid, .commission, .filters, .stats { grid-template-columns: 1fr; }
  .commission__item { border-right: 0; }
  .section { padding: 64px 0; }
  .feature-list { columns: 1; }
}
