/* =============================================================
   propiedad.css — Individual property detail page
   ============================================================= */

/* ── LOADING / ERROR ── */
.prop-det-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-block: 12rem;
  color: var(--cream-2);
  font-size: .95rem;
}

.prop-det-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  padding-block: 10rem;
  color: var(--cream-2);
}

/* El display:flex empata con el [hidden] del navegador y lo anula. Esta
   regla más específica hace que el atributo hidden vuelva a ocultar. */
.prop-det-loading[hidden],
.prop-det-error[hidden] {
  display: none;
}

/* ── BREADCRUMB ── */
.prop-det-breadcrumb {
  padding-top: clamp(6rem, 12vw, 9rem);
  padding-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--cream-2);
}

.prop-det-breadcrumb a {
  color: var(--gold);
  text-decoration: none;
  transition: opacity .2s;
}
.prop-det-breadcrumb a:hover { opacity: .7; }

.prop-det-breadcrumb span {
  text-transform: uppercase;
  opacity: .5;
}
.prop-det-breadcrumb span::before { content: "—  "; }

/* ── GALLERY ── */
.prop-det-gallery-section {
  position: relative;
  background: var(--bg-2);
  padding: 1.25rem 0 1rem;
}

.prop-det-gallery {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Visor: la foto se ve entera, sin recortar ni ampliar */
.pg-stage {
  position: relative;
  height: clamp(250px, 56vw, 560px);
  background: #e6e9ed;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-main {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
.pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--cream);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.pg-prev { left: 12px; }
.pg-next { right: 12px; }
@media (hover: hover) { .pg-arrow:hover { background: #fff; color: var(--teal); } }
.pg-expand {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  color: var(--cream);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.pg-count {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  padding: .3rem .7rem;
  border-radius: 99px;
  z-index: 2;
}
.pg-thumbs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .75rem 0 .35rem;
  scroll-snap-type: x proximity;
}
.pg-thumb {
  flex: 0 0 auto;
  width: 96px; height: 66px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #d5d9de;
  cursor: pointer;
  opacity: .7;
  scroll-snap-align: center;
  transition: opacity .2s, border-color .2s;
}
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-thumb:hover { opacity: 1; }
.pg-thumb.is-active { border-color: var(--teal); opacity: 1; }

/* Pantalla completa */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 16, 22, .95);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-lightbox[hidden] { display: none; }
.pg-lb-img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.pg-lb-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.pg-lb-count {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .1em;
}

.prop-det-gallery-placeholder {
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-3);
  background: var(--bg-2);
}

/* ── BODY LAYOUT ── */
.prop-det-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  padding-block: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

@media (max-width: 1024px) {
  .prop-det-body {
    grid-template-columns: 1fr;
  }
}

/* ── MAIN COLUMN ── */
.prop-det-header {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.prop-det-badges {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.prop-det-badge {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 4px;
  font-weight: 500;
}
.prop-det-badge.venta    { background: var(--gold); color: #fff; }
.prop-det-badge.alquiler { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.2); }
.prop-det-badge.tipo     { background: rgba(255,255,255,.07); color: var(--cream-2); border: 1px solid var(--line); }

.prop-det-title {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.prop-det-address {
  font-size: .875rem;
  color: var(--cream-2);
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Price mobile (hidden on desktop) */
.prop-det-price-mobile {
  display: none;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 1024px) {
  .prop-det-price-mobile { display: block; }
}

.prop-det-price-big {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.04em;
}
.prop-det-price-big span {
  font-size: .8em;
  font-weight: 400;
  color: var(--cream-2);
  margin-left: .25rem;
}
.prop-det-price-note {
  font-size: .8rem;
  color: var(--cream-3);
  margin-top: .35rem;
}

/* Specs grid */
.prop-det-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.prop-det-spec {
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.prop-det-spec-icon {
  color: var(--gold);
  flex-shrink: 0;
}
.prop-det-spec-val {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.prop-det-spec-lbl {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cream-3);
}

/* Section titles */
.prop-det-section-title {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

/* Description */
.prop-det-desc-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.prop-det-desc {
  font-size: clamp(.875rem, 1.3vw, .95rem);
  color: var(--cream-2);
  line-height: 1.85;
}
.prop-det-desc p { margin-bottom: .9rem; }
.prop-det-desc p:last-child { margin-bottom: 0; }

/* Tabla características */
.prop-det-tabla-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.prop-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(.8rem, 1.2vw, .9rem);
}
.prop-tabla tr:nth-child(odd) { background: var(--bg); }
.prop-tabla tr:nth-child(even) { background: var(--bg-2); }
.prop-tabla-key {
  padding: .6rem 1rem;
  color: var(--cream-2);
  font-weight: 400;
  width: 45%;
}
.prop-tabla-val {
  padding: .6rem 1rem;
  color: var(--cream);
  font-weight: 500;
}

/* Mapa */
.prop-det-mapa-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.prop-det-mapa {
  height: 340px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* Extras */
.prop-det-extras-block {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.prop-det-extras {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .6rem;
}
.prop-det-extras li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--cream-2);
}
.prop-det-extras li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* Energy certificate */
.prop-det-energy-block {
  margin-bottom: 2.5rem;
}
.prop-det-energy { }
.energy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.energy-col-title {
  font-size: .78rem;
  font-weight: 500;
  color: var(--cream-2);
  margin-bottom: .75rem;
  line-height: 1.4;
}
.energy-col-title small {
  font-weight: 400;
  color: var(--cream-3);
}
.energy-scale { display: flex; flex-direction: column; gap: 3px; }
.energy-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.energy-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 22px;
  border-radius: 0 3px 3px 0;
  padding-right: 8px;
  min-width: 40px;
  transition: opacity .2s;
}
.energy-row:not(.is-active) .energy-bar { opacity: .35; }
.energy-bar-letter {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
}
.energy-arrow {
  width: 0; height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left-width: 10px;
  border-left-style: solid;
  flex-shrink: 0;
}
.energy-value {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--cream);
}

/* ── SIDEBAR ── */
.prop-det-sidebar {
  position: sticky;
  top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .prop-det-sidebar { position: static; order: -1; }
}

.prop-det-price-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
}

@media (max-width: 1024px) {
  .prop-det-price-card { display: none; }
}

.prop-det-price {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.04em;
  margin-bottom: .35rem;
}
.prop-det-price span {
  font-size: .75em;
  font-weight: 400;
  color: var(--cream-2);
  margin-left: .2rem;
}
.prop-det-price-detail {
  font-size: .8rem;
  color: var(--cream-3);
  line-height: 1.6;
}

.prop-det-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

.prop-det-agent {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--line);
}

.prop-det-agent-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.prop-det-agent-name {
  font-size: .9rem;
  font-weight: 500;
  color: var(--cream);
}
.prop-det-agent-role {
  font-size: .75rem;
  color: var(--cream-3);
  margin-top: .1rem;
}

.prop-det-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  text-align: center;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--cream-2);
  padding: .7rem 1.5rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--cream);
}

/* Compartir la propiedad (WhatsApp, correo, copiar enlace) */
.prop-det-share { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.prop-det-share[hidden] { display: none; }
.prop-det-share-label { font-size: .75rem; color: var(--cream-3); margin: 0 0 .6rem; letter-spacing: .04em; }
.prop-det-share-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.prop-det-share-btn {
  flex: 1 1 auto;
  padding: .55rem .9rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream-2);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
@media (hover: hover) { .prop-det-share-btn:hover { border-color: var(--gold); color: var(--gold); } }

/* Garaje y ascensor en las características principales */
.prop-det-spec.is-si .prop-det-spec-val { color: var(--teal); }
.prop-det-spec.is-no .prop-det-spec-val { color: var(--cream-3); font-weight: 400; }
.prop-det-spec.is-no .prop-det-spec-icon { color: var(--cream-3); opacity: .65; }
