/* ═══════════════════════════════════════
   PHONE 3D COVERFLOW CAROUSEL
   ═══════════════════════════════════════ */

/* Wrapper */
.phone-carousel-wrapper {
  position: relative;
  width: 100%;
  padding: 20px 0 60px;
  overflow: visible;
}

/* Navigation arrows — top-center like reference */
.pc-btn {
  position: absolute;
  top: -60px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: 0.3s var(--ease);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  z-index: 20;
}
.pc-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(37,99,235,0.25);
  transform: scale(1.08);
}
.pc-prev { left: calc(50% - 56px); }
.pc-next { left: calc(50% + 10px); }

/* ── 3D Stage ── */
.phone-carousel-track {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  perspective-origin: 50% 40%;
  height: 560px;
  position: relative;
}

/* ── Each Phone Slide ── */
.phone-slide {
  position: absolute;
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform-style: preserve-3d;
  transition:
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.65s ease,
    z-index   0s;
  cursor: pointer;
  user-select: none;
}

/* ── Position States ── */

/* Active — front and center */
.phone-slide.pos-center {
  transform: translateX(0) translateZ(0) rotateY(0deg) scale(1);
  opacity: 1;
  z-index: 10;
  pointer-events: all;
}

/* Left neighbor */
.phone-slide.pos-left {
  transform: translateX(-290px) translateZ(-120px) rotateY(42deg) scale(0.82);
  opacity: 0.8;
  z-index: 5;
  pointer-events: all;
}

/* Right neighbor */
.phone-slide.pos-right {
  transform: translateX(290px) translateZ(-120px) rotateY(-42deg) scale(0.82);
  opacity: 0.8;
  z-index: 5;
  pointer-events: all;
}

/* Far left — hidden behind */
.phone-slide.pos-far-left {
  transform: translateX(-420px) translateZ(-250px) rotateY(55deg) scale(0.6);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* Far right — hidden behind */
.phone-slide.pos-far-right {
  transform: translateX(420px) translateZ(-250px) rotateY(-55deg) scale(0.6);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Phone Frame ── */
.phone-frame-wrap {
  transition: all 0.5s var(--ease);
  transform-style: preserve-3d;
}

.pos-center .phone-frame-wrap {
  filter: 
    drop-shadow(0 40px 80px rgba(0,0,0,0.3))
    drop-shadow(0 10px 30px rgba(37, 99, 235, 0.2));
}

.phone-frame-device {
  width: 230px;
  height: 480px;
  background: #020617; /* Deep black chassis */
  border-radius: 40px;
  position: relative;
  /* Metallic outer frame effect */
  padding: 4px; 
  box-shadow: 
    inset 0 0 2px 1px rgba(255,255,255,0.1),
    0 0 0 1px #1e293b,
    0 4px 10px rgba(0,0,0,0.5);
  transition: all 0.4s;
}

/* Side Buttons (Hardware simulation) */
.phone-frame-device::before,
.phone-frame-device::after {
  content: "";
  position: absolute;
  background: #1e293b;
  width: 3px;
  border-radius: 2px;
}
/* Volume buttons on left */
.phone-frame-device::before {
  left: -2px;
  top: 80px;
  height: 60px;
  box-shadow: -1px 0 2px rgba(0,0,0,0.5);
}
/* Power button on right */
.phone-frame-device::after {
  right: -2px;
  top: 100px;
  height: 40px;
  box-shadow: 1px 0 2px rgba(0,0,0,0.5);
}

.dark-mode .phone-frame-device {
  background: #000;
  box-shadow: 
    inset 0 0 3px 1px rgba(255,255,255,0.05),
    0 0 0 1px #0f172a,
    0 10px 30px rgba(0,0,0,0.8);
}

.pos-center .phone-frame-device {
  /* Active center gets a slight glow on the metal edge */
  box-shadow: 
    inset 0 0 2px 1px rgba(37,99,235,0.3),
    0 0 0 1px var(--accent),
    0 15px 45px rgba(0,0,0,0.4);
}

/* Speaker Grill (Top) */
.phone-speaker {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 4px;
  background: #111827;
  border-radius: 10px;
  z-index: 20;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.8);
}

/* Screen Shell */
.phone-frame-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #000;
  position: relative;
  z-index: 5;
  border: 1px solid rgba(255,255,255,0.05); /* Thin inner screen bezel */
}

/* Screenshot image */
.slide-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  border-radius: 30px;
}

