/* === SECCIÓN PRINCIPAL === */
.projects-section {
  width: 100%;
  max-width: 1200px;
  text-align: center;
  margin: 50px auto;
  overflow: hidden;
}

.projects-section h2 {
  font-size: 2rem;
  color: #082b0c;
  margin-bottom: 30px;
}

/* === CARRUSEL === */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.6s ease;
}

.carousel-item {
  flex: 0 0 calc(33.333% - 20px);
  margin: 0 10px;
  cursor: pointer;
}

.carousel-item img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.carousel-item:hover img {
  transform: scale(1.03);
}

/* === FLECHAS === */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #0b2a0b;
  font-size: 2rem;
  cursor: pointer;
  width: 50px;
  height: 80px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  transition: background 0.3s ease;
}

.carousel-btn:hover {
  background: #fff;
}

.prev-btn { left: 0; }
.next-btn { right: 0; }

/* === POPUP === */
.popup {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0,0,0,0.85);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.popup.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.popup-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0,0,0,0.3);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.popup.active .popup-content {
  transform: scale(1);
}

.popup-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
}

body.no-scroll {
  overflow: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .carousel-item {
    flex: 0 0 calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .carousel-item {
    flex: 0 0 100%;
    margin: 0;
  }

  .carousel-btn {
    width: 45px;
    height: 70px;
    font-size: 1.8rem;
  }

  .carousel-item img {
    height: 300px;
  }
}
