/* propiedad-individual.css */
/* Estilos para la vista individual de una propiedad inmobiliaria */



:root {
  --secondary-color: #111111;
  --primary-color: #ffffff;
  --lux-gray: #2c2c2c;
  --lux-font-title: 'Playfair Display', serif;
  --lux-font-body: 'Playfair Display', serif;
}

body {
  font-family: var(--lux-font-body);
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: var(--lux-gray);
}

body {
  overflow-y: scroll;
}

main {
  display: flex;
  flex-direction: row;
  padding: 40px;
  gap: 40px;
}

.layout-container {
  display: flex;
  position: relative;
}

/* Barra lateral */
.sidebar {
  position: fixed;
  top: 140px;
  left: 0;
  width: 280px;
  height: calc(100% - 130px);
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  font-family: 'Montserrat', sans-serif;
}

.sidebar.visible {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
}

.toggle-sidebar-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #555;
  cursor: pointer;
  transition: color 0.3s;
}

.toggle-sidebar-btn:hover {
  color: #000;
}



.barra-control {
  padding: 0;
  text-align: left;
}

/* Botón de toggle */
.toggle-sidebar {
  position: fixed;
  top: 170px;
  left: 0px;
  transform: translateY(-50%);
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 15px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.3s ease;
}

/* Cuando la sidebar está abierta, mover el botón */
.sidebar-open .toggle-sidebar {
  left: 260px;
  /* sidebar + margen */
}


.sidebar.visible~.toggle-sidebar {
  display: none;
}


.toggle-sidebar:hover {
  background: var(--secondary-color);
}

.sidebar h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--lux-gray);
}

/* Lista del sidebar */
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li a {
  display: block;
  padding: 1rem;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #222;
}

.property-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.property-header {
  display: flex;
  gap: 30px;
  background: var(--primary-color);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  align-items: center; /* ✅ CENTRA verticalmente todo el contenido */
  flex-wrap: wrap;
  position: relative;
}

.property-header .details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  zoom: 1.2;
  justify-content: center; /* ✅ Centra verticalmente el contenido interno */
  height: 100%;
}


.property-header img {
  width: 200px;
  max-width: 100%;
  border-radius: 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  /* Separación entre h2 y botón */
}

/* El título */
.header-top h2 {
  font-family: var(--lux-font-title);
  font-size: 1.5rem;
  color: #111;
  margin: 0;
}

/* El botón de favorito (corazón) */
.favorite-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #111;
  padding: 0;
  transition: transform 0.3s ease;
}

/* Cuando está marcado como favorito */
.favorite-btn.favorited {
  color: #000;
  /* Corazón relleno */
}


.property-header {
  position: relative; /* Para posicionar absolutamente dentro */
}

.invertir-btn {
  position: absolute;
  top: 50%;  right: 30px;
  margin: 0;
  background-color: var(--lux-gray);
  color: var(--primary-color);
  padding: 15px 50px;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  transform: translateY(-50%);
}

.invertir-btn:hover {
  background-color: var(--secondary-color);
}

.price-info {
  background: var(--primary-color);
  padding: 20px;
  border-radius: 16px;
  align-self: flex-start;
  min-width: 220px;
  text-align: center;
  zoom: 1.2;
  align-items: center;
}

.price-info h3 {
  margin: 0;
  font-size: 2rem;
  color: var(--lux-gray);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;

}

.price-info .variation {
  margin-top: 10px;
  font-weight: 600;
  font-size: 1.5rem;
  color: green;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.bottom-section {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}




.analysis-chart canvas {
  display: block;
  margin-top: 0;
}

.analysis-chart,
.property-stats {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.analysis-chart canvas {
  display: block;
  margin: 0;
  padding: 0;
}


.analysis-chart,
.property-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* NO uses height aquí */
}

.analysis-chart {
  flex: 1;
  background: var(--primary-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;

}

.property-stats {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--primary-color);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 100%;
  border-top: 2px solid #eee;
  border-bottom: 2px solid #eee;
}

.property-stats .stat {
  background: #f7f7f7;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 12px;
}


.property-stats .stat {
  margin-top: 15px;
  /* o más si lo ves necesario */
}


.tab-section {
  background: var(--primary-color);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  gap:20px;
}

.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 2px solid #eee;
  margin-bottom: 20px;
}

