/* Propiedades Chile – Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

:root {
  --pc-bg:           #f5f5f5;
  --pc-surface:      #ffffff;
  --pc-surface-alt:  #E1E9EF;
  --pc-border:       #e6e6e6;
  --pc-primary:      #3c5180;
  --pc-primary-dark: #2d3e63;
  --pc-accent:       #488FE4;
  --pc-text:         #000000;
  --pc-text-soft:    #1a1a1a;
  --pc-muted:        #4a4a4a;
  --pc-white:        #ffffff;
  --pc-radius:       6px;
  --pc-shadow:       0 6px 20px rgba(60,81,128,0.08);
  --pc-shadow-hover: 0 14px 32px rgba(60,81,128,0.16);
}

.pc-wrapper {
  font-family: 'Raleway', sans-serif;
  background: var(--pc-bg);
  padding: 60px 20px;
  min-height: 200px;
  color: var(--pc-text);
}

/* ─── Encabezado ── */
.pc-header {
  text-align: center;
  margin-bottom: 56px;
}
.pc-header-eyebrow {
  font-family: 'Raleway', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--pc-text);
  margin-bottom: 12px;
}
.pc-header h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  color: var(--pc-text);
  margin: 0 0 8px;
  line-height: 1.1;
}
.pc-header-line {
  width: 48px;
  height: 2px;
  background: var(--pc-accent);
  margin: 16px auto 0;
}

/* ─── Filtros ── */
.pc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}
.pc-filter-btn {
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--pc-border);
  background: var(--pc-white);
  color: var(--pc-text);
  cursor: pointer;
  border-radius: var(--pc-radius);
  transition: all 0.25s ease;
}
.pc-filter-btn:hover {
  border-color: var(--pc-accent);
  color: var(--pc-text);
  background: var(--pc-surface-alt);
}
.pc-filter-btn.active {
  border-color: var(--pc-primary);
  background: var(--pc-primary);
  color: var(--pc-white);
}

/* ─── Grid ── */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(var(--pc-cols, 3), 1fr);
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 1024px) { .pc-grid { --pc-cols: 2; } }
@media (max-width: 640px)  { .pc-grid { --pc-cols: 1; } }

/* ─── Tarjeta ── */
.pc-card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: var(--pc-shadow);
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
  position: relative;
}
.pc-card:hover {
  transform: translateY(-6px);
  border-color: var(--pc-accent);
  box-shadow: var(--pc-shadow-hover);
}
.pc-badge-destacado {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #3c5180;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 10;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(60,81,128,0.35);
}
.pc-badge-destacado .pc-star {
  color: #D4AF37;
  margin-right: 2px;
}

/* ─── Slider de fotos ── */
.pc-slider {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--pc-surface-alt);
}
.pc-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.pc-slide.active { opacity: 1; }
.pc-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.pc-slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E1E9EF 0%, #c9d6e2 100%);
  color: var(--pc-muted);
  font-size: 40px;
}

/* Controles slider */
.pc-slider-prev,
.pc-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.85);
  color: #ffffff;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.pc-slider:hover .pc-slider-prev,
.pc-slider:hover .pc-slider-next { opacity: 1; }
.pc-slider-prev { left: 10px; }
.pc-slider-next { right: 10px; }
.pc-slider-prev:hover,
.pc-slider-next:hover {
  background: rgba(255,255,255,0.18);
  border-color: #ffffff;
}
.pc-slider-prev svg,
.pc-slider-next svg { display: block; }

/* Dots */
.pc-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 20;
}
.pc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.pc-dot.active {
  background: var(--pc-accent);
  transform: scale(1.4);
}

/* Badge operación sobre imagen */
.pc-badge-op {
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-size: 10px;
  font-family: 'Raleway', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 15;
  font-weight: 500;
}
.pc-badge-op.venta    { background: var(--pc-primary); color: var(--pc-white); }
.pc-badge-op.arriendo { background: var(--pc-accent); color: var(--pc-white); }

/* ─── Cuerpo tarjeta ── */
.pc-card-body {
  padding: 24px 26px 22px;
  background: var(--pc-surface);
}

.pc-card-zona {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pc-text);
  margin-bottom: 8px;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
}
.pc-card-zona svg { flex-shrink: 0; }

.pc-card-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--pc-text);
  margin: 0 0 6px;
  line-height: 1.25;
}

.pc-card-tipo {
  font-size: 11px;
  color: var(--pc-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  line-height: 1.4;
}

.pc-card-desc {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--pc-text-soft);
  margin-bottom: 20px;
  min-height: 6.6em;
  position: relative;
  cursor: pointer;
  max-height: 6.6em;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}
.pc-card-desc::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.8em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--pc-surface) 90%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.pc-card-desc.expanded {
  max-height: 60em;
}
.pc-card-desc.expanded::after {
  opacity: 0;
}

/* ─── Stats ── */
.pc-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--pc-border);
  border-bottom: 1px solid var(--pc-border);
  margin-bottom: 18px;
}
.pc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.pc-stat-icon {
  color: var(--pc-accent);
  line-height: 1;
}
.pc-stat-icon svg { width: 16px; height: 16px; }
.pc-stat-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--pc-text);
  line-height: 1;
}
.pc-stat-lbl {
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pc-muted);
}

