/* Correção visual para produtos sem estoque */
.produto .detalhes.sem-estoque {
    background-color: #ee0909 !important;
    color: #ffffff !important;
    border: 1px solid #ee0909 !important;
    font-weight: bold !important;
}

/* Correção visual para produtos Em Oferta */
.produto .detalhes.em-oferta {
    background-color: #0a311b !important;
    color: #ffffff !important;
    border: 1px solid #0a311b !important;
    font-weight: bold !important;
}

/* ==========================================================================
   Grade de opções de variação (tamanhos etc.) da página do produto
   2026-11-26: troca dos floats (que desalinhavam em degraus) por CSS grid.
   Botões do mesmo tamanho; selecionado em preto; indisponível riscado.
   Para reverter: remover este bloco (ou restaurar template_override.css.bak-20261126).
   ========================================================================== */
.opcoes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.opcoes .opcao,
.opcoes .opcaoindisponivel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    float: none !important;
    width: auto !important;
    min-height: 62px;
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    background: #fff;
    border: 2px solid #e2e2e2;
    border-radius: 8px;
    transition: border-color .2s, background .2s, color .2s;
}

/* o quadrado de seleção some: a borda/fundo escuro já indica a escolha */
.opcoes .opcao .check,
.opcoes .opcaoindisponivel .check {
    display: none !important;
}

.opcoes .opcao .detalhes,
.opcoes .opcaoindisponivel .detalhes {
    display: block;
    float: none;
    width: 100% !important;
    padding: 8px 6px !important;
    box-sizing: border-box;
}

.opcoes .opcao .titulo,
.opcoes .opcaoindisponivel .titulo {
    display: block;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.opcoes .opcao .descricao,
.opcoes .opcaoindisponivel .descricao {
    display: block;
    padding-top: 2px;
    font-size: 11px;
    line-height: 1.3;
    opacity: .75;
}

.opcoes .opcao .descricao:empty,
.opcoes .opcaoindisponivel .descricao:empty {
    display: none;
}

.opcoes .opcao:hover {
    border-color: #999;
}

/* selecionado */
.opcoes .opcao.active {
    background: #000;
    border-color: #000;
    color: #fff;
}

.opcoes .opcao.active .descricao {
    opacity: .85;
}

/* indisponível */
.opcoes .opcaoindisponivel {
    background: #f4f4f4;
    border-style: dashed;
    color: #aaa;
    cursor: not-allowed;
}

.opcoes .opcaoindisponivel .titulo {
    text-decoration: line-through;
}

/* ==========================================================================
   Mensagens de validação de formulário (jQuery Validate) em vermelho
   2026-11-26: o texto cinza claro (#939393, 12px) passava despercebido.
   ========================================================================== */
/* Aviso abaixo do campo: faixa vermelha com ícone, bem visível */
label.error {
    display: flex !important;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 6px 0 4px 0 !important;
    padding: 7px 10px;
    box-sizing: border-box;
    background: #fdecea;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    color: #b71c1c !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3;
    text-align: left;
    animation: mm-surgir .25s ease-out;
}

label.error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* não mostra a faixa vazia quando o campo é corrigido */
label.error:empty,
label.error[style*="display: none"] {
    display: none !important;
}

/* campo com erro: borda vermelha forte + leve tremida */
input.error,
select.error,
textarea.error {
    border: 2px solid #d32f2f !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .15) !important;
    animation: mm-tremer .35s ease-in-out;
}

/* select fica dentro do .fake-select: destaca a caixa toda */
.fake-select:has(select.error) {
    border: 2px solid #d32f2f !important;
    border-radius: 4px;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .15);
}

/* rótulo do campo com erro também fica vermelho */
.form-field-default:has(.error:not(label)) > label:not(.error) {
    color: #d32f2f !important;
}

@keyframes mm-tremer {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

@keyframes mm-surgir {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Popup "Faltam algumas informações" (AlertifyJS com a classe .mm-aviso)
   ========================================================================== */
.alertify.mm-aviso .ajs-dialog {
    max-width: 420px;
    width: 92%;
    border-radius: 14px;
    overflow: hidden;
    border-top: 6px solid #d32f2f;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.alertify.mm-aviso .ajs-header {
    background: #fff;
    border: 0;
    color: #b71c1c;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    padding: 18px 24px 4px 24px;
}

.alertify.mm-aviso .ajs-body .ajs-content {
    padding: 4px 6px 0 6px;
    text-align: center;
}

.alertify.mm-aviso .mm-aviso-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    background: #fdecea;
    color: #d32f2f;
    font-size: 28px;
}

.alertify.mm-aviso .mm-aviso-texto {
    margin: 0 0 10px 0;
    color: #444;
    font-size: 14px;
}

.alertify.mm-aviso .mm-aviso-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.alertify.mm-aviso .mm-aviso-lista li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px 0;
    padding: 10px 12px;
    background: #fdecea;
    border-left: 4px solid #d32f2f;
    border-radius: 6px;
    color: #b71c1c;
    font-size: 14px;
    font-weight: 600;
}

