/* ==================== ESTILO GERAL ==================== */

body {
    padding-top: 70px;
    background-color: #f8f9fa;
}

/* Botões */
.btn-warning {
    background-color: #ffc107;
    border: none;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-custom {
    background-color: #000;
    color: #fff;
}

.btn-custom:hover {
    background-color: #ff9800;
    color: #000;
}

.divisor-tabacaria {
    width: 100%;
    max-width: 220px;
    height: 3px;
    background: linear-gradient(to right, transparent, #3b2f2f, transparent);
    margin: 0.5rem auto 2rem auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}



/* ==================== FOOTER ==================== */

.footer {
    background-color: #121212;
    color: #ffffff;
}

.footer p {
    margin: 0;
}

/* ==================== IMAGEM PRINCIPAL PRODUTO ==================== */

.produto-img-container {
    width: 100%;
    height: 300px; /* Ajuste conforme necessário */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 10px;
    background-color: #f8f9fa; /* Fundo caso a imagem não cubra tudo */
    margin-bottom: 20px;
}

/* Imagem dentro do container (comportamento igual ao primeiro CSS) */
.produto-img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain; /* Mantém proporção sem cortar */
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease;
}

.produto-img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ==================== VARIAÇÕES ==================== */

.variacao-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: border-color 0.2s, transform 0.2s;
}

.variacao-img:hover,
.variacao-img.ativa {
    border-color: #0d6efd;
    transform: scale(1.1);
}

/* ==================== RELACIONADOS ==================== */

.relacionados-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.relacionados-container .card {
    flex: 0 0 200px;
    max-width: 200px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.relacionados-container .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.relacionados-container .card-img-top {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    height: 200px;
    object-fit: cover;
}

.relacionados-container .card-body {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: center;
    height: 150px;
}

.relacionados-container .card-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.2rem;
}

.relacionados-container .card-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.relacionados-container .btn {
    width: 100%;
    border-radius: 5px;
    font-weight: bold;
}

/* ==================== PRODUTO CARD (GRID PRINCIPAL) ==================== */

.produto-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.imagem-produto {
    width: 100%;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    background-color: #f8f9fa;
    position: relative;
}

.imagem-produto img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Badge Promoção */
.badge-promocao {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc3545;
    color: white;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 0.25rem;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    user-select: none;
}

/* Corpo do Card */
.produto-card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1rem;
    flex-grow: 1;
}

/* Título */
.produto-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Preço antigo */
.preco-antigo {
    text-decoration: line-through;
    color: #6c757d;
    margin-right: 0.5rem;
}

/* Preço promoção */
.preco-promocao {
    color: #dc3545;
    font-weight: 700;
}

/* Botões */
.btn {
    width: 100%;
    margin-top: auto;
}

.btn-comprar {
    width: auto !important;
    padding: 0.5rem 1.5rem;
}


/* ==================== RESPONSIVO ==================== */

@media (max-width: 768px) {
    .produto-img {
        width: 100%;
        max-width: 350px;
        height: auto;
        max-height: 300px;
        object-fit: contain;
        margin-bottom: 10px;
    }

    .relacionados-container .card {
        flex: 0 0 180px;
        max-width: 180px;
    }

    .relacionados-container .card-img-top {
        height: 200px;
    }
}

/* Botões menores, quadrados e alinhados */
table .btn {
    width: 28px;              /* um pouco menor */
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;          /* fonte maior para o ícone */
    line-height: 1;
    transition: all 0.2s ease;
    user-select: none;
}

/* Botões com borda e cor neutra */
table .btn-outline-secondary {
    border: 1px solid #ccc;
    color: #333;
    background-color: #fff;
}

/* Hover suave */
table .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
    color: #000;
}

/* Quantidade alinhada, com largura fixa e font maior */
table td span.fw-semibold {
    min-width: 30px;       /* ligeiramente maior que o botão */
    display: inline-block;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1;
    margin: 0 6px;         /* espaçamento lateral para respirar */
    font-weight: 600;
    user-select: none;
}

/* Container flex para os botões e quantidade */
.d-flex.justify-content-center.align-items-center.gap-2 {
    gap: 6px !important; /* espaçamento entre botões e número */
}

/* Para telas pequenas, mantém os botões alinhados */
@media (max-width: 575px) {
    table .btn {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    table td span.fw-semibold {
        min-width: 26px;
        font-size: 1rem;
        margin: 0 4px;
    }
}
