/* Modal "escolha entre vários produtos" - usado pelo banner (banner.php)
   e pelo cupom de produto grátis (checkout.php). */
.mesc-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; transition: opacity .2s;
}
.mesc-overlay.show { opacity: 1; }
.mesc-dialog {
    background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: 90vh;
    display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); overflow: hidden;
}
.mesc-header { padding: 18px 20px 10px; border-bottom: 1px solid #eee; }
.mesc-header h3 { margin: 0 0 4px; font-size: 18px; color: #222; }
.mesc-header p { margin: 0; font-size: 13px; color: #666; }
.mesc-body { padding: 14px 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.mesc-bloco + .mesc-bloco { margin-top: 20px; padding-top: 16px; border-top: 1px dashed #ddd; }
.mesc-bloco-titulo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: #333; }
.mesc-contador { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #f1f1f1; color: #555; white-space: nowrap; }
.mesc-contador.completo { background: #d4edda; color: #1e6b32; }
.mesc-triste { background: #fff6e0; border: 1px solid #f3d98b; color: #7a5a00; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.mesc-aviso { background: #fdecea; border: 1px solid #f5c2c0; color: #8a1f17; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.mesc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mesc-card {
    position: relative; border: 2px solid #e3e3e3; border-radius: 10px; padding: 8px; background: #fff;
    text-align: center; cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s;
}
.mesc-card:hover { border-color: #bbb; }
.mesc-card.selecionado { border-color: var(--cor-primaria, #d35400); box-shadow: 0 0 0 2px rgba(211,84,0,.15); }
.mesc-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 6px; background: #f4f4f4; }
.mesc-card-nome { font-size: 13px; font-weight: 600; margin: 6px 0 2px; color: #222; line-height: 1.2; }
.mesc-card-preco { font-size: 12px; font-weight: 700; color: #1e8a3c; }
.mesc-card-preco s { color: #999; font-weight: 500; margin-right: 4px; }
.mesc-check {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--cor-primaria, #d35400); color: #fff; font-size: 13px; display: none; align-items: center; justify-content: center;
}
.mesc-card.selecionado .mesc-check { display: flex; }
.mesc-card.indisponivel { cursor: not-allowed; opacity: .75; }
.mesc-card.indisponivel img { filter: grayscale(1); }
.mesc-card.indisponivel .mesc-card-nome { color: #888; }
.mesc-sem-estoque { display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 700; color: #a33; background: #fbe9e9; border-radius: 8px; padding: 1px 8px; }
.mesc-stepper { display: none; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.mesc-card.com-stepper .mesc-stepper { display: flex; }
.mesc-stepper button {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid #ccc; background: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}
.mesc-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.mesc-stepper span { min-width: 18px; font-weight: 700; font-size: 14px; }
.mesc-footer { padding: 12px 20px 16px; border-top: 1px solid #eee; display: flex; gap: 10px; }
.mesc-btn { flex: 1; padding: 13px 14px; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; }
.mesc-btn-cancelar { background: #f1f1f1; color: #444; flex: 0 0 auto; }
.mesc-btn-confirmar { background: var(--cor-primaria, #d35400); color: #fff; }
.mesc-btn-confirmar:disabled { background: #c9c9c9; cursor: not-allowed; }
@media (max-width: 600px) {
    .mesc-overlay { align-items: flex-end; padding: 0; }
    .mesc-dialog { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
    .mesc-grid { grid-template-columns: repeat(2, 1fr); }
    .mesc-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
