/* MGR Black Friday - front e admin */

.mgr-bf {
    --mgr-bf-borda: #e5e7eb;
    --mgr-bf-texto: #1f2937;
    --mgr-bf-suave: #6b7280;
    --mgr-bf-fundo: #ffffff;
    box-sizing: border-box;
}

.mgr-bf *,
.mgr-bf *::before,
.mgr-bf *::after {
    box-sizing: border-box;
}

/* Grade: colunas vêm de --mgr-bf-cols (desktop), 3 no tablet, 2 no celular */
.mgr-bf-grade {
    display: grid;
    grid-template-columns: repeat(var(--mgr-bf-cols, 4), minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

@media (max-width: 1024px) {
    .mgr-bf-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 640px) {
    .mgr-bf-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Lojas */
.mgr-bf-loja {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 90px;
    padding: 16px 12px;
    background: var(--mgr-bf-fundo);
    border: 1px solid var(--mgr-bf-borda);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    color: var(--mgr-bf-texto);
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.mgr-bf-loja:hover,
a.mgr-bf-loja:focus {
    border-color: #c9cdd4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.mgr-bf-logo {
    display: block;
    width: 100%;
    max-width: 160px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.mgr-bf-loja-nome {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

/* Carrossel (rolagem nativa com snap; setas só onde há mouse) */
.mgr-bf-carrossel {
    position: relative;
    margin: 18px 0;
}

.mgr-bf-trilho {
    --mgr-bf-gap: 14px;
    --c: var(--mgr-bf-cols, 4);
    display: flex;
    gap: var(--mgr-bf-gap);
    padding: 4px 2px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.mgr-bf-trilho > .mgr-bf-card {
    flex: 0 0 calc((100% - (var(--c) - 1) * var(--mgr-bf-gap)) / var(--c));
    min-width: 0;
    scroll-snap-align: start;
}

@media (max-width: 1024px) {
    .mgr-bf-trilho { --c: 3; }
}

@media (max-width: 640px) {
    .mgr-bf-trilho { --c: 2.15; --mgr-bf-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .mgr-bf-trilho { scroll-behavior: auto; }
}

.mgr-bf-seta {
    position: absolute;
    top: 42%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--mgr-bf-borda);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.mgr-bf-seta[hidden] { display: none; }
.mgr-bf-seta-prev { left: -12px; }
.mgr-bf-seta-next { right: -12px; }
.mgr-bf-seta:hover,
.mgr-bf-seta:focus { background: #111827; color: #ffffff; }

@media (hover: none) {
    .mgr-bf-seta { display: none; }
}

/* Cards de oferta */
.mgr-bf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--mgr-bf-fundo);
    border: 1px solid var(--mgr-bf-borda);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mgr-bf-card:hover,
.mgr-bf-card:focus-within {
    border-color: #c9cdd4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.mgr-bf-desconto {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.mgr-bf-card-imagem {
    display: block;
    padding: 10px;
    background: #f7f8fa;
}

.mgr-bf-card-imagem img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.mgr-bf-card-conteudo {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.mgr-bf-card-loja {
    color: var(--mgr-bf-suave);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mgr-bf-card-titulo {
    display: -webkit-box;
    min-height: 2.7em;
    margin: 0;
    overflow: hidden;
    color: var(--mgr-bf-texto);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mgr-bf-preco-antigo {
    color: var(--mgr-bf-suave);
    font-size: 12px;
    text-decoration: line-through;
}

.mgr-bf-preco {
    color: #b91c1c;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.mgr-bf-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.mgr-bf-botao:hover,
.mgr-bf-botao:focus {
    background: #b91c1c;
    color: #ffffff;
}

/* Compartilhar */
.mgr-bf-share {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.mgr-bf-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 11px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.mgr-bf-share a:hover,
.mgr-bf-share a:focus {
    border-color: transparent;
    color: #ffffff;
}

.mgr-bf-share-whatsapp:hover, .mgr-bf-share-whatsapp:focus { background: #25d366; }
.mgr-bf-share-telegram:hover, .mgr-bf-share-telegram:focus { background: #229ed9; }
.mgr-bf-share-x:hover, .mgr-bf-share-x:focus { background: #000000; }
.mgr-bf-share-facebook:hover, .mgr-bf-share-facebook:focus { background: #1877f2; }
.mgr-bf-share-email:hover, .mgr-bf-share-email:focus { background: #4b5563; }

@media (max-width: 640px) {
    .mgr-bf-card-conteudo { padding: 10px; }
    .mgr-bf-preco { font-size: 16px; }
    .mgr-bf-share a { min-height: 34px; padding: 0 9px; font-size: 12px; }
}

/* Aviso de afiliado */
.mgr-bf-disclaimer {
    margin: 10px 0 0;
    color: var(--mgr-bf-suave);
    font-size: 11px;
    line-height: 1.4;
}

/* ---------- Admin ---------- */
.mgr-bf-admin #mgr-bf-status { margin-left: 8px; font-weight: 600; }
.mgr-bf-admin #mgr-bf-status.mgr-bf-erro { color: #b32d2e; }
.mgr-bf-admin #mgr-bf-status.mgr-bf-ok { color: #1a7f37; }
.mgr-bf-admin .mgr-bf-campos th { width: 190px; }
.mgr-bf-admin .mgr-bf-campos select { max-width: 100%; min-width: 320px; }
.mgr-bf-admin .mgr-bf-previa img { display: block; width: 48px; height: 48px; object-fit: contain; }
.mgr-bf-admin .mgr-bf-previa td { vertical-align: middle; word-break: break-word; }
.mgr-bf-admin [hidden] { display: none !important; }

/* ---------- Admin: listas de Ofertas e Lojas ---------- */
.column-mgr_img { width: 70px; }
.column-mgr_id { width: 60px; }
.column-mgr_dest { width: 80px; }
.mgr-bf-mini { display: block; width: 48px; height: 48px; object-fit: contain; background: #f6f7f7; border-radius: 4px; }
.mgr-bf-mini-logo { width: 60px; height: 30px; }
.mgr-bf-estrela { font-size: 24px; line-height: 1; text-decoration: none; color: #8c8f94; }
.mgr-bf-estrela:hover, .mgr-bf-estrela:focus { color: #dba617; }
.mgr-bf-estrela-on { color: #dba617; }
.mgr-bf-pilula { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #b91c1c; color: #fff; font-size: 11px; font-weight: 600; }
.mgr-bf-aviso { color: #b32d2e; font-size: 12px; }
.mgr-bf-box th { width: 160px; }
.mgr-bf-vazio { padding: 10px 12px; border: 1px dashed #b91c1c; border-radius: 6px; color: #b91c1c; font-size: 13px; }
