/* =========================
   PROPERTY CARD
   ========================= */

.property-card {
  background-color: var(--color-surface);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 10px 28px rgba(12, 20, 38, 0.07);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--color-border);
  position: relative;
}

.property-card.is-scarcity {
  border-color: rgba(195, 149, 59, 0.92);
  box-shadow:
    0 0 0 1px rgba(195, 149, 59, 0.26),
    0 14px 28px -10px rgba(195, 149, 59, 0.22);
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(32, 47, 78, 0.1);
}

.property-card.is-scarcity:hover {
  box-shadow:
    0 0 0 1px rgba(195, 149, 59, 0.34),
    0 18px 34px -10px rgba(195, 149, 59, 0.28);
}

.property-card:focus-within {
  box-shadow: 0 0 0 2px rgba(32, 47, 78, 0.14), 0 18px 34px -10px rgba(32, 47, 78, 0.12);
}

.property-card.is-map-focused {
  z-index: 2;
  animation: property-card-map-focus 820ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 0 0 2px rgba(211, 44, 67, 0.18),
    0 24px 44px -16px rgba(211, 44, 67, 0.28);
  border-color: rgba(211, 44, 67, 0.34);
}

@keyframes property-card-map-focus {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  }

  34% {
    transform: translateY(-12px) scale(1.018);
    box-shadow:
      0 0 0 3px rgba(211, 44, 67, 0.22),
      0 28px 48px -18px rgba(211, 44, 67, 0.34);
  }

  62% {
    transform: translateY(2px) scale(0.998);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 2px rgba(211, 44, 67, 0.18),
      0 24px 44px -16px rgba(211, 44, 67, 0.28);
  }
}

/* --- IMAGE --- */
.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background-color: var(--color-bg);
}

.card-gallery {
  position: relative;
  width: 100%;
  height: 100%;
}

.card-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.card-gallery-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.card-gallery-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 16, 31, 0.2) 100%);
  pointer-events: none;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.property-card:hover .card-image img {
  transform: scale(1.08);
}

.card-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(8, 16, 31, 0.18);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.card-gallery-nav.is-prev {
  left: 0.75rem;
}

.card-gallery-nav.is-next {
  right: 0.75rem;
}

.card-gallery-nav span {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  pointer-events: none;
}

.card-gallery-nav:hover,
.card-gallery-nav:focus-visible {
  background: rgba(8, 16, 31, 0.34);
  border-color: rgba(255, 255, 255, 0.96);
  transform: translateY(-50%) scale(1.04);
}

.card-gallery-nav:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.card-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  z-index: 2;
}

.card-gallery-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.card-gallery-dot.is-active {
  background: #fff;
  transform: scale(1.15);
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(32, 47, 78, 0.06), rgba(211, 44, 67, 0.08));
}

/* --- PROMOTION BADGE --- */
.badge-promotion {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, rgba(18, 31, 58, 0.9), rgba(31, 52, 92, 0.82));
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(8, 15, 28, 0.2);
  backdrop-filter: blur(10px);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.badge-promotion--new-build {
  background: linear-gradient(135deg, rgba(18, 31, 58, 0.92), rgba(39, 67, 115, 0.84));
  color: #f8fafc;
}

.badge-promotion--resale {
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(244, 232, 208, 0.94));
  color: #18314f;
  border-color: rgba(24, 49, 79, 0.12);
  box-shadow: 0 12px 28px rgba(24, 49, 79, 0.14);
}

.badge-scarcity {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  max-width: calc(100% - 1.5rem);
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f2df9a, #c3953b);
  color: #1f1606;
  border: 1px solid rgba(255, 248, 220, 0.65);
  box-shadow: 0 10px 18px rgba(195, 149, 59, 0.28);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
}

