@import url("fonts.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Fuentes cargadas previamente: “Montserrat-Bold” y “Poppins-Regular” */
  --color-titles: #333333;
  --color-texto: #444;
}

/* estilo base del espaciador */
#menu-spacer {
  position: relative;
  top: 0;
  width: 100%;
  height: 0; /* se actualizará por JS */
  pointer-events: none;
}

/* ——— PROJECT HEADER dentro de CenterContainer ——— */
.project-header {
  width: 100%;
  background: #ededed;
}
.project-header .CenterContainer {
  padding: 40px 40px;
  display: flex;
  flex-direction: column; /* breadcrumb arriba, contenido abajo */
  align-items: flex-start; /* textos a la izquierda */
  gap: 20px; /* separa breadcrumb de project-content */
}

.project-header .breadcrumb {
  font-size: 14px;
}
.project-header .breadcrumb a {
  padding: 1rem;
  font-family: "Roboto-Regular";
  color: var(--color-texto);
  font-size: 0.9rem;
  text-decoration: none;
}
.project-header .breadcrumb a:hover {
  text-decoration: underline;
}

.project-header .project-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.project-header .project-info {
  flex: 1 1 300px;
  font-family: "Roboto-Regular";
  color: var(--color-titles);
}
.project-header .project-info h4 {
  font-size: 22px;
  font-weight: normal;
  margin: 0 0 8px 0;
  border-bottom: 2px solid #333333;
  display: inline-block;
  padding-bottom: 4px;
  line-height: 0.75;
}
.project-header .project-info h2 {
  font-size: 40px;
  font-weight: bold;
  margin: 0 0 8px 0;
}
.project-header .project-info p {
  font-size: 14px;
  margin: 0;
}

.project-header .project-logo {
  flex: 0 1 120px;
  text-align: right;
  padding-right: 20px;
  -webkit-user-drag: none;
}
.project-header .project-logo a {
  display: inline-block;
}
.project-header .project-logo img {
  max-height: 120px;
  width: auto;
  height: auto;
}

/* Estilos del carrusel */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel-slides {
  display: flex;
  transition: transform 0.5s ease;
}
.slide {
  min-width: 100%;
  position: relative;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.slide.active {
  opacity: 1;
}
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 4;
}
.expanded .carousel-indicators {
  display: none !important;
}
.carousel-container:not(.expanded) .carousel-indicators {
  display: flex;
}
.indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(20, 61, 165, 0.3);
  transition: all 0.3s ease;
  z-index: 5;
  cursor: pointer;
  position: relative;
}
.indicator.active {
  background: #143da5;
}

/* Botones SOLO en el overlay */
.expanded-carousel .carousel-btn {
  background: #fff;
  border: 2px solid #143da5;
  color: #143da5;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  opacity: 0.9;
  display: flex;
  justify-content: center;
  align-items: center;
}

.expanded-carousel .carousel-btn:hover {
  background: #143da5;
  opacity: 1;
}

.expanded-carousel .carousel-btn:hover svg path {
  fill: #fff;
}

