/* ========================= SEÇÃO SERVIÇOS CINEMATOGRÁFICA - VITRINE IMERSIVA ========================= */
/* MOBILE: Scroll livre e natural, sem posicionamento automático ou snap */
/* DESKTOP: Experiência cinematográfica com navegação assistida */

/* Reset e configuração base */
.services-cinematic {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    min-height: 100vh;
    background: #1a1a1a;
    color: white;
    scroll-behavior: smooth;
    /* scroll-snap-type: y mandatory; DESABILITADO - scroll livre em mobile */
}

/* Container principal das cenas */
.services-scenes {
    position: relative;
    width: 100%;
}

/* Cada cena de serviço */
.service-scene {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* scroll-snap-align: start; DESABILITADO - causava scroll automático */
}

/* Background de cada cena com efeito de inclinação alternada */
.scene-background {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transform: scale(1.1) skewY(2deg);
    transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.9) contrast(1.1) saturate(1.2);
    z-index: 1;
    will-change: transform, filter;
    backface-visibility: hidden;
    opacity: 1;
}

/* Inclinação alternada para cada cena */
.service-scene:nth-child(odd) .scene-background {
    transform: scale(1.1) skewY(2deg); /* Inclina para direita */
}

.service-scene:nth-child(even) .scene-background {
    transform: scale(1.1) skewY(-2deg); /* Inclina para esquerda */
}

.service-scene.active .scene-background {
    filter: brightness(1) contrast(1.2) saturate(1.3);
}

.service-scene:nth-child(odd).active .scene-background {
    transform: scale(1) skewY(2deg); /* Mantém inclinação direita quando ativa */
}

.service-scene:nth-child(even).active .scene-background {
    transform: scale(1) skewY(-2deg); /* Mantém inclinação esquerda quando ativa */
}

/* Overlay com textura preta transparente sobre toda a imagem */
.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.3) 25%,
        rgba(0, 0, 0, 0.35) 50%,
        rgba(0, 0, 0, 0.4) 75%,
        rgba(0, 0, 0, 0.45) 100%
    ) !important;
    /* Adiciona uma textura sutil */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 0, 0, 0.05) 0%, transparent 50%);
    z-index: 2;
}

/* Conteúdo de cada cena */
.scene-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 50px;
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* CORREÇÃO: Primeira cena deve ter conteúdo visível por padrão */
.service-scene:first-child .scene-content {
    opacity: 1;
    transform: translateY(0);
}

.service-scene.active .scene-content {
    opacity: 1;
    transform: translateY(0);
}

/* Título da cena */
.scene-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 20px;
    color: white;
    letter-spacing: -0.03em;
    line-height: 0.9;
    text-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.9), 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.7);
}

@keyframes shimmerText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Subtítulo da cena */
.scene-subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: rgba(245, 240, 232, 0.9);
    margin-bottom: 40px;
    font-weight: 300;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1.5s ease-out 0.3s both;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.9);
}

/* Lista de características cinematográfica */
.scene-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 50px 0;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.6s both;
}

.feature-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 240, 232, 0.3);
    border-radius: 20px;
    padding: 30px 25px;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFeature 1s ease-out both;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(245, 240, 232, 0.4);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.feature-item:nth-child(1) { animation-delay: 0.8s; }
.feature-item:nth-child(2) { animation-delay: 1s; }
.feature-item:nth-child(3) { animation-delay: 1.2s; }

@keyframes slideUpFeature {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-item::before {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, rgba(139, 90, 60, 0.3), rgba(109, 68, 40, 0.3));
    border: 2px solid rgba(245, 240, 232, 0.3);
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.feature-item:nth-child(1)::before { content: '🏢'; }
.feature-item:nth-child(2)::before { content: '⚡'; }
.feature-item:nth-child(3)::before { content: '✨'; }

.feature-item:hover::before {
    background: linear-gradient(135deg, rgba(139, 90, 60, 0.5), rgba(109, 68, 40, 0.5));
    border-color: rgba(245, 240, 232, 0.5);
    transform: scale(1.1);
}

.feature-item h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #F5F0E8;
    margin-bottom: 10px;
}

.feature-item p {
    font-size: 0.95rem;
    color: rgba(245, 240, 232, 0.8);
    line-height: 1.5;
}

/* Botão de Call-to-Action cinematográfico */
.scene-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 35px;
    margin: 30px auto 0;
    background: linear-gradient(135deg, 
        rgba(139, 90, 60, 0.9) 0%, 
        rgba(109, 68, 40, 1) 50%, 
        rgba(83, 52, 30, 1) 100%
    );
    color: #F5F0E8;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(245, 240, 232, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.8s ease-out 0.6s both;
}

