/* ========================================
   Product Pages CSS
   ======================================== */

/* Product Hero */
.product-hero {
    min-height: 100vh;
    padding: 140px 24px 80px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.product-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.4);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.3);
    bottom: -100px;
    left: -100px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 40px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary);
}

.product-hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.product-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.product-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
}

.product-subtitle {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 24px;
}

.product-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.product-cta-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Product Hero Visuals */
.product-hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Face Swap Demo */
.face-swap-demo {
    display: flex;
    align-items: center;
    gap: 24px;
}

.demo-card {
    width: 160px;
    height: 200px;
    background: rgba(139, 92, 246, 0.1);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.demo-card.transformed {
    background: var(--gradient-card);
    border: 2px solid var(--primary);
}

.demo-icon {
    color: var(--primary);
}

.demo-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.demo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.arrow-line {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--primary));
}

.arrow-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Before/After Comparison */
.before-after-container {
    position: relative;
    width: 450px;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ba-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ba-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    /* Initial split */
    height: 100%;
    overflow: hidden;
    border-right: 2px solid white;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
    transition: width 0.1s;
}

.ba-overlay-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 450px;
    /* Must match container width */
    height: 100%;
    object-fit: cover;
}

.ba-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    margin-left: -20px;
    cursor: ew-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-handle {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ba-label {
    position: absolute;
    top: 20px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

.ba-label.before {
    left: 20px;
}

.ba-label.after {
    right: 20px;
}

/* Voice Visualization */
.voice-visualization {
    text-align: center;
}

.waveform-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100px;
    margin-bottom: 24px;
}

.wave-bar-lg {
    width: 8px;
    height: var(--h, 50px);
    background: var(--gradient-primary);
    border-radius: 4px;
    animation: waveAnim 1s ease-in-out infinite alternate;
}

.wave-bar-lg:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar-lg:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar-lg:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar-lg:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar-lg:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes waveAnim {
    0% {
        transform: scaleY(0.5);
    }

    100% {
        transform: scaleY(1.2);
    }
}

.language-flags {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 1.5rem;
}

/* Detection Visual */
.detection-visual {
    display: flex;
    justify-content: center;
}

.roulette-detection {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
    border: 3px solid rgba(139, 92, 246, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detection-ring {
    position: absolute;
    inset: -20px;
    border: 2px dashed rgba(6, 182, 212, 0.4);
    border-radius: 50%;
    animation: spin 20s linear infinite;
}

.detection-scan {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 20px var(--accent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes scan {

    0%,
    100% {
        transform: translateY(-100px);
        opacity: 0.5;
    }

    50% {
        transform: translateY(100px);
        opacity: 1;
    }
}

.detected-num {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.big-num {
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-heading);
}

.det-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* Features Showcase */
/* Features Showcase */
.features-showcase {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
}

.feature-item {
    flex: 1 1 300px;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.1);
}

.feature-icon-large {
    width: 100%;
    max-width: 280px;
    height: 180px;
    background: var(--gradient-card);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
}

.feature-icon-large:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.25);
    transform: scale(1.02);
}

.feature-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.3s ease;
}

.feature-icon-large:hover img {
    transform: scale(1.05);
}

.feature-item h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.language-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.language-card:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

/* How It Works / Steps */
.how-it-works {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.steps-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.step-item {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    text-align: center;
    padding: 24px;
}

.step-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.step-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Specifications */
.specifications {
    padding: var(--section-padding) 0;
    background: var(--bg-primary);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.spec-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
}

.spec-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.spec-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.spec-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* CTA Section */
.product-cta-section {
    padding: 100px 24px;
    background: var(--bg-dark);
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--text-light);
    margin-bottom: 16px;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .product-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .product-cta-group {
        justify-content: center;
    }

    .face-swap-demo {
        justify-content: center;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
    }

    .step-connector {
        width: 2px;
        height: 30px;
        background: linear-gradient(180deg, var(--primary), var(--accent));
        margin: 0 auto;
        /* Ensure connector is centered too */
    }
}

@media (max-width: 768px) {
    .product-hero {
        padding: 120px 24px 60px;
        min-height: auto;
    }

    .env-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .before-after-container {
        width: 100%;
        max-width: 450px;
        height: auto;
        aspect-ratio: 1/1;
    }

    .ba-overlay-img {
        width: 100%;
        /* Will be fixed by JS to match container */
    }
}

@media (max-width: 480px) {
    .face-swap-demo {
        gap: 8px;
    }

    .demo-card {
        width: 135px;
        height: 180px;
        padding: 16px;
    }

    .demo-icon {
        font-size: 2rem;
    }

    .demo-icon svg {
        width: 40px;
        height: 40px;
    }

    .demo-arrow {
        transform: scale(0.8);
        gap: 4px;
    }

    .arrow-line {
        height: 20px;
    }

    .arrow-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .product-title {
        font-size: 2.2rem;
        word-wrap: break-word;
    }

    /* Feature images responsive */
    .feature-icon-large {
        max-width: 100%;
        height: 140px;
    }
}