.tabs button {
  background: none;
  border: none;
  font-weight: bold;
  padding: 10px 15px;
  cursor: pointer;
  color: var(--lux-gray);
  transition: color 0.3s, border-bottom 0.3s;
  border-bottom: 3px solid transparent;
}

.tabs button.active {
  color: var(--secondary-color);
  border-bottom: 3px solid var(--secondary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}



.floating-buttons {
  position: fixed;
  top: 160px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-buttons a {
  background: var(--lux-gray);
  color: var(--primary-color);
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.3s;
}

.floating-buttons a:hover {
  background: var(--secondary-color);
}



/* Sección principal del menú */
.menu-section {
  border: 1px solid #2c2c2c;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background-color: #fafafa;
  font-weight: 600;
  color: #111;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.section-header:hover {
  background-color: #f0f0f0;
}

/* Icono del botón desplegable */

.section-toggle {
  font-size: 1.2rem;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  transition: transform 0.3s;
}

.section-toggle.collapsed {
  transform: rotate(-90deg);
}

/* Submenú */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  background-color: #fff;
  transition: all 0.3s ease;
}

.submenu.hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

.submenu li a {
  display: block;
  padding: 0.75rem 2rem;
  text-decoration: none;
  color: #444;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
}

.submenu li a::before {
  position: absolute;
  left: 1rem;
  color: #aaa;
}

@media (max-width: 768px) {
  .property-header {
    flex-direction: row;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }

  .property-header img {
    width: 120px;
    height: auto;
    border-radius: 12px;
  }

  .property-header .details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .property-header .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    
  }

  .property-header .header-top h2 {
    font-size: 1.2rem;
    margin: 0;
    flex: 1;
    align-items: center;
  }

  .property-header p {
    font-size: 0.9rem;
    margin: 0;
  }

  .invertir-btn {
    align-self: flex-start;
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: 24px;
    margin-top: 8px;
  }
}

@media screen and (max-width: 48rem) {
  * {
    box-shadow: none !important;
  }
}

@media (max-width: 768px) {
  .property-header {
    display: flex;
    align-items: center; /* 🔧 esto centra verticalmente los hijos */
    flex-direction: row;
    gap: 40px;
  }

  .property-header .header-top {
    display: flex;
    align-items: center; /* 🔧 centra verticalmente el h2 respecto al resto */
    flex: 1;
  }

  .property-header .header-top h2 {
    font-size: 1.2rem;
    margin: 0;
    flex: 1;
  }
}



@media screen and (max-width: 48rem) {
  .btn-invertir {
    all: unset; /* 🔧 Resetea estilos heredados */
    position: fixed !important;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    background-color: black;
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
    border-radius: 2rem;
    cursor: pointer;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
  }

  .btn-invertir:hover {
    background-color: var(--lux-gray);
  }

  body {
    padding-bottom: 5rem;
  }
}

@media screen and (max-width: 48rem) {
  .property-header .invertir-btn {
    display: none !important;
  }


body {

  background-color: white;
}
}

/* SOLO en pantallas hasta 768px */
@media screen and (max-width: 48rem) {
  .btn-invertir {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    background-color: black;
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
    border-radius: 2rem;
    cursor: pointer;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
    display: block;
  }
}

/* OCULTAR en pantallas mayores a 768px */
@media screen and (min-width: 48.063rem) {
  .btn-invertir {
    display: none !important;
  }
}

@media screen and (max-width: 48rem) {
  #toggleSidebarBtn {
    display: none !important;
  }
}



@media (max-width: 768px) {
  .property-main {
    padding: 0px;
    gap: 0px;
  }

  .header-top h2 {
    font-size: 1.3rem;
  }

  .property-header .details p,
  .property-header .details .invertir-btn {
    font-size: 0.95rem;
  }

  .price-info h3 {
    font-size: 1.4rem;
    text-align: center;
  }

  .price-info .variation {
    font-size: 1.2rem;
  }

  .property-stats {

    width: 100%;
  }

  .property-stats .stat {
    font-size: 0.95rem;
  }

  .sidebar {
    top: 80px;
    height: calc(100% - 0px);

  }
}




@media (max-width: 768px) {
  .tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .tabs::-webkit-scrollbar {
    height: 6px;
  }

  .tabs::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 4px;
  }

  .tabs button {
    flex: 0 0 auto;
    font-size: 0.95rem;
    white-space: nowrap;
  }
}