.scene-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.6s ease;
}

.scene-cta-button:hover::before {
    left: 100%;
}

.scene-cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(245, 240, 232, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, 
        rgba(159, 110, 80, 0.95) 0%, 
        rgba(129, 88, 60, 1) 50%, 
        rgba(103, 72, 50, 1) 100%
    );
}

.button-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.scene-cta-button:hover .button-arrow {
    transform: translateX(5px);
}

.scene-cta-button:active {
    transform: translateY(-1px) scale(1.02);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Navegação entre cenas - bolinhas laterais */
.scene-navigation {
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000; /* Z-index mais alto para garantir visibilidade */
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 240, 232, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(245, 240, 232, 0.4);
    border: 2px solid rgba(245, 240, 232, 0.6);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    box-sizing: border-box;
}

.nav-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(245, 240, 232, 0.8);
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-dot.active {
    background: #8B5A3C !important;
    border-color: #F5F0E8 !important;
    transform: scale(1.4) !important;
    box-shadow: 
        0 0 15px rgba(139, 90, 60, 0.6),
        0 0 25px rgba(139, 90, 60, 0.3) !important;
}

.nav-dot.active::before {
    opacity: 1;
    background: #F5F0E8;
    transform: translate(-50%, -50%) scale(1.2);
}

.nav-dot:hover:not(.active) {
    background: rgba(139, 90, 60, 0.8) !important;
    border-color: rgba(245, 240, 232, 0.8);
    transform: scale(1.25) !important;
    box-shadow: 0 0 8px rgba(139, 90, 60, 0.4);
}

.nav-dot:hover:not(.active)::before {
    opacity: 0.7;
    background: rgba(245, 240, 232, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Melhor visibilidade em desktop */
@media (min-width: 1025px) {
    .scene-navigation {
        right: 35px;
        gap: 20px;
        padding: 25px 12px;
    }
    
    .nav-dot {
        width: 16px;
        height: 16px;
    }
    
    .nav-dot::before {
        width: 8px;
        height: 8px;
    }
}

/* CTA final cinematográfico */
.services-cta-final {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        #8B5A3C 0%,
        #6D4428 25%,
        #5D4E37 50%,
        #3E2723 75%,
        #2E1F1B 100%
    );
    overflow: hidden;
    scroll-snap-align: start;
}

.services-cta-final::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(245,240,232,0.1)"/><circle cx="80" cy="80" r="1" fill="rgba(245,240,232,0.1)"/></svg>') repeat;
    background-size: 100px 100px;
    opacity: 0.3;
    animation: floatPattern 30s linear infinite;
}

.cta-final-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 0 50px;
    position: relative;
    z-index: 2;
}

.cta-final-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 30px;
    color: #F5F0E8; /* Cor sólida em vez de gradiente com clip */
    text-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.9), 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.7); /* Sombra para legibilidade */
    line-height: 1.1;
}

.cta-final-text {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: rgba(245, 240, 232, 0.9);
    margin-bottom: 50px;
    line-height: 1.6;
}

.btn-final-cta {
    display: inline-block;
    background: linear-gradient(135deg, #F5F0E8 0%, #E7D7C1 100%);
    color: #3E2723;
    padding: 25px 60px;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-final-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 90, 60, 0.3), transparent);
    transition: left 0.8s ease;
}

.btn-final-cta:hover::before {
    left: 100%;
}

.btn-final-cta:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #E7D7C1 0%, #D4C4A8 100%);
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatPattern {
    0% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-30px) translateX(15px); }
    50% { transform: translateY(-15px) translateX(-10px); }
    75% { transform: translateY(-40px) translateX(10px); }
    100% { transform: translateY(0px) translateX(0px); }
}

