/*
 * mobile.css — Correcciones exclusivas para dispositivos móviles
 * REGLA: Este archivo NO afecta a desktop. Solo opera bajo @media (max-width: 768px) o touch.
 * Nunca modificar el CSS compilado existente (assets/main-*.css).
 */

/* ============================================================
   1. CURSOR — Desactivar cursor custom en dispositivos touch
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  /* Restaurar cursor nativo del sistema */
  body,
  body * {
    cursor: auto !important;
  }

  /* Ocultar el elemento cursor personalizado */
  #custom-cursor {
    display: none !important;
  }
}

/* ============================================================
   2. CAROUSEL — Slide tipo Instagram en mobile
   ============================================================ */
@media (max-width: 768px) {

  /* Contenedor principal del carousel */
  .carousel-container {
    gap: 0;
    margin-bottom: 60px;
  }

  /* Ocultar botones de navegación en mobile (se navega con swipe) */
  .carousel-nav-btn {
    display: none !important;
  }

  /* Viewport: ancho completo, scroll horizontal táctil con snap */
  .portfolio-viewport {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;        /* Firefox */
    border-radius: 20px;
  }

  .portfolio-viewport::-webkit-scrollbar {
    display: none;                /* Chrome/Safari */
  }

  /* Track: sin gap entre slides para snap limpio */
  .portfolio-track {
    gap: 0;
    width: max-content;
  }

  /* Cada card: exactamente el ancho de la pantalla, snap al centro */
  .portfolio-track .project-card {
    width: 100vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    border-radius: 0;
    aspect-ratio: 4 / 5;
  }

  /* Indicadores de posición (dots) */
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.3s;
  }

  .carousel-dot.active {
    background: #AACE00;
  }
}

/* ============================================================
   3. HAMBURGER MENU — Solo mobile
   Desktop: .hamburger oculto, .nav-links visible como siempre
   ============================================================ */

/* En desktop el hamburger no existe */
@media (min-width: 769px) {
  .hamburger {
    display: none !important;
  }
}

@media (max-width: 768px) {

  /* Ocultar links horizontales del nav */
  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    gap: 48px;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 2rem;
    margin-left: 0;
    color: #fff;
    letter-spacing: 2px;
  }

  .nav-links a:hover,
  .nav-links a:active {
    color: #AACE00;
  }

  /* Botón hamburger */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
  }

  .hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }

  /* Animación X al abrir */
  .hamburger.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .hamburger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

/* ============================================================
   4. ABOUT — Texto arriba, foto abajo (mobile)
   Desktop: sin cambios (grid 2 columnas intacto)
   ============================================================ */
@media (max-width: 768px) {

  /* Romper el grid de 2 columnas → columna única */
  .about-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
  }

  /* Texto: primero, ancho completo */
  .about-text {
    order: 1;
    width: 100%;
  }

  /* Foto: después del texto, ancho completo con altura controlada */
  .about-image {
    order: 2;
    width: 100%;
  }

  .about-image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    object-position: center top;
    border-radius: 24px;
  }
}

/* ============================================================
   5. LIGHTBOX — Flechas navegación y contador
   ============================================================ */
.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.8rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2100;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

.modal-prev:hover,
.modal-next:hover {
  background: #AACE00;
  color: #000;
  border-color: #AACE00;
}

.modal-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Outfit, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  z-index: 2100;
}

/* En mobile ocultar flechas (navega con swipe) */
@media (max-width: 768px) {
  .modal-prev,
  .modal-next {
    display: none;
  }
}

/* ============================================================
   6. BACK BTN — Solo mobile (en desktop el nav ya tiene volver)
   ============================================================ */
@media (min-width: 769px) {
  #back-btn {
    display: none !important;
  }
}

/* ============================================================
   7. RESTORATION CARDS — Fix imagen colgada en mobile
   ============================================================ */
@media (max-width: 768px) {
  .restoration-card {
    aspect-ratio: unset;
    height: auto;
  }

  .restoration-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* ============================================================
   8. LIGHTBOX FLECHAS — SVG sizing
   ============================================================ */
.modal-prev svg,
.modal-next svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   9. PROJECT MEDIA — Espaciado entre wrappers y composition-section
   Aplica a todas las páginas de proyecto (desktop + mobile)
   ============================================================ */

/* Aire entre bloques de contenido en páginas de proyecto */
.composition-section {
  margin-bottom: 80px;
}

.composition-section + .project-media-wrapper,
.project-media-wrapper + .composition-section {
  margin-top: 20px;
}
