/* ============================================================
   AGENTE100 — propiedades.css
   Solo estilos de la página de propiedades. Cabecera, pie,
   .container y .btn salen de styles.css; aquí se reutilizan sus
   variables (colores, radios, sombras, tipografías) para que el
   cambio de acento de Tweaks también afecte a esta página.
   ============================================================ */

.page-props {
  --p-navy: #0F2A44;                 /* mismo azul oscuro del pie y de las secciones oscuras */
  --p-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.props-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Cabecera de página (la cabecera de la web es sticky, no hace falta hueco extra) ---------- */
.props-head {
  background: var(--gradient-hero-bg);
  padding-block: clamp(44px, 6vw, 76px) clamp(28px, 4vw, 44px);
}
.props-head h1 { font-size: var(--text-h2); font-weight: 800; }
.props-head p { margin-top: 12px; max-width: 52ch; font-size: var(--text-body-lg); }

.props { padding-block: 12px clamp(56px, 7vw, 96px); }

/* ---------- Filtros ---------- */
.props-filters {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.props-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--color-bg-section);
  border-radius: 10px;
}
.props-tab { position: relative; cursor: pointer; }
.props-tab input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.props-tab span {
  display: block;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--color-text-body);
  transition: background .2s, color .2s, box-shadow .2s;
}
.props-tab small { font-weight: 600; font-size: 13px; margin-left: 4px; opacity: .8; }
.props-tab input:checked + span {
  background: #fff;
  color: var(--color-accent-blue);
  box-shadow: 0 1px 4px rgba(15, 42, 68, 0.14);
}
.props-tab input:focus-visible + span {
  outline: 3px solid rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.45);
  outline-offset: 2px;
}
.props-tab input:focus-visible { outline: none; }

.props-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}
.props-field--search { grid-column: span 2; }
@media (max-width: 560px) { .props-field--search { grid-column: 1 / -1; } }

.props-field label,
.props-sort label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-primary);
}
.props-field input,
.props-field select,
.props-sort select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-primary);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.props-field select,
.props-sort select {
  appearance: none;
  padding-right: 40px;
  background-image: var(--p-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.props-field input::placeholder { color: var(--color-text-muted); }
.props-field input:focus, .props-field input:focus-visible,
.props-field select:focus, .props-field select:focus-visible,
.props-sort select:focus, .props-sort select:focus-visible {
  outline: none;
  border-radius: 8px;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.12);
}

/* ---------- Barra de resultados ---------- */
.props-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0 20px;
}
.props-bar[hidden] { display: none; }
.props-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text-primary);
}
.props-sort { min-width: 230px; }

/* ---------- Rejilla y tarjetas ---------- */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.pcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pcard:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.pcard:focus-visible { border-radius: var(--radius-card); }

.pcard__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--color-accent-blue-light), var(--color-bg-section));
  overflow: hidden;
}
.pcard__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* solo la foto de la propiedad, no el avatar del agente */
.pcard__media::after {                       /* degradado para que el precio se lea sobre cualquier foto */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background: linear-gradient(to top, rgba(15, 42, 68, 0.9), rgba(15, 42, 68, 0));
  pointer-events: none;
}
.pcard__nophoto { position: absolute; inset: 0; display: grid; place-items: center; color: #9DB3C7; }
.pcard__nophoto svg { width: 46px; height: 46px; }

.pcard__price {
  position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.pcard__price small { margin-left: 2px; font-size: 14px; font-weight: 600; letter-spacing: 0; opacity: .88; }
.pcard__price--ask { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

.pcard__flag {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-gold);
  color: #3A2600;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
}
.pcard__count {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 42, 68, 0.74);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
}
.pcard__count svg { width: 14px; height: 14px; }

.pcard__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.pcard__title {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard__loc {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-small);
  color: var(--color-text-body);
}
.pcard__loc svg { width: 16px; height: 16px; flex: none; color: var(--color-accent-blue); }
.pcard__specs {
  list-style: none;
  margin: auto 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--color-border);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text-primary);
}
.pcard__specs li { display: inline-flex; align-items: center; gap: 6px; }
.pcard__specs svg { width: 18px; height: 18px; color: var(--color-accent-blue); }

/* ---------- Estados ---------- */
.props-state {
  padding: 56px 20px;
  text-align: center;
  background: var(--color-bg-section);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card);
}
.props-state h3 { margin-bottom: 8px; font-size: 20px; }
.props-state p { max-width: 46ch; margin: 0 auto 20px; }
.props-state p:last-child { margin-bottom: 0; }
.props-state a { color: var(--color-accent-blue); font-weight: 600; }

.props-more { margin-top: 40px; text-align: center; }
.props-more .btn { white-space: normal; }
.props-updated { margin-top: 24px; text-align: center; font-size: 13px; color: var(--color-text-body); }