/* Responsividade */
@media (max-width: 1024px) {
    .scene-content {
        padding: 0 30px;
    }
    
    .scene-navigation {
        right: 20px;
        gap: 12px;
    }
    
    .nav-dot {
        width: 10px;
        height: 10px;
    }
    
    .scene-features {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }
    
    .feature-item {
        padding: 25px 20px;
    }
    
    .cta-final-content {
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .service-scene {
        height: auto;
        min-height: calc(100vh - 80px); /* Ajuste para não cortar conteúdo */
        padding: 60px 0 40px; /* Reduzido para dar mais espaço */
        display: flex;
        align-items: flex-start; /* Alinha no topo para evitar cortes */
        justify-content: center;
        flex-direction: column;
        box-sizing: border-box;
        overflow: visible; /* Garante que nada seja cortado */
    }
    
    .scene-content {
        padding: 20px 15px 30px; /* Ajustado para melhor espaçamento */
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        text-align: center;
        gap: 15px; /* Reduzido para otimizar espaço */
        min-height: auto; /* Remove altura mínima fixa */
        box-sizing: border-box;
    }
    
    .scene-title {
        font-size: clamp(1.8rem, 5.5vw, 2.5rem); /* Otimizado para mobile */
        margin-bottom: 15px;
        line-height: 1.1;
        padding: 0 10px;
        order: -1; /* Força o título a ficar no topo */
        width: 100%;
        max-width: 90%;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .scene-subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1.05rem);
        margin-bottom: 20px;
        max-width: 95%;
        padding: 0 10px;
        order: 1; /* Segundo elemento */
        line-height: 1.4;
        word-wrap: break-word;
    }
    
    .scene-features {
        grid-template-columns: 1fr;
        gap: 12px; /* Reduzido para otimizar espaço */
        margin: 15px 0 20px; /* Ajustado */
        width: 100%;
        max-width: 350px; /* Limita largura para melhor organização */
        order: 2; /* Terceiro elemento */
    }
    
    .scene-cta-button {
        padding: 14px 28px;
        font-size: 0.95rem;
        margin: 15px auto 0;
        order: 3; /* Quarto elemento - botão por último */
    }
    
    .feature-item {
        padding: 15px 12px;
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .feature-item::before {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .feature-item h4 {
        font-size: 1.05rem;
        margin-bottom: 6px;
    }
    
    .feature-item p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .scene-navigation {
        display: none; /* Ocultar navegação lateral em mobile */
    }
    
    .services-cta-final {
        min-height: 450px;
    }
    
    .cta-final-content {
        padding: 0 20px;
    }
    
    .btn-final-cta {
        padding: 18px 35px;
    }
    
    /* Efeito "imagem parada" otimizado para mobile */
    .scene-background {
        background-attachment: scroll !important; /* EFEITO IMAGEM PARADA */
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: scale(1) !important; /* Remove parallax/escala para performance */
        transition: none; /* Remove transições custosas */
        will-change: auto; /* Remove otimizações desnecessárias */
    }
}

@media (max-width: 480px) {
    .service-scene {
        min-height: auto; /* Altura automática para melhor adaptação */
        padding: 40px 0 30px; /* Reduzido para aproveitar melhor o espaço */
        display: flex;
        align-items: flex-start;
        justify-content: center;
        box-sizing: border-box;
        overflow: visible;
    }
    
    .scene-content {
        padding: 15px 10px 20px; /* Padding mínimo para aproveitar espaço */
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        text-align: center;
        gap: 10px; /* Gap mínimo para otimizar espaço */
        box-sizing: border-box;
    }
    
    .scene-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
        margin-bottom: 8px; /* Reduzido */
        line-height: 1.05;
        padding: 0 5px;
        width: 100%;
        max-width: 95%;
        word-wrap: break-word;
        hyphens: auto;
        order: -1; /* Força o título a ficar no topo */
    }
    
    .scene-subtitle {
        font-size: clamp(0.8rem, 4vw, 1rem);
        margin-bottom: 15px; /* Reduzido */
        max-width: 98%;
        line-height: 1.3;
        padding: 0 5px;
        word-wrap: break-word;
        order: 1; /* Segundo elemento */
    }
    
    .scene-features {
        margin: 12px 0 15px; /* Reduzido */
        gap: 8px; /* Reduzido para otimizar espaço */
        width: 100%;
        max-width: 320px; /* Limite para telas muito pequenas */
        order: 2; /* Terceiro elemento */
    }
    
    .scene-cta-button {
        padding: 12px 22px;
        font-size: 0.85rem;
        margin: 10px auto 0; /* Reduzido */
        border-radius: 25px;
        letter-spacing: 0.5px;
        order: 3; /* Quarto elemento - botão por último */
    }
    
    .feature-item {
        padding: 12px 8px; /* Padding reduzido */
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
        min-height: auto; /* Remove altura mínima */
    }
    
    .feature-item::before {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .feature-item h4 {
        font-size: 0.95rem;
        margin-bottom: 4px; /* Reduzido */
        line-height: 1.2;
    }
    
    .feature-item p {
        font-size: 0.8rem;
        line-height: 1.3;
        margin: 0; /* Remove margem extra */
    }
    
    .services-cta-final {
        min-height: 400px; /* Reduzido */
    }
    
    .cta-final-content {
        padding: 0 10px;
    }
    
    .btn-final-cta {
        padding: 16px 30px;
        letter-spacing: 0.5px;
        font-size: 0.9rem;
    }
    
    /* EFEITO "IMAGEM PARADA" otimizado para telas muito pequenas */
    .scene-background {
        background-size: cover;
        background-position: center center;
        background-attachment: scroll !important; /* IMAGEM PARADA GARANTIDA */
        background-repeat: no-repeat;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: none !important; /* Remove qualquer transformação */
        transition: none !important; /* Remove transições */
        will-change: auto; /* Remove otimizações custosas */
        filter: none; /* Remove filtros custosos */
    }
    
    /* Garantir que conteúdo não seja cortado */
    .service-scene {
        overflow: visible !important;
        contain: none; /* Remove containment para evitar cortes */
    }
    
    /* Remove qualquer efeito parallax em telas muito pequenas */
    .service-scene.active .scene-background {
        transform: none !important;
        filter: none !important;
    }
    
    /* Otimização adicional para performance */
    .scene-overlay {
        backdrop-filter: none; /* Remove blur custoso */
    }
}

/* Configuração para scroll suave - SNAP DESABILITADO */
.services-cinematic {
    scroll-behavior: smooth;
    /* scroll-snap-type: y mandatory; DESABILITADO - causava scroll automático */
}

/* Efeitos de entrada progressive enhancement */
@supports (backdrop-filter: blur(10px)) {
    .feature-item {
        backdrop-filter: blur(10px);
    }
}

/* Preload de imagens para performance */
.scene-background[data-bg] {
    background-image: var(--bg-image);
}

/* Otimizações para dispositivos de alta DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .scene-background {
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .services-cinematic {
        background: #0a0a0a;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .scene-background,
    .scene-content,
    .feature-item,
    .btn-final-cta {
        animation: none;
        transition: none;
    }
    
    .services-cinematic {
        scroll-behavior: auto;
    }
    
    .scene-title {
        animation: none;
        color: #F5F0E8 !important; /* Cor sólida ao invés de background */
        background: none !important;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        background-clip: unset;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .feature-item {
        border: 2px solid rgba(245, 240, 232, 0.5);
        background: rgba(245, 240, 232, 0.2);
    }
    
    .nav-dot {
        border: 3px solid rgba(245, 240, 232, 0.8);
    }
    
    .nav-dot.active {
        background: #F5F0E8;
        border-color: #F5F0E8;
    }
}

/* Modo Performance para dispositivos lentos */
.services-cinematic.performance-mode {
    scroll-snap-type: none;
}

.services-cinematic.performance-mode .scene-background {
    animation: none;
    transition: none;
    transform: none !important;
}

.services-cinematic.performance-mode .scene-content {
    transition: opacity 0.3s ease;
}

.services-cinematic.performance-mode .feature-item {
    animation: none;
    opacity: 1;
    transform: none;
}

.services-cinematic.performance-mode .scene-title {
    animation: none;
    color: #F5F0E8 !important; /* Cor sólida ao invés de background */
    background: none !important;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

/* Estados de carregamento */
.scene-background {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scene-background.loaded {
    opacity: 1;
}

/* Estados de carregamento aprimorados */
.services-cinematic.loading-backgrounds .scene-background {
    transition: opacity 0.5s ease;
}

.services-cinematic.backgrounds-loaded .scene-background {
    opacity: 1;
}

.scene-background {
    /* Garantir que todas as imagens apareçam */
    opacity: 1;
    display: block;
}

.scene-background:not(.loaded) {
    /* Fallback enquanto carrega */
    background-color: rgba(139, 90, 60, 0.2);
}

.scene-background.loaded {
    /* Estado quando carregou */
    background-color: transparent;
}

/* Otimizações específicas para dispositivos móveis */
@media (max-width: 768px) {
    .scene-background {
        /* Forçar background-attachment scroll em mobile */
        background-attachment: scroll !important;
        /* Reduzir will-change para economizar memória */
        will-change: filter;
        /* Garantir que background cubra toda a tela */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    /* Manter inclinações em mobile mas reduzir ângulo */
    .service-scene:nth-child(odd) .scene-background {
        transform: scale(1.02) skewY(0.5deg) !important;
    }

    .service-scene:nth-child(even) .scene-background {
        transform: scale(1.02) skewY(-0.5deg) !important;
    }
}

@media (max-width: 480px) {
    .scene-background {
        /* Performance máxima em mobile pequeno */
        will-change: auto;
        background-attachment: scroll !important;
        transition: filter 0.3s ease;
        /* Sem transformações para melhor performance */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    /* Remover inclinação em mobile muito pequeno para melhor performance */
    .service-scene:nth-child(odd) .scene-background,
    .service-scene:nth-child(even) .scene-background {
        transform: scale(1) !important;
    }
    
    .service-scene.active .scene-background {
        transform: scale(1) !important;
    }
}
