/* ===== Lomas Propiedades — piezas compartidas por las demos ===== */
body[data-demo="presencia"] { --lp-accent: #1e3a32; --lp-accent-2: #2c5246; --lp-soft: #efe8dc; }
body[data-demo="catalogo"]  { --lp-accent: #b8431f; --lp-accent-2: #9c3516; --lp-soft: #f6ece6; }
body[data-demo="portal"]    { --lp-accent: #0f3d36; --lp-accent-2: #a68456; --lp-soft: #eef2ef; }

/* Estado de la propiedad */
.lp-estado {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em; color: #fff; background: #6b6b6b;
}
.card-photo .lp-estado, .lp-foto .lp-estado { position: absolute; top: .7rem; right: .7rem; }
.lp-estado--reservada { background: #b7791f; }
.lp-estado--vendida, .lp-estado--alquilada { background: #3f3f46; }
.is-cerrada img { filter: grayscale(.85); opacity: .75; }
.resumen .lp-estado { margin-left: .4rem; vertical-align: middle; }
.lp-codigo { color: #6b6b6b; font-size: .92rem; }
.lp-cerrada-nota { background: var(--lp-soft, #f3f3f3); padding: .8rem 1rem; border-radius: 12px; }
.lp-cerrada-nota a { color: var(--lp-accent, #333); font-weight: 600; }

/* Aviso de modo prueba */
.lp-prueba {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; justify-content: center;
  background: #fff4d6; color: #5c4400; padding: .6rem 1rem; font-size: .9rem; text-align: center;
  border-bottom: 1px solid #f0d58a;
}
.lp-prueba button { font: inherit; font-weight: 600; color: #5c4400; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }

/* WhatsApp fijo en la ficha */
.lp-wa-fija {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: .55rem;
  background: #25D366; color: #fff; text-decoration: none; font-weight: 600;
  padding: .85rem 1.2rem .85rem 1rem; border-radius: 999px;
  box-shadow: 0 14px 28px -12px rgba(16, 120, 60, .6);
}
.lp-wa-fija svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.lp-wa-fija:hover { filter: brightness(.95); }
@media (max-width: 640px) {
  .lp-wa-fija { left: 12px; right: 12px; bottom: 12px; justify-content: center; }
  body:has(.lp-wa-fija) { padding-bottom: 76px; }
}

/* Favoritas */
.lp-fav {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid rgba(0,0,0,.12); background: #fff; cursor: pointer; color: #888;
}
.lp-fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lp-fav[aria-pressed="true"] { color: #d1344b; border-color: #f3c2cb; background: #fff3f5; }
.lp-fav[aria-pressed="true"] svg { fill: currentColor; }

/* Comparar */
.lp-cmp-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: #52605b; cursor: pointer; }
.lp-cmp-check input { accent-color: var(--lp-accent, #333); width: 16px; height: 16px; }
.lp-cmpbar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: center;
  background: var(--lp-accent, #222); color: #fff; padding: .6rem .7rem .6rem 1.1rem; border-radius: 999px;
  box-shadow: 0 16px 32px -14px rgba(0,0,0,.5); font-size: .92rem; max-width: calc(100% - 24px);
}
.lp-cmpbar[hidden] { display: none; }
.lp-cmpbar button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; }
.lp-cmpbar .lp-cmp-go { background: #fff; color: var(--lp-accent, #222); }
.lp-cmpbar .lp-cmp-clear { background: transparent; color: #fff; text-decoration: underline; padding: .5rem .3rem; }

/* Ventanas (comparar y ficha de Presencia) */
.lp-dialog {
  width: min(980px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); background: #fff; color: inherit;
}
.lp-dialog::backdrop { background: rgba(15, 20, 18, .55); }
.lp-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff; z-index: 2; }
.lp-dialog__head h2 { margin: 0; font-size: 1.25rem; }
.lp-dialog__close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 1.3rem; line-height: 1; }
.lp-dialog__body { padding: 1.2rem; }
.lp-cmp-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.lp-cmp-table th, .lp-cmp-table td { padding: .65rem .7rem; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.lp-cmp-table thead td { border-bottom: 0; }
.lp-cmp-table img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; margin-bottom: .5rem; }
.lp-cmp-table th { color: #52605b; font-weight: 500; width: 22%; }
.lp-cmp-table .best { font-weight: 700; color: var(--lp-accent, #222); }
.lp-cmp-wrap { overflow-x: auto; }
.lp-cmp-wrap table { min-width: 560px; }

/* Ficha en ventana (Presencia) */
.lp-ficha { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; }
.lp-foto { position: relative; }
.lp-foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; }
.lp-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin-top: .45rem; }
.lp-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; cursor: pointer; background: none; }
.lp-thumbs button.is-on { border-color: var(--lp-accent, #222); }
.lp-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.lp-ficha h3 { margin: 0 0 .3rem; font-size: 1.45rem; }
.lp-ficha dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1rem 0; font-size: .95rem; }
.lp-ficha dt { color: #6b6b6b; }
.lp-ficha dd { margin: 0; }
.lp-ficha .lp-acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
@media (max-width: 720px) { .lp-ficha { grid-template-columns: 1fr; } }

/* Mapa real (Portal) */
.lp-map { width: 100%; height: 100%; min-height: 320px; border-radius: 16px; overflow: hidden; z-index: 0; }
.lp-map .leaflet-popup-content { margin: .7rem .8rem; font: 14px/1.35 Sora, system-ui, sans-serif; }
.lp-map .leaflet-popup-content a { color: #0f3d36; font-weight: 600; }
.lp-pin {
  width: 16px; height: 16px; border-radius: 50%; background: #0f3d36; border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(16,33,30,.45);
}
.lp-pin.is-on { background: #a68456; transform: scale(1.35); }
.lp-pin.is-cerrada { background: #8b8b8b; }

/* Recorrido en fotos / video (Portal) */
.lp-tour { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0f1d1a; margin: 1.3rem 0; }
.lp-tour iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lp-tour__slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease; }
.lp-tour__slide.is-on { opacity: 1; animation: lp-kenburns 6s ease-out forwards; }
.lp-tour__ui { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.lp-tour__ui button { font: inherit; font-weight: 600; background: #fff; color: #0f3d36; border: 0; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; }
.lp-tour__bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.lp-tour__bar i { display: block; height: 100%; width: 0; background: #fff; }
.lp-tour__label { position: absolute; top: .9rem; left: 1rem; color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
@keyframes lp-kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .lp-tour__slide.is-on { animation: none; } }

@media print {
  .lp-wa-fija, .lp-cmpbar, .lp-prueba, .nw-bar, .lp-fav { display: none !important; }
}

/* Filas del Portal con favoritas y comparar */
.fila { position: relative; }
.fila h3 a { color: inherit; text-decoration: none; }
.fila h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.fila h3 a:focus-visible { outline: none; }
.fila:has(h3 a:focus-visible) { outline: 3px solid #a68456; outline-offset: 2px; }
.fila-acc { position: relative; z-index: 1; display: flex; gap: .8rem; align-items: center; margin-top: .45rem; }
.fila-acc .lp-fav { width: 32px; height: 32px; }
.fila .lp-foto img { width: 148px; height: 108px; object-fit: cover; border-radius: 12px; background: #e4ebe7; display: block; }
.map .lp-map { min-height: 0; border-radius: 16px; }
.ficha-top .acciones { align-items: center; }
@media (max-width: 980px) {
  .fila .lp-foto img { width: 104px; height: 84px; }
  .map { height: 340px !important; }
}