/* ---------- Ficha (modal) ---------- */
.pmodal {              /* por encima de .modal (100) y por debajo del aviso legal (200) */
  position: fixed; inset: 0; z-index: 150;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.pmodal.is-open { display: flex; }
.pmodal__overlay {
  position: absolute; inset: 0;
  background: rgba(15, 42, 68, 0.55);
  backdrop-filter: blur(4px);
  animation: modalFade .25s ease;          /* keyframes definidas en styles.css */
}
.pmodal__panel {
  position: relative;
  width: 100%;
  max-width: 1120px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(15, 42, 68, 0.32);
  animation: modalRise .3s cubic-bezier(.2, .8, .2, 1);
}
.pmodal__panel:focus, .pmodal__panel:focus-visible { outline: none; }
@media (min-width: 900px) {
  .pmodal__panel {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    background: linear-gradient(to right, var(--p-navy) 55.5556%, #fff 55.5556%);   /* columna azul de la galería */
  }
}
@media (max-width: 560px) {
  .pmodal { padding: 0; }
  .pmodal__panel { height: 100dvh; max-height: 100dvh; border-radius: 0; }
}

.pmodal__x {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 42, 68, 0.25);
  transition: background .2s, color .2s;
}
.pmodal__x:hover { background: var(--color-accent-blue-light); color: var(--color-accent-blue); }
.pmodal__x:focus-visible, .pgal__nav:focus-visible { border-radius: 50%; }

/* Galería */
.pmodal__gallery { min-width: 0; background: var(--p-navy); }
.pgal__stage { position: relative; aspect-ratio: 4 / 3; background: #0A1F33; touch-action: pan-y; }
@media (min-width: 900px) {
  /* La galería se queda a la vista mientras se desplaza la información (descripciones largas) */
  .pmodal__gallery { position: sticky; top: 0; align-self: start; }
  .pgal__stage { aspect-ratio: auto; height: min(calc(100vh - 32px - 76px), 720px); height: min(calc(100dvh - 32px - 76px), 720px); }
}
.pgal__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pgal__stage.is-empty img { display: none; }
.pgal__stage.is-empty::before {
  content: "Sin fotos disponibles";
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #A9BBCD; font-size: 15px;
}
.pgal__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 42, 68, 0.3);
  transition: background .2s, color .2s;
}
.pgal__nav:hover { background: var(--color-accent-blue-light); color: var(--color-accent-blue); }
.pgal__nav--prev { left: 12px; }
.pgal__nav--next { right: 12px; }
.pgal__stage.is-single .pgal__nav,
.pgal__stage.is-empty .pgal__nav { display: none; }
.pgal__counter {
  position: absolute; left: 12px; bottom: 12px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(15, 42, 68, 0.78);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.pgal__thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: thin; }
.pgal__thumbs:empty { display: none; }
.pgal__thumb {
  flex: none;
  width: 76px; height: 56px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #0A1F33;
  cursor: pointer;
  opacity: .65;
  transition: opacity .2s;
}
.pgal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pgal__thumb:hover { opacity: 1; }
.pgal__thumb.is-active { border-color: var(--color-accent-gold); opacity: 1; }
.pgal__thumb:focus-visible { border-radius: 8px; }

/* Información */
.pmodal__info { min-width: 0; padding: 30px 30px 32px; }
@media (max-width: 560px) { .pmodal__info { padding: 22px 20px 28px; } }

.pinfo__ref { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--color-text-body); }
.pinfo__price {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}
.pinfo__price small { margin-left: 3px; font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--color-text-body); }
.pinfo__also { margin-top: 6px; font-size: var(--text-small); }
.pinfo__title { margin: 16px 0 6px; font-size: 20px; line-height: 1.3; }
.pinfo__loc { display: flex; align-items: center; gap: 6px; }
.pinfo__loc svg { width: 17px; height: 17px; flex: none; color: var(--color-accent-blue); }

.pinfo__facts {
  display: flex;
  flex-wrap: wrap;
  margin: 22px 0 0;
  overflow: hidden;                                  /* recorta las líneas del borde exterior */
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.pinfo__fact {
  flex: 1 1 120px;
  padding: 11px 14px;
  background: #fff;
  box-shadow: 1px 0 0 var(--color-border), 0 1px 0 var(--color-border);   /* línea a la derecha y debajo */
}
.pinfo__fact dt { margin: 0 0 2px; font-size: var(--text-xs); color: var(--color-text-body); }
.pinfo__fact dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--color-text-primary); }

.pinfo__h { margin: 26px 0 10px; font-size: 16px; }
.pinfo__desc p { max-width: 65ch; margin: 0 0 10px; line-height: 1.65; }
.pinfo__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pinfo__chips li {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-blue-light);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-accent-blue-dark);
}

