/* ============================================
   SECCIÓN PORTAFOLIO (portfolio.css)
   Mobile-First
   ============================================ */

.portfolio-section {
  background-color: var(--color-negro);
  padding: 0 0 300px 0;
  position: relative;
  z-index: 4;
}

.portfolio-section__container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  transform: translateY(-8vw);
}

/* --- Cabecera --- */
.portfolio-header {
  text-align: center;
  margin-bottom: 40px;
}

.portfolio-title {
  font-family: var(--font-base);
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 900;
  color: var(--color-blanco);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.portfolio-subtitle {
  font-family: var(--font-secondary);
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: rgba(255, 255, 255, 0.7);
  margin: 12px auto 0;
  max-width: 500px;
  line-height: 1.6;
}

/* --- Slider wrapper --- */
.portfolio-slider {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

/* --- Contador --- */
.portfolio-counter {
  position: absolute;
  top: -36px;
  right: 0;
  font-family: var(--font-base);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  z-index: 5;
}

.portfolio-counter__current {
  color: var(--color-blanco);
}

/* --- Imagen principal --- */
.portfolio-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.portfolio-main__track {
  flex: 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  cursor: zoom-in;
}

.portfolio-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.portfolio-slide.active {
  opacity: 1;
  position: relative;
}

.portfolio-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Botones prev/next --- */
.portfolio-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--color-rojo);
  border: none;
  border-radius: 50%;
  color: var(--color-blanco);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.portfolio-btn svg {
  width: 22px;
  height: 22px;
}

.portfolio-btn:hover {
  background: #6e0918;
  transform: scale(1.1);
}

/* --- Miniaturas --- */
.portfolio-thumbs {
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-rojo) #1a1a1a;
  padding-bottom: 6px;
}

.portfolio-thumbs::-webkit-scrollbar {
  height: 4px;
}

.portfolio-thumbs::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 2px;
}

.portfolio-thumbs::-webkit-scrollbar-thumb {
  background: var(--color-rojo);
  border-radius: 2px;
}

.portfolio-thumbs__track {
  display: flex;
  gap: 8px;
  width: max-content;
}

.portfolio-thumb {
  width: 80px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.5;
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio-thumb.active {
  border-color: var(--color-rojo);
  opacity: 1;
}

.portfolio-thumb:hover {
  opacity: 0.85;
}

/* --- Desktop (992px+) --- */
@media (min-width: 992px) {
  .portfolio-section {
    padding: 0 0 360px 0;
  }

  .portfolio-section__container {
    transform: translateY(-10vh);
  }

  .portfolio-btn {
    width: 56px;
    height: 56px;
  }

  .portfolio-thumb {
    width: 100px;
    height: 68px;
  }
}

/* --- Lightbox --- */
.portfolio-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.portfolio-lightbox.active {
  display: flex;
}

.portfolio-lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: lightbox-in 0.3s ease;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.portfolio-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--color-rojo);
  color: var(--color-blanco);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10000;
}

.portfolio-lightbox__close:hover {
  background: #6e0918;
  transform: scale(1.1);
}