/* ==========================================================================
   Moi Pet · stage.css
   Hero Stage — slideshow full-bleed atrás do header + hero.
   Ativado quando 'mp_stage_enable' está true no Customizer.
   ========================================================================== */

/* Stage em si: fixed, full-bleed, viewport completo */
.mp-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--mp-stage-height, 100vh);
    max-height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-color: var(--moipet-paper, #fbf3e7);
}

.mp-stage__slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slide individual */
.mp-stage__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity;
}

.mp-stage__slide.is-active {
    opacity: 1;
}

/* Imagem (background) */
.mp-stage__image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* zoom sutil para vida */
    animation: mp-stage-zoom 18s ease-in-out infinite alternate;
}

@keyframes mp-stage-zoom {
    from { transform: scale(1); }
    to   { transform: scale(1.06); }
}

/* Vídeo */
.mp-stage__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Véu (gradient para legibilidade) */
.mp-stage__veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Legenda */
.mp-stage__caption {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%);
    color: var(--moipet-paper, #fbf3e7);
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    z-index: 2;
    text-align: center;
    max-width: 80%;
    opacity: 0.95;
}

/* ==========================================================================
   Quando o stage está ativo: site inteiro fica ACIMA do stage (z-index 1)
   ========================================================================== */

body.mp-has-stage .site {
    position: relative;
    z-index: 1;
    background: transparent;
}

/* Hero editorial (primeira seção do main) fica transparente para o stage aparecer.
   Faixa escura no topo (até ~20%) para o eyebrow ter contraste sobre a imagem. */
body.mp-has-stage .site-main > section:first-of-type,
body.mp-has-stage main > .ep-section:first-of-type {
    background: linear-gradient(180deg,
        rgba(63, 42, 28, 0.35) 0%,
        rgba(63, 42, 28, 0.15) 18%,
        rgba(251, 239, 227, 0.0) 32%,
        rgba(251, 239, 227, 0.35) 55%,
        rgba(251, 239, 227, 0.92) 85%,
        var(--moipet-paper) 100%) !important;
    background-color: transparent !important;
}

body.mp-has-stage .site-main > section:first-of-type .ep-paper,
body.mp-has-stage main > .ep-section:first-of-type .ep-paper {
    background-color: transparent;
}

body.mp-has-stage .site-main > section:first-of-type .ep-paper::before,
body.mp-has-stage main > .ep-section:first-of-type .ep-paper::before {
    opacity: 0.3; /* reduz blob para nao competir com o stage */
}

/* Eyebrow: branco/papel + text-shadow para legibilidade sobre a imagem
   APENAS dentro do hero (resto da pagina tem fundo cream normal). */