.pinfo__energy { display: flex; flex-wrap: wrap; gap: 20px; }
.penergy { display: flex; align-items: center; gap: 10px; font-size: var(--text-small); }
.penergy b {
  display: grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 6px;
  border-radius: 8px;
  background: #8895A3;
  font-family: var(--font-display);
  font-size: 16px;
  color: #fff;
}
.penergy b[data-l="A+"], .penergy b[data-l="A"] { background: #1A9850; }
.penergy b[data-l="B"] { background: #4FA857; }
.penergy b[data-l="C"] { background: #A6D96A; color: #1E3A10; }
.penergy b[data-l="D"] { background: #FEE08B; color: #4A3A00; }
.penergy b[data-l="E"] { background: #FDAE61; color: #4A2500; }
.penergy b[data-l="F"] { background: #E8552F; }
.penergy b[data-l="G"] { background: #D73027; }
.penergy span { display: flex; flex-direction: column; line-height: 1.3; }
.penergy small { font-size: var(--text-xs); color: var(--color-text-body); }
.pinfo__energy-state { margin: 0; font-size: var(--text-small); color: var(--color-text-body); }

.pinfo__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pinfo__cta .btn { flex: 1 1 200px; }

/* ---------- Agente (tarjeta y ficha) ---------- */
.pavatar {
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-accent-blue-light);
  color: var(--color-accent-blue);
  font-family: var(--font-display);
  font-weight: 800;
  object-fit: cover;
}
.pavatar--sm { width: 28px; height: 28px; font-size: 11px; }
.pavatar--md { width: 56px; height: 56px; font-size: 19px; background: #fff; border: 3px solid rgba(255, 255, 255, 0.35); }
.pavatar--lg { width: 48px; height: 48px; font-size: 16px; }

/* Con ratón: al pasar por la tarjeta la foto se oscurece y aparece el agente (el precio se mantiene) */
.pcard__agent {
  position: absolute; inset: 0; z-index: 1;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 44px 16px 62px;
  text-align: center;
  color: #fff;
  background: rgba(15, 42, 68, 0.84);
  opacity: 0;
  transition: opacity .2s ease;
}
.pcard__agent .pavatar { margin-bottom: 6px; }
.pcard__agent-label { font-size: var(--text-xs); opacity: .8; }
.pcard__agent-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.pcard__agent-tel {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-accent-blue-dark);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
}
.pcard__agent-tel svg { width: 15px; height: 15px; }
@media (hover: hover) {
  .pcard__agent { display: flex; }
  .pcard:hover .pcard__agent,
  .pcard:focus-visible .pcard__agent { opacity: 1; }
}

/* Sin ratón (móvil/tablet) no existe "pasar por encima": el agente se ve siempre, en una línea de la tarjeta */
.pcard__agentrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--color-text-body);
}
.pcard__agentrow strong { color: var(--color-text-primary); font-weight: 600; }
@media (hover: hover) { .pcard__agentrow { display: none; } }

/* Ficha: bloque de agente con botones para llamar y escribir por WhatsApp */
.pinfo__agent {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 18px;
  padding: 14px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}
.pinfo__agent-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pinfo__agent-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pinfo__agent-txt span { font-size: var(--text-xs); color: var(--color-text-body); }
.pinfo__agent-txt strong { font-family: var(--font-display); font-size: 16px; color: var(--color-text-primary); }
.pinfo__agent-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pinfo__call, .pinfo__wa { padding: 12px 14px; font-size: 15px; }
.pinfo__wa { background: #0F7B43; color: #fff; }               /* verde de WhatsApp con contraste suficiente para texto blanco */
.pinfo__wa:hover { background: #0B6636; box-shadow: 0 6px 18px rgba(15, 123, 67, 0.35); transform: translateY(-2px); }
.pinfo__wa svg { width: 19px; height: 19px; }

/* Aviso al pie de la ficha */
.pinfo__legal {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-body);
}
.pinfo__legal strong { color: var(--color-text-primary); font-weight: 600; }
.pinfo__legal p + p { margin-top: 8px; }
.pinfo__legal-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pinfo__legal a { color: var(--color-accent-blue); text-decoration: underline; text-underline-offset: 2px; }

/* Página actual en el menú */
.page-props .nav__links a[aria-current="page"] { color: var(--color-accent-blue); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .page-props *, .page-props *::before, .page-props *::after {
    transition: none !important;
    animation: none !important;
  }
  .pcard:hover { transform: none; }
}

/* Selector de idioma de la descripción (ES · EN · DE · FR) */
.pinfo__deschead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.pinfo__deschead .pinfo__h { margin: 0; }
.plang { display: inline-flex; gap: 2px; padding: 3px; background: var(--color-bg-section); border-radius: var(--radius-btn); }
.plang__b {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 4px;
  font: 700 12px/1 var(--font-display); letter-spacing: .04em; color: var(--color-text-body);
}
.plang__b:hover { color: var(--color-accent-blue); }
.plang__b.is-on { background: #fff; color: var(--color-accent-blue); box-shadow: var(--shadow-card); }
.plang__b:focus-visible { outline: 2px solid var(--color-accent-blue); outline-offset: 1px; }