.alertify.mm-aviso .mm-aviso-lista li i {
    flex: 0 0 auto;
    font-size: 12px;
}

.alertify.mm-aviso .ajs-footer {
    background: #fff;
    border: 0;
    padding: 8px 20px 20px 20px;
}

.alertify.mm-aviso .ajs-footer .ajs-buttons {
    float: none;
    text-align: center;
}

.alertify.mm-aviso .ajs-footer .ajs-button.ajs-ok {
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #d32f2f;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
}

.alertify.mm-aviso .ajs-footer .ajs-button.ajs-ok:hover {
    background: #b71c1c;
}

/* ==========================================================================
   Caixa de erros devolvidos pelo servidor (list_errors) na loja
   ========================================================================== */
.list-errors {
    margin: 0 0 20px 0;
    padding: 14px 16px;
    background: #fdecea;
    border: 1px solid #f5c2c0;
    border-left: 6px solid #d32f2f;
    border-radius: 8px;
    color: #b71c1c;
}

.list-errors .title-line {
    border: 0 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    color: #b71c1c;
    font-weight: 700;
}

.list-errors .title-line span,
.list-errors .title-line i {
    color: #b71c1c !important;
}

.list-errors .error-info {
    padding: 3px 0;
    color: #b71c1c;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   Página "obrigado": botão do WhatsApp em destaque quando o navegador
   bloqueia a abertura automática da nova aba (2026-11-26)
   ========================================================================== */
.mm-btn-whatsapp {
    background: #25d366 !important;
    border-color: #25d366 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.mm-btn-whatsapp.mm-pulsar {
    animation: mm-pulsar 1.4s ease-in-out infinite;
}

@keyframes mm-pulsar {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); transform: scale(1); }
    50%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); transform: scale(1.04); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); transform: scale(1); }
}

/* ==========================================================================
   28/11/2026 - Descrição do produto recolhível ("Ver mais" / "Ver menos")
   Usado em app/estabelecimento/produto.php (HTML + JS no fim do arquivo).
   Motivo: descrições longas empurravam a grade de tamanhos para baixo.
   Recolhe em 6 linhas (desktop) ou 4 (mobile <= 767px) via variável --linhas.
   Classe própria "descricao-produto" para não conflitar com ".descricao"
   das variações (.opcoes .opcao .descricao).
   ========================================================================== */
.descricao-produto { --linhas: 6; position: relative; }

/* Fonte fixa em 14px (igual a ".produto-detalhes .descricao span" do template.css)
   para o cálculo de linhas em "em" bater com o texto real. */
.descricao-produto .descricao-texto {
    font-size: 14px;
    line-height: 1.5;
    max-height: calc(1.5em * var(--linhas));
    overflow: hidden;
    transition: max-height .2s ease;
}
.descricao-produto.expandida .descricao-texto { max-height: none; }

/* Degradê no fim do texto cortado (fundo branco) */
.descricao-produto.tem-mais:not(.expandida) .descricao-texto::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 44px; /* altura do botão */
    height: 3em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
    pointer-events: none;
}

/* Botão: oculto por padrão; o JS adiciona .tem-mais só se o texto passar do limite */
.descricao-produto .descricao-toggle {
    display: none;
    min-height: 44px; /* área de toque no mobile */
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
}
.descricao-produto.tem-mais .descricao-toggle { display: inline-flex; align-items: center; }

/* 28/11/2026 - Link de texto (sem ícone), padrão de marketplaces: texto sublinhado na cor de destaque.
   Também anula a regra global ".descricao span {display:block; font-size:14px}" no span do botão. */
#descricao-produto .descricao-toggle span {
    display: inline;
    font-size: 14px;
    font-weight: 600;
    color: #1a3c8c;
    text-decoration: underline;
    text-underline-offset: 3px;
}
#descricao-produto .descricao-toggle:hover span,
#descricao-produto .descricao-toggle:focus-visible span { text-decoration-thickness: 2px; }

@media (max-width: 767px) {
    .descricao-produto { --linhas: 4; }
}

/* 28/11/2026 - Aviso de limite de estoque abaixo do campo de quantidade (produto.php) */
.aviso-estoque {
    margin-top: 6px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #b3261e;
}
