/* =====================================================
   Revolution Hair — Camada de Design & Motion
   Refinamentos sobre o design system base, inspirados
   em referências editoriais do setor profissional
   (Kérastase, Davines, Olaplex, L'Oréal Professionnel)
   ===================================================== */

/* ---------- 0. SEGURANÇA: PÁGINA SEMPRE VISÍVEL ----------
   Garante que o body/html nunca fiquem ocultos por regras
   antigas em cache ou animações de fade-in de página. */
html, body {
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
}

/* Elementos estruturais NUNCA devem receber transform/opacity de reveal
   (proteção contra classes de animação aplicadas por engano a contêineres
   grandes, que encolheriam ou esconderiam a página inteira). */
body.reveal, body.reveal-scale, body.reveal-fade, body.reveal-left, body.reveal-right, body.reveal-clip,
#root, main, header#site-header, footer {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
}

/* ---------- 1. TIPOGRAFIA REFINADA ---------- */

.display-title {
    letter-spacing: -0.03em;
    font-weight: 300;
}

.display-title em,
.section-title em {
    font-weight: 300;
    letter-spacing: -0.02em;
}

/* Numerais elegantes nas estatísticas */
[data-counter] {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
}

/* Texto corrido mais respirado */
.lead {
    line-height: 1.75;
}

/* ---------- 3. SISTEMA DE REVEALS ---------- */

.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variante: reveal lateral sutil */
.reveal-left {
    opacity: 0;
    transform: translateX(-36px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Variante: imagens com máscara (clip reveal editorial) */
.reveal-clip {
    clip-path: inset(8% 0 8% 0);
    transform: scale(1.06);
    transition:
        clip-path 1.2s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: clip-path, transform;
}

.reveal-clip.is-visible {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
}

/* Compatibilidade com a classe antiga */
.fade-in-up {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Acessibilidade: respeita preferência por menos movimento */
/* Acessibilidade: mesmo com "reduzir movimento", mantemos as transições
   suaves (reveals, fades, typewriter) e cortamos apenas os movimentos
   mais intensos e contínuos (parallax e respiração do hero). */
@media (prefers-reduced-motion: reduce) {
    [data-parallax] { transform: none !important; }
    .hero-breathe { animation: none; }
}
}

/* ---------- 4. PARALLAX ---------- */

[data-parallax] {
    will-change: transform;
}

.page-hero > img {
    height: 100%;
    top: 0;
}

/* ---------- 5. HOVER & MICROINTERAÇÕES ---------- */

/* Cards de produto: elevação suave + zoom de imagem refinado */
.product-card-luxe {
    transition:
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card-luxe:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-soft);
}

.product-card-luxe img {
    transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card-luxe:hover img {
    transform: scale(1.07);
}

/* Links com sublinhado animado (estética editorial) */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}

/* Botões luxe: leve deslocamento da seta no hover */
.luxe-btn-primary svg,
.luxe-btn-outline svg {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.luxe-btn-primary:hover svg,
.luxe-btn-outline:hover svg {
    transform: translateX(4px);
}

/* Pills de categoria: transição refinada */
.pill-categoria {
    transition: color 0.35s ease, border-color 0.35s ease, letter-spacing 0.35s ease;
}

/* ---------- 6. IMAGENS: FADE AO CARREGAR ---------- */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.8s ease;
}

img[loading="lazy"].is-loaded,
img[loading="lazy"].lazy-error {
    opacity: 1;
}

/* ---------- 7. MARQUEE REFINADO ---------- */

.animate-marquee {
    animation-duration: 48s;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* ---------- 8. SCROLLBAR & DETALHES ---------- */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--background));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 5px;
    border: 2px solid hsl(var(--background));
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary) / 0.5);
}

/* Indicador de progresso de leitura (páginas de conteúdo) */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: hsl(var(--primary));
    z-index: 200;
    transition: width 0.1s linear;
}

/* ---------- 9. HEADER REFINADO ---------- */

#site-header {
    transition:
        background-color 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header.header-scrolled {
    box-shadow: 0 1px 0 hsl(var(--border)), 0 10px 30px -18px hsl(var(--foreground) / 0.12);
}

/* Header se esconde ao rolar para baixo e reaparece ao subir */
#site-header.header-hidden {
    transform: translateY(-100%);
}

/* ---------- 10. GALERIA DO PRODUTO ---------- */

.produto-thumb {
    transition: opacity 0.35s ease, border-color 0.35s ease;
    cursor: pointer;
}

.produto-thumb:not(.thumb-active) {
    opacity: 0.55;
}

.produto-thumb:hover {
    opacity: 1;
}

.produto-imagem-principal {
    transition: opacity 0.45s ease;
}

.produto-imagem-principal.is-switching {
    opacity: 0;
}

/* ---------- 13. HERO TYPEWRITER ---------- */

.hero-cursor {
    display: inline-block;
    margin-left: 2px;
    color: hsl(var(--primary));
    animation: heroCursorBlink 0.9s steps(1) infinite;
    font-weight: 300;
}

@keyframes heroCursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.ig-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
    mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.ig-carousel-track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
    animation: igScroll 50s linear infinite;
}

.ig-carousel-track:hover {
    animation-play-state: paused;
}

.ig-carousel-item {
    flex: 0 0 auto;
    width: 240px;
    height: 240px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 640px) {
    .ig-carousel-item {
        width: 170px;
        height: 170px;
    }
}

@keyframes igScroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ig-carousel-track {
        animation: none;
        overflow-x: auto;
    }
}

::selection {
    background: hsl(var(--primary) / 0.18);
}

/* ---------- 14. POP-UP DO SITE ---------- */

.site-popup {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.site-popup.is-open {
    visibility: visible;
    opacity: 1;
}

.site-popup-backdrop {
    position: absolute;
    inset: 0;
    background: hsl(var(--foreground) / 0.55);
    backdrop-filter: blur(2px);
}

.site-popup-box {
    position: relative;
    max-width: min(440px, 90vw);
    max-height: 85vh;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-luxe);
}

.site-popup.is-open .site-popup-box {
    transform: scale(1) translateY(0);
}

.site-popup-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    background: hsl(var(--background));
}

.site-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.site-popup-close:hover {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    .site-popup-close {
        top: 8px;
        right: 8px;
    }
}

/* ---------- 15. HERO: MOVIMENTO SUTIL DA IMAGEM ---------- */

.hero-breathe {
    animation: heroBreathe 22s ease-in-out infinite;
}

@keyframes heroBreathe {
    0%, 100% { transform: scale(1) translate3d(0, 0, 0); }
    50%      { transform: scale(1.045) translate3d(-0.6%, -0.6%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-breathe { animation: none; }
}

/* ---------- 16. VARIEDADE DE REVEALS ---------- */

.reveal-right {
    opacity: 0;
    transform: translateX(36px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

.reveal-fade {
    opacity: 0;
    transition: opacity 1s ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-fade.is-visible {
    opacity: 1;
}
