:root {
  /* Background colors - light theme */
  --bg-body: #101416;
  --bg-card: #161c1e;
  --bg-input: #14191b;
  --bg-hover: #1b2225;

  /* Text colors - high contrast on light */
  --text-main: #f2f6f6;
  --text-muted: #c4cecd;
  --text-subtle: #9aa6a4;

  /* Primary colors - verde bosco brand */
  --primary: #3fa9a6;
  --primary-hover: #4cb6b3;
  --primary-dark: #338e8b;

  /* Secondary colors - blu rassicurante */
  --secondary: #cfae70;
  --secondary-hover: #d8bb83;

  /* Status colors */
  --success: #0f9b50;
  --warning: #d97706;
  --error: #c2410c;

  /* Border and effects */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.12);

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* HEADER */
header {
  padding: 0 var(--space-lg);
  height: 70px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-mark {
  font-family: 'Poppins', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.15px;
  padding: 0;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: lowercase;
  border: none;
  background: none;
  box-shadow: none;
}

.brand-mark:hover {
  color: var(--primary-hover);
  transform: translateY(-1px);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
}

.nav-badge {
  background: var(--primary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: top;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 6px;
}

.contact-link:hover {
  color: var(--primary-hover);
  background: rgba(207, 174, 112, 0.12);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.menu-close {
  display: none;
}

.menu-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.menu-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  margin: 3px 0;
  border-radius: 2px;
}

.header-nav a {
  margin-left: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.header-nav a.nav-admin {
  color: var(--primary);
  font-weight: 700;
}

.header-nav a.nav-admin:hover {
  color: var(--primary-hover);
}

.nav-overlay {
  display: none;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* MAP PAGE */
.map-filters .row > div {
  min-width: 200px;
}

/* Collapsible filter panels (risultati / mappa) */
.filter-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-panel__body[hidden] {
  display: none;
}

.map-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.map-panel {
  position: relative;
  z-index: 0;
}

.map-canvas {
  width: 100%;
  height: 70vh;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  z-index: 0;
}

.map-status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  pointer-events: none;
}

.map-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.map-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.map-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.map-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-height: 70vh;
  overflow-y: auto;
}

.map-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.map-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.map-card-thumb {
  width: 110px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.map-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-card-thumb--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-card-title {
  font-weight: 700;
  color: var(--text-main);
}

.map-card-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.map-card-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
}

@media (max-width: 1024px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
  .map-list {
    max-height: none;
  }
  .map-canvas {
    height: 60vh;
  }
}

@media (max-width: 640px) {
  .map-card {
    grid-template-columns: 1fr;
  }
  .map-card-thumb {
    width: 100%;
    height: 180px;
  }
  .map-canvas {
    height: 55vh;
  }
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

/* Card interattive nelle grid */
.grid .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Admin dashboard */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.admin-listing {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow);
  align-items: center;
}

.admin-listing-thumb {
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.admin-listing-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-listing-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.admin-listing-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: flex-start;
}

.admin-listing-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.admin-listing-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.admin-listing-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.admin-listing-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.admin-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-left: auto;
}

.admin-actions.user-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.admin-actions.user-actions form {
  margin: 0;
}

.admin-actions.user-actions button {
  white-space: nowrap;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
}

.badge-active { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.4); }
.badge-draft  { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.4); }
.badge-sold   { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.4); }
.badge-neutral{ background: rgba(148,163,184,0.15); color: #cbd5e1; border-color: rgba(148,163,184,0.4); }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-main);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}

.chart-card h3 {
  margin: 0 0 var(--space-sm);
  color: var(--text-main);
}

.chart-wrapper {
  position: relative;
  height: 320px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.8);
  color: #fecdd3;
}

@media (max-width: 640px) {
  .chart-wrapper {
    height: 260px;
  }
  .admin-listing {
    grid-template-columns: 1fr;
  }
  .admin-listing-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-actions {
    margin-left: 0;
  }
}

/* Profile form */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.profile-header__actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

.profile-form {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.profile-type-toggle {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: nowrap;
  align-items: center;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-input);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-pill:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.profile-pill input {
  accent-color: var(--primary);
}

.profile-type-toggle .profile-pill {
  flex: 1;
  min-width: 220px;
}

.profile-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
}

