/* iluminacion.css — iPhone 3D flotante + layout de galería */

/* ===== LAYOUT PRINCIPAL ===== */
.iluminacion-layout {
  display: grid;
  gap: 32px;
  margin: 60px auto;
  max-width: 1100px;
  padding: 0 1rem;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
}

@media (min-width: 768px) {
  .iluminacion-layout {
    grid-template-columns: 1fr 1fr;
  }
  .phone-container { grid-column: 1; justify-self: end; }
  .info-container   { grid-column: 2; justify-self: start; }
}

/* ===== GALERÍA ===== */
.gallery-section {
  display: grid;
  gap: 32px;
  margin: 60px auto;
  max-width: 1100px;
  padding: 0 1rem;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
}

@media (min-width: 768px) {
  .gallery-section {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-slider { grid-column: 1; }
  .gallery-info   { grid-column: 2; }
}

/* ===== IPHONE 3D FLOTANTE ===== */
.phone-container {
  display: flex;
  justify-content: center;
  perspective: 1200px;
  margin: 20px 0;
}

.iphone {
  position: relative;
  width: 300px;
  height: 600px;
  border-radius: 48px;
  background: linear-gradient(145deg, #1a1a1e, #0f0f14);
  padding: 16px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.3),
    inset 0 0 0 3px rgba(255,255,255,.06),
    0 0 40px rgba(109,40,217,.15);
  transform-style: preserve-3d;
  transition: all .6s cubic-bezier(.23, 1, .32, 1);
  overflow: hidden;
  z-index: 2;
}

/* Sombra difusa bajo el iPhone */
.iphone::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 50%;
  width: 180px;
  height: 80px;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,.4) 0%,
    rgba(0,0,0,.15) 50%,
    transparent 80%);
  border-radius: 50%;
  transform: translateX(-50%) translateZ(-1px);
  filter: blur(20px);
  opacity: .7;
  transition: all .6s ease;
  pointer-events: none;
  z-index: 1;
}

.iphone:hover {
  transform: translateY(-16px) rotateY(4deg) scale(1.02);
  box-shadow:
    0 50px 100px rgba(0,0,0,.4),
    0 0 60px rgba(109,40,217,.3),
    inset 0 0 0 3px rgba(255,255,255,.08);
}

.iphone:hover::after {
  bottom: -60px;
  width: 220px;
  height: 100px;
  opacity: .9;
  filter: blur(28px);
}

/* Animación flotante al entrar en viewport */
.parallax-phone.in-view .iphone      { animation: floatPhone   4s ease-in-out infinite; }
.parallax-phone.in-view .iphone::after { animation: floatShadow 4s ease-in-out infinite; }

@keyframes floatPhone {
  0%, 100% { transform: translateY(0)    rotateY(-3deg); }
  50%       { transform: translateY(-12px) rotateY(3deg); }
}

@keyframes floatShadow {
  0%, 100% { transform: translateX(-50%) translateY(0)   scale(1);   opacity: .7; }
  50%       { transform: translateX(-50%) translateY(-8px) scale(1.1); opacity: .9; }
}

/* Pantalla interna */
.iphone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.iphone .screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 28px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .iphone { width: 260px; height: 520px; }
  .iphone::after { bottom: -40px; width: 160px; height: 70px; }

  /* En móvil siempre animado sin IntersectionObserver */
  .parallax-phone .iphone      { animation: floatPhoneMobile   3.5s ease-in-out infinite; }
  .parallax-phone .iphone::after { animation: floatShadowMobile 3.5s ease-in-out infinite; }

  .iluminacion-layout,
  .gallery-section { gap: 24px; margin: 40px auto; }
}

@keyframes floatPhoneMobile {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes floatShadowMobile {
  0%, 100% { transform: translateX(-50%) translateY(0)   scale(1);    opacity: .6; }
  50%       { transform: translateX(-50%) translateY(-6px) scale(1.08); opacity: .8; }
}

@media (max-width: 480px) {
  .iphone { width: 220px; height: 440px; }
}