/* --- CONTENT --- */
.card-content {
  padding: 1.15rem 1.3rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.82rem;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.property-card .title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.28;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.property-card .title a {
  color: inherit;
  text-decoration: none;
}

.property-card .title a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.card-location {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.42;
  color: var(--color-muted);
  letter-spacing: 0.01em;
}

.price-row {
  min-height: 1.65rem;
}

/* --- PRICE --- */
.property-card .price {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* --- META INFO --- */
.property-card .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.45rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.property-card .meta-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.95rem;
  font-size: 0.8rem;
  color: var(--color-primary);
  opacity: 0.9;
  font-weight: 700;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-bg);
  padding: 0.35rem 0.5rem;
}

.property-card .meta-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: inline-flex;
  color: var(--color-muted);
  flex-shrink: 0;
}

.property-card .meta-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.property-card .meta-value {
  line-height: 1;
}

/* --- FEATURES --- */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.more-features {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- ACTIONS --- */
.card-actions {
  margin-top: auto;
  padding-top: 0.25rem;
}

.btn-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.82rem;
  background-color: var(--color-bg);
  color: var(--color-primary);
  border-radius: 0;
  font-weight: 700;
  font-size: 0.86rem;
  transition: all 0.25s;
  text-decoration: none;
  border: 1px solid var(--color-border);
}

.btn-card:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.property-card.is-compact .card-content {
  gap: 0.6rem;
  padding: 0.95rem 1rem 1rem;
}

.property-card.is-compact .price-row {
  min-height: 1.4rem;
}

.property-card.is-compact .price {
  font-size: 1.12rem;
}

.property-card.is-compact .compact-meta {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.42;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.65rem;
}

.property-card.is-compact .btn-card {
  min-height: 2.45rem;
  padding-block: 0.72rem;
}

@media (max-width: 640px) {
  .property-card {
    border-radius: 0;
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
  }

  .property-card:hover {
    transform: none;
  }

  .card-content {
    padding: 1rem;
  }

  .card-image {
    aspect-ratio: 4 / 3.15;
  }

  .property-card .title {
    font-size: 1rem;
  }

  .property-card .price {
    font-size: 1.18rem;
  }

  .property-card .meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .property-card .meta-item {
    font-size: 0.78rem;
    min-height: 2.25rem;
    padding-inline: 0.35rem;
  }

  .btn-card {
    min-height: 2.95rem;
    font-size: 0.84rem;
  }

  .property-card.is-compact .card-content {
    padding: 0.95rem 1rem 1rem;
  }

  .card-gallery-nav {
    width: 2.35rem;
    height: 2.35rem;
  }

  .card-gallery-nav.is-prev {
    left: 0.55rem;
  }

  .card-gallery-nav.is-next {
    right: 0.55rem;
  }
}


/* --- ESTADO DE LA PROPIEDAD (vendida / reservada / alquilada) --- */
.badge-promotion--sold {
  background: linear-gradient(135deg, rgba(120, 18, 30, 0.94), rgba(160, 30, 45, 0.88));
  color: #fff5f6;
  border-color: rgba(255, 255, 255, 0.22);
}

.badge-promotion--reserved {
  background: linear-gradient(135deg, rgba(150, 105, 10, 0.94), rgba(191, 135, 0, 0.88));
  color: #fffaf0;
  border-color: rgba(255, 255, 255, 0.22);
}

.badge-promotion--rented {
  background: linear-gradient(135deg, rgba(32, 47, 78, 0.94), rgba(52, 76, 122, 0.88));
  color: #f4f7fc;
  border-color: rgba(255, 255, 255, 0.22);
}

/* La tarjeta sigue siendo visible y navegable, pero se
   distingue a simple vista de las que estan a la venta. */
.property-card--inactiva .card-image img {
  filter: grayscale(0.55) contrast(0.95);
  opacity: 0.78;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.property-card--inactiva:hover .card-image img {
  filter: grayscale(0.2);
  opacity: 0.92;
}

.property-card--inactiva .price {
  color: #6b7280;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .property-card--inactiva .card-image img {
    transition: none;
  }
}


/* --- IMAGEN PULSABLE --- */
/* El enlace envuelve la foto sin alterar la maquetacion:
   ocupa exactamente el hueco que ocupaba la imagen. */
.card-image-link {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.card-image-link:focus-visible {
  outline: 2px solid #d32c43;
  outline-offset: -2px;
}
