/**
 * TeamHost Ficha - Pixel Perfect 1:1 Design
 *
 * Clases hc-* para la nueva estructura HTML reconstruida por JavaScript
 * Layout: 2-col grid (65% content + 35% sidebar)
 * Fonts: Montserrat (headings) + Open Sans (body)
 * Colors: #24559D (blue), #D57A1C (orange), #22c55e (green check)
 */

/* ============================================================================
   LAYOUT - 2 Columns Grid
   ============================================================================ */

.hc-ficha-layout {
  background: #ffffff;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px;
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .hc-ficha-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 32px 24px;
  }
}

@media (max-width: 640px) {
  .hc-ficha-layout {
    padding: 24px 16px;
  }
}

/* ============================================================================
   CONTENT COLUMN (Left - 65%)
   ============================================================================ */

.hc-ficha-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- BADGES ---- */

.hc-badges {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.hc-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: white;
}

.hc-badge--oferta {
  background: #D57A1C;
}

.hc-badge--tipo {
  background: #24559D;
}

/* ---- TITULO ---- */

.hc-titulo {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  color: #111827;
  line-height: 1.15;
  margin: 0 0 12px 0;
  padding: 0;
}

.hc-titulo-decor {
  width: 50px;
  height: 3px;
  background: #D57A1C;
  margin-top: 12px;
  margin-bottom: 16px;
}

/* ---- META (Ubicación + Ref) ---- */

.hc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 28px;
}

.hc-meta__pin {
  color: #D57A1C;
  flex-shrink: 0;
}

.hc-meta__loc {
  font-weight: 500;
}

.hc-meta__sep {
  color: #d1d5db;
  margin: 0 4px;
}

.hc-meta__ref {
  font-weight: 500;
}

/* ---- SPECS - 6 Columnas ---- */

.hc-specs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding: 28px 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .hc-specs {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 16px;
  }
}

@media (max-width: 640px) {
  .hc-specs {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 0;
  }
}

.hc-spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.hc-spec i {
  font-size: 24px;
  color: #24559D;
  display: block;
}

.hc-spec__val {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.hc-spec__lbl {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #9ca3af;
}

/* ---- SECTIONS (Description, Info, Chars, Cert, Mapa) ---- */

.hc-section {
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .hc-section {
    margin-bottom: 24px;
  }
}

.hc-section__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
  padding: 0;
}

@media (max-width: 640px) {
  .hc-section__title {
    font-size: 18px;
  }
}

/* ---- DESCRIPCIÓN ---- */

.hc-descripcion {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #4b5563;
  margin-bottom: 12px;
  transition: max-height 0.3s ease-out;
}

.hc-descripcion--truncated {
  max-height: 145px;
  overflow: hidden;
}

.hc-ver-mas {
  color: #24559D;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.2s;
}

.hc-ver-mas:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ---- TABLA DE INFORMACIÓN ---- */

.hc-info-table {
  width: 100%;
  border-collapse: collapse;
}

.hc-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  gap: 16px;
}

.hc-info-lbl {
  font-family: 'Open Sans', sans-serif;
  color: #6b7280;
  flex: 1;
}

.hc-info-val {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #111827;
  text-align: right;
}

/* ---- CARACTERÍSTICAS CON CHECKMARKS ---- */

.hc-caracts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 32px;
}

