/* ===================================
   BLACK FRIDAY TOP BAR - CNM
   Edição moderna com glow + fundo animado + reflexo em movimento
   =================================== */

/* ===================================
   VARIÁVEIS GLOBAIS
   =================================== */
:root {
    --bf-topbar-height: 100px;
    --navbar-height: 70px;
}

/* ===================================
   TOP BAR - Fixa no topo com fundo animado moderno
   =================================== */
.blackfriday-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    /* Usar altura mínima para flexibilidade */
    min-height: var(--bf-topbar-height); 
    height: auto;
    padding: 0.75rem 1.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);

    /* Fundo animado com reflexos quentes */
    background: radial-gradient(circle at 20% 80%, rgba(255,140,0,0.1), transparent 70%),
                radial-gradient(circle at 80% 20%, rgba(255,90,0,0.15), transparent 70%),
                linear-gradient(135deg, #080808 0%, #111 50%, #080808 100%);
    background-size: 200% 200%;
    animation: bf-lights 12s ease-in-out infinite;
}

@keyframes bf-lights {
    0%, 100% { background-position: 0% 50%; filter: brightness(1); }
    50% { background-position: 100% 50%; filter: brightness(1.2); }
}

/* Link que cobre o Top Bar INTEIRO */
.blackfriday-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none; 
    cursor: pointer;
    /* Ajusta o flex para alinhar o topbar-content */
    display: flex; 
    align-items: center; 
}

/* Reflexo suave cruzando o fundo */
.blackfriday-topbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 250%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 157, 1, 0.08) 50%,
        transparent 70%
    );
    transform: skewX(-10deg);
    animation: bf-reflex 10s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes bf-reflex {
    0% { left: -150%; }
    50% { left: 0%; }
    100% { left: 150%; }
}

/* Partículas sutis de brilho */
.blackfriday-topbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle, rgba(255, 157, 1, 0.06) 1px, transparent 1px);
    background-size: 100px 100px;
    opacity: 0.25;
    animation: bf-particles 40s linear infinite;
    z-index: 0;
}

@keyframes bf-particles {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -40px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

.topbar-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    /* Colunas: Badge (auto), Centro (1fr), Contador (auto) */
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

/* ===================================
   BADGE BLACK FRIDAY - Texto luminoso moderno
   =================================== */
.bf-badge {
    position: relative;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    white-space: nowrap;
    z-index: 2;

    /* Glow quente e elegante */
    text-shadow:
        0 0 8px rgba(255, 180, 0, 0.9),
        0 0 20px rgba(255, 120, 0, 0.6),
        0 0 40px rgba(255, 80, 0, 0.4);
    transition: all 0.4s ease;
}

/* ===================================
   INTERATIVIDADE GERAL (HOVER no link pai)
   =================================== */
/* Efeito de hover no badge quando passa o mouse em qualquer lugar do banner */
.blackfriday-link:hover .bf-badge {
    text-shadow:
        0 0 15px rgba(255, 200, 0, 1),
        0 0 35px rgba(255, 140, 0, 0.9),
        0 0 60px rgba(255, 90, 0, 0.7);
    transform: scale(1.02);
}

/* ===================================
   CENTRO - Texto e CTA
   =================================== */
.bf-center {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza o CTA dentro da coluna 1fr */
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.bf-main-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.bf-highlight {
    color: #ff9d01;
    font-weight: 900;
    text-shadow: 0 0 15px rgba(255, 157, 1, 0.6);
}

/* Botão (agora SPAN para estilo) */
.bf-cta-btn {
    margin-top: 0.25rem;
    background: linear-gradient(135deg, #ffb642 0%, #ff6a00 100%);
    color: #000;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    text-decoration: none; 
    font-weight: 800;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255,120,0,0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default; 
}

/* Efeito de hover no botão quando passa o mouse em qualquer lugar do banner */
.blackfriday-link:hover .bf-cta-btn {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255,120,0,0.6);
    background: linear-gradient(135deg, #ff9d01 0%, #ffb642 100%);
    color: #000;
}

.bf-cta-btn svg {
    width: 16px;
    height: 16px;
}

/* ===================================
   DIREITA - Contador (Estrutura ajustada para coluna)
   =================================== */
.bf-countdown {
    /* MUDANÇA: Altera para coluna para empilhar Header e Timer */
    display: flex;
    flex-direction: column; 
    align-items: center;
    
    gap: 0.5rem; /* Espaço entre "Termina em..." e os números */
    background: rgba(255, 157, 1, 0.08);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 157, 1, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 157, 1, 0.1);
    white-space: nowrap;
}

.countdown-header {
    color: #ff9d01;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 157, 1, 0.5);
    line-height: 1;
}

.countdown-timer-content {
    /* Novo wrapper para icon + numbers, mantido como flex-row */
    display: flex;
    align-items: center;
    gap: 0.75rem; 
}

.countdown-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 8px rgba(255, 157, 1, 0.6));
}