.expanded-carousel .carousel-btn.left {
  left: 0;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.expanded-carousel .carousel-btn.left svg {
  fill: #143da5;
  width: 28px;
}

.expanded-carousel .carousel-btn.right {
  /* <-- corregido aquí */
  right: 0;
  transform: translate(50%, -50%);
}

.expanded-carousel .carousel-btn.right svg {
  fill: #143da5;
  width: 28px;
}

.carousel-container:not(.expanded) .carousel-btn {
  display: none !important;
}

/* Overlay expandido */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 102;
  display: none;
  justify-content: center;
  align-items: center;
}
.overlay.active {
  display: flex;
}
.expanded-carousel {
  position: relative;
  width: auto;
  max-width: 1000px;
  max-height: 85vh;
  background: white;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.expanded-carousel .slide {
  position: relative;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.expanded-carousel .slide.active {
  opacity: 1;
  display: flex;
}

.expanded-carousel .carousel-container {
  width: 100%;
  height: 100%;
}
.expanded-carousel img {
  border-radius: 15px;
  width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
}

/* Botón cerrar */
.close-btn {
  cursor: pointer;
  top: -55px;
  right: 0;
  width: 40px;
  height: 40px;
  position: absolute;
  border: none;
  border-radius: 0.8rem;
  background-color: #143da5;
}
.close-btn:before,
.close-btn:after {
  content: "";
  position: absolute;
  width: 80%;
  height: 2px;
  background-color: white;
  transition: 0.3s ease-out;
  left: 50%;
  top: 50%;
}
.close-btn:after {
  transform: translate(-50%, -50%) rotate(45deg);
}
.close-btn:before {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.close-btn:hover,
.close-btn:focus {
  transform: scale(1.2);
}
.close-btn:hover:before,
.close-btn:hover:after,
.close-btn:focus:before,
.close-btn:focus:after {
  transform: translate(-50%, -50%) rotate(180deg);
}

.CenterContainer {
  width: 100%;
  max-width: 1440px;
  height: fit-content;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.apartment-section {
  background: #ededed;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: fit-content;
  margin: 0;
  padding: 0;
}

.apartment-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
}

.apt-tabs {
  display: flex;
  max-width: 1280px;
  gap: 0.25rem;
  justify-content: flex-start;
  width: 100%;
  padding-left: 70px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  font-family: "Roboto-Regular";
  padding-top: 15px;
  line-height: normal;
  font-weight: bold;
  color: var(--color-texto);
}
.tab-btn.active {
  transform: scale(1.1);
  border-bottom: 3px solid #143da5;
  color: #143da5;
}

.apt-content {
  max-width: 1440px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  padding-top: 25px;
}

.text-block {
  padding-right: 20%;
  padding-left: 40px;
}
.text-block .headline {
  font-family: "Montserrat-Bold";
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  color: var(--color-titles);
}

.stats {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.2rem;
  position: relative;
  left: -10px;
  padding-right: 20%;
}
.stats div {
  text-align: center;
  padding: 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.2rem;
}
.stat-value {
  font-family: "Montserrat-Bold";
  font-size: 1.2rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  color: var(--color-titles);
}
.stat-description {
  white-space: normal;
  overflow-wrap: break-word;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--color-texto);
  font-family: "Poppins-Regular";
}

.description {
  line-height: 1.6;
  padding-bottom: 0.5rem;
  font-family: "Poppins-Regular";
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-texto);
  padding-right: 15px;
}

.image-block {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  height: 450px;
  margin-left: 20%;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: grab;
  overflow: visible;
}

.image-disclaimer {
  padding: 1rem;
  background: #d4d4d4;
  font-family: "Roboto-Regular";
  color: var(--color-texto);
  font-size: 0.9rem;
}

.carousel-slides {
  position: relative;
  height: 100%;
  width: 100%;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  padding: 40px;
  /* --- ¡LA CLAVE ESTÁ AQUÍ! --- */
  box-sizing: border-box; /* Esto asegura que el padding se reste del 100% del ancho/alto */
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.features {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
  width: 100%;
  gap: 8%;
  padding: 0 20px 0;
}
.feature {
  max-width: 70px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature svg {
  width: 100%;
  max-height: 70px;
  fill: #444;
}

.feature span {
  white-space: normal;
  overflow-wrap: break-word;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--color-texto);
  font-family: "Poppins-Regular";
}

.ExpandIcon {
  position: absolute;
  background-color: #143da5;
  display: flex;
  height: 45px;
  width: 45px;
  border: none;
  border-radius: 0.8rem;
  margin: 20px;
  z-index: 3;
  transition: 0.5s;
}

.ExpandIcon:hover {
  transform: scale(1.3);
  cursor: pointer;
}

/* Media Queries */
@media (max-width: 1024px) {
  .text-block {
    padding: 0 20px 0;
  }
  .features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    padding: 20px 10px 20px;
    place-items: center;
    margin-top: 15px;
    margin-bottom: 20px;
  }
  .feature {
    position: relative;
  }
  .expanded-carousel {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0px;
  }

  .expanded-carousel img {
    border-radius: 0px;
  }

  .expanded-carousel .carousel-btn.left {
    left: 25px;
    transform: translate(-48%, -48%);
  }

  .expanded-carousel .carousel-btn.right {
    right: 25px;
    transform: translate(48%, -48%);
  }
}

@media (max-width: 768px) {
  .project-header .CenterContainer {
    padding: 15px 20px;
  }
  .project-header .breadcrumb {
    font-size: 12px;
  }
  .project-header .project-info h4 {
    font-size: 14px;
    padding-bottom: 0px;
  }
  .project-header .project-info h2 {
    font-size: 24px;
    margin: 0 0 2px 0;
  }
  .project-header .project-info p {
    font-size: 12px;
  }
  .project-header .project-content {
    /* mantenemos logo a la derecha */
    flex-wrap: nowrap;
  }
  .project-header .project-logo {
    flex: 0 1 100px;
    margin-top: 0;
  }
  .project-header .project-logo img {
    max-height: 65px;
  }

  .apt-content {
    padding-top: 15px;
    display: flex;
    flex-direction: column-reverse;
  }
  .apt-tabs {
    padding-left: 10vw;
    justify-content: flex-start;
  }
  .apartment-form {
    align-items: center;
  }
  .image-block {
    margin-top: 15px;
    margin-left: 0;
    max-width: 80vw;
  }
  .text-block {
    padding: 0 0px 0;
    margin-left: 0;
    max-width: 80vw;
  }

  .text-block .headline {
    font-size: 2rem;
  }
  .stats {
    display: flex;
    flex-wrap: wrap; /* Permite el salto de línea */
    justify-content: left; /* Distribuye el espacio entre elementos */
    width: 100%;
    margin-bottom: 0.2rem;
    position: relative;
    left: -10px;
    padding-right: 20%;
    gap: 0.4rem; /* Espacio entre elementos */
  }

  .stats div {
    text-align: center;
    padding: 0.5rem;
    flex: 1 1; /* Ocupa ~30% del ancho (3 elementos por fila) */
    max-width: fit-content; /* Ancho mínimo antes de saltar (ajusta según necesidad) */
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .stat-value {
    font-size: 1.1rem !important;
  }
  .stat-description {
    font-size: 0.8rem;
  }

  .close-btn {
    top: -45px;
    right: 10px;
    width: 35px;
    height: 35px;
  }

  .expanded-carousel .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .expanded-carousel .carousel-btn.right svg,
  .expanded-carousel .carousel-btn.left svg {
    width: 20px;
  }
}

@media (max-height: 768px) and (max-width: 1024px) {
  .image-block {
    height: 400px;
    margin-right: 10%;
  }
}

@media (max-height: 768px) and (max-width: 768px) {
  .image-block {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .project-header .breadcrumb {
    font-size: 11px;
  }
  .project-header .project-info h4 {
    font-size: 11px;
    padding-bottom: 2px;
  }
  .project-header .project-info h2 {
    font-size: 18px;
    margin: 0 0 0px 0;
  }
  .project-header .project-info p {
    font-size: 11px;
  }
  .project-header .project-content {
    flex-wrap: nowrap;
  }
  .project-header .project-logo {
    flex: 0 1 80px;
  }
  .project-header .project-logo img {
    max-height: 50px;
  }
  .ExpandIcon {
    margin: 10px;
    height: 35px;
    width: 35px;
  }
  .slide {
    padding: 15px;
  }
  .text-block {
    padding: 0;
  }
  .tab-btn {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
  .stats {
    position: relative;
    left: 0;
    padding-right: 0;
  }
  .stats div {
    padding: 0.1rem;
    margin: 0 0.05rem;
  }
  .stat-value {
    font-size: 1.2rem !important;
  }
  .stat-description {
    font-size: 0.9rem;
    line-height: 1.1;
  }

  .feature {
    max-width: 55px;
  }
  .feature span {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  .feature-icon {
    height: 3.5rem;
    margin-bottom: 0.3rem;
  }

  .expanded-carousel .carousel-btn.left {
    left: 20px;
  }

  .expanded-carousel .carousel-btn.right {
    right: 20px;
  }

  .expanded-carousel .carousel-btn {
    width: 35px;
    height: 35px;
  }

  .expanded-carousel .carousel-btn.right svg,
  .expanded-carousel .carousel-btn.left svg {
    width: 18px;
  }
}
