/* ==========================
   1. VARIÁVEIS E RESET
   ========================== */
:root {
    --primaria: #e53935;
    /* Vermelho mercadinho */
    --secundaria: #ff9800;
    /* Laranja ofertas */
    --fundo: #f4f6f8;
    --texto-escuro: #2d3436;
    --texto-claro: #636e72;
    --branco: #ffffff;
    --borda: #dfe6e9;
    --sombra: 0 4px 15px rgba(0, 0, 0, 0.05);
    --sombra-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1,
h2,
h3,
.btn,
.btn-pesquisar,
.tab-btn {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

html {
    overflow-x: hidden;
    height: 100%;
}

body {
    background-color: var(--fundo);
    color: var(--texto-escuro);
    overflow-x: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Faz o conteúdo principal "esticar" para empurrar o rodapé para o final
   da tela mesmo quando há pouco conteúdo (ex: poucos produtos carregados) */
main#app {
    flex: 1 0 auto;
}

.rodape {
    flex-shrink: 0;
}

/* ==========================
   2. HEADER MODERNO
   ========================== */
header {
    background: var(--branco);
    box-shadow: var(--sombra);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-bar-principal {
    background-color: var(--primaria);
    color: var(--branco);
    padding: 6px 5%;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
}

.first-line {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-bar-principal a {
    color: var(--branco);
    text-decoration: none;
    opacity: 0.9;
}

.nav-bar-secundaria {
    padding: 12px 5%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 20px;
}

.nav-bar-secundaria h2 {
    color: var(--primaria);
    font-weight: 800;
    letter-spacing: -1px;
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
}

.nav-links a {
    text-decoration: none;
    color: var(--texto-escuro);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primaria);
}

/* ==========================================
   HEADER: LOGO E REDES SOCIAIS
   ========================================== */

.logo-e-sociais {
    display: flex;
    align-items: center;
    gap: 25px;
    /* Espaço entre o nome SOS ALIMENTOS e os ícones */
}

.redes-sociais {
    display: flex;
    gap: 15px;
    /* Espaço entre o WhatsApp e o Instagram */
}

.redes-sociais a {
    color: #333;
    /* Cor neutra para combinar com a logo */
    font-size: 26px;
    /* Tamanho dos ícones */
    text-decoration: none;
    transition: transform 0.2s ease, color 0.3s ease;
    display: flex;
    align-items: center;
}

.redes-sociais a:hover {
    transform: scale(1.15);
    /* Efeito de crescer ao passar o mouse */
}

/* Cores oficiais ao passar o mouse */
.redes-sociais .icon-zap:hover {
    color: #25D366;
}

.redes-sociais .icon-insta:hover {
    color: #E1306C;
}

@media (max-width: 480px) {
    .nav-bar-principal {
        font-size: 0.72rem;
        gap: 14px;
    }

    .nav-bar-secundaria {
        justify-content: center;
        text-align: center;
    }

    .nav-bar-secundaria h2 {
        font-size: 1.15rem;
    }

    .nav-links a {
        font-size: 0.82rem;
    }
}

/* ==========================
   3. LÓGICA SPA E LAYOUT
   ========================== */
.page {
    display: none;
    padding: 16px 5% 40px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.titulo-pagina {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--texto-escuro);
}

.titulo-secao {
    text-align: center;
    margin: 35px 0 20px;
}

.titulo-secao h3 {
    font-size: 1.3rem;
    color: var(--texto-escuro);
}

/* ==========================
   4. CARROSSEL (OFERTAS)
   ========================== */
.carrossel {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sombra);
    background: linear-gradient(135deg, var(--texto-escuro) 0%, #1a1d1e 100%);
}

.botao-ant,
.botao-prox {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: var(--texto-escuro);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: 0.2s;
    box-shadow: var(--sombra);
}

@media (max-width: 768px) {
    .carrossel {
        /* O banner empilha imagem + texto no celular, então precisa de mais
           altura (não menos) para caber tudo sem cortar */
        height: 460px;
        border-radius: 12px;
    }

    .botao-ant,
    .botao-prox {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .botao-ant {
        left: 10px;
    }

    .botao-prox {
        right: 10px;
    }
}

@media (max-width: 420px) {
    .carrossel {
        height: 420px;
    }
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--branco);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.slide.ativo {
    opacity: 1;
}

.botao-ant,
.botao-prox {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: var(--texto-escuro);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: 0.2s;
    box-shadow: var(--sombra);
}

.botao-ant:hover,
.botao-prox:hover {
    background: var(--branco);
    transform: translateY(-50%) scale(1.1);
}

.botao-ant {
    left: 20px;
}

.botao-prox {
    right: 20px;
}

.carrossel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.dot.ativo {
    background: var(--branco);
    transform: scale(1.2);
}

/* ==========================
   5. GRID DE PRODUTOS E BUSCA
   ========================== */
.pesquisa-container {
    display: flex;
    max-width: 600px;
    margin: 20px auto 30px auto;
    box-shadow: var(--sombra);
    border-radius: 30px;
    overflow: hidden;
    background: var(--branco);
}

@media (max-width: 420px) {
    .pesquisa-container {
        border-radius: 14px;
    }

    .pesquisa-container input {
        padding: 13px 16px;
        font-size: 0.95rem;
    }

    .btn-pesquisar {
        padding: 0 16px;
        font-size: 0.9rem;
    }
}

.pesquisa-container input {
    flex: 1;
    min-width: 0;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: var(--branco);
    color: var(--texto-escuro);
}

.btn-pesquisar {
    padding: 0 24px;
    background: var(--primaria);
    color: var(--branco);
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-pesquisar:hover {
    background: #c62828;
}

/* Grid: lista vertical no mobile, grade no desktop */
.grid-produtos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 700px) {
    .grid-produtos {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 25px;
    }
}

.produto-card {
    position: relative;
    background: var(--branco);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--borda);
    transition: transform 0.2s, box-shadow 0.2s;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

.img-placeholder {
    width: 100%;
    height: 180px;
    background: var(--fundo);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto-claro);
    font-weight: 500;
    overflow: hidden;
}

.img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.produto-card h3 {
    font-size: 1.1rem;
    color: var(--texto-escuro);
    margin-bottom: 6px;
}

.unidade {
    color: var(--texto-claro);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.preco {
    color: var(--primaria);
    font-size: 1.4rem;
    font-weight: 800;
}

.preco-antigo {
    color: var(--texto-claro);
    font-size: 0.95rem;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.preco-promo {
    color: var(--secundaria);
}

.selo-promocao {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5f2e 0%, var(--primaria) 55%, #b71c1c 100%);
    color: var(--branco);
    box-shadow: 0 6px 14px rgba(229, 57, 53, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    overflow: hidden;
    line-height: 1;
}

/* Brilho que passa pelo selo de tempos em tempos */
.selo-promocao::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: brilho-selo 3.5s ease-in-out infinite;
}

@keyframes brilho-selo {

    0%,
    60% {
        left: -80%;
    }

    100% {
        left: 140%;
    }
}

.selo-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--branco);
    color: var(--primaria);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.selo-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.selo-label {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.92;
}

.selo-percentual {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Card em promoção ganha um leve destaque */
.produto-card-promo {
    border-color: rgba(229, 57, 53, 0.25);
    box-shadow: 0 4px 18px rgba(229, 57, 53, 0.1);
}

/* Título da seção "Todos os Produtos" */
.titulo-secao-todos {
    margin-top: 50px;
}

.titulo-secao-todos h3 {
    display: inline-block;
}

.titulo-secao-linha {
    display: block;
    width: 60px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primaria), var(--secundaria));
}

/* ==========================================
   DESIGN DOS BANNERS HORIZONTAIS
   ========================================== */

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primaria) 0%, #8e1a17 100%);
    border-radius: 12px;
    padding: 20px 40px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Área da Imagem (Esquerda) */
.banner-img-wrapper {
    position: relative;
    width: 40%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-img-wrapper img {
    max-height: 110%;
    /* Deixa a imagem estourar um pouquinho a caixa, fica lindo */
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.3));
    /* Sombra chique na imagem solta */
}

.banner-no-img {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

/* Crachá de Desconto Flutuante (selo estrela) */
.badge-desconto {
    position: absolute;
    top: -12px;
    right: -6px;
    z-index: 3;
    width: 112px;
    height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: #8e1a17;
    text-align: center;
    line-height: 1;
    background: radial-gradient(circle at 30% 25%, #fff59d 0%, #ffd54f 35%, #ffa000 100%);
    clip-path: polygon(50.0% 0.0%, 57.5% 7.7%, 67.1% 3.0%, 71.5% 12.8%, 82.1% 11.7%, 82.9% 22.4%, 93.3% 25.0%, 90.4% 35.3%, 99.2% 41.3%, 93.0% 50.0%, 99.2% 58.7%, 90.4% 64.7%, 93.3% 75.0%, 82.9% 77.6%, 82.1% 88.3%, 71.5% 87.2%, 67.1% 97.0%, 57.5% 92.3%, 50.0% 100.0%, 42.5% 92.3%, 32.9% 97.0%, 28.5% 87.2%, 17.9% 88.3%, 17.1% 77.6%, 6.7% 75.0%, 9.6% 64.7%, 0.8% 58.7%, 7.0% 50.0%, 0.8% 41.3%, 9.6% 35.3%, 6.7% 25.0%, 17.1% 22.4%, 17.9% 11.7%, 28.5% 12.8%, 32.9% 3.0%, 42.5% 7.7%);
    transform: rotate(12deg);
    animation: pulsar-badge 2.4s ease-in-out infinite;
}

.badge-pre {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    opacity: 0.85;
}

.badge-valor {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.badge-off {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    padding: 2px 8px;
    border-radius: 20px;
    background: #8e1a17;
    color: #fff59d;
}

@keyframes pulsar-badge {

    0%,
    100% {
        transform: rotate(12deg) scale(1);
    }

    50% {
        transform: rotate(8deg) scale(1.05);
    }
}

/* Área do Texto (Direita) */
.banner-info {
    width: 50%;
    color: #fff;
    text-align: left;
}

.banner-tag {
    display: inline-block;
    background: #2f3542;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.banner-info h2 {
    font-size: 2.8rem;
    /* Nome GIGANTE */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.banner-precos {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.banner-preco-antigo {
    font-size: 1.5rem;
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.7);
}

.banner-preco-novo {
    font-size: 3rem;
    /* Preço GIGANTE */
    font-weight: 800;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsividade (Para não quebrar no celular) */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        justify-content: center;
        padding: 20px;
        gap: 10px;
    }

    .banner-img-wrapper {
        width: 60%;
        height: 45%;
    }

    .banner-info {
        width: 100%;
        text-align: center;
    }

    .banner-info h2 {
        font-size: 1.8rem;
    }

    .banner-preco-novo {
        font-size: 2rem;
    }

    .banner-precos {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .banner-content {
        padding: 16px;
    }

    .banner-img-wrapper {
        width: 55%;
        height: 40%;
    }

    .banner-tag {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .banner-info h2 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .banner-preco-antigo {
        font-size: 1.1rem;
    }

    .banner-preco-novo {
        font-size: 1.6rem;
    }

    .badge-desconto {
        width: 84px;
        height: 84px;
        top: -10px;
        right: -4px;
    }

    .badge-pre {
        font-size: 0.4rem;
    }

    .badge-valor {
        font-size: 1.35rem;
    }

    .badge-off {
        font-size: 0.55rem;
        padding: 1px 6px;
    }
}

/* No celular, o card vira uma linha horizontal (foto à esquerda, dados à direita) */
@media (max-width: 699px) {
    .produto-card {
        display: grid;
        grid-template-columns: 88px 1fr;
        grid-template-rows: auto auto auto;
        column-gap: 14px;
        row-gap: 2px;
        align-items: center;
        text-align: left;
        padding: 14px;
    }

    .produto-card:hover {
        transform: none;
    }

    .img-placeholder {
        grid-row: 1 / 4;
        width: 88px;
        height: 88px;
        margin-bottom: 0;
        font-size: 0.7rem;
    }

    .produto-card h3 {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .unidade {
        margin-bottom: 4px;
        font-size: 0.8rem;
    }

    .preco {
        font-size: 1.15rem;
    }

    .selo-promocao {
        top: 6px;
        left: 6px;
        right: auto;
        gap: 5px;
        padding: 4px 8px 4px 5px;
    }

    .selo-icone {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .selo-label {
        font-size: 0.45rem;
    }

    .selo-percentual {
        font-size: 0.8rem;
    }
}

.msg-estado {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--texto-claro);
    padding: 30px 0;
    line-height: 1.6;
}

.btn-tentar-novamente {
    margin-top: 12px;
    padding: 10px 22px;
    background: var(--primaria);
    color: var(--branco);
    border: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-tentar-novamente:hover {
    background: #c62828;
}

/* Skeleton (carregando) */
.skeleton-card {
    background: var(--branco);
    border-radius: 12px;
    height: 260px;
    border: 1px solid var(--borda);
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.045), transparent);
    transform: translateX(-100%);
    animation: brilho 1.4s infinite;
}

@keyframes brilho {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 699px) {
    .skeleton-card {
        height: 88px;
        border-radius: 12px;
    }
}

/* Link ativo no menu */
.nav-links a.ativo {
    color: var(--primaria);
}

/* Rodapé */
.rodape {
    background: var(--texto-escuro);
    color: #dfe6e9;
    margin-top: 40px;
    padding: 40px 5% 20px;
}

.rodape-conteudo {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rodape-marca h3 {
    color: var(--branco);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.rodape-marca p {
    font-size: 0.85rem;
    color: #b2bec3;
    max-width: 280px;
}

.rodape-links,
.rodape-contato {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rodape-links a,
.rodape-contato a {
    color: #dfe6e9;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.rodape-links a:hover,
.rodape-contato a:hover {
    color: var(--secundaria);
}

.rodape-localizacao {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 0;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 2fr;
    gap: 30px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rodape-endereco h3 {
    color: var(--branco);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.rodape-endereco p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #dfe6e9;
    margin-bottom: 16px;
}

.rodape-endereco p i {
    color: var(--secundaria);
    margin-right: 6px;
}

.btn-como-chegar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primaria);
    color: var(--branco);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.btn-como-chegar:hover {
    background: #c62828;
    transform: translateY(-2px);
}

.rodape-mapa {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.rodape-mapa iframe {
    display: block;
    width: 100%;
}

@media (max-width: 700px) {
    .rodape-localizacao {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .rodape-mapa iframe {
        height: 220px;
    }
}

.rodape-copy {
    text-align: center;
    font-size: 0.78rem;
    color: #7f8c8d;
    padding-top: 18px;
}

@media (max-width: 480px) {
    .rodape-conteudo {
        justify-content: center;
        text-align: center;
    }

    .rodape-marca p {
        max-width: none;
    }
}

/* ==========================
   6. PÁGINA DE GESTÃO (ADMIN)
   ========================== */

/* TELA DE LOGIN (SPA GESTÃO)*/
.login-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e272e 0%, #2f3640 100%);
    /* Fundo escuro elegante */
}

.login-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    color: #2f3542;
    margin-bottom: 5px;
    font-size: 24px;
}

.login-box p {
    color: #747d8c;
    margin-bottom: 25px;
    font-size: 14px;
}

.mensagem-erro {
    color: #ff4757;
    background: #ffdfe4;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 600;
}

/* Header Admin Simplificado */
.header-admin {
    background-color: var(--primaria);
    padding: 25px 5%;
    text-align: center;
    box-shadow: var(--sombra);
    margin-bottom: 40px;
    position: relative;
}

.header-admin h1 {
    color: var(--branco);
    font-size: 1.8rem;
}

.link-voltar {
    position: absolute;
    top: 22px;
    left: 5%;
    color: var(--branco);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.link-voltar:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .link-voltar {
        position: static;
        display: inline-block;
        margin-bottom: 12px;
    }
}

/* Container e Cards */
.container {
    max-width: 1400px;
    margin: 0 auto 60px auto;
    padding: 0 5%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: var(--branco);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--sombra);
    border: 1px solid var(--borda);
}

.card h2 {
    color: var(--primaria);
    margin-bottom: 25px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--fundo);
    padding-bottom: 10px;
}

.card h3 {
    margin: 20px 0 15px 0;
    color: var(--texto-escuro);
    font-size: 1.1rem;
}

/* Área de Upload */
.upload-area {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--fundo);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #b2bec3;
}

.upload-area input[type="file"] {
    flex: 1;
    font-size: 1rem;
}

/* Formulário (Grid e Inputs) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--texto-claro);
}

.input-group input {
    padding: 12px 15px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
    background-color: var(--fundo);
}

.input-group input:focus {
    border-color: var(--primaria);
    background-color: var(--branco);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    margin-top: 25px;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    accent-color: var(--primaria);
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    color: var(--texto-escuro);
}

/* Botões */
.btn {
    padding: 12px 24px;
    background: var(--primaria);
    color: var(--branco);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover {
    background: #c62828;
}

.btn-outline {
    background: transparent;
    color: var(--texto-claro);
    border: 1px solid var(--borda);
}

.btn-outline:hover {
    background: var(--fundo);
    color: var(--texto-escuro);
}

.btn-success {
    background: #10ac84;
}

.btn-success:hover {
    background: #01a3a4;
}

.btn-danger {
    background: #e53935;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Tabelas (Preview e Produtos) */
.table-container {
    width: 100%;
    overflow-x: auto;
    /* Responsivo para celular */
    border-radius: 8px;
    border: 1px solid var(--borda);
}

table {
    width: 100%;
    min-width: 1000px;
    /* Garante espaço suficiente pra coluna Nome e pros botões lado a lado */
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed;
    /* Evita que o navegador distribua o espaço de forma esquisita entre as colunas */
}

/* Larguras por coluna: fixo em px nas colunas curtas (não quebram linha),
   o resto do espaço sobra pra coluna "Nome", que é a mais importante */
th:nth-child(1),
td:nth-child(1) {
    width: 110px;
}

th:nth-child(2),
td:nth-child(2) {
    width: auto;
}

th:nth-child(3),
td:nth-child(3) {
    width: 80px;
}

th:nth-child(4),
td:nth-child(4) {
    width: 120px;
}

th:nth-child(5),
td:nth-child(5) {
    width: 130px;
}

th:nth-child(6),
td:nth-child(6) {
    width: 100px;
}

th:nth-child(7),
td:nth-child(7) {
    width: 220px;
}

thead {
    background-color: var(--fundo);
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid var(--borda);
    color: var(--texto-escuro);
}

td {
    overflow-wrap: break-word;
    /* nomes de produto longos podem quebrar linha */
}

th {
    white-space: normal;
    /* cabeçalho quebra só no espaço, nunca no meio da palavra */
}

/* Coluna de Ações: botões lado a lado, nunca empilhados */
td:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

th {
    font-weight: 600;
    color: var(--texto-claro);
}

tbody tr:hover {
    background-color: #fafbfc;
}

/* Utilitários */
.hidden {
    display: none !important;
}

.mt-1 {
    margin-top: 15px;
}

.abas {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 600;
    transition: 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.tab-btn.ativo {
    color: var(--primaria);
    background: var(--branco);
}

.input-tabela {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.input-curto {
    max-width: 90px;
}

/* ==========================================
   MINI CRUD DE IMAGEM
   ========================================== */

/* Quadradinho de imagem dentro da tabela */
.thumb-tabela {
    width: 45px;
    height: 45px;
    background: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    margin: 0 auto;
    transition: 0.2s;
}

.thumb-tabela:hover {
    border-color: #0d6efd;
    background: #e9ecef;
}

.thumb-tabela img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-tabela span {
    font-size: 18px;
    color: #adb5bd;
}

/* O Modal de Preview */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-preview-area {
    width: 100%;
    height: 250px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f1f1;
    overflow: hidden;
}

.modal-preview-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-botoes {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}