/* Placeholder when no image */
.slide-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #475569;
  gap: 10px;
  background: #1e293b;
  border-radius: 29px;
  z-index: 0;
}
.slide-img-placeholder span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}
/* Hide placeholder when real image is present */
.slide-img[src]:not([src=""]) { z-index: 2; }
.slide-img[src]:not([src=""]) ~ .slide-img-placeholder { display: none; }

/* Screen shine */
.phone-frame-screen::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 45%);
  pointer-events: none;
  z-index: 10;
  border-radius: 29px;
}

/* ── Slide Caption ── */
.slide-caption {
  text-align: center;
  transition: opacity 0.5s ease;
  min-height: 60px;
}
.phone-slide:not(.pos-center) .slide-caption {
  opacity: 0;
  pointer-events: none;
}
.slide-caption h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.slide-caption p {
  font-size: 0.9rem;
  color: var(--text-2);
  max-width: 250px;
  text-align: justify;
  text-justify: inter-word;
  text-align-last: center;
}

/* Index label on side cards — like "1. Facturación Pista" */
.slide-index-label {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 20;
  background: rgba(15,23,42,0.6);
  padding: 6px;
  backdrop-filter: blur(4px);
}
.pos-center .slide-index-label { display: none; }

/* ── Dot Indicators ── */
.pc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 50px;
}
.pc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.35s var(--ease);
}
.pc-dot.active {
  width: 26px;
  border-radius: 5px;
  background: var(--accent);
}

/* ── ambient glow behind center ── */
.phone-carousel-wrapper::before {
  content: "";
  position: absolute;
  bottom: 40px; left: 50%; transform: translateX(-50%);
  width: min(320px, 80vw); height: 80px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.18) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}

/* ═══════════════════════════════════════
   UNIVERSAL RESPONSIVE ENGINE
   ═══════════════════════════════════════ */

/* Large Tablets & Small Desktops */
@media (max-width: 1100px) {
  .phone-carousel-track { height: 500px; perspective: 1000px; }
  .phone-slide { width: 200px; }
  .phone-frame-device { width: 200px; height: 420px; }
  .phone-slide.pos-left { transform: translateX(-240px) translateZ(-150px) rotateY(35deg) scale(0.85); }
  .phone-slide.pos-right { transform: translateX(240px) translateZ(-150px) rotateY(-35deg) scale(0.85); }
}

/* Tablets (Portrait) */
@media (max-width: 850px) {
  .phone-carousel-track { height: 450px; perspective: 900px; }
  .phone-slide { width: 180px; }
  .phone-frame-device { width: 180px; height: 380px; }
  .phone-slide.pos-left { transform: translateX(-180px) translateZ(-180px) rotateY(30deg) scale(0.8); }
  .phone-slide.pos-right { transform: translateX(180px) translateZ(-180px) rotateY(-30deg) scale(0.8); }
}

/* Small Tablets / Large Phones */
@media (max-width: 640px) {
  .phone-carousel-wrapper { overflow: hidden; padding-top: 60px; }
  .pc-btn { top: -20px; scale: 0.85; }
  .phone-carousel-track { height: 400px; perspective: 800px; }
  .phone-slide { width: 160px; }
  .phone-frame-device { width: 160px; height: 340px; border-radius: 24px; }
  .phone-slide.pos-left { transform: translateX(-140px) translateZ(-200px) rotateY(25deg) scale(0.75); }
  .phone-slide.pos-right { transform: translateX(140px) translateZ(-200px) rotateY(-25deg) scale(0.75); }
  .slide-caption h3 { font-size: 1rem; }
  .slide-caption p { font-size: 0.8rem; }
}

/* Standard Mobile (iPhone, Samsung) */
@media (max-width: 480px) {
  .phone-carousel-track { height: 360px; perspective: 700px; }
  .phone-slide { width: 140px; }
  .phone-frame-device { width: 140px; height: 290px; }
  .phone-slide.pos-left { transform: translateX(-110px) translateZ(-220px) rotateY(20deg) scale(0.7); }
  .phone-slide.pos-right { transform: translateX(110px) translateZ(-220px) rotateY(-20deg) scale(0.7); }
}

/* Extra Small Mobile (iPhone SE, etc.) */
@media (max-width: 350px) {
  .phone-carousel-track { height: 320px; perspective: 600px; }
  .phone-slide { width: 120px; }
  .phone-frame-device { width: 120px; height: 250px; }
  .phone-slide.pos-left { transform: translateX(-90px) translateZ(-240px) rotateY(15deg) scale(0.65); }
  .phone-slide.pos-right { transform: translateX(90px) translateZ(-240px) rotateY(-15deg) scale(0.65); }
}
