﻿/* Carrossel principal da home — moldura (Swiper) e barra de controles.
   A anatomia dos slides está em ../../base/css/slides.css; o Outubro Rosa e o
   Essencial têm CSS próprio (hero_outubro_rosa/, hero_essencial/).

   Sem movimento decorativo contínuo (A-051): nada pulsa, não há dica
   "deslize" animada e nenhum CTA pulsa. O único movimento é a troca de slide (que tem
   pausa) e a barra de progresso do destaque ativo, que só existe enquanto a troca
   automática está rodando. */

#master-hero-carousel {
    position: relative;
    /* A altura varia por oferta; o navegador não deve ancorar a página no rodapé
       do slide que saiu enquanto a navegação manual revela o próximo título. */
    overflow-anchor: none;
    width: 100%;
    height: auto;
    background: #050b14;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.master-swiper {
    width: 100%;
    height: auto;
}

#master-hero-carousel .swiper-slide {
    width: 100%;
    height: auto;
    background: #050b14;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---------- Essencial: malha e vinheta compartilhadas ----------
   O slide do plano de entrada não tem foto; a malha do tema vem daqui (ele documenta
   isso em hero_essencial/css/style.css) e desliga até 768px, junto com a dele. */
#master-hero-carousel .hero-essencial-section {
    position: relative;
}

#master-hero-carousel .hero-essencial-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 50% 50%, transparent 20%, #000 120%),
        linear-gradient(90deg, rgba(0, 255, 234, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 234, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 2;
}

#master-hero-carousel .hero-essencial-content {
    position: relative;
    z-index: 3;
}

@media (max-width: 768px) {
    #master-hero-carousel .hero-essencial-section::before {
        display: none;
    }
}

/* ---------- celular e tablet: carrossel do tamanho da tela ----------
   991.98px é o limite real do grid lg do Bootstrap (quem empilha os col-lg-*). */
@media (max-width: 991.98px) {
    :root {
        /* Altura do cabeçalho mobile medida no lab (73px a 390, 72px a 576-991). */
        --master-carousel-mobile-header: 73px;
    }

    #master-hero-carousel {
        height: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    #master-hero-carousel .master-swiper {
        height: auto !important;
    }

    #master-hero-carousel .swiper-slide {
        height: auto !important;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
    }

    #master-hero-carousel .container {
        width: 100%;
        max-width: 100% !important;
        padding-left: clamp(14px, 4vw, 24px) !important;
        padding-right: clamp(14px, 4vw, 24px) !important;
    }

    #master-hero-carousel .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #master-hero-carousel .row > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* O Essencial reserva a faixa da barra de controles na própria seção (ver o
       comentário longo em hero_essencial/css/style.css). */
    #master-hero-carousel .hero-essencial-section {
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    :root {
        --master-carousel-mobile-header: 72px;
    }
}

/* ---------- celular deitado (tela baixa em paisagem) ----------
   Com a altura presa à tela (318px em 844x390, 288px em 740x360), o preço, o botão do
   WhatsApp e o link do Essencial ficavam numa rolagem interna sem barra visível. Aqui o
   carrossel cresce com o conteúdo (no mínimo a tela) e quem rola é a PÁGINA. Os slides
   ficam todos da altura do maior (o trilho do Swiper é flex), e a barra de controles
   continua no pé do carrossel, abaixo do conteúdo. */
@media (max-width: 991.98px) and (max-height: 480px) and (orientation: landscape) {
    #master-hero-carousel {
        height: auto !important;
    }

    #master-hero-carousel .master-swiper,
    #master-hero-carousel .swiper-slide {
        height: auto !important;
    }

    #master-hero-carousel .swiper-slide {
        min-height: calc(100svh - var(--master-carousel-mobile-header));
    }

    #master-hero-carousel .mc-slide,
    #master-hero-carousel .hor-section,
    #master-hero-carousel .hero-essencial-section {
        height: auto;
        min-height: 100%;
    }

    #master-hero-carousel .mc-conteudo,
    #master-hero-carousel .hor-conteudo,
    #master-hero-carousel .hero-essencial-content {
        max-height: none;
        overflow-y: visible;
    }
}

/* ---------- barra de controles (único lugar dos controles) ----------
   Celular: à ESQUERDA (o canto inferior direito é do botão do chat — contrato N2/N6):
   [pausa] [‹] 2 de 7 [›]. A partir de 768px: centralizada, [pausa] [‹] um botão por
   destaque [›]. Sem setas laterais: elas encostavam no texto (desktop) e no painel
   (tablet). Alvos de 44px. */
.mc-controles {
    position: relative;
    left: auto;
    bottom: auto;
    width: fit-content;
    margin: 0 auto 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    background: rgba(5, 11, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mc-controles__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #e8f0f4;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.mc-controles__btn[hidden] {
    display: none;
}

.mc-controles__btn:hover {
    color: #fff;
    background: rgba(255, 77, 29, 0.28);
}

.mc-controles__btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.mc-controles__pausa {
    color: #00ffea;
}

.mc-controles__contador {
    min-width: 56px;
    margin: 0;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-align: center;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A paginação do Swiper vira parte da barra (não mais absoluta no rodapé). */
#master-hero-carousel .mc-controles .swiper-pagination {
    position: static;
    display: none;
    width: auto;
    transform: none;
}

#master-hero-carousel .mc-controles .swiper-pagination-bullet {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 44px;
    margin: 0 !important;
    padding: 0 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    opacity: 1;
    cursor: pointer;
}

/* Trilho visível fino; a área de toque é o botão inteiro (44px de altura). */
#master-hero-carousel .mc-controles .swiper-pagination-bullet::before {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.28);
}

#master-hero-carousel .mc-controles .swiper-pagination-bullet:hover::before {
    background: rgba(255, 255, 255, 0.5);
}

#master-hero-carousel .mc-controles .swiper-pagination-bullet:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

#master-hero-carousel .progress-bar-fill {
    position: absolute;
    left: 6px;
    top: 50%;
    z-index: 1;
    display: block;
    width: 0;
    height: 4px;
    transform: translateY(-50%);
    background: #ff4d1d;
}

#master-hero-carousel .mc-controles .swiper-pagination-bullet-active {
    width: 72px;
}

#master-hero-carousel .mc-controles .swiper-pagination-bullet-active .progress-bar-fill {
    width: calc(100% - 12px);
    transition: width 8s linear;
}

/* Sem troca automática (pausada, parada pelo cliente ou reduced-motion): o destaque
   ativo fica com a barra cheia, parada. */
#master-hero-carousel .mc-controles.is-autoplay-parado .swiper-pagination-bullet-active .progress-bar-fill {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    #master-hero-carousel .mc-controles .swiper-pagination-bullet-active .progress-bar-fill {
        transition: none;
    }
}

@media (min-width: 768px) {
    .mc-controles {
        left: auto;
        transform: none;
        bottom: auto;
    }

    .mc-controles__contador {
        display: none;
    }

    #master-hero-carousel .mc-controles .swiper-pagination {
        display: flex;
        align-items: center;
    }
}

/* Carrossel sem Swiper (script do vendor não carregou). */
#master-hero-carousel.master-carousel-fallback .swiper-wrapper {
    display: block;
}