@media screen and (max-width: 48rem) {
  .bottom-section {
    display: flex;
    flex-direction: column; /* NO column-reverse */
    gap: 1.5rem;
  }
}





.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  /* capa gris semitransparente */
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}


.lux-header {
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  z-index: 9999;
}

.lux-header.fixed {
  position: fixed;
  top: 0;
  left: 0;
}

body.fixed-header-active .layout-container {
  margin-top: 100px;
  /* ajusta según la altura del header */
}



/* NOTICIAS DE UN ACTIVO INDIVIDUAL */
.noticia-activo {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background-color: var(white);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.noticia-activo:hover {
  transform: scale(1.01);
}

.noticia-activo-img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.noticia-activo-content {
  flex: 1;
}

.noticia-activo-content h2 {
  font-family: var(--lux-font-title);
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.noticia-activo-content h2 a {
  color: inherit;
  text-decoration: none;
}

.noticia-activo-content h2 a:hover {
  text-decoration: underline;
}

.fecha-noticia-activo {
  font-size: 0.9rem;
  color: #111;
  margin-bottom: 0.8rem;
}

.btn-leer-mas-activo {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-leer-mas-activo:hover {
  background-color: #333;
  color: #fff;
}





.analysis-chart {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding: 1rem;
  justify-items: center;
  align-items: center;
  margin: 0 auto;
  max-width: 1000px;
}

.rentabilidad-burbuja {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--lux-gray, #2c2c2c);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: 'Playfair Display', serif;
  text-align: center;
  transition: transform 0.2s ease;
}

.rentabilidad-burbuja:hover {
  transform: translateY(-3px);
}

.rentabilidad-burbuja p {
  margin: 0;
  font-size: 1rem;
  color: var(--lux-gray, #2c2c2c);
  font-weight: 500;
}

.rentabilidad-burbuja .valor {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 0.3rem;
  color: #111111;
}




.comentarios-container {
  background-color: var(--primary-color);
  padding: 2rem;
  border-radius: 28px;
  margin-top: 2rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
  font-family: var(--lux-font-body);
  color: var(--secondary-color);
}

.comentarios-header h3 {
  font-family: var(--lux-font-title);
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.comentarios-header p {
  font-size: 1rem;
  color: #666;
  margin-top: 0;
}

.comentarios-header select {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 0.95rem;
  background-color: #fff;
  color: #333;
  font-family: var(--lux-font-body);
}

/* Formulario */
.comentario-form {
  background-color: #fcfcfc;
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.comentario-user {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.avatar-circle {
  width: 50px;
  height: 50px;
  background-color: var(--lux-gray);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.comentario-user textarea {
  flex: 1;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-family: var(--lux-font-body);
  font-size: 1rem;
  min-height: 100px;
  resize: none;
  background-color: white;
}

.comentario-user textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
}

.comentario-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  align-items: center;
}

#caracteres-restantes {
  font-size: 0.85rem;
  color: #999;
}

.comentario-actions button {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.comentario-actions button:hover {
  background-color: #1a1a1a;
}

/* Lista de comentarios */
.comentario-lista {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.comentario {
  display: flex;
  gap: 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.comentario .contenido {
  background-color: #f8f8f8;
  padding: 1rem 1.3rem;
  border-radius: 14px;
  width: 100%;
  position: relative;
}

.comentario .contenido p {
  margin: 0 0 0.5rem;
  line-height: 1.5;
  color: #333;
}

.comentario .contenido small {
  font-size: 0.8rem;
  color: #777;
}

.comentario .contenido strong {
  font-weight: bold;
  color: var(--secondary-color);
}

.autor-badge {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Botones debajo de cada comentario */
.comentario-footer {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.4rem;
}

.btn-responder,
.btn-like {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: #555;
  transition: color 0.2s ease;
}

.btn-responder:hover,
.btn-like:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Respuestas */
.respuestas {
  margin-top: 1rem;
  padding-left: 2rem;
  border-left: 2px solid #ddd;
}

.comentario.respuesta {
  margin-top: 1.5rem;
}

.respuesta-formulario {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.respuesta-formulario textarea {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  resize: vertical;
  background-color: #fff;
  font-family: var(--lux-font-body);
}

.respuesta-formulario button {
  align-self: flex-end;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.respuesta-formulario button:hover {
  background-color: #1a1a1a;
  color: white;
}
