/* ===== carousel VERTICAL 3D (DESKTOP - 768px+) ===== */
.carousel-wrapper {
  perspective: 1800px;
  perspective-origin: center center;
  position: relative;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-stack {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 320px;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  transition: all 0.9s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

.slide-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Mejoras de renderizado */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.75));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  transition: opacity 0.4s;
}

.carousel-slide.active .slide-overlay {
  opacity: 1;
}

.open-btn {
  background: var(--accent-mind);
  color: var(--darker-blue);
  padding: 14px 40px;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.open-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ===== NAVEGACIÓN DESKTOP ===== */
.nav-controls {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.nav-button {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  border-color: var(--accent-mind);
}

.nav-button svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-mind);
  stroke-width: 3;
  fill: none;
}

/* ===== DOTS LATERALES DESKTOP ===== */
.dots-container {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.dot.active {
  background: var(--accent-mind);
  height: 28px;
  border-radius: 4px;
}

/* ===== COUNTER ===== */
.counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* ===== AJUSTAR IMG carousel ===== */
.carousel-slide img[src*="img/carousel/4.avif"] {
  object-position: 50% 15%;
}

.carousel-slide img[src*="img/carousel/0.avif"] {
  object-position: 50% 40%;
}

.carousel-slide img[src*="img/carousel/14.avif"] {
  object-position: 50% 25%;
}

.carousel-slide img[src*="img/carousel/28.avif"] {
  object-position: 50% 24%;
}

.carousel-slide img[src*="img/carousel/34.avif"] {
  object-position: 50% 22%;
}

.carousel-slide img[src*="img/carousel/24.avif"] {
  object-position: center bottom;
}

.carousel-slide img[src*="img/carousel/22.avif"] {
  object-position: 50% 95%;
}

.carousel-slide img[src*="img/carousel/23.avif"] {
  object-position: 50% 15%;
}

.carousel-slide img[src*="img/carousel/36.avif"] {
  object-position: 50% 15%;
}

.carousel-slide img[src*="img/carousel/46.avif"] {
  object-position: 50% 30%;
}

.carousel-slide img[src*="img/carousel/44.avif"] {
  object-position: 20% 30% 10%;
}

.carousel-slide img[src*="img/carousel/42.avif"] {
  object-position: 50% 60%;
}

.carousel-slide img[src*="img/carousel/39.avif"] {
  object-position: 50% 32%;
}

.carousel-slide img[src*="img/carousel/15.avif"] {
  object-position: center 25%;
}

/* ===== RESPONSIVE: CAROUSEL MÓVIL ===== */
@media (max-width: 768px) {
  .carousel-wrapper {
    perspective: none;
    height: auto;
    padding: 0;
    overflow: hidden;
    display: block;
  }

  .carousel-stack {
    position: relative;
    width: 100%;
    height: 280px;
    transform-style: flat;
    display: flex;
    align-items: center;
    overflow: visible;
    gap: 0;
    padding: 0;
    cursor: grab;
    transition: transform 0.5s ease;
  }

  .carousel-stack.dragging {
    cursor: grabbing;
    transition: none;
  }

  /* ===== SLIDES MÓVIL ===== */
  .carousel-slide {
    position: relative;
    width: 100%;
    height: 280px;
    left: auto;
    top: auto;
    transform: none !important;
    transform-origin: center;
    transition: transform 0.5s ease-out;
    transform-style: flat;
    flex-shrink: 0;
    opacity: 1;
  }

  .slide-inner {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  .carousel-slide img {
    image-rendering: auto;
  }

  /* ===== OVERLAY VISIBLE EN MÓVIL ===== */
  .slide-overlay {
    opacity: 1;
  }

  /* ===== OCULTAR CONTROLES DESKTOP ===== */
  .nav-controls {
    display: none;
  }

  /* ===== DOTS MÓVIL - CENTRADOS ABAJO ===== */
  .dots-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    top: auto;
    flex-direction: row;
    gap: 6px;
    z-index: 20;
  }

  .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
  }

  .dot:hover {
    background: rgba(255, 255, 255, 0.6);
  }

  .dot.active {
    background: var(--accent-mind);
    width: 24px;
    height: 8px;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.5);
  }

  .counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    left: auto;
    transform: none;
    margin: 0;
    text-align: right;
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent-mind);
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 20px;
  }

  /* ===== AUTOPLAY INDICATOR ===== */

  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
  }
}

/* Tablets pequeños */
@media (max-width: 640px) {
  .carousel-stack {
    height: 240px;
  }

  .carousel-slide {
    height: 240px;
  }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
  .carousel-stack {
    height: 220px;
  }

  .carousel-slide {
    height: 220px;
  }

  .counter {
    font-size: 11px;
    padding: 5px 10px;
  }

  .dot {
    width: 6px;
    height: 6px;
  }

  .dot.active {
    width: 20px;
  }
}

@media (max-width: 768px) {
  .about-wrap {
    grid-template-columns: 1fr;
  }

  .about-photo {
    min-height: 420px;
  }

  .about-card {
    padding: 34px 26px;
  }
}