/* ─── Precio ── */
.pc-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.pc-price {
  font-family: 'Raleway', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--pc-text);
  line-height: 1;
}
.pc-price-unit {
  font-size: 0.75rem;
  color: var(--pc-muted);
  margin-left: 4px;
  font-family: 'Raleway', sans-serif;
}
.pc-region-tag {
  font-size: 10px;
  color: var(--pc-muted);
  letter-spacing: 0.5px;
  text-align: right;
  line-height: 1.3;
}

/* ─── No resultados ── */
.pc-no-results {
  text-align: center;
  color: var(--pc-muted);
  padding: 60px 20px;
  font-family: 'Raleway', sans-serif;
  font-size: 1.2rem;
}

/* ─── Responsive tweaks ── */
@media (max-width: 480px) {
  .pc-stats { grid-template-columns: repeat(3, 1fr); }
  .pc-stats .pc-stat:nth-child(4),
  .pc-stats .pc-stat:nth-child(5) { display: none; }
}

/* ─── Lightbox / Galería ── */
.pc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pc-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.pc-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}
.pc-lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94),
              opacity 0.25s ease;
  cursor: zoom-out;
  user-select: none;
  -webkit-user-drag: none;
}
.pc-lightbox.open .pc-lightbox-img.is-loaded {
  transform: scale(1);
  opacity: 1;
}
.pc-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  font-family: Arial, sans-serif;
  font-size: 28px;
  line-height: 1;
  z-index: 2;
}
.pc-lightbox-close:hover {
  background: rgba(255,255,255,0.28);
  transform: scale(1.05);
}

.pc-lightbox-prev,
.pc-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}
.pc-lightbox-prev:hover,
.pc-lightbox-next:hover {
  background: rgba(255,255,255,0.18);
  border-color: #ffffff;
}
.pc-lightbox-prev svg,
.pc-lightbox-next svg { display: block; }
.pc-lightbox-prev { left: 24px; }
.pc-lightbox-next { right: 24px; }

.pc-lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  background: rgba(0,0,0,0.4);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  user-select: none;
}

@media (max-width: 640px) {
  .pc-lightbox { padding: 12px; }
  .pc-lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 22px; }
  .pc-lightbox-prev,
  .pc-lightbox-next { width: 34px; height: 34px; }
  .pc-lightbox-prev { left: 8px; }
  .pc-lightbox-next { right: 8px; }
  .pc-lightbox-counter { bottom: 14px; font-size: 12px; padding: 4px 12px; }
  .pc-lightbox-img { max-width: 96vw; max-height: 80vh; }
}

/* ─── Botones de contacto ── */
.pc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--pc-border);
}
.pc-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--pc-radius);
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.pc-btn-action svg { flex-shrink: 0; }

.pc-btn-wa,
.pc-btn-wa:link,
.pc-btn-wa:visited,
.pc-btn-wa:hover,
.pc-btn-wa:focus,
.pc-btn-wa:active {
  color: #ffffff !important;
  text-decoration: none;
}
.pc-btn-wa {
  background: #25D366;
}
.pc-btn-wa:hover {
  background: #1da851;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37,211,102,0.28);
}

.pc-btn-mail,
.pc-btn-mail:link,
.pc-btn-mail:visited,
.pc-btn-mail:hover,
.pc-btn-mail:focus,
.pc-btn-mail:active {
  color: #ffffff !important;
  text-decoration: none;
}
.pc-btn-mail {
  background: var(--pc-primary);
}
.pc-btn-mail:hover {
  background: var(--pc-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(60,81,128,0.28);
}

@media (max-width: 380px) {
  .pc-actions { grid-template-columns: 1fr; }
}

/* ─── Carrusel horizontal ── */
.pc-carousel-wrapper {
  padding: 60px 20px;
}
.pc-carousel {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pc-carousel-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.pc-carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
  will-change: transform;
  touch-action: pan-y;
}
.pc-carousel-slide {
  flex: 0 0 auto;
  width: calc((100% - 24px * 2) / 3);
  min-width: 0;
}
.pc-carousel-slide .pc-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.pc-carousel-slide .pc-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pc-carousel-slide .pc-actions { margin-top: auto; }

/* Flechas del carrusel */
.pc-carousel-prev,
.pc-carousel-next {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--pc-white);
  border: 1px solid var(--pc-border);
  color: var(--pc-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(60,81,128,0.12);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 5;
}
.pc-carousel-prev:hover,
.pc-carousel-next:hover {
  background: var(--pc-primary);
  border-color: var(--pc-primary);
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(60,81,128,0.22);
}
.pc-carousel-prev:disabled,
.pc-carousel-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.pc-carousel-prev svg,
.pc-carousel-next svg { display: block; }

/* Paginación (dots) */
.pc-carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.pc-carousel-pagination span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-border);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.pc-carousel-pagination span.active {
  background: var(--pc-primary);
  transform: scale(1.3);
}

/* Responsive: nº visible se ajusta a viewport */
@media (max-width: 1024px) {
  .pc-carousel-slide { width: calc((100% - 24px) / 2); }
}
@media (max-width: 640px) {
  .pc-carousel-slide { width: 100%; }
  .pc-carousel { gap: 6px; }
  .pc-carousel-prev,
  .pc-carousel-next { width: 36px; height: 36px; }
}
