/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --green:       #2E4736;
  --green-dark:  #1C2A20;
  --green-deep:  #233829;
  --gold:        #E0982E;
  --gold-dark:   #C9821F;
  --gold-light:  #E8B563;
  --bg:          #F6F1E7;
  --bg-alt:      #F0E9DA;
  --bg-card:     #FFFFFF;
  --text:        #2B2A26;
  --text-mid:    #56524A;
  --text-muted:  #837C6E;
  --text-label:  #A89C84;
  --border:      #E7DFD0;
  --border-dark: #EDE6D8;
  --shadow-card: 0 14px 32px rgba(43,42,38,.10);
  --shadow-side: 0 18px 48px rgba(43,42,38,.10);
  --shadow-btn:  0 10px 26px rgba(224,152,46,.35);
  --radius-sm:   12px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-pill: 999px;
}

/* ─── Fonts ──────────────────────────────────────────────────────────────── */
@font-face { font-family:'Satoshi'; src:url('../fonts/Satoshi-Light.ttf') format('truetype');   font-weight:300; font-display:swap }
@font-face { font-family:'Satoshi'; src:url('../fonts/Satoshi-Regular.ttf') format('truetype'); font-weight:400; font-display:swap }
@font-face { font-family:'Satoshi'; src:url('../fonts/Satoshi-Medium.ttf') format('truetype');  font-weight:500; font-display:swap }
@font-face { font-family:'Satoshi'; src:url('../fonts/Satoshi-Bold.ttf') format('truetype');    font-weight:700; font-display:swap }
@font-face { font-family:'Satoshi'; src:url('../fonts/Satoshi-Black.ttf') format('truetype');   font-weight:900; font-display:swap }

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth }
body {
  margin: 0;
  font-family: 'Satoshi', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit }
img { max-width: 100%; display: block }
button { cursor: pointer; font-family: inherit }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(246,241,231,.86);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1200px; margin: 0 auto;
  padding: 13px 24px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 11px; flex: none }
.logo-text { display: flex; flex-direction: column; line-height: 1 }
.logo-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600; font-size: 23px; color: var(--text);
  letter-spacing: .01em; white-space: nowrap;
}
.logo-sub {
  font-size: 10px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-label); margin-top: 3px;
}
.nav-links {
  display: flex; gap: 30px; margin-left: auto;
  align-items: center; font-size: 15px; font-weight: 500; color: var(--text-mid);
}
.nav-links a:hover, .nav-links a.active { color: var(--text) }
.nav-ctas { display: flex; align-items: center; gap: 14px }
.lang-toggle {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--text-mid);
  background: transparent;
}
.lang-toggle:hover { background: var(--bg-alt) }
.btn-book {
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  padding: 9px 18px; border-radius: var(--radius-pill);
  border: none; display: inline-flex; align-items: center; gap: 7px;
  transition: background .2s;
}
.btn-book:hover { background: #3a5a46 }
.burger {
  display: none; margin-left: auto;
  background: none; border: none; padding: 6px;
  color: var(--text); flex-direction: column; gap: 5px;
}
.burger span {
  display: block; width: 22px; height: 2px;
  background: currentColor; border-radius: 2px; transition: .2s;
}
.mobile-menu {
  display: none; flex-direction: column;
  border-top: 1px solid var(--border);
  background: rgba(246,241,231,.97);
  padding: 16px 24px 20px;
  gap: 4px;
}
.mobile-menu.open { display: flex }
.mobile-menu a {
  font-size: 16px; font-weight: 500; color: var(--text-mid);
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none }
.mobile-menu a:hover { color: var(--text) }

/* ─── Layout helpers ─────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px }
.section { padding: clamp(48px,7vw,88px) 0 }
.section-alt { background: var(--bg-alt) }
.section-white { background: var(--bg-card) }

/* ─── Typography ─────────────────────────────────────────────────────────── */
.serif { font-family: 'Cormorant Garamond', serif }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-light);
  margin-bottom: 12px;
}
h1.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500; font-size: clamp(38px,6vw,68px);
  line-height: 1.05; letter-spacing: -.01em; margin: 0;
}
h2.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500; font-size: clamp(28px,4vw,42px);
  line-height: 1.1; margin: 0 0 16px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--gold); color: #231f20;
  font-size: 16px; font-weight: 700;
  padding: 15px 24px; border-radius: var(--radius-md);
  border: none; box-shadow: var(--shadow-btn);
  transition: transform .2s, background .2s;
}
.btn-primary:hover { transform: translateY(-2px); background: var(--gold-dark) }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--bg-card); border: 1px solid var(--border-dark);
  color: var(--green); font-size: 15px; font-weight: 600;
  padding: 13px 22px; border-radius: var(--radius-md);
  border: none; transition: background .2s;
}
.btn-secondary:hover { background: var(--bg-alt) }
.btn-green {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--green); color: #fff;
  font-size: 15px; font-weight: 700;
  padding: 14px 22px; border-radius: var(--radius-md);
  border: none; transition: background .2s;
}
.btn-green:hover { background: #3a5a46 }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.apt-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.apt-card:hover { box-shadow: var(--shadow-card); transform: translateY(-3px) }
.apt-card-img { aspect-ratio: 16/10; overflow: hidden; position: relative }
.apt-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s }
.apt-card:hover .apt-card-img img { transform: scale(1.04) }
.apt-card-body { padding: clamp(18px,2.5vw,26px); flex: 1; display: flex; flex-direction: column }
.apt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 5px 11px; border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.apt-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600; line-height: 1.2;
  margin: 0 0 8px;
}
.apt-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px;
}
.apt-meta span { display: flex; align-items: center; gap: 5px }