@media (max-width: 1024px) {
  .hc-caracts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hc-caracts {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.hc-caract-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.4;
}

.hc-caract-check {
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---- CERTIFICADO ENERGÉTICO ---- */

.hc-cert {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px 20px;
}

@media (max-width: 768px) {
  .hc-cert {
    gap: 16px;
    padding: 12px 16px;
  }
}

@media (max-width: 640px) {
  .hc-cert {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.hc-cert__badge {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #D57A1C;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.hc-cert__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hc-cert__val {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.hc-cert__unit {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #6b7280;
}

/* ---- MAPA ---- */

.hc-mapa-wrapper {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.hc-mapa-wrapper #map-canvas {
  height: 280px;
  width: 100%;
  border-radius: 12px;
}

.hc-mapa-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  background: white;
  border-radius: 50px;
  padding: 8px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.hc-mapa-chip svg {
  width: 16px;
  height: 16px;
  color: #D57A1C;
  flex-shrink: 0;
}

/* ============================================================================
   SIDEBAR (Right - 35%)
   ============================================================================ */

.hc-ficha-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 100px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1024px) {
  .hc-ficha-sidebar {
    position: static;
    top: auto;
    order: 2;
  }
}

/* ---- PRECIO ---- */

.hc-price-block {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.hc-price-old {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
  margin-bottom: 6px;
  display: block;
}

.hc-price-current {
  font-family: 'Montserrat', sans-serif;
  font-size: 38px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  display: block;
}

/* ---- AGENTE ---- */

.hc-agent {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0 24px 0;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
}

.hc-agent__photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.hc-agent__name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin: 0 0 4px 0;
  display: block;
}

.hc-agent__phone {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #24559D;
  text-decoration: none;
  transition: opacity 0.2s;
  display: block;
}

.hc-agent__phone:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ---- BOTÓN CTA ---- */

.hc-cta-btn {
  display: block;
  width: 100%;
  background: #D57A1C !important;
  color: white !important;
  text-align: center;
  padding: 16px 28px;
  border-radius: 50px;
  text-decoration: none !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  margin: 24px 0;
  line-height: 1;
}

.hc-cta-btn:hover {
  background: #b8661a !important;
  color: white !important;
}

.hc-cta-btn:visited {
  color: white !important;
}

/* ---- CONSERVACIÓN ---- */

.hc-conservation {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 16px 20px;
  text-align: center;
  margin-top: 0;
}

.hc-conservation__lbl {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  font-weight: 600;
}

.hc-conservation__val {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin: 0;
}

/* ============================================================================
   RESPONSIVE MOBILE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 640px) {
  .hc-ficha-layout {
    padding: 24px 16px;
  }

  .hc-titulo {
    font-size: clamp(20px, 5vw, 28px);
  }

  .hc-section__title {
    font-size: 16px;
  }

  .hc-spec__val {
    font-size: 14px;
  }

  .hc-price-current {
    font-size: 28px;
  }

  .hc-cta-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* ============================================================================
   UBICACIO CONTAINER
   ============================================================================ */

.hc-ubicacio-container {
  width: 100%;
  height: 280px;
  border-radius: 12px;
  background: #DFF2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hc-ubicacio-chip {
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
  .hc-ubicacio-container {
    height: 200px;
  }

  .hc-ubicacio-chip {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* ============================================================================
   PLUGIN ELEMENTS HIDE/OVERRIDE
   ============================================================================ */

.teamhost-ficha .property-item-panorama > .row:has(.tag-ficha),
.teamhost-ficha .property-item-panorama > .row:has(.tag-ficha-oferta),
.teamhost-ficha .property-item-panorama > .row.contenedor-ficha,
.teamhost-ficha .property-item-panorama > .row.content-agente,
.teamhost-ficha .botones-imprimibles {
  display: none !important;
}

/* Hide agent photo from property gallery (URL pattern: /usuarios/) */
.teamhost-ficha .fila-imagen img[src*="/usuarios/"],
.teamhost-ficha .fila-imagen a[href*="/usuarios/"],
.teamhost-ficha a[data-toggle="lightbox"][href*="/usuarios/"],
.teamhost-ficha .galleria img[src*="/usuarios/"] {
  display: none !important;
}

/* Hide the parent container of the agent image in the gallery grid */
.teamhost-ficha .fila-imagen:has(img[src*="/usuarios/"]),
.teamhost-ficha a[data-toggle="lightbox"]:has(img[src*="/usuarios/"]) {
  display: none !important;
}

/* Bootstrap resets (shouldn't be needed now, but failsafe) */
.teamhost-ficha .row {
  width: 100%;
  float: none;
  margin: 0;
  padding: 0;
}

.teamhost-ficha .col-md-12,
.teamhost-ficha .col-md-10 {
  width: 100%;
  float: none;
  margin: 0;
  padding: 0;
}