.profile-badge--biz {
  background: linear-gradient(120deg, #f97316, #f59e0b);
  color: #0b0b0b;
}

.profile-badge--priv {
  background: linear-gradient(120deg, #10b981, #34d399);
  color: #0b0b0b;
}

.profile-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  background: var(--bg-input);
  box-shadow: var(--shadow);
}

.profile-section--muted {
  border-style: dashed;
  background: rgba(255,255,255,0.03);
}

.profile-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.profile-section__title {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
}

.profile-form-wrapper.collapsed {
  display: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.profile-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.profile-price-form {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) minmax(160px, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.profile-price-form label {
  margin: 0;
}

.profile-price-label,
.profile-price-currency {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-price-input {
  max-width: 160px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.profile-price-input::-webkit-outer-spin-button,
.profile-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.profile-price-input {
  -moz-appearance: textfield;
}

.profile-price-btn {
  font-size: 0.78rem;
  padding: 6px 12px;
  white-space: nowrap;
  width: 100%;
}

@media (min-width: 641px) {
  .profile-price-btn--desktop {
    font-size: 0.62rem;
    padding: 6px 10px;
  }
}

.profile-switch {
  margin-top: var(--space-sm);
}

.profile-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 500;
}

.profile-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (max-width: 640px) {
  .profile-header {
    align-items: flex-start;
  }

  .profile-header__actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .profile-header__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .profile-type-toggle {
    flex-wrap: wrap;
  }

  .profile-price-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .profile-price-currency {
    display: none;
  }

  .profile-price-input {
    max-width: none;
  }
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--primary);
  letter-spacing: -0.5px;
  font-weight: 600;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }

/* FORMS */
label {
  display: block;
  margin: var(--space-md) 0 var(--space-xs);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-required {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(237, 254, 0, 0.12);
}

.field-required:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 254, 0, 0.2);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px rgba(237, 254, 0, 0.15);
}

/* Form compatto per pubblicazione/modifica */
.listing-form--compact label {
  margin: var(--space-sm) 0 6px;
  font-size: 0.85rem;
}

.listing-form--compact input,
.listing-form--compact select,
.listing-form--compact textarea {
  padding: 7px 10px;
  font-size: 0.9rem;
}

.listing-form--compact .form-field--large {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.95rem;
}

.listing-form--compact .row {
  gap: var(--space-sm);
}

/* Wizard pubblicazione annuncio */
.wizard-steps {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wizard-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.wizard-step.is-active {
  border-color: var(--primary);
  color: var(--text-main);
  background: rgba(237, 254, 0, 0.08);
}

.wizard-step.is-active .wizard-step-num {
  background: var(--primary);
  color: #000;
}

.wizard-step.is-done {
  border-color: rgba(16, 185, 129, 0.6);
  color: var(--text-main);
}

.wizard-step.is-done .wizard-step-num {
  background: #10b981;
  color: #000;
}

.wizard-desc {
  margin-top: 8px;
  color: var(--text-muted);
}

.wizard-hint {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wizard-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Alert nei form */
.form-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.12);
  color: #fcd34d;
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

.row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.row > div {
  flex: 1;
  min-width: 200px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btnp {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.btnp:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.err {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: var(--space-xs);
  display: block;
}

/* GRID & LISTINGS */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.listing-img-container {
  position: relative;
  width: 100%;
  padding-top: 66%; /* Aspect ratio 3:2 */
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-sm);
  background: var(--bg-input);
}

.listing-img-container img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .listing-img-container img { transform: scale(1.05); }

.price-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-sm);
  background: rgba(0, 128, 0, 0.08);
  border: 1px solid var(--primary-dark);
}

.meta-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.meta-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.meta-info-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.meta-info-label {
  color: var(--text-muted);
  font-weight: 500;
  flex: 0 0 10px;
}

.meta-info-value {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  flex: 1;
}

/* Responsive meta-info */
@media (max-width: 768px) {
  .meta-info {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .meta-info-label {
    flex: 0 0 100px;
    font-size: 0.8rem;
  }

  .meta-info-value {
    font-size: 0.8rem;
  }
}

/* Car details - organized layout for search results */
.car-details {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  overflow: hidden; /* Previene overflow dal contenitore */
}

.car-specs-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
}

.car-location-group {
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.car-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: all 0.2s ease;
  min-width: 0; /* Permette ai flex items di shrinkare sotto la loro dimensione minima */
}

.car-detail-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.car-detail-label {
  color: var(--text-muted);
  font-weight: 500;
  flex: 0 0 70px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.car-detail-value {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  flex: 1;
  font-size: 0.8rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.location-item {
  border-color: rgba(237, 254, 0, 0.2);
}

.location-item .car-detail-label,
.location-item .car-detail-value {
  color: var(--primary);
  font-weight: 700;
}

/* Responsive car-details */
@media (max-width: 768px) {
  .car-details {
    gap: var(--space-xs);
  }

  .car-specs-group {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .car-detail-item {
    padding: 5px 8px;
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  .car-detail-label {
    flex: 0 0 80px;
    font-size: 0.7rem;
  }

  .car-detail-value {
    font-size: 0.75rem;
    text-align: left;
    margin-top: 2px;
  }
  }

.badge {
  font-size: 0.75rem;
  background: var(--bg-input);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.badge:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* Modifiche nelle schede annunci */
.mods-preview {
  margin: var(--space-sm) 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.mod-tag {
  background: rgba(0, 128, 0, 0.08);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(0, 128, 0, 0.18);
  white-space: nowrap;
  display: inline-block;
  transition: all 0.2s ease;
}

.mod-tag.mod-more {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.mod-tag:hover {
  background: rgba(0, 128, 0, 0.14);
  border-color: rgba(0, 128, 0, 0.25);
  transform: translateY(-1px);
}

.mod-tag.mod-more:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Responsive per modifiche nelle schede */
@media (max-width: 768px) {
  .mods-preview {
    margin: var(--space-xs) 0;
    gap: 2px;
  }

  .mod-tag {
    font-size: 0.65rem;
    padding: 1px 6px;
  }
}

/* ===========================================
   MODIFICATIONS GRID - Layout Migliorato
   =========================================== */

/* Contenitore principale a griglia responsive */
.mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* Card di ogni categoria di modifiche */
.mod-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  min-height: 50px; /* Altezza minima per uniformità */
  transition: all 0.2s ease;
}

.mod-category-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
}

/* Titolo della categoria */
.mod-category-title {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mod-category-title:hover {
  color: var(--primary);
  border-bottom-color: var(--primary-hover);
}

/* Contenitore della lista delle opzioni */
.mod-items-list {
  display: grid;
  grid-template-columns: 1fr; /* Una colonna per categoria */
  gap: var(--space-xs);
  flex: 1; /* Occupa tutto lo spazio disponibile */
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Stato collassato */
.mod-category-card.collapsed .mod-items-list {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0;
  margin-bottom: 0;
}

/* Stato espanso */
.mod-category-card:not(.collapsed) .mod-items-list {
  max-height: 1000px; /* Valore sufficientemente alto */
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: var(--space-lg) var(--space-md);
  }

  header {
    padding: 0 var(--space-md);
    height: 60px;
  }

  .header-brand img {
    max-height: 50px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-nav {
    position: fixed;
    top: 12px;
    right: 12px;
    width: min(82vw, 360px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transform: translateX(12px);
    transition: opacity 0.25s ease, max-height 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(10px);
    z-index: 999;
  }

  .menu-close {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    margin-bottom: 6px;
  }

  .menu-close:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
  }

  .header-nav a {
    margin-left: 0;
    font-size: 0.9rem;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .header-nav a:last-child {
    border-bottom: none;
  }

  .header-nav.open {
    opacity: 1;
    pointer-events: auto;
    max-height: 500px;
    transform: translateX(0);
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
  }

  .nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .mods-preview {
    margin: var(--space-xs) 0;
    gap: 2px;
  }

  .mod-tag {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Gestione collasso su mobile */
  .mod-category-card.collapsed .mod-items-list {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0;
    margin-bottom: 0;
  }

  .mod-category-card:not(.collapsed) .mod-items-list {
    max-height: 2000px; /* Valore più alto per mobile */
    opacity: 1;
  }
}

@media (max-width: 480px) {
  main {
    padding: var(--space-md) var(--space-sm);
  }

  header {
    padding: 0 var(--space-sm);
  }

  .header-inner {
    gap: var(--space-sm);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

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

  .mod-category-card {
    float: none;
    width: 100%;
    margin-right: 0;
  }

  .row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .row > div {
    min-width: auto;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================================
   FEATURED LISTINGS SECTION - Homepage
   =========================================== */

.featured-section {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
  padding: var(--space-xl) 0;
  margin: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.featured-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Footer */
.site-footer .container {
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

@media (max-width: 640px) {
  .site-footer .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .site-footer__bottom {
    text-align: left;
  }

  .site-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__bottom-links {
    gap: var(--space-sm);
  }
}

.featured-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.featured-header h2 {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.featured-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
}

.featured-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg-input);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-image img {
  transform: scale(1.05);
}

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 1.2rem;
}

.featured-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--primary);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.featured-content {
  padding: var(--space-md);
}

.featured-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.featured-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.featured-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.featured-features {
  margin-bottom: var(--space-sm);
}

.feature-tag {
  display: inline-block;
  background: rgba(0, 128, 0, 0.1);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: var(--space-xs);
  margin-bottom: var(--space-xs);
  border: 1px solid rgba(0, 128, 0, 0.18);
}

.featured-location {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: var(--space-sm);
}

.featured-footer {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

/* Stats Section */
.stats-section {
  background: var(--bg-card);
  padding: var(--space-xl) 0;
  margin: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  text-align: center;
}

.stat-card {
  padding: var(--space-lg);
  background: var(--bg-hover);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================================
   HOMEPAGE - Layout piu' Vinted
   =========================================== */
.home-hero {
  padding: var(--space-md) 0 var(--space-sm);
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.home-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  align-items: center;
  justify-items: center;
}

.home-hero-copy {
  width: 100%;
  max-width: 720px;
  text-align: center;
}

.home-hero-eyebrow {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 var(--space-sm);
}

.home-hero-copy h1 {
  font-size: 2.15rem;
  line-height: 1.1;
  margin: 0 0 var(--space-sm);
  color: var(--text-main);
}

.home-hero-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: var(--space-sm);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  justify-content: center;
}

.home-hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.home-hero-trust i {
  color: var(--primary);
  margin-right: 6px;
}

.home-hero-categories {
  max-width: 1200px;
  margin: var(--space-md) auto 0;
  padding: 0 var(--space-lg);
  text-align: center;
}

.home-hero-categories-header {
  margin-bottom: var(--space-sm);
}

.home-hero-categories-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.home-hero-categories-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.home-features {
  padding: var(--space-lg) 0 var(--space-xl);
}

.home-features-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
}


.home-features-title h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  text-align: center;
}

.home-features-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.home-features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

.home-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.home-feature:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 169, 166, 0.35);
  box-shadow: var(--shadow);
}

.home-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(63, 169, 166, 0.12);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(63, 169, 166, 0.25);
}

.home-feature-text {
  font-weight: 600;
  font-size: 0.85rem;
}

.home-section {
  padding: var(--space-xl) 0;
}

.home-section-header {
  text-align: left;
  margin-bottom: var(--space-lg);
}

.home-section-header h2 {
  margin-bottom: var(--space-xs);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.category-chips--compact .category-chip--more {
  display: none;
}

.category-chips--compact.is-expanded .category-chip--more {
  display: inline-flex;
}

.category-chips-toggle {
  margin-top: var(--space-sm);
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.category-chips-toggle:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.category-chip {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.category-chip:hover {
  border-color: var(--border-hover);
  color: var(--primary);
  background: var(--bg-hover);
}

.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.listing-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.listing-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.listing-media {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg-input);
}

.listing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.listing-card:hover .listing-media img {
  transform: scale(1.04);
}

.listing-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.listing-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.listing-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.listing-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.listing-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.listing-essentials {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.listing-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.listing-location .distance-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.7rem;
}

.listing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.listing-tag {
  background: rgba(13, 122, 66, 0.15);
  color: var(--primary);
  border: 1px solid rgba(13, 122, 66, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
  }
  .home-features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-hero-copy h1 {
    font-size: 2rem;
  }
  .home-features-banner {
    padding: var(--space-md);
  }
  .listing-media {
    height: 180px;
  }
}

@media (max-width: 640px) {
  .home-features-grid {
    grid-template-columns: 1fr;
  }
  .home-feature {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .home-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Hero Section Migliorata */
.hero {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.hero-content {
  max-width: 900px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  line-height: 1.1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}

.hero p {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
  opacity: 0.92;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
}

.hero-actions {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 2px solid var(--primary);
  box-shadow: 0 4px 15px rgba(0, 128, 0, 0.28);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 128, 0, 0.32);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 2px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.2rem;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 500;
}

.feature-icon {
  font-size: 1.2rem;
  opacity: 1;
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-lg) var(--space-md);
    min-height: 50vh;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .hero-actions {
    gap: var(--space-md);
  }

  .btn-primary, .btn-secondary {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.95rem;
  }

  .hero-features {
    gap: var(--space-lg);
  }

  .feature-item {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: var(--space-lg) var(--space-sm);
    text-align: left;
  }

  .hero-content {
    text-align: left;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary, .btn-secondary {
    justify-content: center;
  }

  .hero-features {
    justify-content: flex-start;
    gap: var(--space-md);
  }
}

/* ===========================================
   LISTING DETAIL PAGE - Two Column Layout
   =========================================== */

.listing-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.listing-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.listing-image-column {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.listing-main-image {
  width: 100%;
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-card);
}

.listing-data-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.listing-header {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.listing-description {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.listing-features {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Gallery Section */
.gallery-section {
  margin-bottom: var(--space-xl);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.gallery-header h3 {
  margin: 0;
}

.photo-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumb {
  transform: scale(1.1);
}

/* Modifications Section */
.modifications-section {
  margin-bottom: var(--space-xl);
}

.modifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.modification-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.category-title {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--space-md) 0;
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--primary);
}

.category-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.mod-item {
  background: var(--bg-input);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.mod-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* Responsive per galleria e modifiche */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
  }

  .modifications-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .modification-category {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .category-items {
    gap: 6px;
  }

  .mod-item {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

/* Clear per creare nuove righe dopo ogni coppia di card */
.mod-category-card:nth-child(2n) {
  margin-right: 0;
}

.mod-category-card:nth-child(2n+1) {
  clear: left;
}

/* Responsive per dispositivi mobili */
@media (max-width: 768px) {
  .mod-category-card {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 12px;
    padding: 16px;
    min-height: auto;
  }

  .mod-category-card:nth-child(2n) {
    margin-right: 0;
  }

  .mod-category-card:nth-child(2n+1) {
    clear: none;
  }

  .mod-category-title {
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .mod-option {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .mod-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
  }

  /* Gestione collasso su mobile */
  .mod-category-card.collapsed .mod-items-list {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0;
    margin-bottom: 0;
  }

  .mod-category-card:not(.collapsed) .mod-items-list {
    max-height: 2000px; /* Valore più alto per mobile */
    opacity: 1;
  }
}

/* Responsive per pagina dettaglio */
@media (max-width: 1024px) {
  .listing-main {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .listing-image-column {
    position: static;
    order: -1; /* Immagine prima su tablet */
  }

  .listing-main-image {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .listing-detail {
    padding: var(--space-md);
  }

  .listing-main {
    gap: var(--space-md);
  }

  .listing-main-image {
    height: 300px;
  }

  .listing-header,
  .listing-description,
  .listing-features {
    padding: var(--space-md);
  }

  .price-tag {
    font-size: 2rem !important;
  }
}

@media (max-width: 480px) {
  .listing-main-image {
    height: 250px;
  }

  .listing-header h1 {
    font-size: 1.5rem;
  }

  .price-tag {
    font-size: 1.8rem !important;
  }
}

/* Utility Classes */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-secondary { background: var(--secondary) !important; }

.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Focus states */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* LISTING DETAIL PAGE STYLES */
.listing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

/* Impedisce che i contenuti (es. galleria) forzino larghezze extra */
.listing-detail-grid > * {
  min-width: 0;
}

@media (max-width: 768px) {
  .listing-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

.listing-cover-col {
  order: 1;
  min-width: 0; /* consente alla colonna di non espandere la griglia */
}

.listing-info-col {
  order: 2;
  min-width: 0;
}

@media (max-width: 768px) {
  .listing-cover-col {
    order: 1;
  }
  .listing-info-col {
    order: 2;
  }
}

.listing-cover-card {
  top: 90px;
}

@media (max-width: 768px) {
  .listing-cover-card {
    position: static;
  }
}

.listing-cover-main {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.wishlist-toggle {
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.wishlist-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.wishlist-toggle.active {
  background: #d97706 !important;
  border-color: #d97706 !important;
}

.listing-cover-main-placeholder {
  width: 100%;
  height: 300px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.listing-price-views {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-lg) 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 480px) {
  .listing-price-views {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

.price-tag {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 768px) {
  .price-tag {
    font-size: 2.2rem;
  }
}

.listing-views-badge {
  background: var(--bg-input);
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.listing-features-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
}

.listing-features-badges span {
  background: var(--primary);
  color: #ffffff;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.listing-description-box {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.listing-description-box h3 {
  margin-bottom: var(--space-md);
  color: var(--text-main);
}

.listing-description-box p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* GALLERY STYLES */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* MODIFICATIONS DETAIL STYLES */
.mods-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.mod-detail-category {
  background: var(--bg-input);
  padding: var(--space-lg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.mod-detail-title {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.mod-detail-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.mod-detail-tag {
  background: var(--primary);
  color: #ffffff;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* SOCIAL SHARE STYLES */
.social-share-section {
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.social-share-section h4 {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
}

.social-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  transition: color 0.2s ease;
  text-decoration: none;
  border: none;
  background: transparent;
  padding: var(--space-xs);
  border-radius: 4px;
  width: auto;
  height: auto;
}

.social-text {
  display: none;
}

.social-btn:hover {
  color: var(--primary);
}

.social-icon {
  line-height: 1;
}

.social-text {
  line-height: 1;
}

@media (max-width: 480px) {
  .social-share-buttons {
    justify-content: center;
  }
}

/* LOCATION LINK STYLES */
.location-link {
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.location-link:hover {
  color: var(--secondary-hover);
  text-decoration: underline;
  transform: translateY(-1px);
}

.location-link:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* FOOTER STYLES */
footer a:hover {
  color: var(--primary) !important;
}

/* MESSAGING SYSTEM STYLES */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.message-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.message-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.message-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.message-sender {
  font-weight: 600;
  color: var(--text-main);
}

.message-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.unread-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: var(--space-sm);
}

.message-subject {
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}

.message-preview {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* CONVERSATION STYLES */
.conversation-container {
  max-height: 600px;
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.message-bubble {
  max-width: 70%;
  padding: var(--space-md);
  border-radius: var(--radius);
  position: relative;
}

.message-highlight {
  box-shadow: 0 0 0 2px var(--primary);
}

.message-sent {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  margin-left: auto;
}

.message-received {
  align-self: flex-start;
  background: var(--bg-input);
  color: var(--text-main);
  margin-right: auto;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
  font-size: 0.8rem;
  opacity: 0.8;
}

.message-author {
  font-weight: 600;
}

.message-time {
  font-size: 0.75rem;
}

.message-subject-bubble {
  font-weight: 600;
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}

.message-text {
  line-height: 1.5;
  word-wrap: break-word;
}

@media (max-width: 768px) {
  .message-item {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }

  .avatar-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .message-bubble {
    max-width: 85%;
  }

  .conversation-container {
    max-height: 400px;
    padding: var(--space-sm);
  }
}

/* MODIFICATIONS CHEVRON AND ALIGNMENT IMPROVEMENTS */
.mod-chevron {
  margin-left: auto;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  opacity: 0.7;
  transform-origin: center;
}

.mod-category-card.collapsed .mod-chevron {
  transform: rotate(-90deg);
}

.mod-category-card:not(.collapsed) .mod-chevron {
  transform: rotate(0deg);
}

.mod-category-title:hover .mod-chevron {
  opacity: 1;
  color: var(--primary);
}

/* Miglior allineamento checkbox */
.mod-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.mod-option:hover {
  background-color: var(--bg-hover);
}

.mod-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: var(--primary);
  cursor: pointer;
}

.mod-option span {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Image Popup Styles */
.image-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.image-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-popup-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-popup-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.3s ease;
}

.image-popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.image-popup-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.05);
}

.image-popup-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.image-popup-prev {
  left: -60px;
}

.image-popup-next {
  right: -60px;
}

.image-popup-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.image-popup-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.image-popup-close:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-popup-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .image-popup-close {
    top: -45px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .image-popup-nav {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .image-popup-prev {
    left: 10px;
  }

  .image-popup-next {
    right: 10px;
  }

  .image-popup-img {
    max-height: 80vh;
  }

  .image-popup-counter {
    bottom: -30px;
    font-size: 0.8rem;
  }
}

/* Aggiungi cursore pointer alle immagini cliccabili nella pagina dettaglio */
.listing-cover-main,
.gallery-item .thumb {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.listing-cover-main:hover,
.gallery-item .thumb:hover {
  transform: scale(1.02);
}

/* === SISTEMA UPLOAD IMMAGINI MODERNO === */
.image-upload-container {
  margin: var(--space-lg) 0;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  background: var(--bg-card);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(237, 254, 0, 0.05);
  transform: scale(1.01);
}

.upload-zone.drag-over {
  border-style: solid;
  background: rgba(237, 254, 0, 0.1);
  box-shadow: 0 0 20px rgba(237, 254, 0, 0.2);
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.upload-icon {
  font-size: 3rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
  color: var(--primary);
}

.upload-text {
  font-size: 1.1rem;
  color: var(--text-main);
}

.upload-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.upload-link:hover {
  color: var(--primary-hover);
}

.upload-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.image-preview-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: move;
}

.image-preview-item.loading {
  border-color: var(--border-hover);
}

.image-preview-item.preview-error {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.image-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-preview-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.image-preview-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.image-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-preview-item:hover .image-preview-overlay {
  opacity: 1;
}

.image-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  z-index: 2;
}

.image-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}

.image-loading-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.image-preview-remove,
.image-preview-cover {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
}

.image-preview-remove:hover {
  background: #dc2626;
  color: white;
  transform: scale(1.1);
}

.image-preview-cover:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.1);
}

.cover-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #000;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-preview-info {
  padding: var(--space-sm);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.image-filename {
  display: block;
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.image-status {
  display: block;
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
}

/* STILI PROFILO UNIFICATO */
.nav-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === SISTEMA LOADER PER MIGLIORARE UX === */

/* Loader globale overlay */
.global-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.global-loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.global-loader-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 200px;
}

.global-loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.global-loader-text {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* Loader per bottoni */
.button-loader {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Loader per select/disabled states */
.select-loading {
  position: relative;
}

.select-loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  pointer-events: none;
}

/* Animazione spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive per mobile */
@media (max-width: 768px) {
  .upload-zone {
    padding: var(--space-lg);
  }

  .upload-icon {
    font-size: 2.5rem;
  }

  .upload-text {
    font-size: 1rem;
  }

  .image-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
  }

  .image-preview-info {
    padding: var(--space-xs);
  }

  .global-loader-content {
    margin: var(--space-md);
    padding: var(--space-lg);
    min-width: 180px;
  }

  .global-loader-text {
    font-size: 0.8rem;
  }
}

/* === GALLERIA SCORREVOLE === */

/* Contenitore principale della galleria */
.gallery-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

/* Area di scorrimento */
.gallery-scroll {
  flex: 1;
  min-width: 0; /* evita che il contenitore si espanda oltre la card */
  max-width: 100%;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Nasconde la scrollbar in Chrome/Safari */
.gallery-scroll::-webkit-scrollbar {
  display: none;
}

/* Singola immagine della galleria scorrevole */
.gallery-container .gallery-item {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Hover effect per le immagini della galleria */
.gallery-container .gallery-item:hover {
  transform: scale(1.05);
}

/* Pulsanti di navigazione */
.gallery-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  font-size: 16px;
  transition: all 0.2s ease;
  z-index: 1;
  flex-shrink: 0;
}

/* Hover dei pulsanti */
.gallery-nav:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

/* Stato disabilitato dei pulsanti */
.gallery-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 14px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-banner__text {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.4;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: baseline;
}

.cookie-banner__text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* === COMPARATORE ANNUNCI === */
.compare-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.compare-toggle:hover {
  transform: scale(1.05);
  background: rgba(37, 99, 235, 0.9);
}

.compare-toggle.is-active {
  background: rgba(16, 185, 129, 0.95);
}

.compare-bar {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  display: none;
  backdrop-filter: blur(6px);
}

.compare-bar.is-visible {
  display: block;
}

.compare-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.compare-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.compare-slot {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
}

.compare-slot.is-filled {
  border-style: solid;
  background: rgba(30, 41, 59, 0.8);
}

.compare-slot-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #0f172a;
  object-fit: cover;
  flex-shrink: 0;
}

.compare-slot-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
}

.compare-slot-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.compare-slot-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1rem;
}

.compare-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compare-count {
  font-size: 0.85rem;
  color: #cbd5f5;
}

.compare-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.compare-modal.is-open {
  display: flex;
}

.compare-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
}

.compare-modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: min(1100px, 92vw);
  max-height: 84vh;
  overflow: auto;
  z-index: 2;
}

.compare-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.4rem;
}

.compare-modal-header h2 {
  margin: 0 0 4px 0;
}

.compare-modal-header p {
  margin: 0 0 18px 0;
  color: var(--text-muted);
}

.compare-table {
  display: grid;
  grid-template-columns: 160px repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 760px;
}

.compare-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.compare-cell {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: 10px;
}

.compare-cell.is-empty {
  color: var(--text-muted);
  text-align: center;
}

.compare-cell img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.compare-cell a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
}

.compare-cell .compare-price {
  color: var(--primary);
  font-weight: 700;
}

.compare-cell .compare-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

body.is-compare-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .compare-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .compare-table {
    min-width: 680px;
  }
}

/* ====== Schede tecniche ====== */
.tech-sheet-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
  margin: 16px 0 24px;
}

.tech-sheet-sidebar .card {
  position: sticky;
  top: 16px;
}

.tech-sheet-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}

.tech-sheet-spec {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tech-sheet-spec-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tech-sheet-spec-value {
  font-weight: 600;
}

.tech-sheet-body h1,
.tech-sheet-body h2,
.tech-sheet-body h3 {
  margin: 16px 0 8px;
}

.tech-sheet-body p {
  margin: 8px 0;
  line-height: 1.6;
}

.tech-sheet-body ul {
  margin: 8px 0 8px 18px;
}

.tech-sheet-listings {
  display: grid;
  gap: 12px;
}

.tech-sheet-listing-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.tech-sheet-listing-link {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.tech-sheet-listing-media img,
.tech-sheet-listing-placeholder {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #1f2937;
}

.tech-sheet-listing-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.tech-sheet-listing-body {
  padding: 10px 10px 10px 0;
}

.tech-sheet-listing-price {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.tech-sheet-listing-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.tech-sheet-listing-meta,
.tech-sheet-listing-essentials,
.tech-sheet-listing-location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tech-sheet-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tech-sheet-gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tech-sheet-list .tech-sheet-make-block {
  margin-bottom: 18px;
}

.tech-sheet-models {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-sheet-model-link {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  background: var(--bg-card);
}

@media (max-width: 980px) {
  .tech-sheet-layout {
    grid-template-columns: 1fr;
  }
  .tech-sheet-sidebar .card {
    position: static;
  }
  .tech-sheet-listing-link {
    grid-template-columns: 100px 1fr;
  }
}

/* AREE SOSTA */
.area-sosta-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

.area-sosta-sidebar {
  order: 1;
}

.area-sosta-main {
  order: 2;
  min-width: 0;
}

.area-sosta-sidebar-card {
  position: sticky;
  top: calc(var(--space-lg) + 74px);
}

.area-sosta-sidebar-list {
  display: grid;
  gap: 10px;
}

.area-sosta-ad-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}

.area-sosta-ad-link {
  display: grid;
  grid-template-columns: 110px 1fr;
  text-decoration: none;
  color: inherit;
}

.area-sosta-ad-image {
  width: 100%;
  height: 100%;
  min-height: 86px;
  object-fit: cover;
  display: block;
}

.area-sosta-ad-copy {
  padding: 8px;
}

.area-sosta-ad-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.area-sosta-ad-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.area-sosta-ad-price {
  margin-top: 4px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.area-sosta-card {
  margin-top: 14px;
}

.area-sosta-cover-link,
.area-sosta-cover-wrap {
  display: block;
  margin: -12px -12px 12px;
}

.area-sosta-cover {
  width: 100%;
  object-fit: cover;
  display: block;
  max-height: 320px;
}

.area-sosta-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.area-sosta-excerpt {
  font-size: 1.02rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.area-sosta-content {
  line-height: 1.65;
}

.area-sosta-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-sosta-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #000;
  font-size: 0.85rem;
}

.area-sosta-contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-sosta-info-grid {
  display: grid;
  gap: 8px;
}

.area-sosta-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.area-sosta-gallery-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 980px) {
  .area-sosta-layout {
    grid-template-columns: 1fr;
  }

  .area-sosta-sidebar {
    order: 2;
  }

  .area-sosta-main {
    order: 1;
  }

  .area-sosta-sidebar-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .area-sosta-cover-link,
  .area-sosta-cover-wrap {
    margin: -10px -10px 10px;
  }

  .area-sosta-cover {
    max-height: 180px;
  }

  .area-sosta-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .area-sosta-gallery-image {
    height: 110px;
  }
}