/* ─── Info icon cards ────────────────────────────────────────────────────── */
.info-cards { display: flex; gap: 10px; flex-wrap: wrap }
.info-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px; min-width: 76px;
}
.info-card-val { font-size: 18px; font-weight: 700; color: var(--text) }
.info-card-lbl { font-size: 11px; color: var(--text-label); text-transform: uppercase; letter-spacing: .06em }

/* ─── Season badge ───────────────────────────────────────────────────────── */
.stagione-bassa  { background: #DFF0ED; color: #2E6058 }
.stagione-media  { background: #FEF3DC; color: #8A5C00 }
.stagione-alta   { background: #FDEBD0; color: #7A3B00 }
.stagione-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-pill);
}

/* ─── Pricing table ──────────────────────────────────────────────────────── */
.price-table { width: 100%; border-collapse: collapse; min-width: 660px }
.price-table thead tr { background: var(--green) }
.price-table th {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.72); padding: 16px 20px; text-align: left;
}
.price-table td { padding: 12px 16px; border-bottom: 1px solid var(--border) }
.price-table tr:last-child td { border-bottom: none }
.price-table tr.passato td { opacity: .52 }
.price-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-alt); border-radius: 9px; padding: 7px 11px;
  transition: background .18s;
}
.price-cell:hover { background: #E8DCC6 }
.price-cell-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 600;
}
.price-cell-nights { font-size: 12px; color: var(--text-muted) }
.price-unavail { font-size: 13px; color: var(--text-label); font-style: italic }

/* ─── Aside booking card ─────────────────────────────────────────────────── */
.booking-aside {
  position: sticky; top: 96px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(22px,3vw,30px);
  box-shadow: var(--shadow-side);
}

/* ─── Service list ───────────────────────────────────────────────────────── */
.service-item { display: flex; align-items: center; gap: 11px; font-size: 15px }
.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: #E9F3EC; color: var(--green); flex: none;
}

/* ─── Alert info box ─────────────────────────────────────────────────────── */
.alert-info {
  display: flex; align-items: flex-start; gap: 12px;
  background: #E5ECEA; border: 1px solid #CFDDD8;
  border-radius: var(--radius-md); padding: 18px 20px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--green-dark); color: rgba(255,255,255,.78) }
.site-footer .inner {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(48px,6vw,72px) 24px 32px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 40px;
}
.footer-col-title {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-light); margin-bottom: 16px;
}
.footer-links { display: flex; flex-direction: column; gap: 11px; font-size: 14.5px }
.footer-links a:hover { color: #fff }
.footer-bar {
  border-top: 1px solid rgba(255,255,255,.12);
}
.footer-bar .inner {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  justify-content: space-between;
  font-size: 12.5px; color: rgba(255,255,255,.5);
  padding: 22px 24px;
}

/* ─── Grids ──────────────────────────────────────────────────────────────── */
.apt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 28px }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px 24px }
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 8px; margin-top: 10px;
}
.photos-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm) }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: min(86vh,760px);
  display: flex; align-items: flex-end; overflow: hidden;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(35,56,41,.18) 0%, rgba(35,56,41,.20) 45%, rgba(28,42,32,.78) 100%);
}
.hero-content {
  position: relative; width: 100%;
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px clamp(36px,6vw,72px);
  color: #fff;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px); padding: 7px 14px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  letter-spacing: .02em; margin-bottom: 22px;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500; font-size: clamp(42px,7.2vw,80px);
  line-height: 1.02; letter-spacing: -.005em; margin: 0;
  max-width: 16ch; text-shadow: 0 2px 30px rgba(20,30,22,.35);
}
.hero-sub {
  font-size: clamp(16px,2vw,20px); line-height: 1.6;
  color: rgba(255,255,255,.92); max-width: 54ch;
  margin: 20px 0 30px; font-weight: 400;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px }
