/* ============================================================
   LISTING PAGE — Via della Croce, 45
   ============================================================ */

/* ----- PANEL SHOW / HIDE ----- */
.listing-detail-panel {
  display: none;
}
body.listing-open .listing-detail-panel {
  display: block;
}
body.listing-open .hero,
body.listing-open .listings-section,
body.listing-open .sell-section,
body.listing-open .about-section {
  display: none;
}

/* ----- BACK BUTTON ----- */
.lp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--pine);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}
.lp-back-btn:hover { opacity: 0.7; }

/* ----- PORTRAIT CIRCLE ----- */
.sidebar-portrait-wrap {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}
.sidebar-portrait {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border: 2px solid var(--parchment);
}

/* ----- PAGE WRAPPER ----- */
.lp {
  padding-top: 2rem;
  padding-bottom: 6rem;
}
.lp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ----- BREADCRUMB ----- */
.lp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--slate);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}
.lp-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--pine);
  transition: opacity 0.2s;
}
.lp-breadcrumb a:hover { opacity: 0.7; }
.bc-sep { opacity: 0.4; }

/* ----- GALLERY ----- */
.lp-gallery {
  display: grid;
  grid-template-columns: 1fr 0.54fr;
  grid-template-rows: 540px;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--parchment);
}
.gallery-main-btn {
  display: block;
  width: 100%; height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--parchment);
}
.gallery-main-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  display: block;
}
.gallery-main-btn:hover .gallery-main-img { transform: scale(1.03); }

.gallery-thumbs {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
}
.gallery-thumb-btn {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--parchment);
}
.gallery-thumb-btn img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  display: block;
}
.gallery-thumb-btn:hover img { transform: scale(1.05); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fff;
  transition: background 0.2s;
}
.gallery-thumb-btn:hover .gallery-overlay { background: rgba(0,0,0,0.52); }
.gallery-overlay-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ----- TWO-COLUMN BODY ----- */
.lp-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}
.lp-main { min-width: 0; }

/* ----- LISTING HEADER ----- */
.lp-header { margin-bottom: 1.75rem; }
.lp-type {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
  margin-bottom: 0.6rem;
}
.lp-title {
  font-family: 'Newsreader', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.lp-price {
  font-family: 'Newsreader', serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--pine);
  letter-spacing: -0.02em;
}
.lp-price .price-euro {
  font-size: 0.6em;
  vertical-align: 0.18em;
}

/* ----- QUICK SPECS BAR ----- */
.lp-quickspecs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 2.5rem;
  border: 1px solid var(--parchment);
  border-radius: 10px;
  overflow: hidden;
}
.qs-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-right: 1px solid var(--parchment);
  flex: 1;
  min-width: 100px;
}
.qs-item:last-child { border-right: none; }
.qs-icon {
  color: var(--pine);
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.qs-icon svg { width: 18px; height: 18px; display: block; }
.qs-text { display: flex; flex-direction: column; gap: 1px; }
.qs-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.qs-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ----- SECTIONS ----- */
.lp-section { margin-bottom: 2.5rem; }
.lp-section-title {
  font-family: 'Newsreader', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--parchment);
}

/* ----- DESCRIPTION ----- */
.lp-desc { display: flex; flex-direction: column; gap: 1rem; }
.lp-desc p {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--slate);
  line-height: 1.85;
}

/* ----- CHARACTERISTICS GRID ----- */
.lp-chars {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.char-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--parchment);
}
.char-item:nth-child(odd) { padding-right: 2rem; }
.char-item:nth-child(even) {
  padding-left: 2rem;
  border-left: 1px solid var(--parchment);
}
.char-item:nth-last-child(1),
.char-item:nth-last-child(2) { border-bottom: none; }
.char-icon {
  color: var(--pine);
  width: 22px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.char-icon svg { width: 17px; height: 17px; display: block; }
.char-icon--lg svg { width: 21px; height: 21px; }
.char-icon--sm svg { width: 14px; height: 14px; }
.char-label {
  flex: 1;
  font-size: 0.8rem;
  color: var(--slate);
}
.char-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  margin-left: auto;
  flex-shrink: 0;
}

