/* ===================================================
   TEST-DRIVE - IPHONE INTERATIVO
   =================================================== */

.testdrive-iphone-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 40px auto;
    position: relative;
    max-width: 1000px;
}

/* Container do iPhone (Reusando lógica do Ciclo mas adaptado) */
.td-iphone-container {
    position: relative;
    width: 320px;
    z-index: 10;
}

.td-iphone {
    width: 320px;
    height: 660px;
    background: #000;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 40px rgba(245, 158, 11, 0.15),
        0 40px 80px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dynamic Island removido a pedido do usuário */
.td-iphone::before {
    display: none;
}

.td-iphone:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
}

/* Glow Dinâmico atrás do iPhone */
.td-iphone-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 100%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
    opacity: 0.8;
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.1); }
}


.td-iphone-screen {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
    border-radius: 26px;
}

/* Barra de Progresso no topo da tela do iPhone */
.td-progress-bar {
    position: absolute;
    top: 50px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    z-index: 60;
    display: flex;
    gap: 4px;
}

.td-progress-segment {
    flex: 1;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.td-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--gold-premium);
    transition: width 0.4s ease;
}

.td-progress-fill.active {
    width: 100%;
}

/* Reflexo de Vidro Realista */
.td-iphone-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-25deg);
    z-index: 70;
    pointer-events: none;
    animation: screenReflex 8s infinite linear;
}

@keyframes screenReflex {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* Imagens do Mapeamento */
.td-step-images {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: 34px;
    padding-bottom: 25px;
}

.td-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.td-img.active {
    opacity: 1;
}

/* Container do Relatório */
.td-report-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: 34px;
    padding-bottom: 25px;
    background: #f5f5f5;
    z-index: 50;
    overflow-y: auto;
    display: none;
    scrollbar-width: none;
}

.td-report-container::-webkit-scrollbar {
    display: none;
}

.td-report-container.visible {
    display: block;
}

.td-report-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Setas de Navegação Lateral */
.td-nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 20;
}

.td-nav-btn:hover {
    background: var(--gold-premium);
    color: #000;
    transform: scale(1.1);
}

.td-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Controles de Scroll Inferiores */
.td-scroll-controls {
    display: none;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.td-scroll-controls.visible {
    display: flex;
}

.td-scroll-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #0c1424;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.td-scroll-btn:hover {
    border-color: var(--gold-premium);
    background: #162036;
}

/* Responsividade */
@media (max-width: 768px) {
  .testdrive-iphone-wrapper {
    gap: 15px;
  }

  .td-iphone, .td-iphone-container {
    width: 240px;
    height: 500px;
  }

  .td-nav-btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  /* Status bar menor no mockup mobile */
  .td-iphone .iphone-status-bar {
    font-size: 9px;
    height: 32px;
    padding: 4px 14px 0;
  }

  .td-iphone .battery-pct {
    font-size: 8px;
  }

  .td-iphone .signal-bar.bar1 { height: 3px; }
  .td-iphone .signal-bar.bar2 { height: 5px; }
  .td-iphone .signal-bar.bar3 { height: 6px; }
  .td-iphone .signal-bar.bar4 { height: 8px; }

  .td-iphone .battery-icon {
    width: 17px;
    height: 9px;
  }

  .td-iphone .status-signal {
    height: 10px;
  }

  .td-iphone .status-right {
    gap: 5px;
  }
}

/* iPhone SE (375px) e similares */
@media (max-width: 420px) {
  .testdrive-iphone-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    position: relative;
  }

  .td-nav-btn {
    display: flex !important;
    position: relative !important;
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    z-index: 30 !important; /* Acima do iPhone */
  }

  .td-iphone-container {
    z-index: 10 !important;
  }

  .td-iphone, .td-iphone-container {
    width: 240px !important;
    height: 500px !important;
  }

  .td-iphone {
    border-radius: 28px !important;
  }

  .td-iphone-screen {
    border-radius: 18px !important;
  }

  .td-scroll-controls {
    display: none;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    z-index: 30;
  }

  .td-scroll-controls.visible {
    display: flex !important;
  }

  .td-scroll-btn {
    width: 40px;
    height: 40px;
  }
}

/* Telas muito pequenas (320px) */
@media (max-width: 340px) {
  .td-iphone, .td-iphone-container {
    width: 190px;
    height: 400px;
  }
}