body.mp-has-stage .ep-hero .ep-eyebrow {
    color: var(--moipet-paper, #fbf3e7) !important;
    border-bottom-color: rgba(255, 250, 240, 0.45) !important;
    text-shadow: 0 2px 10px rgba(63, 42, 28, 0.6), 0 0 2px rgba(63, 42, 28, 0.4);
}

/* Hero copy: text-shadow forte em multiplas camadas para legibilidade
   sobre qualquer imagem do stage (sem halo de fundo, sem quebrar layout) */
body.mp-has-stage .ep-hero h1 {
    text-shadow:
        0 0 2px rgba(63, 42, 28, 0.95),
        0 1px 2px rgba(63, 42, 28, 0.9),
        0 2px 12px rgba(63, 42, 28, 0.7),
        0 4px 28px rgba(63, 42, 28, 0.45);
    /* Mantem o pulse do editorial.css (animacao nao pode ser redefinida aqui) */
}

body.mp-has-stage .ep-hero .ep-lead {
    text-shadow:
        0 0 1px rgba(63, 42, 28, 0.9),
        0 1px 8px rgba(63, 42, 28, 0.55);
}

/* Meta tags (FEITO A MÃO, TECIDOS PREMIUM, FRETE PARA TODO BRASIL) */
body.mp-has-stage .ep-meta span {
    color: var(--moipet-paper, #fbf3e7);
    text-shadow: 0 1px 8px rgba(63, 42, 28, 0.5);
}

body.mp-has-stage .ep-meta span + span::before {
    color: var(--moipet-gold, #cfaa67);
}

/* Botões do hero (CTA) ja tem bom contraste por causa do gold;
   mas adiciona sombra sutil para destacar */
body.mp-has-stage .ep-cta {
    box-shadow: 0 6px 24px rgba(63, 42, 28, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.mp-has-stage .ep-cta--ghost {
    background: rgba(63, 42, 28, 0.55);
    color: var(--moipet-paper, #fbf3e7);
    border: 1px solid rgba(251, 243, 231, 0.5);
    backdrop-filter: blur(8px);
}

body.mp-has-stage .ep-cta--ghost:hover {
    background: var(--moipet-paper, #fbf3e7);
    color: var(--moipet-ink-2, #3f2a1c);
    border-color: var(--moipet-paper);
}

body.mp-has-stage .ep-hero-side {
    background: rgba(255, 250, 244, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(207, 170, 103, 0.3);
}

/* Header translúcido */
.site-header.mp-has-stage {
    background: linear-gradient(180deg, rgba(63, 42, 28, 0.35) 0%, rgba(63, 42, 28, 0.18) 80%, rgba(63, 42, 28, 0) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(207, 170, 103, 0.18);
}

.site-header.mp-has-stage .brand-name,
.site-header.mp-has-stage .brand-logo,
.site-header.mp-has-stage .menu a,
.site-header.mp-has-stage .action-link {
    color: var(--moipet-paper, #fbf3e7);
}

.site-header.mp-has-stage .menu a:hover {
    color: var(--moipet-gold, #cfaa67);
}

/* Botao Atendimento (.action-link sem .action-link--gold) precisa de
   background escuro + texto claro para nao desaparecer sobre a imagem */
body.mp-has-stage .site-header .action-link:not(.action-link--gold) {
    background: rgba(63, 42, 28, 0.55);
    border: 1px solid rgba(251, 243, 231, 0.35);
    color: var(--moipet-paper, #fbf3e7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.mp-has-stage .site-header .action-link:not(.action-link--gold):hover {
    background: rgba(63, 42, 28, 0.75);
    border-color: rgba(207, 170, 103, 0.6);
}

body.mp-has-stage .site-header .action-link:not(.action-link--gold) span:first-child {
    color: var(--moipet-gold, #cfaa67);
}

/* Carrinho (action-link--gold) mantem visual proprio, so ajusta texto */
body.mp-has-stage .site-header .action-link--gold {
    color: #fff8ef;
}

.site-header.mp-has-stage::after {
    background: linear-gradient(90deg, transparent 0%, rgba(207, 170, 103, 0.4) 18%, rgba(168, 116, 45, 0.55) 50%, rgba(207, 170, 103, 0.4) 82%, transparent 100%);
}

/* Topbar também translúcida quando stage ativo */
body.mp-has-stage .topbar {
    background: linear-gradient(90deg, rgba(63, 42, 28, 0.5), rgba(63, 42, 28, 0.3));
    color: var(--moipet-paper, #fbf3e7);
    border-bottom: 1px solid rgba(207, 170, 103, 0.18);
}

body.mp-has-stage .topbar-links a,
body.mp-has-stage .topbar strong,
body.mp-has-stage .topbar-slide {
    color: var(--moipet-paper, #fbf3e7);
}

/* Mobile: vídeo desabilitado (performance), imagem mantida */
@media (max-width: 768px) {
    .mp-stage__video {
        display: none;
    }
    .mp-stage__image {
        background-attachment: scroll; /* evita bug no iOS */
    }
    .mp-stage__caption {
        font-size: 1rem;
        bottom: 18%;
    }
}

/* prefers-reduced-motion: sem crossfade animation, sem zoom */
@media (prefers-reduced-motion: reduce) {
    .mp-stage__slide {
        transition: none !important;
    }
    .mp-stage__image {
        animation: none !important;
    }
}