/* ----- COSTS SECTION ----- */
.lp-costs {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--parchment);
  border-radius: 10px;
  overflow: hidden;
}
.cost-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--parchment);
}
.cost-item:last-child { border-bottom: none; }
.cost-icon {
  color: var(--pine);
  width: 17px; height: 17px;
  flex-shrink: 0;
  display: flex; align-items: center;
}
.cost-icon svg { width: 17px; height: 17px; display: block; }
.cost-label { flex: 1; font-size: 0.82rem; color: var(--slate); }
.cost-value { font-size: 0.9rem; font-weight: 500; color: var(--ink); }

/* ----- 360 VIRTUAL TOUR ----- */
.lp-tour {
  border-radius: 10px;
  overflow: hidden;
  height: 480px;
  background: var(--parchment);
}
.lp-tour iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* ----- UNION ENERGIA BANNER ----- */
.lp-energia {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 1.75rem 2rem;
  background: rgba(43, 85, 53, 0.04);
  border: 1px solid rgba(43, 85, 53, 0.14);
  border-left: 3px solid var(--pine);
  border-radius: 0 10px 10px 0;
  margin-bottom: 2.5rem;
}
.energia-logo-wrap {
  flex-shrink: 0;
  width: 130px; height: 80px;
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.energia-logo-wrap img {
  max-width: 110px;
  max-height: 60px;
  object-fit: contain;
}
.energia-logo-placeholder {
  font-size: 0.6rem;
  color: var(--mist);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.5;
}
.energia-info { flex: 1; }
.energia-info h3 {
  font-family: 'Newsreader', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.energia-info p {
  font-size: 0.83rem;
  color: var(--slate);
  line-height: 1.7;
  font-weight: 400;
}
.energia-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
  border-bottom: 1px solid var(--pine);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}
.energia-tag:hover { opacity: 0.7; }

/* ----- ENERGY EFFICIENCY ----- */
.lp-energy { display: flex; flex-direction: column; gap: 1.5rem; }
.energy-top { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.energy-badge-wrap { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.energy-badge {
  width: 52px; height: 52px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.energy-class-c { background: #f5c200; color: var(--forest); }
.energy-class-e { background: #ea6b00; }
.energy-class-f { background: #e13b1b; }
.energy-class-g { background: #c00000; }
.energy-badge-info { display: flex; flex-direction: column; gap: 2px; }
.energy-badge-label { font-size: 0.82rem; font-weight: 500; color: var(--ink); }
.energy-badge-desc { font-size: 0.72rem; color: var(--slate); font-weight: 400; }

.energy-scale-wrap { flex: 1; min-width: 200px; }
.energy-scale { display: flex; height: 10px; gap: 2px; margin-bottom: 5px; }
.energy-bar { flex: 1; border-radius: 2px; opacity: 0.28; }
.energy-bar.active { opacity: 1; }
.eb-a4 { background: #00a651; }
.eb-a3 { background: #4cb848; }
.eb-a2 { background: #8dc641; }
.eb-a1 { background: #bed630; }
.eb-b  { background: #e3e41d; }
.eb-c  { background: #f5c200; }
.eb-d  { background: #f5a200; }
.eb-e  { background: #ea6b00; }
.eb-f  { background: #e13b1b; }
.eb-g  { background: #c00000; }
.energy-scale-labels { display: flex; font-size: 0.6rem; color: var(--slate); }
.energy-scale-labels span { flex: 1; text-align: center; }

.energy-data {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--parchment);
  border-radius: 10px;
  overflow: hidden;
}
.energy-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 0.875rem 1.25rem;
  border-right: 1px solid var(--parchment);
}
.energy-row:last-child { border-right: none; }
.energy-label-text { font-size: 0.68rem; color: var(--slate); text-transform: uppercase; letter-spacing: 0.07em; }
.energy-value-text { font-size: 0.92rem; font-weight: 500; color: var(--ink); margin-top: 2px; }

/* ----- FLOORPLAN ----- */
.lp-floorplan {
  background: var(--parchment);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.floorplan-img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* ----- MAP ----- */
.lp-map {
  border-radius: 10px;
  overflow: hidden;
  height: 320px;
  background: var(--parchment);
}
.lp-map iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}
.lp-map-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ----- SIDEBAR ----- */
.lp-sidebar {
  position: sticky;
  top: 1.5rem;
}
.lp-sidebar-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
}
.sidebar-agency {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}
.agency-logo {
  max-width: 170px;
  max-height: 56px;
  object-fit: contain;
}
.sidebar-divider {
  width: 100%;
  height: 1px;
  background: #d8d8d8;
  flex-shrink: 0;
  margin-top: 0.5rem;
  margin-bottom: -0.35rem;
}
.sidebar-agent-name {
  font-family: 'Newsreader', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
}
.sidebar-agent-role {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 3px;
}
.sidebar-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  background: var(--forest);
  color: #fff;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(28,56,32,0.28);
}
.sidebar-wa-btn:hover {
  background: var(--pine);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(28,56,32,0.36);
}
.sidebar-wa-btn svg { flex-shrink: 0; }
.sidebar-listing-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-ref {
  font-size: 0.72rem;
  color: var(--slate);
  font-weight: 400;
}
.sidebar-ref strong {
  color: var(--ink);
  font-weight: 500;
}

/* ----- LIGHTBOX ----- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10,10,10,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.lightbox.lb-open {
  opacity: 1;
  pointer-events: all;
}
.lb-inner {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap {
  max-width: 90vw;
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  transition: opacity 0.2s;
}
.lb-img.lb-transitioning { opacity: 0; }
.lb-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }
.lb-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lb-btn:hover { background: rgba(255,255,255,0.20); }
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }
.lb-counter {
  position: absolute;
  bottom: 1.75rem; left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
}

/* ============================================================
   OTHER LISTINGS CAROUSEL
   ============================================================ */
.other-listings-section {
  background: var(--cream);
  padding: 4rem 0 5rem;
  border-top: 1px solid var(--parchment);
}
.ol-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.ol-header { margin-bottom: 2.5rem; }
.ol-title {
  font-family: 'Newsreader', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 400;
  color: var(--ink);
  margin-top: 0.4rem;
  line-height: 1.1;
}
.ol-carousel-wrap {
  position: relative;
}
.ol-track-clip {
  overflow: hidden;
  border-radius: var(--radius);
}
.ol-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.45s var(--ease-out);
}
.ol-track .listing-card {
  flex: 0 0 336px;
  width: 336px;
}
.ol-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--parchment);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--pine);
  transition: box-shadow 0.2s, opacity 0.2s;
  cursor: pointer;
}
.ol-btn:hover {
  box-shadow: var(--shadow-md);
}
.ol-prev { left: -1.3rem; }
.ol-next { right: -1.3rem; }

@media (max-width: 640px) {
  .ol-btn { display: none; }
  .ol-track-clip { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ol-track { transition: none; }
  .ol-track .listing-card { flex: 0 0 80vw; width: 80vw; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .lp-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 320px 200px;
  }
  .gallery-thumbs {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr;
  }
  .lp-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .lp-sidebar { position: static; }
  .lp-quickspecs { gap: 0; }
}

@media (max-width: 640px) {
  .lp-gallery {
    grid-template-rows: 260px 160px;
    border-radius: 10px;
  }
  .lp-chars { grid-template-columns: 1fr; }
  .char-item:nth-child(odd) { padding-right: 0; }
  .char-item:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
  .char-item:nth-last-child(1) { border-bottom: none; }
  .char-item:nth-last-child(2) { border-bottom: 1px solid var(--parchment); }
  .lp-energia { flex-direction: column; gap: 1.25rem; }
  .lp-quickspecs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    flex-wrap: initial;
  }
  .qs-item {
    min-width: 0;
    border-right: 1px solid var(--parchment);
    border-bottom: 1px solid var(--parchment);
    flex: unset;
  }
  .qs-item:nth-child(3n) { border-right: none; }
  .qs-item:last-child { border-right: none; }
  .qs-item:nth-last-child(-n+2) { border-bottom: none; }
  .lb-prev { left: 0.75rem; }
  .lb-next { right: 0.75rem; }
}
