/* ===================================
   ESTILOS PARA PÁGINA DE PROYECTOS
   =================================== */

/* Hero Section de Proyectos */
.projects-hero {
  position: relative;
  height: 400px;
  background-image: url("../img/Constructora Domun Spa/Unihue.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.projects-hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 95, 95, 0.92) 0%,
    rgba(46, 125, 125, 0.88) 100%
  );
  z-index: 1;
}

.projects-hero .container {
  position: relative;
  z-index: 2;
}

.projects-hero .hero-content {
  text-align: center;
  color: var(--white);
}

.projects-hero .hero-subtitle {
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-color);
  margin-bottom: 15px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.projects-hero .hero-title {
  font-size: 3.5em;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.projects-hero .decorative-line {
  width: 100px;
  height: 4px;
  background: var(--accent-color);
  margin: 0 auto 25px;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(255, 180, 0, 0.5);
}

.projects-hero .hero-description {
  font-size: 1.2em;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
  opacity: 0.95;
}

/* Filtros de Proyectos */
.projects-filters {
  padding: 40px 0;
  background: var(--white);
  border-bottom: 2px solid #f0f0f0;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.filter-btn {
  padding: 12px 30px;
  background: var(--white);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 1em;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn i {
  font-size: 1.1em;
}

.filter-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(26, 95, 95, 0.3);
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 5px 15px rgba(26, 95, 95, 0.3);
}

/* Galería de Proyectos */
.projects-gallery {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.projects-grid-portfolio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  margin-bottom: 60px;
}

/* Tarjetas de Proyecto (Estilo mejorado tipo servicios) */
.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    background: var(--white);
    height: 350px; /* Fixed total height for uniformity */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.project-image {
    position: relative;
    height: 100%; /* Occupy full card since info overlays */
    width: 100%;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

/* Overlay siempre visible en parte inferior como gradiente, texto sube al hover */
/* Overlay siempre visible en parte inferior como gradiente, texto sube al hover */
.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
    display: flex; /* Flexbox para centrar contenido */
    flex-direction: column;
    justify-content: flex-end; /* Alinear al fondo */
    padding: 25px;
    transition: all 0.4s ease;
    opacity: 1; /* Always show gradient */
}

.overlay-content {
    text-align: left; /* Alineación izquierda más moderna */
    color: var(--white);
    transform: translateY(15px); /* Bajar un poco */
    transition: transform 0.4s ease;
    width: 100%;
}

.project-card:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h3 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    line-height: 1.3;
}

.project-location {
    font-size: 0.9em;
    margin-bottom: 0; /* Remove bottom margin to keep compact */
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    justify-content: flex-start;
    font-weight: 500;
}

.project-location i {
    color: var(--accent-color);
    font-size: 1em; /* Ensure icon is not huge */
}

.project-info {
    display: none; /* Hide old separate info box */
}

/* Custom buttons for inside the image */
.btn-view-project {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(10px);
    align-self: flex-start; /* Align left */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view-project:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--dark-grey);
}

.btn-view-project i {
    font-size: 1em; /* Ensure icon size inside button */
}

.project-card:hover .btn-view-project {
    opacity: 1;
    transform: translateY(0);
}

/* Categoría flotante */
.project-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(26, 95, 95, 0.9);
    backdrop-filter: blur(4px);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Paginación */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 60px;
}

.pagination-btn {
  padding: 12px 25px;
  background: var(--white);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-numbers {
  display: flex;
  gap: 10px;
}

.page-number {
  width: 45px;
  height: 45px;
  background: var(--white);
  border: 2px solid #e0e0e0;
  color: var(--dark-grey);
  font-weight: 600;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-number:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.1);
}

.page-number.active {
  background: var(--gradient-primary);
  color: var(--white);
  border-color: var(--primary-color);
}

/* Lightbox para Galería */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gallery-lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 2.5em;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.lightbox-close:hover {
  color: var(--accent-color);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  font-size: 2em;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-color);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-image-container {
  text-align: center;
}

.lightbox-image-container img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
  color: var(--white);
  margin-top: 20px;
  text-align: center;
}

.lightbox-info h3 {
  font-size: 1.8em;
  margin-bottom: 10px;
}

.lightbox-info p {
  font-size: 1.1em;
  opacity: 0.9;
}

.lightbox-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.lightbox-thumbnail {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.lightbox-thumbnail:hover,
.lightbox-thumbnail.active {
  opacity: 1;
  border-color: var(--accent-color);
}

/* CTA Section */
.projects-cta {
  padding: 80px 0;
  background: var(--gradient-primary);
  text-align: center;
}

.projects-cta .cta-content h2 {
  font-size: 2.5em;
  color: var(--white);
  margin-bottom: 15px;
  font-weight: 700;
}

.projects-cta .cta-content p {
  font-size: 1.2em;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 30px;
}

.projects-cta .btn-primary {
  padding: 18px 40px;
  font-size: 1.1em;
}

/* Responsive */
@media (max-width: 992px) {
  .projects-grid-portfolio {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .projects-hero .hero-title {
    font-size: 2.5em;
  }

  .filter-buttons {
    gap: 10px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }
}

@media (max-width: 768px) {
  .projects-grid-portfolio {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .projects-hero {
    height: 350px;
    background-attachment: scroll;
  }

  .projects-hero .hero-title {
    font-size: 2em;
  }

  .projects-hero .hero-description {
    font-size: 1em;
  }

  .filter-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-btn {
    justify-content: center;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .lightbox-nav {
    font-size: 1.5em;
    padding: 10px 15px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }
}