.btn-hero-sec {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-size: 15px; font-weight: 600;
  padding: 13px 22px; border-radius: var(--radius-md);
  transition: background .2s;
}
.btn-hero-sec:hover { background: rgba(255,255,255,.22) }

/* ─── Page hero (green bg) ───────────────────────────────────────────────── */
.page-hero {
  background: var(--green); color: #fff;
  padding: clamp(48px,7vw,88px) 0;
  position: relative; overflow: hidden;
}
.page-hero .breadcrumb {
  font-size: 13px; color: rgba(255,255,255,.55); margin-bottom: 14px;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,.55) }
.page-hero .breadcrumb a:hover { color: rgba(255,255,255,.9) }
.page-hero .label {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-light); margin-bottom: 14px;
}

/* ─── Admin ──────────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh }
.admin-sidebar {
  width: 240px; flex: none;
  background: var(--green-dark); color: rgba(255,255,255,.78);
  display: flex; flex-direction: column;
  padding: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-logo {
  padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-logo .logo-name { color: #fff; font-size: 20px }
.admin-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1 }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 500; color: rgba(255,255,255,.7);
  transition: background .15s, color .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff }
.admin-nav a.active { background: rgba(255,255,255,.12); color: #fff }
.admin-nav a svg { flex: none; opacity: .7 }
.admin-nav a.active svg { opacity: 1 }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0 }
.admin-topbar {
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
}
.admin-topbar h1 { font-size: 20px; font-weight: 700; margin: 0 }
.admin-content { padding: 28px; flex: 1 }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(20px,2.5vw,28px);
}
.admin-table { width: 100%; border-collapse: collapse }
.admin-table th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-label);
  padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border);
}
.admin-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle }
.admin-table tr:last-child td { border-bottom: none }
.admin-table tr:hover td { background: var(--bg) }
.form-group { margin-bottom: 20px }
.form-label {
  display: block; font-size: 13.5px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--text);
  background: var(--bg-card);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,71,54,.12);
}
.form-textarea { resize: vertical; min-height: 100px }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px }
.btn-sm {
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); border: none; transition: .15s;
}
.btn-danger { background: #FEE2E2; color: #B91C1C }
.btn-danger:hover { background: #FECACA }
.btn-edit { background: var(--bg-alt); color: var(--text) }
.btn-edit:hover { background: var(--border) }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(43,42,38,.6); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: clamp(24px,3vw,36px);
  max-width: 520px; width: calc(100% - 48px);
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 64px rgba(43,42,38,.22);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-title { font-size: 20px; font-weight: 700; margin: 0 }
.modal-close {
  background: none; border: none; font-size: 22px; color: var(--text-muted);
  padding: 4px; line-height: 1; transition: color .15s;
}
.modal-close:hover { color: var(--text) }

.apt-desc {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 65ch;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ─── Spinner pulsanti (salvataggi AJAX) ─────────────────────────────────── */
.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: .8;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg) } }

/* ─── Toast salvataggi admin ─────────────────────────────────────────────── */
#zona-toast, #apt-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  padding: 14px 22px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  transform: translateY(80px); opacity: 0;
  transition: transform .3s, opacity .3s; pointer-events: none;
}
#zona-toast.show, #apt-toast.show { transform: translateY(0); opacity: 1; }
#zona-toast.ok, #apt-toast.ok  { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
#zona-toast.err, #apt-toast.err { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links, .nav-ctas { display: none !important }
  .burger { display: inline-flex !important }
  .admin-sidebar { display: none }
  .admin-layout { flex-direction: column }
}
@media (max-width: 768px) {
  .apt-layout { grid-template-columns: 1fr !important }
  .apt-desc { max-width: 100% }
}
@media (max-width: 600px) {
  .container { padding: 0 16px }
  .apt-grid { grid-template-columns: 1fr }
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.fade-in { animation: fadeIn .3s ease both }