.countdown-numbers {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
}

.countdown-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ff9d01;
    text-shadow: 0 0 15px rgba(255, 157, 1, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 0.2rem;
    letter-spacing: 0.5px;
}

.countdown-separator {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ff9d01;
    margin: 0 0.15rem;
    opacity: 1;
    animation: bf-blink 1.5s ease-in-out infinite;
}

@keyframes bf-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===================================
   NAVBAR DO SITE
   =================================== */
.navbar.navbar-expand-custom.navbar-expand-lg.fixed-top {
    position: fixed;
    top: var(--bf-topbar-height);
    left: 0;
    right: 0;
    z-index: 1999;
    transition: top 0.3s ease;
}

/* ===================================
   BODY - Compensa as duas barras
   =================================== */
body {
    padding-top: calc(var(--bf-topbar-height) + var(--navbar-height)) !important;
}

/* ===================================
   RESPONSIVO TABLET
   =================================== */
@media (max-width: 1100px) {
    .topbar-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        text-align: center;
    }

    .bf-badge {
        justify-self: center;
    }

    .bf-countdown {
        justify-self: center;
    }
}

/* ===================================
   RESPONSIVO MOBILE (768px)
   =================================== */
@media (max-width: 768px) {
    :root {
        --bf-topbar-height: 90px; 
        --navbar-height: 70px;
    }

    .blackfriday-topbar {
        padding: 0.5rem 0.5rem; 
        height: auto; 
        min-height: var(--bf-topbar-height);
    }

    .navbar.navbar-expand-custom.navbar-expand-lg.fixed-top {
        top: var(--bf-topbar-height);
    }

    body {
        padding-top: calc(var(--bf-topbar-height) + var(--navbar-height)) !important;
    }

    .topbar-content {
        grid-template-columns: 1fr auto; 
        grid-template-rows: auto auto;
        gap: 0.5rem 0.5rem; 
    }

    .bf-badge {
        grid-column: 1 / -1;
        font-size: 1.1rem; 
        justify-self: center;
    }

    .bf-center {
        grid-row: 2;
        grid-column: 1;
        align-items: center;
        gap: 0;
    }

    .bf-main-text {
        display: none !important;
    }

    .bf-cta-btn {
        font-size: 0.6rem;
        padding: 0.35rem 0.6rem; 
        gap: 0.25rem; 
        margin-top: 0;
        border-radius: 5px;
        white-space: nowrap;
    }

    .bf-cta-btn svg {
        width: 11px; 
        height: 11px;
    }

    .bf-countdown {
        grid-row: 2;
        grid-column: 2;
        padding: 0.3rem 0.5rem; 
        gap: 0.25rem; 
        border-radius: 6px;
        height: min-content; 
    }
    
    /* ESTILIZAÇÃO DO NOVO HEADER EM MOBILE */
    .countdown-header {
        font-size: 0.6rem; 
        letter-spacing: 0.5px;
    }

    .countdown-timer-content {
        gap: 0.25rem; 
    }

    .countdown-icon {
        font-size: 0.75rem; 
    }

    .countdown-numbers {
        gap: 0.2rem; 
    }

    .countdown-value {
        font-size: 0.8rem; 
    }

    .countdown-unit {
        min-width: 22px; 
    }

    .countdown-label {
        font-size: 0.4rem; 
        margin-top: 0.1rem;
    }

    .countdown-separator {
        font-size: 0.8rem; 
        margin: 0 0.05rem;
    }
}

/* ===================================
   FIX PARA MODAL FICAR ACIMA DAS BARRAS
   =================================== */
.modal {
    z-index: 2100 !important;
}

.modal-backdrop {
    z-index: 2050 !important;
}